diff --git a/published/201309/20190204 7 Best VPN Services For 2019.md b/published/201309/20190204 7 Best VPN Services For 2019.md new file mode 100644 index 0000000000..2a1fe8c29a --- /dev/null +++ b/published/201309/20190204 7 Best VPN Services For 2019.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10691-1.html) +[#]: subject: (7 Best VPN Services For 2019) +[#]: via: (https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/) +[#]: author: (Editor https://www.ostechnix.com/author/editor/) + +2019 年最好的 7 款虚拟私人网络服务 +====== + +在过去三年中,全球至少有 67% 的企业面临着数据泄露,亿万用户受到影响。研究表明,如果事先对数据安全采取最基本的保护措施,那么预计有 93% 的安全问题是可以避免的。 + +糟糕的数据安全会带来极大的代价,特别是对企业而言。它会大致大规模的破坏并影响你的品牌声誉。尽管有些企业可以艰难地收拾残局,但仍有一些企业无法从事故中完全恢复。不过现在,你很幸运地可以得到数据及网络安全软件。 + +![](https://www.ostechnix.com/wp-content/uploads/2019/02/vpn-1.jpeg) + +到了 2019 年,你可以通过**虚拟私人网络**,也就是我们熟知的 **VPN** 来保护你免受网络攻击。当涉及到在线隐私和安全时,常常存在许多不确定因素。有数百个不同的 VPN 提供商,选择合适的供应商也同时意味着在定价、服务和易用性之间谋取恰当的平衡。 + +如果你正在寻找一个可靠的 100% 经过测试和安全的 VPN,你可能需要进行详尽的调查并作出最佳选择。这里为你提供在 2019 年 7 款最好用并经过测试的 VPN 服务。 + +### 1、Vpnunlimitedapp + +通过 VPN Unlimited,你的数据安全将得到全面的保障。此 VPN 允许你连接任何 WiFi ,而无需担心你的个人数据可能被泄露。你的数据通过 AES-256 算法加密,保护你不受第三方和黑客的窥探。无论你身处何处,这款 VPN 都可确保你在所有网站上保持匿名且不受跟踪。它提供 7 天的免费试用和多种协议支持:openvpn、IKEv2 和 KeepSolidWise。有特殊需求的用户会获得特殊的额外服务,如个人服务器、终身 VPN 订阅和个人 IP 选项。 + +### 2、VPN Lite + +VPN Lite 是一款易于使用而且**免费**的用于上网的 VPN 服务。你可以通过它在网络上保持匿名并保护你的个人隐私。它会模糊你的 IP 并加密你的数据,这意味着第三方无法跟踪你的所有线上活动。你还可以访问网络上的全部内容。使用 VPN Lite,你可以访问在被拦截的网站。你还放心地可以访问公共 WiFi 而不必担心敏感信息被间谍软件窃取和来自黑客的跟踪和攻击。 + +### 3、HotSpot Shield + +这是一款在 2005 年推出的大受欢迎的 VPN。这套 VPN 协议至少被全球 70% 的数据安全公司所集成,并在全球有数千台服务器。它提供两种免费模式:一种为完全免费,但会有线上广告;另一种则为七天试用。它提供军事级的数据加密和恶意软件防护。HotSpot Shield 保证网络安全并保证高速网络。 + +### 4、TunnelBear + +如果你是一名 VPN 新手,那么 TunnelBear 将是你的最佳选择。它带有一个用户友好的界面,并配有动画熊引导。你可以在 TunnelBear 的帮助下以极快的速度连接至少 22 个国家的服务器。它使用 **AES 256-bit** 加密算法,保证无日志记录,这意味着你的数据将得到保护。你还可以在最多五台设备上获得无限流量。 + +### 5、ProtonVPN + +这款 VPN 为你提供强大的优质服务。你的连接速度可能会受到影响,但你也可以享受到无限流量。它具有易于使用的用户界面,提供多平台兼容。 ProtonVPN 的服务据说是因为为种子下载提供了优化因而无法访问 Netflix。你可以获得如协议和加密等安全功能来保证你的网络安全。 + +### 6、ExpressVPN + +ExpressVPN 被认为是最好的用于接触封锁和保护隐私的离岸 VPN。凭借强大的客户支持和快速的速度,它已成为全球顶尖的 VPN 服务。它提供带有浏览器扩展和自定义固件的路由。 ExpressVPN 拥有一系列令人赞叹高质量应用程序,配有大量的服务器,并且最多只能支持三台设备。 + +ExpressVPN 并不是完全免费的,恰恰相反,正是由于它所提供的高质量服务而使之成为了市场上最贵的 VPN 之一。ExpressVPN 有 30 天内退款保证,因此你可以免费试用一个月。好消息是,这是完全没有风险的。例如,如果你在短时间内需要 VPN 来绕过在线审查,这可能是你的首选解决方案。用过它之后,你就不会随意想给一个会发送垃圾邮件、缓慢的免费的程序当成试验品。 + +ExpressVPN 也是享受在线流媒体和户外安全的最佳方式之一。如果你需要继续使用它,你只需要续订或取消你的免费试用。ExpressVPN 在 90 多个国家架设有 2000 多台服务器,可以解锁 Netflix,提供快速连接,并为用户提供完全隐私。 + +### 7、PureVPN + +虽然 PureVPN 可能不是完全免费的,但它却是此列表中最实惠的一个。用户可以注册获得 7 天的免费试用,并在之后选择任一付费计划。通过这款 VPN,你可以访问到至少 140 个国家中的 750 余台服务器。它还可以在几乎所有设备上轻松安装。它的所有付费特性仍然可以在免费试用期间使用。包括无限数据流量、IP 泄漏保护和 ISP 不可见性。它支持的系统有 iOS、Android、Windows、Linux 和 macOS。 + +### 总结 + +如今,可用的免费 VPN 服务越来越多,为什么不抓住这个机会来保护你自己和你的客户呢?在了解到有那么多优秀的 VPN 服务后,我们知道即使是最安全的免费服务也不一定就完全没有风险。你可能需要付费升级到高级版以增强保护。高级版的 VPN 为你提供了免费试用,提供无风险退款保证。无论你打算花钱购买 VPN 还是准备使用免费 VPN,我们都强烈建议你使用一个。 + +**关于作者:** + +**Renetta K. Molina** 是一个技术爱好者和健身爱好者。她撰写有关技术、应用程序、 WordPress 和其他任何领域的文章。她喜欢在空余时间打高尔夫球和读书。她喜欢学习和尝试新事物。 + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/ + +作者:[Editor][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 diff --git a/published/20180529 Manage your workstation with Ansible- Configure desktop settings.md b/published/20180529 Manage your workstation with Ansible- Configure desktop settings.md new file mode 100644 index 0000000000..f3c8ef2873 --- /dev/null +++ b/published/20180529 Manage your workstation with Ansible- Configure desktop settings.md @@ -0,0 +1,158 @@ +使用 Ansible 管理你的工作站:配置桌面设置 +====== + +> 在本系列第三篇(也是最后一篇)文章中,我们将使用 Ansible 自动化配置 GNOME 桌面设置。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ) + +在本系列关于使用 Ansible 配置工作站的[第一篇文章][1]中,我们设置了一个仓库并配置了一些基本的东西。在[第二篇文章][2]中,我们配置了 Ansible 以使其在对仓库进行更改时自动应用设置。在第三篇(也是最后一篇)文章中,我们将使用 Ansible 配置 GNOME 桌面设置。 + +此配置只适用于较新的发行版(例如我将在示例中使用的 Ubuntu 18.04)。较旧版本的 Ubuntu 将无法运行,因为它们附带了一个老版本的 `python-psutils`,对于 Ansible 的 `dconf` 模块无法正常工作。如果你使用的是较新版本的 Linux 发行版,则应该没有问题。 + +在开始之前,确保你已经完成了本系列的第一部分和第二部分,因为第三部分建立在此基础之上的。如果还没有,下载前两篇文章中一直使用的 GitHub [仓库][3],我们将为其添加更多功能。 + +### 设置壁纸和锁屏 + +首先,我们将创建一个任务手册来保存我们的 GNOME 设置。在仓库的根目录中,应该有一个名为 `local.yml` 的文件,添加以下行: + +``` +- include: tasks/gnome.yml +``` + +整个文件应如下所示: + +``` +- hosts: localhost + become: true + pre_tasks: + - name: update repositories + apt: update_cache=yes + changed_when: False + + tasks: + - include: tasks/users.yml + - include: tasks/cron.yml + - include: tasks/packages.yml + - include: tasks/gnome.yml +``` + +基本上,这添加了对名为 `gnome.yml` 文件的引用,它将存储在仓库内的 `tasks` 目录中。我们还没有创建这个文件,现在就来创建它。在 `tasks` 目录中创建 `gnome.yml` 文件,并将以下内容放入: + +``` +- name: Install python-psutil package + apt: name=python-psutil + +- name: Copy wallpaper file + copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 + +- name: Set GNOME Wallpaper + become_user: jay + dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" +``` + +注意,此代码多次引用我的用户名(`jay`),因此确保使用你机器上的用户名替换每次出现的 `jay`。另外,如果你没有像我一样使用 Ubuntu 18.04,你将必须更改 `apt` 一行来匹配你所选择的发行版的包管理器,并确认 `python-psutil` 包的名称,因为它可能有所不同。 + +在示例任务中,我引用了 `file` 目录下的 `wallpaper.jpg` 文件,此文件必须存在,否则 Ansible 配置将失败。在 `tasks` 目录中,创建一个名为 `files` 的子目录。找到你喜欢的壁纸图片,将其命名为 `wallpaper.jpg`,然后把它放在 `files` 目录中。如果文件是 PNG 图像而不是 JPG,在代码和仓库中更改文件扩展名。如果你觉得没有创意,我在 [GitHub 仓库][3] 中有一个示例壁纸文件,你可以使用它。 + +完成所有这些更改后,将内容提交到 GitHub 仓库,并推送这些更改。总结一下,你应该完成以下工作: + + * 修改 `local.yml` 文件以引用 `tasks/gnome.yml` + * 使用上面提到的内容创建 `tasks/gnome.yml` + * 在 `tasks` 目录中创建一个 `files` 目录,其中有一个名为 `wallpaper.jpg` 的图像文件(或者你选择的任何名称)。 + +完成这些步骤并将更改推送到仓库后,配置应该在下次计划运行期间自动应用。(你可能还记得我们在上一篇文章中对此进行了自动化。)如果你想节省时间,可以使用以下命令立即应用配置: + +``` +sudo ansible-pull -U https://github.com//ansible.git +``` + +如果一切正常,你应该可以看到你的新壁纸。 + +让我们花一点时间来了解新的 GNOME 任务手册的功能。首先,我们添加了一个计划来安装 `python-psutil` 包。如果不添加它,我们就不能使用 `dconf` 模块,因为它需要在修改 GNOME 设置之前安装这个包。接下来,我们使用 `copy` 模块将壁纸文件复制到我们的 `home` 目录,并将生成的文件命名为以点开头的隐藏文件。如果你不希望此文件放在 `home` 目录的根目录中,你可以随时指示此部分将其复制到其它位置 —— 只要你在正确的位置引用它,它仍然可以工作。在下一个计划中,我们使用 `dconf` 模块来更改 GNOME 设置。在这种情况下,我们调整了 `/org/gnome/desktop/background/picture-uri` 键并将其设置为 `file:///home/jay/.wallpaper.jpg`。注意本节中的引号 —— 你必须在 `dconf` 值中使用两个单引号,如果值是一个字符串,还必须包含在双引号内。 + +现在,让我们进一步进行配置,并将背景应用于锁屏。这是现在的 GNOME 任务手册,但增加了两个额外的计划: + +``` +- name: Install python-psutil package + apt: name=python-psutil + +- name: Copy wallpaper file + copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 + +- name: Set GNOME wallpaper + dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" + +- name: Copy lockscreenfile + copy: src=files/lockscreen.jpg dest=/home/jay/.lockscreen.jpg owner=jay group=jay mode=600 + +- name: Set lock screen background + become_user: jay + dconf: key="/org/gnome/desktop/screensaver/picture-uri" value="'file:///home/jay/.lockscreen.jpg'" +``` + +正如你所看到的,我们做的事情和设置壁纸时差不多。我们添加了两个额外的任务,一个是复制锁屏图像并将其放在我们的 `home` 目录中,另一个是将设置应用于 GNOME 以便使用它。同样,确保将 `jay` 更改为你的用户名,并命名你想要的锁屏图片 `lockscreen.jpg`,并将其复制到 `files` 目录。将这些更改提交到仓库后,在下一次计划的 Ansible 运行期间就会应用新的锁屏。 + +### 应用新的桌面主题 + +设置壁纸和锁屏背景很酷,但是让我们更进一步来应用桌面主题。首先,让我们在我们的任务手册中添加一条指令来安装 `arc` 主题的包。将以下代码添加到 GNOME 任务手册的开头: + +``` +- name: Install arc theme +  apt: name=arc-theme +``` + +然后,在底部,添加以下动作: + +``` +- name: Set GTK theme +  become_user: jay +  dconf: key="/org/gnome/desktop/interface/gtk-theme" value="'Arc'" +``` + +你看到 GNOME 的 GTK 主题在你眼前变化了吗?我们添加了一个动作来通过 `apt` 模块安装 `arc-theme` 包,另一个动作将这个主题应用到 GNOME。 + +### 进行其它定制 + +既然你已经更改了一些 GNOME 设置,你可以随意添加其它定制。你在 GNOME 中调整的任何设置都可以通过这种方式自动完成,设置壁纸和主题只是几个例子。你可能想知道如何找到要更改的设置,以下是一个我用的技巧。 + +首先,通过在你管理的计算机上运行以下命令,获取所有当前 `dconf` 设置的快照: + +``` +dconf dump / > before.txt +``` + +此命令将所有当前更改导出到名为 `before.txt` 的文件中。接下来,手动更改要自动化的设置,并再次获取 `dconf` 设置: + +``` +dconf dump / > after.txt +``` + +现在,你可以使用 `diff` 命令查看两个文件之间的不同之处: + +``` +diff before.txt after.txt +``` + +这应该会给你一个已更改键值的列表。虽然手动更改设置确实违背了自动化的目的,但你实际上正在做的是获取更新首选设置时更改的键,这允许你创建 Ansible 任务以修改这些设置,这样你就再也不需要碰这些设置了。如果你需要还原机器,Ansible 仓库会处理好你的每个定制。如果你有多台计算机,甚至是一组工作站,则只需手动进行一次更改,所有其他工作站都将应用新设置并完全同步。 + +### 最后 + +如果你已经阅读完本系列文章,你应该知道如何设置 Ansible 来自动化工作站。这些示例提供了一个有用的基础,你可以使用这些语法和示例进行其他定制。随着你的进展,你可以继续添加新的修改,这将使你的 Ansible 配置一直增长。 + +我已经用 Ansible 以这种方式自动化了一切,包括我的用户帐户和密码、Vim、tmux 等配置文件、桌面包、SSH 设置、SSH 密钥,基本上我想要自定义的一切都使用了。以本系列文章作为起点,将为你实现工作站的完全自动化铺平道路。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/5/manage-your-workstation-ansible-part-3 + +作者:[Jay LaCroix][a] +选题:[lujun9972](https://github.com/lujun9972 ) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jlacroix +[1]:https://linux.cn/article-10434-1.html +[2]:https://linux.cn/article-10449-1.html +[3]:https://github.com/jlacroix82/ansible_article.git diff --git a/published/20180620 How To Find The Port Number Of A Service In Linux.md b/published/20180620 How To Find The Port Number Of A Service In Linux.md new file mode 100644 index 0000000000..d3e1f04e62 --- /dev/null +++ b/published/20180620 How To Find The Port Number Of A Service In Linux.md @@ -0,0 +1,191 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11066-1.html) +[#]: subject: (How To Find The Port Number Of A Service In Linux) +[#]: via: (https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +如何在 Linux 中查找服务的端口号 +====== + +![Find The Port Number Of A Service In Linux OS][1] + +由于某些原因,你可能经常需要查找端口名称和端口号。如果是这样,你很幸运。今天,在这个简短的教程中,我们将看到在 Linux 系统中最简单、最快捷的查找服务端口号的方法。可能有很多方法可以做到,但我目前只知道以下三种方法。请继续阅读。 + +### 在 Linux 中查找服务的端口号 + +#### 方法1:使用 grep 命令 + +要使用 `grep` 命令在 Linux 中查找指定服务的默认端口号,只需运行: + +``` +$ grep /etc/services +``` + +例如,要查找 SSH 服务的默认端口,只需运行: + +``` +$ grep ssh /etc/services +``` + +就这么简单。此命令应该适用于大多数 Linux 发行版。以下是我的 Arch Linux 测试机中的示例输出: + +``` +ssh 22/tcp +ssh 22/udp +ssh 22/sctp +sshell 614/tcp +sshell 614/udp +netconf-ssh 830/tcp +netconf-ssh 830/udp +sdo-ssh 3897/tcp +sdo-ssh 3897/udp +netconf-ch-ssh 4334/tcp +snmpssh 5161/tcp +snmpssh-trap 5162/tcp +tl1-ssh 6252/tcp +tl1-ssh 6252/udp +ssh-mgmt 17235/tcp +ssh-mgmt 17235/udp +``` + +正如你在上面的输出中所看到的,SSH 服务的默认端口号是 22。 + +让我们找到 Apache Web 服务器的端口号。为此,命令是: + +``` +$ grep http /etc/services +# http://www.iana.org/assignments/port-numbers +http 80/tcp www www-http # WorldWideWeb HTTP +http 80/udp www www-http # HyperText Transfer Protocol +http 80/sctp # HyperText Transfer Protocol +https 443/tcp # http protocol over TLS/SSL +https 443/udp # http protocol over TLS/SSL +https 443/sctp # http protocol over TLS/SSL +gss-http 488/tcp +gss-http 488/udp +webcache 8080/tcp http-alt # WWW caching service +webcache 8080/udp http-alt # WWW caching service +[...] +``` + +FTP 端口号是什么?这很简单! + +``` +$ grep ftp /etc/services +ftp-data 20/tcp +ftp-data 20/udp +# 21 is registered to ftp, but also used by fsp +ftp 21/tcp +ftp 21/udp fsp fspd +tftp 69/tcp +[...] +``` + +#### 方法 2:使用 getent 命令 + +如你所见,上面的命令显示指定搜索词 “ssh”、“http” 和 “ftp” 的所有端口名称和数字。这意味着,你将获得与给定搜索词匹配的所有端口名称的相当长的输出。 + +但是,你可以使用 `getent` 命令精确输出结果,如下所示: + +``` +$ getent services ssh +ssh 22/tcp + +$ getent services http +http 80/tcp www www-http + +$ getent services ftp +ftp 21/tcp +``` + +如果你不知道端口名称,但是知道端口号,那么你只需将端口名称替换为数字: + +``` +$ getent services 80 +http 80/tcp +``` + +要显示所有端口名称和端口号,只需运行: + +``` +$ getent services +``` + +#### 方法 3:使用 Whatportis 程序 + +Whatportis 是一个简单的 Python 脚本,来用于查找端口名称和端口号。与上述命令不同,此程序以漂亮的表格形式输出。 + +确保已安装 pip 包管理器。如果没有,请参考以下链接。 + +- [如何使用 pip 管理 Python 包][6] + +安装 pip 后,运行以下命令安装 Whatportis 程序。 + +``` +$ pip install whatportis +``` + +现在,你可以找到与服务关联的端口,如下所示。 + +``` +$ whatportis ssh + +$ whatportis ftp + +$ whatportis http +``` + +我的 CentOS 7 服务器的示例输出: + +![][7] + +*在 Linux 中查找服务的端口号* + +如果你不知道服务的确切名称,请使用 `–like` 标志来显示相关结果。 + +``` +$ whatportis mysql --like +``` + +上述命令帮助你查找与服务关联的端口。你还可以找到与端口号相关联的服务,如下所示。 + +``` +$ whatportis 993 +``` + +你甚至可以以 JSON 格式显示结果。 + +``` +$ whatportis 993 --json +``` + +![][8] + +有关更多详细信息,请参阅 GitHub 仓库。 + +* [Whatportis GitHub 仓库][9] + +就是这些了。你现在知道了如何使用三种简单方法在 Linux 中查找端口名称和端口号。如果你知道任何其他方法/命令,请在下面的评论栏告诉我。我会查看并更相应地更新本指南。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-find-the-port-number-of-a-service-in-linux/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2018/06/Find-The-Port-Number-720x340.png +[2]: https://www.ostechnix.com/the-grep-command-tutorial-with-examples-for-beginners/ +[6]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[7]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis.png +[8]: https://www.ostechnix.com/wp-content/uploads/2018/06/whatportis-1.png +[9]: https://github.com/ncrocfer/whatportis diff --git a/published/20180629 100 Best Ubuntu Apps.md b/published/20180629 100 Best Ubuntu Apps.md new file mode 100644 index 0000000000..d5c3505d10 --- /dev/null +++ b/published/20180629 100 Best Ubuntu Apps.md @@ -0,0 +1,1208 @@ +100 个最佳 Ubuntu 应用 +====== + +今年早些时候我们发布了一个 [2018 年最好的 20 个 Ubuntu 应用][1]列表,可能对很多用户来说都很有用。现在我们几乎到 2018 年下半年了(LCTT 译注:好吧,我们翻译的有些晚了,顺便打个广告,[LCTT 欢迎你,有志于通过翻译为开源做些贡献的同学!][111]),所以今天我们打算看一下 Ubuntu 上最好的 100 个应用,你可能会觉得有帮助。 + +![100 Best Ubuntu Apps][2] + +很多用户最近从 Microsoft Windows 转换到了 Ubuntu,可能面临着这样一个困境:寻找它们之前使用了数年的操作系统上的应用软件的最好替代应用。Ubuntu 拥有上千个免费使用和开源应用软件,比 Windows 和其它 OS 上的付费软件运行的更好。 + +下列列表归纳了各种分类下很多应用软件的功能特点,因此,你可以找到匹配你的需求的最好的应用。 + +### 1、Google Chrome 浏览器 + +几乎所有 Linux 发行版都默认安装了 Mozilla Firefox 网络浏览器,它是 Google Chrome 的强力竞争对手。但是 Chrome 相对 Firefox 而言有它自己的优点,比如它可以让你直接访问你的 Google 账户,你可以通过它来同步你在其它操作系统和手机上的 Chrome 浏览器的书签、浏览历史、扩展等等。 + +![Chrome][3] + +Google Chrome 为 Linux 集成了最新的 Flash 播放器,其它 Linux 上的浏览器像 Mozilla Firefox 和 Opera 网络浏览器则不是这样。如果你在 Windows 上经常使用 Chrome,那么在 Linux 上也用它是最好的选择。 + +### 2、Steam + +现在在 Linux 上玩游戏已经不是问题了,这在很多年前还是一个遥不可及的梦。在 2013 年,Valve 发布了 Linux 上的 Steam 游戏客户端,此后一切都变了。早期用户犹豫着从 Windows 转到 Linux,只是因为他们不能在 Ubuntu 上玩它们最喜欢的游戏,但是现在已经不是这样了。 + +![Steam][4] + +一些用户可能发现在 Linux 上安装 Steam 有点棘手,但如果能在 Linux 上玩上千的 Steam 游戏这么做就是值得的。一些流行的高端游戏,如《反恐精英:全球攻势》、《Hitman》、《Dota 2》在 Linux 上都能获取,你只需要确保你满足玩这些游戏的最小硬件需求。 + +``` +$ sudo add-apt-repository multiverse +$ sudo apt-get update +$ sudo apt-get install steam +``` + +### 3、WordPress 桌面客户端 + +是的,没错,WordPress 有它专属的 Ubuntu 平台的客户端,你可以用来管理你的 WordPress 站点。你可以在桌面客户端上撰写和设计你的站点而不用转到浏览器。 + +![][5] + +如果你拥有使用 WordPress 建立的站点,那么这个桌面客户端就是你必备的应用,它能够让你在单个窗口内追踪所有的 WordPress 通知。你也可以查看你的站点上的博客数据。桌面客户端可以在 Ubuntu 软件中心中获取,你可以在那里下载和安装。 + +### 4、VLC 媒体播放器 + +VLC 是一个非常流行的跨平台的开源媒体播放器,同样在 Ubuntu 中可以获取。使得 VLC 成为一个最好的媒体播放器的原因是它能够毫无问题地播放世界上任何音频视频格式。 + +![][6] + +VLC 有一个平滑的用户界面,易于使用,除此之外,它提供了很多功能,包括在线视频流、音频和视频自定义等。 + +``` +$ sudo add-apt-repository ppa:videolan/master-daily +$ sudo apt update +$ sudo apt-get install vlc qtwayland5 +``` + +### 5、Atom 文本编辑器 + +由 GitHub 开发的 Atom 是一个自由开源的文本编辑器,它同样能够被用做集成开发环境(IDE)来进行主流编程语言的编码和编辑。Atom 开发者声称它是完全可魔改的 21 世纪文本编辑器。 + +![][7] + +Atom 文本编辑器拥有最佳的用户界面,它是一个富文本编辑器,提供了自动补全、语法高亮,支持扩展与插件。 + +``` +$ sudo add-apt-repository ppa:webupd8team/atom +$ sudo apt-get update +$ sudo apt-get install atom +``` + +### 6、GIMP 图像编辑器 + +GIMP(GNU 图形操作程序)是 Ubuntu 上的自由开源的图像编辑器。无疑它是 Windows 上 Adobe Photoshop 的最好替代品。如果你过去经常用 Adobe Photoshop,会觉得很难习惯 GIMP,但是你可以自定义 GIMP 使它看起来与 Photoshop 非常相似。 + +![][8] + +GIMP 是一个功能丰富的图片编辑器,你可以随时通过安装扩展和插件来使用附加的功能。 + +``` +$ sudo apt-get install gimp +``` + +### 7、Google Play 音乐桌面播放器 + +Google Play 音乐桌面播放器是一个开源的音乐播放器,它是 Google Play 音乐的一个复制品,或者说比它更好。Google 一直少个桌面的音乐客户端,但第三方的应用完美的填充了空白。 + +![][9] + +就像你在上面的截屏里看到的,它的界面在外观和感觉上都是首屈一指的。你只需要登录 Google 账户,之后就会导入你的所有音乐和收藏到桌面客户端里。你可以从它的官方[站点][10]下载安装文件并使用软件中心安装它。 + +### 8、Franz + +Franz 是一个即时消息客户端,它将聊天和信息服务结合到了一个应用中。它是一个现代化的即时消息平台,在单个应用中支持了 Facebook Messenger、WhatsApp、Telegram、微信、Google Hangouts、 Skype。 + +![][11] + +Franz 是一个完备的消息平台,你可以用于商业中管理大量的客户服务。要安装 Franz,你需要从它的[网站][12]下载安装包,在软件中心中打开。 + +### 9、新立得包管理器 + +新立得包管理器是 Ubuntu 上必有工具之一,因为它为我们通常在终端里安装软件的 `apt-get` 命令提供了用户图形界面。它是各种 Linux 发行版中的默认应用商店的强力对手。 + +![][13] + +新立得拥有非常简单的用户图形界面,相比其它的应用商店非常快并易于使用。在左手边你可以浏览不同分类的各种应用,也可以轻松安装和卸载。 + +``` +$ sudo apt-get install synaptic +``` + +### 10、Skype + +Skype 是一个非常流行的跨平台视频电话应用,如今在 Linux 系统可以以 Snap 应用方式获取。Skype 是一个即时通信应用,它提供了视频和音频通话、桌面共享等功能。 + +![][14] + +Skype 有一个优秀的用户图形界面,与 Windows 上的桌面客户端非常相似,易于使用。它对于从 Windows 上转换来的用户来说非常有用。 + +``` +$ sudo snap install skype +``` + +### 11、VirtualBox + +VirtualBox 是由 Oracle 公司开发的跨平台的虚拟化软件应用(LCTT 译注:实际上是由被 Oracle 公司收购的 Sun 公司开发的,包括 Java、Solaris 也是)。如果你喜欢尝试新的操作系统,那么 VirtualBox 是你必备的 Ubuntu 应用。你可以在 Windows 内尝试 Linux、Mac,也可以在 Linux 系统内尝试 Windows 和 Mac。 + +![][15] + +VirtualBox 实际做的是让你在宿机操作系统里可视化地运行访客操作系统。它可以创建虚拟硬盘并在上面安装访客操作系统。你可以在 Ubuntu 软件中心直接下载和安装它。 + +### 12、Unity Tweak 工具 + +Unity Tweak 工具(Gnome Tweak 工具)对于每个 Linux 用户都是必须拥有的,因为它给了用户根据需要自定义桌面的能力。你可以尝试新的 GTK 主题、设置桌面热角、自定义图标集、调整 unity 启动器等等。 + +![][16] + +Unity Tweak 工具对于用户来说可能非常有用,因为它包含了从基础到高级配置的所有内容。 + +``` +$ sudo apt-get install unity-tweak-tool +``` + +### 13、Ubuntu Cleaner + +Ubuntu Cleaner 是一个系统管理工具,其被特别设计用来移除不再使用的包、不需要的应用和清理浏览器缓存。Ubuntu Cleaner 有易于使用的简单用户界面。 + +![][17] + +Ubuntu Cleaner 是 BleachBit 最好的替代品之一,BleachBit 是 Linux 发行版上的相当好的清理工具。 + +``` +$ sudo add-apt-repository ppa:gerardpuig/ppa +$ sudo apt-get update +$ sudo apt-get install ubuntu-cleaner +``` + +### 14、Visual Studio Code + +Visual Studio Code 是一个代码编辑器,你会发现它与你可能曾用过的 Atom 文本编辑器和 Sublime Text 非常相似。Visual Studio Code 被证明是非常好的教育工具,因为它可以对编程中的从 HTML 标签到语法的所有东西做出解释。 + +![][18] + +Visual Studio 自身集成了 Git,它有优秀的用户界面,你会发现它与 Atom Text Editor 和 Sublime Text 非常相似。你可以从 Ubuntu 软件中心下载和安装它。 + +### 15、Corebird + +如果你在找你可以使用 Twitter 的桌面客户端,那 Corebird Twitter 客户端就是你在找的。它被视为 Linux 发行版下可获得的最好的 Twitter 客户端,它提供了与你手机上的 Twitter 应用非常相似的功能。 + +![][19] + +当有人喜欢或者转发你的 tweet 或者给你发消息时,Corebird Twitter 客户端同样会给你通知。你同样可以在这个客户端上添加多个 Twitter 账户。 + +``` +$ sudo snap install corebird +``` + +### 16、Pixbuf + +Pixbuf 是来自 Pixbuf 图片社区中心的一个桌面客户端,可以让你上传、分享和出售你的相片。它支持图片共享,如像 Facebook、Pinterest、Instagram、Twitter 等社交媒体,以及像 Flickr、500px 和 Youpic 等相片服务。 + +![][20] + +Pixbuf 提供了分析等功能,可以让你统计点击量、转发量、照片的回复数、定时发帖、iOS 专有的扩展信息。它同样有移动应用,因此你可以在任何地方连接到你的 Pixbuf 账户。Pixbuf 可以在 Ubuntu 软件中心以 Snap 包的形式获得。 + +### 17、Clementine 音乐播放器 + +Clementine 是一个跨平台的音乐播放器,并且是 Ubuntu 上默认音乐播放器 Rhythmbox 的良好竞争者。它是一个快速而易用的音乐播放器,其用户界面友好。它支持所有主流音频文件格式的回放。 + +![][21] + +除了可以播放本地库中的音乐,你也可以在线听 Spotify、SKY.fm、Soundcloud 等的广播。它也支持其它的功能像智能和动态播放列表,可以从像 Dropbox、Google Drive 这样的云存储中同步音乐。 + +``` +$ sudo add-apt-repository ppa:me-davidsansome/clementine +$ sudo apt-get update +$ sudo apt-get install clementine +``` + +### 18、Blender + +Blender 是一个自由开源的 3D 创建应用软件,你可以用来创建 3D 打印模型、动画电影、视频游戏等。它自身集成了游戏引擎,你可以用来开发和测试视频游戏。 + +![blender][22] + +Blender 拥有赏心悦目的用户界面,易于使用,它包括了内置的渲染引擎、数字雕刻、仿真工具、动画工具,还有很多。考虑到它免费和它的特点,你甚至会认为它可能是 Ubuntu 上最好的应用之一。 + +### 19、Audacity + +Audacity 是一个开源的音频编辑应用,你可以用来记录、编辑音频文件。你可以从各种输入中录入音频,包括麦克风、电子吉它等等。它提供了根据你的需要编辑和裁剪音频的能力。 + +![][23] + +最近 Audacity 发布了 Ubuntu 上的新版本,新特点包括主题改进、放缩命令等。除了这些,它还提供了降噪等音频效果的功能。 + +``` +$ sudo add-apt-repository ppa:ubuntuhandbook1/audacity +$ sudo apt-get update +$ sudo apt-get install audacity +``` + +### 20、Vim + +Vim 是一个集成开发环境,你可以以一个独立应用或 CLI 程序使用它,用于各种像 Python 等主流编程语言的编程。 + +![][24] + +大多数程序员喜欢在 Vim 中编写代码,因为它快速并且是一个可高度定制的集成开发环境。最初你可能觉得有点难用,但你会很快习惯它。 + +``` +$ sudo apt-get install vim +``` + +### 21、Inkscape + +Inkscape 是一个开源和跨平台的矢量图形编辑器,你会觉得它和 Corel Draw 和 Adobe Illustrator 很相似。用它可以创建和编辑矢量图形例如柱形图、徽标、图表、插图等。 + +![][25] + +Inkscape 使用可缩放矢量图形(SVG),这是一个基于 XML 的 W3C 标准格式。它支持各种格式,包括 JPEG、PNG、GIF、PDF、AI(Adobe Illustrator 格式)、VSD 等等。 + +``` +$ sudo add-apt-repository ppa:inkscape.dev/stable +$ sudo apt-get update +$ sudo apt-get install inkscape +``` + +### 22、Shotcut + +Shotcut 是一个 Meltytech, LLC 在 MLT 多媒体框架下开发的自由开源的跨平台视频编辑应用。你会发现它是 Linux 发行版上最强大的视频编辑器之一,它支持所有主要的音频、视频、图片格式。 + +![][26] + +它提供了非线性编辑多轨编辑各种文件格式的视频的能力。它支持 4K 视频分辨率和各种音频、视频过滤、语气生成、音频混合和很多其它的。 + +``` +snap install shotcut -- classic +``` + +### 23、SimpleScreenRecorder + +SimpleScreenRecorder 是 Ubuntu 上的一个免费而轻量级的屏幕录制工具。如果你是 YouTube 创作者或应用开发者,屏幕录制功能非常有用。 + +![][27] + +它可以捕获桌面屏幕的视频/音频记录或直接录制视频游戏。在录制屏幕前,你可以设置视频分辨率、帧率等。它有简单的用户界面,你会发现非常易用。 + +``` +$ sudo add-apt-repository ppa:marten-baert/simplescreenrecorder +$ sudo apt-get update +$ sudo apt-get install simplescreenrecorder +``` + +### 24、Telegram + +Telegram 是一个基于云的即时通信和网络电话平台,近年来非常流行。它是开源和跨平台的,用户可以用来发送消息,共享视频、图片、音频和其它文件。 + +![][28] + +Telegram 中容易注意到的特点是加密聊天、语音信息、机器人、远程视频通话、在线位置和社交登录。在 Telegram 中隐私和安全拥有最高优先级,因此,所有你发送和接收的是端对端加密的。 + +``` +$ sudo snap install telegram-desktop +``` + +### 25、ClamTk + +正如我们知道的,危害 Windows PC 的病毒不能危害 Ubuntu,但是可能被来自包含破坏性文件的 Windows PC 中的邮件所感染。因此,在 Linux 上有一些抗病毒应用是安全的。 + +![][29] + +ClamTk 是一个轻量级的病毒扫描器,可以扫描系统中的文件和文件夹并清理发现的有害文件。ClamTk 可以 Snap 包的形式获得,可以从 Ubuntu 软件中心下载。 + +### 26、MailSpring + +MailSpring 早期名为 Nylas Mail 或 Nylas N1,是开源的邮件客户端。它在电脑本地保存所有的邮件,因此你可以在任何需要的时候访问它。它提供了高级搜索的功能,可以使用“与”和“或”操作,因此你可以基于不同的参数搜索邮件。 + +![][30] + +MailSpring 有着和其它易于上手的邮件客户端同样优秀的用户界面。MailSpring 同样提供了私密性、安全性、日程、通讯录管理、日历等功能特点。 + +### 27、PyCharm + +继 Vim 之后,PyCharm 是我最喜欢的的 Python IDE 之一,因为它有优雅的用户界面,有很多扩展和插件支持。基本上,它有两个版本,一个是自由开源的社区版,另一个是付费的专业版。 + +![][31] + +PyCharm 是可高度自定义的 IDE 并且有很多功能,如错误高亮、代码分析、集成单元测试和 Python 调试器等。PyCharm 对于大多数 Python 程序员和开发者来说是首选 IDE。 + +### 28、咖啡因 + +想象一下你在 Youtube 上看视频或阅读一篇新文章,突然你的 Ubuntu 锁屏了,我知道它很烦人。我们很多人都会遇到这种情况,所以咖啡因是一个阻止 Ubuntu 锁屏或屏幕保护程序的工具。 + +![][32] + +咖啡因指示器是一个轻量级的工具,它添加图标到通知栏,你可以在那里轻松的激活或禁止它。不需要额外的设置。 + +``` +$ sudo add-apt-repository ppa:eugenesan/ppa +$ sudo apt-get update +$ sudo apt-get install caffeine -y +``` + +### 29、Etcher USB 镜像写入器 + +Etcher 是一个由 resin.io 开发的 USB 镜像写入器。它是一个跨平台的应用,可以帮助你将 ZIP、ISO、IMG 格式的镜像文件写入到 USB 存储中。如果你经常尝试新的操作系统,那么 Ethcher 是你必有的简单可靠的工具。 + +![][33] + +Etcher 有干净的用户界面,可以指导你在三步内烧录镜像到 USB 驱动或 SD 卡的过程。步骤包括选择镜像文件、选择 USB 驱动 和最终的烧录(写文件到 USB 驱动)。你可以从它的[官网][34]下载和安装 Etcher。 + +### 30、Neofetch + +Neofetch 是一个酷炫的系统信息工具,通过在终端中运行 `neofetch` 命令,它会给你关于你的系统的所有信息。它酷是因为它可以给你关于桌面环境、内核版本、bash 版本和你正在运行的 GTK 主题的信息。 + +![][35] + +与其它系统信息工具比较,Nefetch 是高度自定义的工具。你可以使用命令行进行各种自定义。 + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch +$ sudo apt-get update +$ sudo apt-get update install neofetch +``` + +### 31、Liferea + +Liferea(Linux 订阅阅读器)是一个自由开源的新闻聚合工具,用于在线新闻订阅。使用新的聚合非常快捷和简单,支持各种格式例如 RSS/RDF,Atom 等。 + +![][36] + +Liferea 自带与 TinyTinyRSS 的同步支持,它给了你离线阅读的能力。你会发现,就可靠性和灵活性而言,它是 Linux 上最好的订阅工具之一。 + +``` +$ sudo add-apt-repository ppa:ubuntuhandbook1/apps +$ sudo apt-get update +$ sudo apt-get install liferea +``` + +### 32、Shutter + +在 Ubuntu 中很容易截屏,但当需要编辑截屏时 Shutter 是你必不可少的应用。它帮助你捕获、编辑和轻松的共享截屏。使用 Shutter 的选择工具,你可以选择屏幕的特定区域来截屏。 + +![][37] + +Shutter 是一个功能强大的截图工具,提供了添加截图效果、画线等功能。它同样给你上传截屏到各种图像托管站点的选项。你可以直接在 Ubuntu 软件中心中下载和安装。 + +### 33、Weather + +Weather 是一个小的应用,可以给你关于你的城市或世界上其它位置的实时天气信息。它简单而且轻量级,可以给你最多 7 天的详细天气预报和今明两天的每个小时的细节信息。 + +![][38] + +它集成在 GNOME shell 中,给你关于最近搜索位置的当前天气状态。它有极简的用户界面,在最小硬件需求下运行很顺畅。 + +### 34、Ramme + +Ramme 是一个很酷的非官方的 Instagram 桌面客户端,给你带来 Instagram 移动端的感觉。它是基于 Electron 开发的客户端,所以它复现了 Instagram 应用的功能,并提供了主题自定义的功能。 + +![][39] + +但是由于 Instagram 的 API 限制,你不能使用 Ramme 客户端上传图像,但你可以订阅 Instagram 流、喜欢和评论文章,给好友发消息。你可以从 [Github][40] 下载 Ramme 安装文件。 + +### 35、Thunderbird + +Thunderbird 是一个开源的邮件客户端,是很多 Linux 发行版的默认邮件客户端。尽管在 2017 年与 Mozilla 分道扬镳(LCTT 译注: Thunderbird 现在由 Thunderbird 议会独立决策,只是将财务和法律关系留在 Mozilla 基金会),Thunderbird 仍然是 Linux 平台非常流行的最好的邮件客户端。它自带的功能包括垃圾邮件过滤、IMAP 和 POP 邮件同步、日历支持、通讯录集成和很多其它可以开箱即用的功能。 + +![][41] + +它是一个跨平台的邮件客户端,由社区提供对所有平台提供支持。因其可以高度自定义,你可以改变它的外观和观感。 + +### 36、Pidgin + +Pidgin 是一个即时信息客户端,你能够在单个窗口下登录不同的即时通讯网络。你可以登录到像 Google Talk、XMPP、AIM、Bonjour 等即时通讯。 + +![][42] + +Pidgin 拥有你所期待的即时通信的所有特点,你总是可以通过安装额外的插件来提升其表现。 + +``` +$ sudo apt-get install pidgin +``` + +### 37、Krita + +Krita 是由 KDE 开发的自由开源的数字绘制、编辑和动画的应用。它有优秀的用户界面,每个组件都恰到好处,因此你可以轻松找到你所需要的。 + +![][43] + +它使用 OpenGL 画布,这提升了 Krita 的性能,并且提供了很多功能,如各种绘画工具、动画工具、矢量工具、层和遮罩等很多。可在 Ubuntu 软件中心获取 Krita 并下载。 + +### 38、Dropbox + +Dropbox 是一个出色的云存储客户端,正确安装后,它在 Ubuntu 中运行得非常好。即使 Google Drive 在 Ubuntu 16.04 LTS 和以后的版本中运行得不错,就 Dropbox 提供的特点而言,Dropbox 仍然是 Linux 上的首选云存储工具。 + +![][44] + +它总是在后台运行,可以备份你系统上的新文件到云存储,持续保持你的电脑和云存储间的同步。 + +``` +$ sudo apt-get install nautilus-dropbox +``` + +### 39、Kodi + +Kodi 的前身是人们所熟知的 Xbox 媒体中心(XBMC),它是一个开源的媒体播放器。你可以在线或离线播放音乐、视频、播客、视频游戏等。这个软件最初是为第一代的 Xbox 游戏主机开发的,之后慢慢地移植到了个人电脑上。 + +![][45] + +Kodi 有令人印象深刻的视频界面,快速而强大。它是可高度定制的媒体播放器,你可以通过安装插件,来获取在线流服务,如 Pandora、Spotify、Amazon Prime Video、Netflix 和 YouTube 等等。 + +### 40、Spotify + +Spotify 是最好的在线媒体流站点之一。它提供免费和付费的音乐、播客、视频流服务。早期的 Spotify 不支持 Linux,但现在它有了自己的全功能的 Ubuntu 客户端。 + +![][46] + +与 Google Play 音乐播放器一样,Spotify 是必不可少的媒体播放器。你只需要登录你的 Spotify 账户,就能在任何地方获取你最爱的在线内容。 + +### 41、Brackets + +Brackets 是一个由 Adobe 开发的开源的文本编辑器。它可以用来进行 web 开发和设计,例如 HTML、CSS 和 JavaScript。它带有的实时预览模式是一个很棒的特点,当你在脚本中修改时,你可以获得实时预览效果。 + +![][47] + +它是 Ubuntu 上的现代文本编辑器之一,拥有平滑的用户界面,这将 web 开发任务带到新的水平。它同样提供了行内编辑器的特点,支持流行的扩展像 Emmet、Beautify、Git、File Icons 等等。 + +### 42、Bitwarden + +现今,账户安全是一个严重的问题,我们可以看到用户密码被盗和重要数据受到侵害的安全漏洞在不断增加。推荐你使用 Bitwarden,将你的所有账户和登录密码安全地存在一个地方。 + +![][48] + +Bitwarden 使用 AES-256 加密技术来存储所有的登录细节,只有用户可以访问这些数据。它同样可以帮你创建健壮的密码,因为弱密码容易被黑。 + +### 43、Terminator + +Terminator 是一个开源的终端模拟器,是用 Java 语言开发的。它是一个跨平台的模拟器,允许你在单个窗口有多个终端,在 Linux 默认的终端模拟器中不是这样。 + +![][49] + +Terminator 其它杰出的特点包括自动日志、拖放、垂直和水平的智能滚动等。 + +``` +$ sudo apt-get install terminator +``` + +### 44、Yak Yak + +Yak Yak 是一个开源的非官方的 Google Hangouts 消息的桌面客户端。它可以作为 Microsort Skype 的一个不错的替代品,自身拥有很多让人吃惊的特点。你可以启用桌面通知、设置语言偏好,使用很少的内存和处理能力就可以工作。 + +![][50] + +Yak Yak 拥有你期待的任何即时消息应用的所有特点,例如输入指示、拖放媒体文件、音/视频电话。 + +### 45、Thonny + +Thonny 是一个简单和轻量级的 IDE,尤其是为编程的初学者设计的。如果你是编程初学者,这是你必备的 IDE,因为当用 Python 编程的时候它会帮你学习。 + +![][51] + +Thonny 同样是一个很棒的调试工具,它支持调试过程中的变量值即时显示,除此之外,它还提供了独立的窗口以执行函数调用,简单的用户界面等等。 + +``` +$ sudo apt-get install thonny +``` + +### 46、字体管理器 + +字体管理器是一个轻量级的工具,用于管理、添加、移除你的 Ubuntu 系统上的字体。它是特别为 Gnome 桌面环境构建的,在用户不知道如何在命令行管理字体时会发现这个工具非常有用。 + +![][52] + +这个 Gtk+ 字体管理器不是为专业用户准备的,它有简单的用户界面,你会发现很容易使用。你只需要从网上下载字体文件,并使用字体管理器添加它们。 + +``` +$ sudo add-apt-repository ppa:font-manager/staging +$ sudo apt-get update +$ sudo apt-get install font-manager +``` + +### 47、Atril 文档查看器 + +Atril 是一个简单的文件查看器,支持便携文件格式(PDF)、PostScript(PS)、Encapsulated PostScript(EPS)、DJVU 和 DVI。Atril 与 MATE 桌面环境捆绑在一起,它比大多数 Linux 发行版中默认的文件查看器 Evince 更理想。 + +![][53] + +Atril 用简单和轻量级的用户界面,可高度自定义,提供了搜索、书签、UI 左侧的缩略图等特点。 + +``` +$ sudo apt-get install atril +``` + +### 48、Notepadqq + +如果你曾在 Windows 上用过 Notepad++,并且想在 Linux 上寻找相似的程序,别担心,开发者们已经将它移植到 Linux,名为 Notepadqq。它是一个简单而强大的文本编辑器,你可以在日常使用它,或用于各种语言进行编程。 + +![][54] + +尽管是作为一个简单的文本编辑器,它有一些令人惊奇的特点,例如,你可以设置主题为暗黑或明亮模式、多选、正则搜索和实时高亮。 + +``` +$ sudo add-apt-repository ppa:notpadqq-team/notepadqq +$ sudo apt-get update +$ sudo apt-get install notepadqq +``` + +### 49、Amarok + +Amarok 是在 KDE 项目下开发的一个开源音乐播放器。它有直观的界面,让你感觉在家一样,因此你可以轻易的发现你最喜爱的音乐。除了 Clementine,当你寻找 Ubuntu 上的完美的音乐播放器时,Amarok 是一个很棒的选择。 + +![][55] + +Amarok 上的一些顶尖的特点,包括智能播放列表支持,集成在线服务像 MP3tunes、Last.fm、 Magnatune 等。 + +### 50、Cheese + +Cheese 是 Linux 默认的网络摄像头应用,在视频聊天或即时消息应用中非常有用。除了这些,你还可以用这个应用来照相或拍视频,附带一些迷人的特效。 + +![][56] + +它同样提供闪拍模式,让你快速拍摄多张相片,并提供你共享给你的朋友和家人的选项。Cheese 预装在大多数的 Linux 发行版中,但是你同样可以在软件中心下载它。 + +### 51、MyPaint + +MyPaint 是一个自由开源的光栅图形编辑器,专于数字绘画而不是图像操作和相片处理。它是跨平台的应用,与 Corel Painter 很相似。 + +![][57] + +MyPaint 可能是 Windows 上的 Microsoft Paint 应用的很好的替代品。它有简单的用户界面,快速而强大。MyPaint 可以软件中心下载。 + +### 52、PlayOnLinux + +PlayOnLinux 是 WINE 模拟器的前端,允许你在 Linux 上运行 Windows 应用。你只需要在 WINE 中安装 Windows 应用,之后你就可以轻松的使用 PlayOnLinux 启动应用和游戏了。 + +![][58] + +### 53、Akregator + +Akregator 是在 KDE 项目下为 KDE Plasma 环境开发的默认 RSS 阅读器。它有简单的用户界面,自带了 KDE 的 Konqueror 浏览器,所以你不需要在阅读新闻提要时切换应用。 + +Akregator 同样提供了桌面通知、自动摘要等功能。你会发现在大多数 Linux 发行版中它是最好的提要阅读器。 + +### 54、Brave + +Brave 是一个开源的 web 浏览器,拦截了广告和追踪,所以你可以快速和安全的浏览你的内容。它实际做的是代表你向网站和 Youtube 主播支付了费用。如果你宁可支持网站和 Youtube 主播也不愿意看广告,这个浏览器更适合你。 + +![][60] + +对于那些想要安全浏览,但又不想错过互联网上重要信息的人来说,这是一个新概念,一个不错的浏览器。 + +### 55、Bitcoin Core + +Bitcoin Core 是一个比特币官方的客户端,非常安全和可靠。它持续追踪你的所有比特币交易以保证你的所有交易都是有效的。它可以防止比特币矿工和银行完全掌控你的比特币钱包。 + +![][61] + +Bitcoin Core 同样提供了其它重要的特点,像私钥备份、冷存储、安全通知等。 + +``` +$ sudo add-apt-repository ppa:bitcoin/bitcoin +$ sudo apt-get update +$ sudo apt-get install bitcoin-qt +``` + +### 56、Speedy 重复查找工具 + +Speedy 重复查找工具是一个跨平台的文件查找工具,用来帮助你查找你的系统上的重复文件,清理磁盘空间。它是一个智能工具,可以在整个硬盘上搜索重复文件,它同样提供了智能过滤功能,根据文件类型、扩展或大小帮你找到文件。 + +![][62] + +它有一个简单和整洁的用户界面,易于上手。从软件中心下载完后你就可以开始磁盘空间清理了。 + +### 57、Zulip + +Zulip 是一个自由开源的群聊应用,被 Dropbox 收购了。它是用 Python 写的,用 PostgreSQL 数据库。它被设计和开发为其它如 Slack 和 HipChat 的聊天应用的替代品。 + +![][63] + +Zulip 功能丰富,支持例如拖放文件、群聊、私密聊天、图像预览等。它也集成了 Github、JIRA、Sentry 和上百种其它服务。 + +### 58、Okular + +Okular 是为 KDE 桌面环境开发的跨平台的文件查看器。它是一个简单的文件查看器,支持 Portable Document Format (PDF)、PostScript、DjVu、Microsoft Compiled HTML help 和很多其它文件格式。 + +![][64] + +Okular 是在 Ubuntu 上你应该尝试的最好的文件查看器之一,它提供了 PDF 文件评论、画线、高亮等很多功能。你同样可以从 PDF 文件中提取文本文件。 + +### 59、FocusWriter + +FocusWriter 是一个集中注意力的字处理工具,隐藏了你的桌面屏幕,让你能够专注写作。正如你看到的屏幕截图,整个 Ubuntu 屏幕被隐藏了,只有你和你的字处理工具。但你总是可以进入 Ubuntu 屏幕,当你需要的时候,只需要将光标移动到屏幕的边缘即可。 + +![][65] + +它是一个轻量级的字处理器,支持 TXT、RTF、ODT 文件格式。它同样提供了可完全定制的用户界面,还有定时器、警报、每日目标、声音效果等特点,已经被翻译为 20 种语言。 + +### 60、Guake + +Guake 是为 GNOME 桌面环境准备的酷炫的下拉式终端。当你需要时,Guake 就会闪现,当你任务完成后,它就会消失。你只需要按 F12 按钮来启动或退出,这样启动 Guake 比启动一个新的终端窗口更快。 + +![][66] + +Guake 是一个功能丰富的终端,支持多栏,只需要点击几下就能将你的终端内容保存到文件,并且有完全可定制的用户界面。 + +``` +$ sudo apt-get install guake +``` + +### 61、KDE Connect + +KDE Connect 是 Ubuntu 上的一个很棒的应用,我很想在这篇马拉松文章中将它提早列出来,但是竞争太激烈了。总之 KDE Connect 可以将你的 Android 智能手机的通知直接转到 Ubuntu 桌面来。 + +![][67] + +有了 KDE Connect,你可以做很多事,例如检查手机电池电量,在电脑和 Android 手机间交换文件,剪贴板同步,发送短信,你还可以将你的手机当作无线鼠标或键盘。 + +``` +$ sudo add-apt-repository ppa:webupd8team/indicator-kedeconnect +$ sudo apt-get update +$ sudo apt-get install kdeconnect indicator-kdeconnect +``` + +### 62、CopyQ + +CopyQ 是一个简单但是非常有用的剪贴板管理器,它保存你的系统剪贴板内容,无论你做了什么改变,你都可以在你需要的时候搜索和恢复它。它是一个很棒的工具,支持文本、图像、HTML 和其它格式。 + +![][68] + +CopyQ 自身有很多功能像拖放、复制/拷贝、编辑、移除、排序、创建等。它同样支持集成文本编辑器,如 Vim,所以如果你是程序员,这非常有用。 + +``` +$ sudo add-apt-repository ppa:hluk/copyq +$ sudo apt-get update +$ sudo apt-get install copyq +``` + +### 63、Tilix + +Tilix 是一个功能丰富的高级 GTX3 平铺式终端模拟器。如果你使用 GNOME 桌面环境,那你会爱上 Tilix,因为它遵循了 GNOME 用户界面指导。Tilix 模拟器与大多数 Linux 发行版上默认终端模拟器相比,它给了你切分终端窗口为多个终端面板的功能。 + +![][69] + +Tilix 提供了自定义链接、图片支持、多面板、拖放、固定布局等功能。它同样支持键盘快捷方式,你可以根据你的需要在偏好设置中自定义快捷方式。 + +``` +$ sudo add-apt-repository ppa:webupd8team/terminix +$ sudo apt-get update +$ sudo apt-get install tilix +``` + +### 64、Anbox + +Anbox 是一个 Android 模拟器,可以让你在 Linux 系统中安装和运行 Android 应用。它是自由开源的 Android 模拟器,通过使用 Linux 容器来执行 Android 运行时环境。它使用最新的 Linux 技术 和 Android 发布版,所以你可以运行任何原生的 Android 应用。 + +![][70] + +Anbox 是现代和功能丰富的模拟器之一,提供的功能包括无限制的应用使用,强大的用户界面,与宿主系统无缝集成。 + +首先你需要安装内核模块。 + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt-get update +$ sudo apt install anbox-modules-dkms +``` + +然后你可以使用 snap 来安装 Anbox。 + +``` +$ snap install --devmode -- beta anbox +``` + +### 65、OpenShot + +你会发现 OpenShot 是 Linux 发行版中最好的开源的视频编辑器。它是跨平台的视频编辑器,易于使用,性能方面毫不逊色。它支持所有主流的音频、视频、图像格式。 + +![][71] + +OpenShot 有干净的用户界面,功能有拖放、剪切缩放、尺寸缩放、裁剪、快照、实时预览、音频混合和编辑等多种功能。 + +``` +$ sudo add-apt-repository ppa:openshot.developers/ppa +$ sudo apt-get update +$ sudo apt-get install openshot -qt +``` + +### 66、Plank + +如果你在为你的 Ubuntu 桌面寻找一个 Dock 导航栏,那 Plank 应该是一个选择。它是完美的,安装后你不需要任何的修改,除非你想这么做,它有内置的偏好面板,你可以自定义主题、Dock 大小和位置。 + +![][72] + +尽管是一个简单的导航栏,Plank 提供了通过拖放来重新摆放,固定和运行应用图标,透明主题支持等功能。 + +``` +$ sudo add-apt-repository ppa:ricotz/docky +$ sudo apt-get update +$ sudo apt-get install plank +``` + +### 67、Filezilla + +Filezilla 是一个免费和跨平台的 FTP 应用,包括 Filezilla 客户端和服务器。它让你使用 FTP 和加密的 FTP,如 FTPS 和 SFTP 传输文件,支持 IPv6 网络协议。 + +![][73] + +它是一个简单的文件传输应用,支持拖放,支持世界范围的各种语言,多任务的强大用户界面,可以控制和配置传输速度。 + +### 68、Stacer + +Stacer 是一个开源的系统诊断和优化工具,使用 Electron 开发框架开发。它有一个优秀的用户界面,你可以清理缓存内存、启动应用、卸载不需要的应用、掌控后台系统进程。 + +![][74] + +它也可以让你检查磁盘、内存和 CPU 使用情况,给你下载和上传的实时状态。它看起来像 Ubuntu clener 的强力竞争者,但是两者都有独特的特点。 + +``` +$ sudo add-apt-repository ppa:oguzhaninan/stacer +$ sudo apt-get update +$ sudo apt-get install stacer +``` + +### 69、4K 视频下载器 + +4K 视频下载器是一个简单的视频下载工具,你可以用来从 Vimeo、Facebook、YouTube 和其它在线视频流站点下载视频、播放列表、频道。它支持下载 YouTuBe 播放列表和频道,可以采用 MP4、MKV、M4A、3GP 和很多其它音/视频格式。 + +![][75] + +4K 视频下载器不是你想的那么简单,除了正常的视频下载,它支持 3D 和 360 度视频下载。它同样提供应用内代理设置、直连 iTunes 等功能。你可以从[这里][76]下载。 + +### 70、Qalculate + +Qalculate 是一个多用途、跨平台的桌面计算器,简单而强大。它可以用来解决复杂的数学问题和等式、货币汇率转换和很多其它日常计算。 + +![][77] + +它有优秀的用户界面,提供了自定义功能、单位计算、符号计算、四则运算、画图和很多你可以在科学计算器上发现的功能。 + +### 71、Hiri + +Hiri 是一个跨平台的邮件客户端,使用 Python 语言开发的。它有平滑的用户界面,就它的功能和服务而言,是 Micorsoft Outlook 的很好的替代品。这是很棒的邮件客户端,可以用来发送和接收邮件,管理通讯录、日历和任务。 + +![][78] + +它是一个具有丰富特点的邮件客户端,提供的功能有集成的任务管理器、邮件同步、邮件评分、邮件过滤等多种功能。 + +``` +$ sudo snap install hiri +``` + +### 72、Sublime Text + +Sublime Text 是一个跨平台的源代码编辑器,用 C++ 和 Python 写的。它有 Python 语言编程接口(API),支持所有主流的编程语言和标记语言。它是简单轻量级的文本编辑器,可被用作 IDE,包含自动补全、语法高亮、分窗口编辑等功能。 + +![][79] + +这个文本编辑器包括一些额外特点:任意跳转、跳转定义、多选、命令模式和可完全定制的用户界面。 + +``` +$ sudo apt-get install sublime-text +``` + +### 73、TeXstudio + +Texstudio 是一个创建和编辑 LaTex 文件的集成写作环境。它是开源的编辑器,提供了语法高亮、集成的查看器、交互式拼写检查、代码折叠、拖放等特点。 + +![][80] + +它是跨平台的编辑器,有简单轻量级的用户界面,易于使用。它集成了 BibTex 和 BibLatex 目录管理器,同样有集成的 PDF 查看器。你可以从[官网][81]和 Ubuntu 软件中心下载 Texstudio。 + +### 74、QtQR + +QtQR 是一个基于 Qt 的应用,让你在 Ubuntu 中创建和读取二维码。它是用 Python 和 Qt 开发的,有简单和轻量级的用户界面,你可以编码网站地址、邮件、文本、短消息等。你也可以用网络相机解码二维码。 + +![][82] + +如果你经常处理产品销售和服务,QtQR 会证明是有用的工具,我觉得没有能在如此低硬件的要求下能和 QtQR 一样提供类似功能顺畅运行的应用了。 + +``` +$ sudo add-apt-repository ppa: qr-tools-developers/qr-tools-stable +$ sudo apt-get update +$ sudo apt-get install qtqr +``` + +### 75、Kontact + +Kontact 是一个为 KDE 桌面环境开发的集成的个人信息管理器(PIM)。它集成了多个软件到一个集合中,在一个用户界面集成了 KMail、KOrganizer和 KAddressBook,你可以管理所有的邮件、通讯录、日程表等。 + +![][83] + +它可能是 Microsoft Outlook 的非常好的替代品,因为它是快速且高度高配置的消息管理工具。它有很好的用户界面,你会发现很容易上手。 + +``` +$ sudo apt-get install kontact +``` + +### 76、NitroShare + +NitroShare 是一个跨平台、开源的网络文件共享应用。它让你轻松的在局域网的多个操作系统中共享文件。它简单而强大,当在局域网中运行 NitroShare 时,它会自动侦查其它设备。 + +![][84] + +文件传输速度让 NitroShare 成为一个杰出的文件共享应用,它在能够胜任的硬件中能够达到 GB 级的传输速度。没有必要额外配置,安装完成后你就可以开始文件传输。 + +``` +$ sudo apt-add-repository ppa:george-edison55/nitroshare +$ sudo apt-get update +$ sudo apt-get install nitroshare +``` + +### 77、Konversation + +Konversation 是一个为 KDE 桌面环境开发的开源的网络中继聊天(IRC)客户端。它给了你到 Freenode 网络频道的快速入口,你可以为大多数发行版找到支持。 + +![][85] + +它是一个简单的聊天客户端,支持 IPv6 链接、SSL 服务器支持、书签、屏幕通知、UTF-8 检测和另外的主题。它易于使用的 GUI 是高度可配置的。 + +``` +$ sudo apt-get install konversation +``` + +### 78、Discord + +如果你是硬核游戏玩家,经常玩在线游戏,我有一个很棒的应用推荐给你。Discord 是一个免费的网络电话应用,尤其是为在线游戏者们设计的。它是一个跨平台的应用,可用来文字或语音聊天。 + +![][86] + +Discord 是一个非常流行的语音通话应用游戏社区,因为它是完全免费的,它是 Skype、Ventrilo、Teamspeak 的很好的竞争者。它同样提供清晰的语音质量、现代的文本聊天,你可以共享图片、视频和链接。 + +### 79、QuiteRSS + +QuiteRSS是一个开源的 RSS 和 Atom 新闻摘要的聚合应用。它是跨平台的摘要阅读器,用 Qt 和 C++ 写的。它有简单的用户界面,你可以改变为经典或者报纸模式。它集成了 webkit 浏览器,因此,你可以在单个窗口执行所有任务。 + +![][87] + +QuiteRSS 自带了很多功能,像内容过滤、自动规划摘要、导入/导出 OPML、系统托盘集成了很多其它摘要阅读器有的特点。 + +``` +$ sudo apt-get install quiterss +``` + +### 80、MPV Media Player + +MPV 是一个自由开源的媒体播放器,基于 MPlayer 和 MPlayer 2。它有简单的用户界面,用户只需要拖放音/视频文件来播放,因为在 GUI 上没有添加媒体文件的选项。 + +![][88] + +关于 MPV 的一件事是它可以轻松播放 4K 视频,Linux 发行版中的其它媒体播放器可能做不到。它同样给了用户播放在线视频流站点如 YouTube 和 Dailymotion 的能力。 + +``` +$ sudo add-apt-repository ppa:mc3man/mpv-tests +$ sudo apt-get update +$ sudo apt-get install -y mpv +``` + +### 81、Plume Creator + +如果你是一个作家,那么 Plume Creator 是你必不可少的应用,因为你在 Ubuntu 上找不到其它应用像 Plume Creater 这样。写作和编辑故事、章节是繁重的任务,在 Plume Creator 这个令人惊奇的工具的帮助下,将大大帮你简化这个任务。 + +![][89] + +它是一个开源的应用,拥有精简的用户界面,开始你可能觉得困惑,但不久你就会习惯的。它提供的功能有:编辑笔记、摘要、导出 HTML 和 ODT 格式、富文本编辑。 + +``` +$ sudo apt-get install plume-creator +``` + +### 82、Chromium Web 浏览器 + +Chromium 是一个由 Google 开发和发布的开源 Web 浏览器。Chromium 就其外观和特点而言,很容易被误认为是 Chrome。它是轻量级和快速的网络浏览器,拥有最小用户界面。 + +![][90] + +如果你经常在 Windows 上使用 Google Chrome,而想在 Linux 上寻找一个类似的浏览器,那么 Chromium 就是你的最佳选择,你可以登录到你的 Google 账户以访问包括 Gmail 在内的所有 Google 服务。 + +### 83、简单天气指示器 + +简单天气指示器是用 Python 开发的开源天气提示应用。它自动侦查你的位置,并显示你天气信息像温度,下雨的可能性,湿度,风速和可见度。 + +![][91] + +简单天气指示器自带一些可配置项,例如位置检测、温度单位、位置可见度开关等等。它是一个还酷的应用,可以根据你的桌面来调整。 + +### 84、SpeedCrunch + +SpeedCrunch 是一个快速和高精度的科学计算器。它预置了数学函数、用户定义函数、复数和单位转换支持。它有简单的用户界面并易于使用。 + +![][92] + +这个科学计算器有令人吃惊的特点,如结果预览、语法高亮和自动补全。它是跨平台的,并有多语言支持。 + +### 85、Scribus + +Scribus 是一个自由开源的桌面出版应用,允许你创建宣传海报、杂志和图书。它是基于 Qt 工具器的跨平台应用,在 GNU 通用公共许可证下发布。它是一个专业的应用,拥有 CMYK 和 ICC 颜色管理的功能、基于 Python 的脚本引擎,和 PDF 创建功能。 + +![][93] + +Scribus 有相当好的用户界面,易于使用,可以在低配置下轻松使用。在所有的最新的 Linux 发行版的软件中心可以下载它。 + +### 86. Cura + +Cura 是一个由 David Braam 开发的开源的 3D 打印应用。Ultimaker Cura 是 3D 打印世界最流行的软件,世界范围有百万用户在使用。它遵守 3D 打印模型的 3 步:设计、准备、打印。 + +![][94] + +它是功能丰富的 3D 打印应用,为 CAD 插件和扩展提供了无缝支持。它是一款简单易于使用的工具,新手艺术家可以马上开始了。它支持主流的文件格式像 STL、3MF 和 OBJ。 + +### 87、Nomacs + +Nomacs 是一款开源、跨平台的图像浏览器,支持所有主流的图片格式包括 RAW 和 psd 图像。它可以浏览 zip 文件中的图像或者 Microsoft Office 文件并提取到目录。 + +![][95] + +Nomacs 拥有非常简单的用户界面,图像缩略图在顶部,它提供了一些基本的图像操作特点像修改、调整大小、旋转、颜色纠正等。 + +``` +$ sudo add-apt-repository ppa:nomacs/stable +$ sudo apt-get update +$ sudo apt-get install nomacs +``` + +### 88、BitTicker + +BitTicker 是一个 Ubuntu 上的在线的 BTC-USDT 价格接收器。它是一个简单的工具,能够连接到 bittrex.com 市场,提取最新的 BTC-USDT 价格,并在系统托盘显示 Ubuntu 时钟。 + +![][96] + +它是简单但有用的工具,如果你经常有规律的投资比特币并且必须了解价格波动的话。 + +### 89、Organize My Files + +Organize My Files 是一个跨平台的一键点击文件组织工具,它在 Ubuntu 中以 Snap 包的形式获得。它简单而强大,可以帮助你找到未组织的文件,通过简单点击来掌控它们。 + +![][97] + +它有易于理解的用户界面,强大且快速。它提供了很多功能:自动组织、递归组织、智能过滤和多层文件夹组织等。 + +### 90、GnuCash + +GnuCash 是一个金融账户软件,在 GNU 公共证书下自由使用。它是个人和商业账户的理想软件。它有简单的用户界面允许你追踪银行账户、股票、收入和花费。 + +![][98] + +GnuCash 实现了双入口记账系统,基于专业的账户原则来确保帐薄的平衡和报告的精确。 + +### 91、Calibre + +Calibre 是一个跨平台的开源的面向电子书需求的解决方案。它是一个简单的电子书管理器,提供显示、创建、编辑电子书、组织已存在的电子书到虚拟书库、同步和其它更多功能。 + +![][99] + +Calibre 同样可以帮你转换电子书到你需要的格式并发送到你的电子书阅读设备。Calibre 是一个很棒的工具,如果你经常阅读和管理电子书的话。 + +### 92、MATE 词典 + +MATE 词典是一个简单的词典,基本上是为 MATE 桌面环境开发的。你可以仅仅输入字然后这个字典会显示意思和引用。 + +![][100] + +它是简单和轻量级的在线词典,有极简的用户界面。 + +### 93、Converseen + +Converseen 是免费的跨平台的批量图片处理应用,允许你转换、编辑、调整、旋转、裁剪大量图像,而仅仅需要一次鼠标点击。它提供了使用前缀或后缀图像批量重命名和从一个 Windows 图标文件提取图像等功能。 + +![][101] + +它有很好的用户界面,易于使用,即时你是一个新手。它也能够转换整个 PDF 文件为图像集合。 + +### 94、贴片地图编辑器 + +贴片地图编辑器是一个免费的关卡地图编辑器,允许你以正交、等轴、和六角等方向编辑地图。这个工具对于游戏开发者在游戏引擎开发阶段内可能非常有用。 + +![][102] + +它是一个通用的地图编辑器,让你创建升级位置、地图布局、碰撞区域和敌人位置。它保存所有的数据为 tmx 格式。 + +### 95. Qmmp + +Qmmp 是一个自由开源的音频播放器,用 C++ 和 Qt 开发的。它是跨平台的音频播放器,界面与 Winamp 很相似。 它有简单的直观的用户界面,可以用 Winamp 皮肤替代默认的 UI。 + +![][103] + +它提供了自动唱片集封面获取、支持多艺术家,另外的插件和扩展支持和其它与 Winamp 相似的特点。 + +``` +$ sudo add-apt-repository ppa:forkotov02/ppa +$ sudo apt-get update +$ sudo apt-get install qmmp qmmp-q4 qmmp-plugin-pack-qt4 +``` + +### 96、Arora + +Arora 是一个免费开源的 web 浏览器,提供了专有的下载管理器、书签、私密模式、选项卡式浏览。 + +![][104] + +Arora web 浏览器由 Benjamin C. Meyer 开发,它由于它的轻量自然灵活的特点在 Linux 用户间很受欢迎。 + +### 97、XnSketch + +XnSketch 是一个 Ubuntu 上的酷应用,只需要几次点击,就能帮你转换你的图片为卡通或素描图。它展现了 18 个不同的效果,例如:锐化、白描、铅笔画等等。 + +![][105] + +它有优秀的用户界面,易于使用。一些额外的特点包括透明度和边缘锐化调整、对比度、亮度、饱和度调整。 + +### 98、Geany + +Geany 是一个简单而轻量级的文本编辑器,像一个集成开发环境。它是跨平台的文本编辑器,支持所有主流编程语言包括 Python、C++、LaTex、Pascal、C#、etc。 + + +![][106] + +Geany 有个类似于 Notepad++ 编程编辑器的简单用户界面。它提供了 IDE 的功能,如代码导航、自动补完、格式高亮,并支持扩展。 + +``` +$ sudo apt-get install geany +``` + +### 99、Mumble + +Mumble 是又一个 VoIP 应用,与 Discord 类似。Mumble 同样最初是为在线游戏玩家设计的,使用客户端-服务器架构提供了端到端的聊天。在 Mumble 上的声音质量非常好,它提供了端到端的加密来确保私密性。 + +![][107] + +Mumble 是一个开源应用,有简单的用户界面,易于使用。Mumble 在 Ubuntu 软件中心可以下载。 + +``` +$ sudo apt-get install mumble-server +``` + +### 100、Deluge + +Deluge 是一个跨平台的轻量级的 BitTorrent 客户端,能够用来在 Ubuntu 上下载文件。BitTorrent 客户端与很多 Linux 发行版一起发行,但 Deluge 是最好的 BitTorrent 客户端,界面简单、易于使用。 + +![][108] + +Deluge 拥有你可以在其它 BitTorrent 客户端上发现的所有功能,但是一个功能特别突出,它给了用户从其它设备访问客户端的能力,这样你可以远程下载文件了。 + +``` +$ sudo add-apt-repository ppa:deluge-team/ppa +$ sudo apt-get update +$ sudo apt-get install deluge +``` + +所以这些就是 2018 年我为大家选择的 Ubuntu 上最好的 100 个应用了。所有列出的应用都在 Ubuntu 18.04 上测试了,肯定在老版本上也能运行。 + +-------------------------------------------------------------------------------- + +via: https://linuxhint.com/100_best_ubuntu_apps/ + +作者:[Swapnil Tirthakar][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://linuxhint.com/author/swapnil/ +[1]:https://linuxhint.com/applications-2018-ubuntu/ +[2]:https://linuxhint.com/wp-content/uploads/2018/06/100-Best-Ubuntu-Apps.png +[3]:https://linuxhint.com/wp-content/uploads/2018/06/Chrome.png +[4]:https://linuxhint.com/wp-content/uploads/2018/06/Steam.png +[5]:https://linuxhint.com/wp-content/uploads/2018/06/Wordpress.png +[6]:https://linuxhint.com/wp-content/uploads/2018/06/VLC.png +[7]:https://linuxhint.com/wp-content/uploads/2018/06/Atom-Text-Editor.png +[8]:https://linuxhint.com/wp-content/uploads/2018/06/GIMP.png +[9]:https://linuxhint.com/wp-content/uploads/2018/06/Google-Play.png +[10]:https://www.googleplaymusicdesktopplayer.com/ +[11]:https://linuxhint.com/wp-content/uploads/2018/06/Franz.png +[12]:https://meetfranz.com/#download +[13]:https://linuxhint.com/wp-content/uploads/2018/06/Synaptic.png +[14]:https://linuxhint.com/wp-content/uploads/2018/06/Skype.png +[15]:https://linuxhint.com/wp-content/uploads/2018/06/VirtualBox.png +[16]:https://linuxhint.com/wp-content/uploads/2018/06/Unity-Tweak-Tool.png +[17]:https://linuxhint.com/wp-content/uploads/2018/06/Ubuntu-Cleaner.png +[18]:https://linuxhint.com/wp-content/uploads/2018/06/Visual-Studio-Code.png +[19]:https://linuxhint.com/wp-content/uploads/2018/06/Corebird.png +[20]:https://linuxhint.com/wp-content/uploads/2018/06/Pixbuf.png +[21]:https://linuxhint.com/wp-content/uploads/2018/06/Clementine.png +[22]:https://linuxhint.com/wp-content/uploads/2016/06/blender.jpg +[23]:https://linuxhint.com/wp-content/uploads/2018/06/Audacity.png +[24]:https://linuxhint.com/wp-content/uploads/2018/06/Vim.png +[25]:https://linuxhint.com/wp-content/uploads/2018/06/Inkscape-1.png +[26]:https://linuxhint.com/wp-content/uploads/2018/06/ShotCut.png +[27]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Screen-Recorder.png +[28]:https://linuxhint.com/wp-content/uploads/2018/06/Telegram.png +[29]:https://linuxhint.com/wp-content/uploads/2018/06/ClamTk.png +[30]:https://linuxhint.com/wp-content/uploads/2018/06/Mailspring.png +[31]:https://linuxhint.com/wp-content/uploads/2018/06/PyCharm.png +[32]:https://linuxhint.com/wp-content/uploads/2018/06/Caffeine.png +[33]:https://linuxhint.com/wp-content/uploads/2018/06/Etcher.png +[34]:https://etcher.io/ +[35]:https://linuxhint.com/wp-content/uploads/2018/06/Neofetch.png +[36]:https://linuxhint.com/wp-content/uploads/2018/06/Liferea.png +[37]:https://linuxhint.com/wp-content/uploads/2018/06/Shutter.png +[38]:https://linuxhint.com/wp-content/uploads/2018/06/Weather.png +[39]:https://linuxhint.com/wp-content/uploads/2018/06/Ramme.png +[40]:https://github.com/terkelg/ramme/releases +[41]:https://linuxhint.com/wp-content/uploads/2018/06/Thunderbird.png +[42]:https://linuxhint.com/wp-content/uploads/2018/06/Pidgin.png +[43]:https://linuxhint.com/wp-content/uploads/2018/06/Krita.png +[44]:https://linuxhint.com/wp-content/uploads/2018/06/Dropbox.png +[45]:https://linuxhint.com/wp-content/uploads/2018/06/kodi.png +[46]:https://linuxhint.com/wp-content/uploads/2018/06/Spotify.png +[47]:https://linuxhint.com/wp-content/uploads/2018/06/Brackets.png +[48]:https://linuxhint.com/wp-content/uploads/2018/06/Bitwarden.png +[49]:https://linuxhint.com/wp-content/uploads/2018/06/Terminator.png +[50]:https://linuxhint.com/wp-content/uploads/2018/06/Yak-Yak.png +[51]:https://linuxhint.com/wp-content/uploads/2018/06/Thonny.png +[52]:https://linuxhint.com/wp-content/uploads/2018/06/Font-Manager.png +[53]:https://linuxhint.com/wp-content/uploads/2018/06/Atril.png +[54]:https://linuxhint.com/wp-content/uploads/2018/06/Notepadqq.png +[55]:https://linuxhint.com/wp-content/uploads/2018/06/Amarok.png +[56]:https://linuxhint.com/wp-content/uploads/2018/06/Cheese.png +[57]:https://linuxhint.com/wp-content/uploads/2018/06/MyPaint.png +[58]:https://linuxhint.com/wp-content/uploads/2018/06/PlayOnLinux.png +[59]:https://linuxhint.com/wp-content/uploads/2018/06/Akregator.png +[60]:https://linuxhint.com/wp-content/uploads/2018/06/Brave.png +[61]:https://linuxhint.com/wp-content/uploads/2018/06/Bitcoin-Core.png +[62]:https://linuxhint.com/wp-content/uploads/2018/06/Speedy-Duplicate-Finder.png +[63]:https://linuxhint.com/wp-content/uploads/2018/06/Zulip.png +[64]:https://linuxhint.com/wp-content/uploads/2018/06/Okular.png +[65]:https://linuxhint.com/wp-content/uploads/2018/06/Focus-Writer.png +[66]:https://linuxhint.com/wp-content/uploads/2018/06/Guake.png +[67]:https://linuxhint.com/wp-content/uploads/2018/06/KDE-Connect.png +[68]:https://linuxhint.com/wp-content/uploads/2018/06/CopyQ.png +[69]:https://linuxhint.com/wp-content/uploads/2018/06/Tilix.png +[70]:https://linuxhint.com/wp-content/uploads/2018/06/Anbox.png +[71]:https://linuxhint.com/wp-content/uploads/2018/06/OpenShot.png +[72]:https://linuxhint.com/wp-content/uploads/2018/06/Plank.png +[73]:https://linuxhint.com/wp-content/uploads/2018/06/FileZilla.png +[74]:https://linuxhint.com/wp-content/uploads/2018/06/Stacer.png +[75]:https://linuxhint.com/wp-content/uploads/2018/06/4K-Video-Downloader.png +[76]:https://www.4kdownload.com/download +[77]:https://linuxhint.com/wp-content/uploads/2018/06/Qalculate.png +[78]:https://linuxhint.com/wp-content/uploads/2018/06/Hiri.png +[79]:https://linuxhint.com/wp-content/uploads/2018/06/Sublime-text.png +[80]:https://linuxhint.com/wp-content/uploads/2018/06/TeXstudio.png +[81]:https://www.texstudio.org/ +[82]:https://linuxhint.com/wp-content/uploads/2018/06/QtQR.png +[83]:https://linuxhint.com/wp-content/uploads/2018/06/Kontact.png +[84]:https://linuxhint.com/wp-content/uploads/2018/06/Nitro-Share.png +[85]:https://linuxhint.com/wp-content/uploads/2018/06/Konversation.png +[86]:https://linuxhint.com/wp-content/uploads/2018/06/Discord.png +[87]:https://linuxhint.com/wp-content/uploads/2018/06/QuiteRSS.png +[88]:https://linuxhint.com/wp-content/uploads/2018/06/MPU-Media-Player.png +[89]:https://linuxhint.com/wp-content/uploads/2018/06/Plume-Creator.png +[90]:https://linuxhint.com/wp-content/uploads/2018/06/Chromium.png +[91]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Weather-Indicator.png +[92]:https://linuxhint.com/wp-content/uploads/2018/06/SpeedCrunch.png +[93]:https://linuxhint.com/wp-content/uploads/2018/06/Scribus.png +[94]:https://linuxhint.com/wp-content/uploads/2018/06/Cura.png +[95]:https://linuxhint.com/wp-content/uploads/2018/06/Nomacs.png +[96]:https://linuxhint.com/wp-content/uploads/2018/06/Bit-Ticker-1.png +[97]:https://linuxhint.com/wp-content/uploads/2018/06/Organize-My-Files.png +[98]:https://linuxhint.com/wp-content/uploads/2018/06/GNU-Cash.png +[99]:https://linuxhint.com/wp-content/uploads/2018/06/Calibre.png +[100]:https://linuxhint.com/wp-content/uploads/2018/06/MATE-Dictionary.png +[101]:https://linuxhint.com/wp-content/uploads/2018/06/Converseen.png +[102]:https://linuxhint.com/wp-content/uploads/2018/06/Tiled-Map-Editor.png +[103]:https://linuxhint.com/wp-content/uploads/2018/06/Qmmp.png +[104]:https://linuxhint.com/wp-content/uploads/2018/06/Arora.png +[105]:https://linuxhint.com/wp-content/uploads/2018/06/XnSketch.png +[106]:https://linuxhint.com/wp-content/uploads/2018/06/Geany.png +[107]:https://linuxhint.com/wp-content/uploads/2018/06/Mumble.png +[108]:https://linuxhint.com/wp-content/uploads/2018/06/Deluge.png +[109]:https://twitter.com/linuxhint +[110]:https://twitter.com/SwapTirthakar +[111]:https://linux.cn/lctt/ + + + + + + + + + + + + + + + + + diff --git a/published/20180902 Learning BASIC Like It-s 1983.md b/published/20180902 Learning BASIC Like It-s 1983.md new file mode 100644 index 0000000000..db8caa1f9b --- /dev/null +++ b/published/20180902 Learning BASIC Like It-s 1983.md @@ -0,0 +1,179 @@ +穿越到 1983 年学习 BASIC +====== + +![](https://img.linux.net.cn/data/attachment/album/201907/12/125743p495dqnqdtctqzgp.jpg) + +1983 年时我还没出生,这让我略有一些遗憾。但我特别遗憾的是,是我没有经历过 8 位计算机时代的到来,因为我认为那些初次接触到还相对简单和受限的计算机的人们,拥有超过如今的我们的巨大优势。 + +今天,(几乎)每个人知道如何使用计算机,但是即使是在计算机行业当中,也很少有人能明白任何一台计算机内部的所有内容。现在软件分为[如此多的层次][1],做的是如此不同的事情,没有哪个人能知道哪些是必不可少的。而在 1983 年,家用电脑足够傻大粗,努力一些的人就能了解到一台特定的计算机是如何工作的。那样的一个人可能不会像今天的我觉得操作系统那么神秘,因为如今的操作系统已经在硬件上叠加了太多的抽象层。我希望这些抽象层逐一引入以易于理解;而今天,新的程序员们不得不自上而下、按时间回溯地尝试理解它们。 + +很多著名的程序员,尤其在计算机游戏行业,孩童时期就在苹果 II 和 Commodore 64 这样的 8 位计算机上开始编写游戏,John Romero、Richard Garriott 和 Chris Roberts 都是这样的例子。这好理解。在 8 位计算机时代,很多游戏只能在计算机杂志和[书籍][2]中以印刷的 BASIC 程序清单方式得到。如果你想玩其中一款游戏,就必须手工键入整个程序。不可避免的,你可能遇到一些问题,所以你就得调试你的程序。等到你让它可以工作起来了,你就已经对程序是如何运行的有了足够的了解,你就可以开始自己修改它了。如果你是一个狂热的游戏玩家,你几乎必然会成为一名优秀的程序员。 + +在我的童年时期我也玩电脑游戏。但是我玩的游戏是在 CD-ROM 上的。我有时发现我自己必须得搜索一下如何修复崩溃的安装程序,这可能涉及编辑 Windows 注册表之类的东西。可能是这种小故障的排除让我感觉很棒,所以我才考虑在大学里学习计算机科学。但是在大学中从不教我一些计算机如何工作的或如何控制它们的关键性的东西。 + +当然,现在我可以告诉计算机去干什么。尽管如此,我还是不禁感到,我缺少一些根本的见解 —— 只有那些伴随着更简单的计算机编程而成长的人才有的深刻见解。我不禁在想,如果在上世纪 80 年代初就接触到计算机会是什么样子?它们与今天使用计算机的体验相比有何不同? + +这篇文章将与通常的 Two-Bit History 的文章有一点不同,因为我将为这些问题尝试设想一个答案。 + +### 1983 + +就在上周,你在电视上看到了 [Commodore 64 的广告][3] ,现在 M\*A\*S\*H 播完了(LCTT 译注: 这是一部上世纪 70 年代初的电视剧),星期一晚上你可以找点新的事情做了。这个 Commodore 64 甚至看起来比鲁迪(LCTT 译注:应该是下文中拥有 Apple II 的人)的家人放在他们家地下室的 Apple II 更好。而且,广告中吹嘘说新的计算机会让你的朋友们“挤破”你家的大门。你知道学校里的几个家伙宁愿在你家闲逛,也不愿去鲁迪家里,只要他们能玩 Zork 就行。 + +所以,你得说服你的父母去买一台。你的母亲说,这事可以考虑,只要你不去游戏厅玩街机就给你买一台家庭电脑。虽然不太情愿,但是你还是同意了。而你的父亲则想,他可以用 MultiPlan (LCTT 译注:电子表格程序)跟踪家庭的资金状况,MultiPlan 是他曾听说过的一个电子表格程序,这就是为什么这台计算机被放在客厅的原因。然而,一年后,你仍然是唯一使用它的人。最终,他们同意你把它搬到了你的卧室的桌子上,正好位于你的警察海报下方。 + +(你的姐姐对这个决定表示抗议,但是,在 1983 年电脑这种东西[并不适合女孩][4]。) + +你的父亲在下班路上从 [ComputerLand][5] 那里把它捎了回来。你俩把盒子放置在电视机的旁边,并打开了它。外包装上说“欢迎来到友好的计算机世界”。而二十分钟以后你就不再信这句话了 —— 你俩仍然在尝试把 Commodore 连接到电视机上,并在想电视机的天线电缆到底是 75 欧姆还是 300 欧姆的同轴电缆。但是,最终你把电视机调到了频道 3,看到了一个颗粒状的、紫色的图像。 + +![Commodore 64 启动屏幕][6] + +计算机显示了一个 `READY`。你的爸爸把计算机推向了你,这意思是你是第一个尝试它的人。你小心翼翼地敲击每个字母,键入了 `HELLO`。然而计算机的回应是令人困惑的。 + +![Commodore 64 语法错误][7] + +你尝试输入了一些稍有不同的单词,然而回应总是一样的。你父亲说,你最好仔细读一下手册的其它部分。这绝非易事,[随 Commodore 64 一起提供的手册][8] 是一本小一些的书。但是这不会困住你,因为手册的介绍预示着奇迹。 + +它声称,Commodore 64 有“微型计算机行业中最先进的图画制作器”,能允许“你设计拥有四种不同颜色的图画,就像你在街机视频游戏里看到的一样”。Commodore 64 也有“内置的音乐和声音效果,可以与很多著名的音乐合成器相媲美”。所有的这些工具都置身于你的手边,手册会引导你完成所有这些: + +> 与所有提供的硬件一样重要的是,这本用户指南将提高你对计算机的理解。它无法在这里告诉你有关计算机的所有信息,但是它会向你推荐各种出版物,以获取有关所提出主题的更多详细信息。Commodore 希望你真正喜欢你的新 COMMODORE 64。要想真正得到乐趣,请记住:编程不是一种一天就能学会的东西。通读这个用户指南你要有耐心。 + +那一夜,你在床上通读了整整前三个章节:“安装”、“入门”和“BASIC 编程入门”,在你最终睡着时,手册还打开着放在了胸前。 + +### Commodore BASIC + +现在是星期六早上,你渴望尝试你所学到的新东西。手册里教给你的第一件事是如何更改在显示器上的颜色。你按照操作说明,按下 `CTRL-9` 来进入反色输入模式,然后按住空格键来创建了一个长长的空行。你可以使用 `CTRL-1` 到 `CTRL-8` 在不同的颜色之间交换,这让你的电视机屏幕焕发出了新的力量。 + +![Commodore 64 颜色带][9] + +尽管这很酷,但你觉得这不能算是编程。要对计算机编程,你昨晚已经学会了如何做,你必须以一种称为 BASIC 的语言与计算机交谈。对你来说,BASIC 看起来就像星球大战中的东西一样科幻,但是,到 1983 年时,其实 BASIC 已经快有二十岁了。它是由两位达特茅斯教授 John Kemeny 和 Tom Kurtz 发明的,他们想让社会科学和人文科学中的本科生也可以使用计算机。它被广泛使用在微型计算机上,在大学的数学课上很受欢迎。在比尔盖茨和保罗艾伦为 Altair 编写了微软 BASIC 解释器后,它就成为了微型计算机上的标准。但是这本手册对此没有任何解释,那么多年你都没学过它。 + +手册中建议你尝试的第一个 BASIC 命令是 `PRINT` 命令。你输入了 `PRINT "COMMODORE 64"`,很慢,因为你需要花费一点时间才能在按键 `2` 上面找到引号符号。你单击 `RETURN`,这一次,计算机没有抱怨,完全是按照你告诉它做的,在下一行中显示了 “COMMODORE 64” 。 + +现在你尝试对各种不同的东西使用 `PRINT` 命令:两个数字加在一起,两个数字乘在一起,甚至几个十进制数字。你不再输入 `PRINT` ,而是使用 `?` 代替,因为手册中告诉你 `?` 是 `PRINT` 的一个缩写,通常专业程序员都这么使用。你感觉自己已经像是一个专家了,不过你想起你还没有进行到第三章“BASIC 编程入门”。 + +你很快就开始了。该章节提示你编写你的第一个真正的 BASIC 程序。你输入 `NEW` 并单击 `RETURN`,它给了你一个干净的黑板slate。然后你在其中输入你的程序: + +``` +10 ?"COMMODORE 64" +20 GOTO 10 +``` + +手册里解释说 10 和 20 是行号。它们为计算机排序了语句。它们也允许程序员在某些命令中引用程序的其它行,正像你在这里使用的 `GOTO` 命令一样,它将程序指回到行 10。“这是一个很好的编程习惯”,手册认为,“以 10 的增量来编号行,可以防止你以后需要插入一些语句”。 + +你输入 `RUN`,并凝视充满了 “COMMODORE 64” 的屏幕,它一遍又一遍的重复。 + +![Commodore 64 显示反复打印 "Commodore 64" 的结果][10] + +你不确定这不会引爆你的计算机,过了一秒钟你才想起来应该单击 `RUN/STOP` 按键来打断循环。 + +手册接下来的一些部分向你介绍了变量,它告诉你变量像“在计算机中许多的盒子,它们每个可以容纳一个数字或一个文本字符串”。以一个 `%` 符号结尾的变量是一个整数,与此同时,以一个 `$` 符号结尾的变量是一个字符串。其余的所有变量是一些称为“浮点”变量的东西。手册警告你要小心变量名称,因为计算机仅会识别变量名称的前两个字母,尽管它不限制你想创建的名称有多长。(这并没有特别让你困扰,但是要是在 30 年后来看,这可能会让人们感到太疯狂了) + +你接着学习 `IF... THEN...` 和 `FOR... NEXT...` 结构体。有了这些新的工具,你感觉有能力来解决接下来手册丢给你的重大挑战。“如果你是个有野心的人”,没错,“输入下面的程序,并查看会发生什么。”该程序比你目前为止看到的程序更长、更复杂,但是,你很想知道它做了什么: + +``` +10 REM BOUNCING BALL +20 PRINT "{CLR/HOME}" +25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT +30 FOR BL = 1 TO 40 +40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) +50 FOR TM = 1 TO 5 +60 NEXT TM +70 NEXT BL +75 REM MOVE BALL RIGHT TO LEFT +80 FOR BL = 40 TO 1 STEP -1 +90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; +100 FOR TM = 1 TO 5 +110 NEXT TM +120 NEXT BL +130 GOTO 20 +``` + +上面的程序充分利用了 Commodore 64 最酷的功能之一。当把不可打印的命令字符作为字符串的一部分传递到 `PRINT` 命令时,它们会执行其操作,而不是被打印到屏幕上。这允许你重新摆放你程序中打印的字符串。(LCTT 译注:上述程序中如 `{CRSR LEFT}` 之类的控制字符执行类似 “在行中向左移动一个位置” 的操作,因此上述程序中利用这些字符操作了一个圆点字符四处移动,如下图。) + +输入上面的程序你花费了很长时间。你犯一些错误,并不得不重新输入一些行。但是,你最终能够按下 `RUN`,并看到了一幅杰作: + +![Commodore 64 反弹球][11] + +你觉得这恐怕是你见过的最酷的事了。不过你几乎转头就忘记了它,因为马上你就学到了 BASIC 的内置函数,像 `RND`(它返回一个随机数字)和 `CHR$`(它返回与一个给定数字代码匹配的字符),这个手册向你展示一个程序,这个程序有名到什么程度呢?直到许多年后,它仍然被当成了一个[短文选集][12]的标题: + +``` +10 PRINT "{CLR/HOME}" +20 PRINT CHR$(205.5 + RND(1)); +40 GOTO 20 +``` + +当运行时,上面的程序会生成一个随机的迷宫: + +![Commodore 64 迷宫程序][13] + +这绝对是你曾经见过最酷的事。 + +### PEEK 和 POKE + +现在你已经看过了 Commodore 64 手册的前四章节,包含那篇 “高级的 BASIC” 的章节,所以你感到十分自豪。在这个星期六早上,你学习到了很多东西。但是这个下午(在赶快吃了点午饭后),你将继续学习一些使这个放在你的客厅中的奇妙机器变得不再神秘的东西。 + +手册中的下一个章节标题是“高级颜色和图像命令”。它从回顾你今天早上首先键入的彩色条开始,并向你展示了如何在一个程序中做同样的事。然后它教给了你如何更改屏幕的背景颜色。 + +为此,你需要使用 BASIC 的 `PEEK` 和 `POKE` 命令。这些命令分别允许你检查和写入一个存储器地址。Commodore 64 有一个主背景颜色和一个边框背景颜色。每个都通过一个特定的内存地址控制。你可以把你喜欢的任何颜色值写入到这些地址,以使用这些背景颜色和边框颜色。 + +手册中解释: + +> 正像变量可以被认为机器中你放置信息的“盒子”一样,你也可以认为在计算机中代表特定内存位置的是一些特殊定义的“盒子”。 +> +> Commodore 64 会查看这些内存位置来了解屏幕的背景和边框应该是什么样的颜色,什么样的字符应该被显示在屏幕上,以及显示在哪里,等等其它任务。 + +你编写了一个程序来遍历所有可用的背景和边界的颜色的组合: + +``` +10 FOR BA = 0 TO 15 +20 FOR BO = 0 TO 15 +30 POKE 53280, BA +40 POKE 53281, BO +50 FOR X = 1 TO 500 : NEXT X +60 NEXT BO : NEXT BA +``` + +虽然 `POKE` 命令以及它的大操作数一开始时看起来很吓人,现在你看到那个数字的实际值其实不是很要紧。显然,你必须得到正确的数字,但是所有的数字代表的是一个“盒子”,Commodore 只是正好存储在地址 53280 处而已。这个盒子有一个特殊的用途:Commodore 使用它来确定屏幕背景应该是什么颜色。 + +![Commodore 64 更改背景颜色][14] + +你认为这简直棒极了。只需要写入到内存中一个专用的盒子,你可以控制一台计算机的基础属性。你不确定 Commodore 64 的电路系统如何读取你写入在内存中的值并更改屏幕的颜色的,但是,你不知道这些也没事。至少你知道结果是怎么样的。 + +### 特殊容器 + +在那个周六,你没有读完整本手册,因为你现在有点精疲力尽了。但是你最终会全部读完它。在这个过程中,你学到更多的 Commodore 64 专用的盒子。有一些盒子你可以写入来控制在屏幕上显示什么——这也是一个盒子,事实上,是控制每一个位置出现的字符。在第六章节 “精灵图形” 中,你学到可以让你定义可以移动和甚至缩放图像的特殊盒子。在第七章节 “创造声音” 中,你学到能写入以便使你的 Commodore 64 歌唱 “Michael Row the Boat Ashore” 的盒子。Commodore 64,事实证明,它和你可能以后学习到的一个称为 API 的关系甚少。控制 Commodore 64 大多涉及写入到电路系统赋予特殊意义的内存地址。 + +多年来,你花费在这些特殊盒子的时光一直伴随着你。甚至几十年后,当你在一个拥有大量的图形或声音 API 的机器上编程时,你知道,隐藏于其背后的,这些 API 最终是写入到这些盒子之类的东西里面的。你有时会好奇那些只使用过 API 的年轻程序员,他们肯定是觉得 API 为他们做到的这一切。可能他们认为这些 API 调用了一些其它隐藏的 API。但是,那些隐藏的 API 调用了什么?你不由得同情这些年轻的程序员们,因为他们一定会非常迷惑。 + +如果你喜欢这篇文章,也喜欢它每两周发布的一篇新文章的话,那么请在 Twitter 上关注 [@TwoBitHistory][15] 或订阅 [RSS 源][16]来确保你知道新的文章发布出来。 + +-------------------------------------------------------------------------------- + +via:https://twobithistory.org/2018/09/02/learning-basic.html + +作者:[Two-Bit History][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://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://www.youtube.com/watch?v=kZRE7HIO3vk +[2]: https://en.wikipedia.org/wiki/BASIC_Computer_Games +[3]: https://www.youtube.com/watch?v=ZekAbt2o6Ms +[4]: https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding +[5]: https://www.youtube.com/watch?v=MA_XtT3VAVM +[6]: https://twobithistory.org/images/c64_startup.png +[7]: https://twobithistory.org/images/c64_error.png +[8]: ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf +[9]: https://twobithistory.org/images/c64_colors.png +[10]: https://twobithistory.org/images/c64_print_loop.png +[11]: https://twobithistory.org/images/c64_ball.gif +[12]: http://10print.org/ +[13]: https://twobithistory.org/images/c64_maze.gif +[14]: https://twobithistory.org/images/c64_background.gif +[15]: https://twitter.com/TwoBitHistory +[16]: https://twobithistory.org/feed.xml +[17]: https://twitter.com/TwoBitHistory/status/1030974776821665793?ref_src=twsrc%5Etfw diff --git a/published/20190301 Emacs for (even more of) the win.md b/published/20190301 Emacs for (even more of) the win.md new file mode 100644 index 0000000000..7da7ab6a51 --- /dev/null +++ b/published/20190301 Emacs for (even more of) the win.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (oneforalone) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11046-1.html) +[#]: subject: (Emacs for (even more of) the win) +[#]: via: (https://so.nwalsh.com/2019/03/01/emacs) +[#]: author: (Norman Walsh https://so.nwalsh.com) + +Emacs 的(更多)胜利 +====== + +![](https://img.linux.net.cn/data/attachment/album/201907/02/002550x2ol48004hx6e0od.jpg) + +我天天用 Emacs,但我却从意识到。但是每当我用 Emacs 时,它都给我带来了很多乐趣。 + +> 如果你是个职业作家……Emacs 与其它的编辑器的相比就如皓日与群星一样。不仅更大、更亮,它轻而易举就让其他所有的东西都消失了。 + +我用 [Emacs][1] 已有二十多年了。我用它来写几乎所有的东西(我用 [IntelliJ][2] 编辑 Scala 和 Java )。看邮件的话我是能在 Emacs 里看就在里面看。 + +尽管我用 Emacs 已有数十年,我在新年前后才意识到,在过去十几年里,我对 Emacs 的使用几乎没有什么变化。当然,新的编辑模式出现了,我就会选一两个插件,几年前我确实是用了 [Helm][3],但大多数时候,它只是完成了我需要的所有繁重工作,日复一日,没有抱怨,也没有妨碍我。一方面,这证明了它有多好。另一方面,这是一个邀请,让我深入挖掘,看看我错过了什么。 + +于此同时,我也决定从以下几方面改进我的工作方式: + +* **更好的议程管理** 我在工作中负责几个项目,这些项目有定期和临时的会议;有些我是我主持的,有些我只要参加就可以。 + + 我意识到我对参加会议变得有些敷衍。往会议室里一坐很简单,但实际上我是在阅读电子邮件或处理其他事情。(我强烈反对在会议中“禁止携带笔记本电脑”的这条规定,但这是另一个话题。) + + 敷衍地去参加会议有几个问题。首先,这是对主持会议的人和其他参会者的不尊重。实际上这是不应该这么做的充分理由,但我还有意识到另一个问题:它掩盖了会议的成本。 + + 如果你在开会,但同时回复了一封电子邮件,也许修复了一个 bug,那么这个会议就没什么成本(或没那么多)。如果会议成本低廉,那么会议数量将会更多。 + + 我想要更少、更短的会议。我不想掩盖它们的成本,我想让开会变得很有价值,除非绝对必要,否则就干脆不要开。 + + 有时,开会是绝对有必要的。而且我认为一个简短的会有时候能够很快的解决问题。但是,如果我一天要开十个短会的话,那我觉得还是不要假装取得了什么效果吧。 + + 我决定在我参加的所有的会上做笔记。我并不是说一定要做会议记录,但是我肯定会花上几分钟。这会让我把注意力集中在开会上,而忽略其他事。 + +* **更好的时间管理** 无论是工作的或私人的,我有很多要做和想做的事。我一直在问题列表中跟踪其中的一些,一些在保存的电子邮件线索中(Emacs 和 [Gmail][4] 中,用于一些稍微不同的提醒),还有一些在日历、手机上各种各样的“待办事项列表”和小纸片上。可能还有其他地方。 + + 我决定把它们放在一起。不是说我认为放到一个一致的地方就更好,而是我想完成两件事:首先,把它们都集中在一个地方,我能够更好更全面地了解我在哪里投入了更多的精力;其次,我想养成一个记录、跟踪并保存它们的习惯(习惯指“固定或规律的倾向或做法,尤指难以放弃的倾向或做法”)。 + +* **更好的问责制** 如果你在某些科学或工程领域工作,你就会养成记笔记的习惯。唉,我没有。但我决定这么做。 + + 我对法律上鼓励使用装订页面或用永久记号笔涂抹并不感兴趣。我感兴趣的是养成做记录的习惯。我的目标是有一个地方记下想法和设计草图等。如果我突然有了灵感,或者我想到了一个不在测试套件中的边缘情况,我希望我的直觉是把它写在我的日志中,而不是草草写在一张小纸片上,或者自己觉得自己会记住它。 + +这些决心让我很快或多或少指向了 [Org][6] 模式。Org 模式有一个庞大的、活跃的、忠诚的用户社区。我以前也用过它(顺带一提,我都[写过][7]关于它的文章,在几年前),我花了很长的一段时间(将 [MarkLogic 集成][8]到其中。(这在过去的一两个星期里得到了回报!) + +但我从没正经用过 Org 模式。 + +我现在正在用它。我用了几分钟,我把所有要做的事情都记录下来,我还记了日记。我不确定我争论或列表它的所有功能能有多大价值,你可以通过网页快速地搜索找到很多。 + +如果你用 Emacs,那你也应该用 Org 模式。如果没用过 Emacs,我相信你不会是第一个因 Org 模式而使用 Emacs 的人。Org 模式可以做很多。它需要一点时间来学习方法和快捷键,但我认为这是值得的。(如果你的口袋中有一台 [iOS][9] 设备,我推荐你在路上使用 [beorg][10] 来记录。) + +当然,我想出了如何[将 XML 从其中提取出来][11](“working out” 确实是“用 elisp 来编程”的一种有趣的魔法)然后,如何将它转换回我的博客用的标记(当然,在 Emacs 中按下一个按钮就可以做到)。这是用 Org 模式写的第一篇帖子。这也不会是最后一次。 + +附注:生日快乐,[小博客][12]。 + +-------------------------------------------------------------------------------- + +via: https://so.nwalsh.com/2019/03/01/emacs + +作者:[Norman Walsh][a] +选题:[lujun9972][b] +译者:[oneforalone](https://github.com/oneforalone) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://so.nwalsh.com +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Emacs +[2]: https://en.wikipedia.org/wiki/IntelliJ_IDEA +[3]: https://emacs-helm.github.io/helm/ +[4]: https://en.wikipedia.org/wiki/Gmail +[5]: https://en.wikipedia.org/wiki/Lab_notebook +[6]: https://en.wikipedia.org/wiki/Org-mode +[7]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html +[8]: https://github.com/ndw/ob-ml-marklogic/ +[9]: https://en.wikipedia.org/wiki/IOS +[10]: https://beorgapp.com/ +[11]: https://github.com/ndw/org-to-xml +[12]: https://so.nwalsh.com/2017/03/01/helloWorld diff --git a/published/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md b/published/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md new file mode 100644 index 0000000000..9940c0e049 --- /dev/null +++ b/published/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11061-1.html) +[#]: subject: (Create a Custom System Tray Indicator For Your Tasks on Linux) +[#]: via: (https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux) +[#]: author: (M.Hanny Sabbagh https://fosspost.org/author/mhsabbagh) + +在 Linux 上为你的任务创建一个自定义的系统托盘指示器 +====== + +系统托盘图标如今仍是一个很神奇的功能。只需要右击图标,然后选择想要的动作,你就可以大幅简化你的生活并且减少日常行为中的大量无用的点击。 + +一说到有用的系统托盘图标,我们很容易就想到 Skype、Dropbox 和 VLC: + +![Create a Custom System Tray Indicator For Your Tasks on Linux][1] + +然而系统托盘图标实际上要更有用得多;你可以根据自己的需求创建自己的系统托盘图标。本指导将会教你通过简单的几个步骤来实现这一目的。 + +### 前置条件 + +我们将要用 Python 来实现一个自定义的系统托盘指示器。Python 可能已经默安装在所有主流的 Linux 发行版中了,因此你只需要确定一下它已经被安装好了(此处使用版本为 2.7)。另外,我们还需要安装好 `gir1.2-appindicator3` 包。该库能够让我们很容易就能创建系统图标指示器。 + +在 Ubuntu/Mint/Debian 上安装: + +``` +sudo apt-get install gir1.2-appindicator3 +``` + +在 Fedora 上安装: + +``` +sudo dnf install libappindicator-gtk3 +``` + +对于其他发行版,只需要搜索包含 “appindicator” 的包就行了。 + +在 GNOME Shell 3.26 开始,系统托盘图标被删除了。你需要安装 [这个扩展][2](或者其他扩展)来为桌面启用该功能。否则你无法看到我们创建的指示器。 + +### 基础代码 + +下面是该指示器的基础代码: + +``` +#!/usr/bin/python +import os +from gi.repository import Gtk as gtk, AppIndicator3 as appindicator +def main(): + indicator = appindicator.Indicator.new("customtray", "semi-starred-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS) + indicator.set_status(appindicator.IndicatorStatus.ACTIVE) + indicator.set_menu(menu()) + gtk.main() +def menu(): + menu = gtk.Menu() + + command_one = gtk.MenuItem('My Notes') + command_one.connect('activate', note) + menu.append(command_one) + exittray = gtk.MenuItem('Exit Tray') + exittray.connect('activate', quit) + menu.append(exittray) + + menu.show_all() + return menu + +def note(_): + os.system("gedit $HOME/Documents/notes.txt") +def quit(_): + gtk.main_quit() +if __name__ == "__main__": + main() +``` + +我们待会会解释一下代码是怎么工作的。但是现在,让我们将该文本保存为 `tray.py`,然后使用 Python 运行之: + +``` +python tray.py +``` + +我们会看到指示器运行起来了,如下图所示: + +![Create a Custom System Tray Indicator For Your Tasks on Linux 13][3] + +现在,让我们解释一下这个魔法的原理: + + * 前三行代码仅仅用来指明 Python 的路径并且导入需要的库。 + * `def main()` :此为指示器的主函数。该函数的代码用来初始化并创建指示器。 + * `indicator = appindicator.Indicator.new("customtray","semi-starred-symbolic",appindicator.IndicatorCategory.APPLICATION_STATUS)` :这里我们指明创建一个名为 `customtray` 的新指示器。这是指示器的唯一名称,这样系统就不会与其他运行中的指示器搞混了。同时我们使用名为 `semi-starred-symbolic` 的图标作为指示器的默认图标。你可以将之改成任何其他值;比如 `firefox` (如果你希望该指示器使用 FireFox 的图标),或任何其他你想用的图标名。最后与 `APPLICATION_STATUS` 相关的部分是指明指示器类别/范围的常规代码。 + * `indicator.set_status(appindicator.IndicatorStatus.ACTIVE)`:这一行激活指示器。 + * `indicator.set_menu(menu())`:这里说的是我们想使用 `menu()` 函数(我们会在后面定义) 来为我们的指示器创建菜单项。这很重要,可以让你右击指示器后看到一个可以实施行为的列表。 + * `gtk.main()`:运行 GTK 主循环。 + * 在 `menu()` 中我们定义了想要指示器提供的行为或项目。`command_one = gtk.MenuItem('My Notes')` 仅仅使用文本 “My notes” 来初始化第一个菜单项,接下来 `command_one.connect('activate',note)` 将菜单的 `activate` 信号与后面定义的 `note()` 函数相连接;换句话说,我们告诉我们的系统:“当该菜单项被点击,运行 `note()` 函数”。最后,`menu.append(command_one)` 将菜单项添加到列表中。 + * `exittray` 相关的行是为了创建一个退出的菜单项,以便让你在想要的时候关闭指示器。 + * `menu.show_all()` 以及 `return menu` 只是返回菜单项给指示器的常规代码。 + * 在 `note(_)` 下面是点击 “My Notes” 菜单项时需要执行的代码。这里只是 `os.system("gedit $HOME/Documents/notes.txt")` 这一句话;`os.system` 函数允许你在 Python 中运行 shell 命令,因此这里我们写了一行命令来使用 `gedit` 打开家目录下 `Documents` 目录中名为 `notes.txt` 的文件。例如,这个可以称为你今后的日常笔记程序了! + +### 添加你所需要的任务 + +你只需要修改代码中的两块地方: + + 1. 在 `menu()` 中为你想要的任务定义新的菜单项。 + 2. 创建一个新的函数让给该菜单项被点击时执行特定的行为。 + +所以,比如说你想要创建一个新菜单项,在点击后,会使用 VLC 播放硬盘中某个特定的视频/音频文件?要做到这一点,只需要在第 17 行处添加下面三行内容: + +``` +command_two = gtk.MenuItem('Play video/audio') +command_two.connect('activate', play) +menu.append(command_two) +``` + +然后在第 30 行添加下面内容: + +``` +def play(_): + os.system("vlc /home//Videos/somevideo.mp4") +``` + +将` `/home//Videos/somevideo.mp4` 替换成你想要播放的视频/音频文件路径。现在保存该文件然后再次运行该指示器: + +``` +python tray.py +``` + +你将会看到: + +![Create a Custom System Tray Indicator For Your Tasks on Linux 15][4] + +而且当你点击新创建的菜单项时,VLC 会开始播放! + +要创建其他项目/任务,只需要重复上面步骤即可。但是要小心,需要用其他命令来替换 `command_two`,比如 `command_three`,这样在变量之间才不会产生冲突。然后定义新函数,就像 `play(_)` 函数那样。 + +可能性是无穷的;比如我用这种方法来从网上获取数据(使用 urllib2 库)并显示出来。我也用它来在后台使用 `mpg123` 命令播放 mp3 文件,而且我还定义了另一个菜单项来 `killall mpg123` 以随时停止播放音频。比如 Steam 上的 CS:GO 退出很费时间(窗口并不会自动关闭),因此,作为一个变通的方法,我只是最小化窗口然后点击某个自建的菜单项,它会执行 `killall -9 csgo_linux64` 命令。 + +你可以使用这个指示器来做任何事情:升级系统包、运行其他脚本——字面上的任何事情。 + +### 自动启动 + +我们希望系统托盘指示器能在系统启动后自动启动,而不用每次都手工运行。要做到这一点,只需要在自启动应用程序中添加下面命令即可(但是你需要将 `tray.py` 的路径替换成你自己的路径): + +``` +nohup python /home//tray.py & +``` + +下次重启系统,指示器会在系统启动后自动开始工作了! + +### 结论 + +你现在知道了如何为你想要的任务创建自己的系统托盘指示器了。根据每天需要运行的任务的性质和数量,此方法可以节省大量时间。有些人偏爱从命令行创建别名,但是这需要你每次都打开终端窗口或者需要有一个可用的下拉式终端仿真器,而这里,这个系统托盘指示器一直在工作,随时可用。 + +你以前用过这个方法来运行你的任务吗?很想听听你的想法。 + + +-------------------------------------------------------------------------------- + +via: https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux + +作者:[M.Hanny Sabbagh][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fosspost.org/author/mhsabbagh +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-28-0808.png?resize=407%2C345&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 12) +[2]: https://extensions.gnome.org/extension/1031/topicons/ +[3]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1041.png?resize=434%2C140&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 14) +[4]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1141.png?resize=440%2C149&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 16) diff --git a/published/20190320 4 cool terminal multiplexers.md b/published/20190320 4 cool terminal multiplexers.md new file mode 100644 index 0000000000..2b7ba72802 --- /dev/null +++ b/published/20190320 4 cool terminal multiplexers.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11054-1.html) +[#]: subject: (4 cool terminal multiplexers) +[#]: via: (https://fedoramagazine.org/4-cool-terminal-multiplexers/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +4 款很酷的终端复用器 +====== + +![][1] + +Fedora 系统对很多用户来说都很舒适。它有一个令人惊叹的桌面,可以轻松地完成日常任务。而在这光鲜的表面之下是由 Linux 系统提供的支持,而终端是高级用户使用这些底层能力的最简单方法。默认的终端简单且功能有限。但是,*终端复用器*能让你的终端变得非常强大。本文展示了一些流行的终端多路复用器以及如何安装它们。 + +为什么要用它?嗯,首先,它可以让你注销你的系统,而同时*让你的终端会话不受干扰*。退出你的控制台,这样安全,在其他地方旅行时通过远程登录 SSH 继续之前的操作是非常有用的。这里有一些工具可以看下。 + +最古老和最知名的终端多路复用器之一是 `screen`。但是,由于其代码不再维护,本文将重点介绍最近的应用。 (“最近的”是相对而言的,其中一些已存在多年!) + +### Tmux + +`tmux` 是 `screen` 最广泛使用的替代品之一。它有高度可配置的接口。你可以根据需要对 `tmux` 进行编程以启动特定类型的会话。在前面发表的这篇文章中你会发现更多关于 tmux 的信息: + +- [使用 tmux 实现更强大的终端][2] + +已经是 `tmux` 用户?你可能会喜欢[这篇使你的 tmux 会话更有效的文章][3]。 + +要安装 `tmux`,由于你可能已经在终端中,请带上 `sudo` 使用 `dnf`: + +``` +$ sudo dnf install tmux +``` + +要开始学习,请运行 `tmux` 命令。单窗格窗口以你的默认 shell 启动。tmux 使用*修饰键*来表示接下来会发出命令。默认情况下,此键为 `Ctrl+B`。如果输入 `Ctrl+B, C`,你将创建一个带有 shell 的新窗口。 + +提示:使用 `Ctrl+B, ?` 进入帮助模式,会列出你可以使用的所有键。为了简单起见,你先查看 `bind-key -T prefix` 开头的行。这些是你可以在修饰键之后立即使用的键,可以用来配置你的 `tmux` 会话。你可以按 `Ctrl+C` 退出帮助模式回 `tmux`。 + +要完全退出 `tmux`,请使用标准 `exit` 命令或 `Ctrl+D` 退出所有 shell。 + +### Dvtm + +你可能最近在 Fedroa Magzine 上看到过一篇 [dwm,一个动态窗口管理器][4]的文章。像 `dwm` 一样,`dvtm` 用于平铺窗口管理,但是是用在终端中。它的设计坚持 UNIX 的“做好一件事”的理念,在这里是管理终端中的窗口。 + +安装 `dvtm` 也很简单。但是,如果你想要前面提到的注销功能,你还需要 `abduco` 包来处理 dvtm 的会话管理。 + +``` +$ sudo dnf install dvtm abduco +``` + +`dvtm` 已经映射了许多管理终端窗口的按键。默认情况下,它使用 `Ctrl+G` 作为其修饰键。这个按键告诉 `dvtm` 接下来的字符将成为它应该处理的命令。例如, `Ctrl+G, C` 创建一个新窗口,`Ctrl+G, X` 将其关闭。 + +有关使用 `dvtm` 的更多信息,请查看 `dvtm` 的[主页][5],其中包含大量提示和入门信息。 + +### Byobu + +虽然 `byobu` 本身并不是真正的多路复用器 —— 它封装了 `tmux` 甚至更老的 `screen` 来添加功能,但它也值得在这里一提。通过帮助菜单和窗口选项卡,以便更加容易地找到那些功能,`byobu` 使终端复用器更适合初学者。 + +当然它也可以在 Fedora 仓库中找到。要安装它,请使用以下命令: + +``` +$ sudo dnf install byobu +``` + +默认情况下,`byobu` 会在内部运行 `screen`,因此你可能希望运行 `byobu-tmux` 来封装 `tmux`。你可以使用 `F9` 键打开帮助菜单以获取更多信息,来帮助你入门。 + +### Mtm + +`mtm` 是你可以找到的最小的复用器之一。事实上,它只有大约 1000 行代码!如果你处于受限的环境(例如旧硬件、最小容器等)中,你可能会发现它很有用。要开始使用,你需要安装一些包。 + +``` +$ sudo dnf install git ncurses-devel make gcc +``` + +然后克隆 `mtm` 所在的仓库: + +``` +$ git clone https://github.com/deadpixi/mtm.git +``` + +进入 `mtm` 文件夹并构建程序: + +``` +$ make +``` + +你可能会收到一些警告,但完成后,你将会有一个非常小的 `mtm` 程序。使用以下命令运行它: + +``` +$ ./mtm +``` + +你可以在 [GitHub 页面][6]上找到该程序的所有文档。 + +这里只是一些终端复用器。你有想推荐的么?请在下面留下你的评论,享受在终端中创建窗口吧! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-terminal-multiplexers/ + +作者:[Paul W. Frields][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://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/tmuxers-4-816x345.jpg +[2]: https://fedoramagazine.org/use-tmux-more-powerful-terminal/ +[3]: https://fedoramagazine.org/4-tips-better-tmux-sessions/ +[4]: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ +[5]: http://www.brain-dump.org/projects/dvtm/#why +[6]: https://github.com/deadpixi/mtm +[7]: https://unsplash.com/photos/48yI_ZyzuLo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/windows?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md similarity index 100% rename from published/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md rename to published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 10 Input01.md diff --git a/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md new file mode 100644 index 0000000000..5c39f24424 --- /dev/null +++ b/published/201904/20150616 Computer Laboratory - Raspberry Pi- Lesson 11 Input02.md @@ -0,0 +1,901 @@ +[#]: collector: (lujun9972) +[#]: translator: (guevaraya) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10700-1.html) +[#]: subject: (Computer Laboratory – Raspberry Pi: Lesson 11 Input02) +[#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input02.html) +[#]: author: (Alex Chadwick https://www.cl.cam.ac.uk) + +计算机实验室之树莓派:课程 11 输入02 +====== + +课程输入 02 是以课程输入 01 为基础讲解的,通过一个简单的命令行实现用户的命令输入和计算机的处理和显示。本文假设你已经具备 [课程11:输入01][1] 的操作系统代码基础。 + +### 1、终端 + +几乎所有的操作系统都是以字符终端显示启动的。经典的黑底白字,通过键盘输入计算机要执行的命令,然后会提示你拼写错误,或者恰好得到你想要的执行结果。这种方法有两个主要优点:键盘和显示器可以提供简易、健壮的计算机交互机制,几乎所有的计算机系统都采用这个机制,这个也广泛被系统管理员应用。 + +> 早期的计算一般是在一栋楼里的一个巨型计算机系统,它有很多可以输命令的'终端'。计算机依次执行不同来源的命令。 + +让我们分析下真正想要哪些信息: + +1. 计算机打开后,显示欢迎信息 +2. 计算机启动后可以接受输入标志 +3. 用户从键盘输入带参数的命令 +4. 用户输入回车键或提交按钮 +5. 计算机解析命令后执行可用的命令 +6. 计算机显示命令的执行结果,过程信息 +7. 循环跳转到步骤 2 + +这样的终端被定义为标准的输入输出设备。用于(显示)输入的屏幕和打印输出内容的屏幕是同一个(LCTT 译注:最早期的输出打印真是“打印”到打印机/电传机的,而用于输入的终端只是键盘,除非做了回显,否则输出终端是不会显示输入的字符的)。也就是说终端是对字符显示的一个抽象。字符显示中,单个字符是最小的单元,而不是像素。屏幕被划分成固定数量不同颜色的字符。我们可以在现有的屏幕代码基础上,先存储字符和对应的颜色,然后再用方法 `DrawCharacter` 把其推送到屏幕上。一旦我们需要字符显示,就只需要在屏幕上画出一行字符串。 + +新建文件名为 `terminal.s`,如下: + +``` +.section .data +.align 4 +terminalStart: +.int terminalBuffer +terminalStop: +.int terminalBuffer +terminalView: +.int terminalBuffer +terminalColour: +.byte 0xf +.align 8 +terminalBuffer: +.rept 128*128 +.byte 0x7f +.byte 0x0 +.endr +terminalScreen: +.rept 1024/8 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated 768/16 +.byte 0x7f +.byte 0x0 +.endr +``` + +这是文件终端的配置数据文件。我们有两个主要的存储变量:`terminalBuffer` 和 `terminalScreen`。`terminalBuffer` 保存所有显示过的字符。它保存 128 行字符文本(1 行包含 128 个字符)。每个字符有一个 ASCII 字符和颜色单元组成,初始值为 0x7f(ASCII 的删除字符)和 0(前景色和背景色为黑)。`terminalScreen` 保存当前屏幕显示的字符。它保存 128x48 个字符,与 `terminalBuffer` 初始化值一样。你可能会觉得我仅需要 `terminalScreen` 就够了,为什么还要`terminalBuffer`,其实有两个好处: + + 1. 我们可以很容易看到字符串的变化,只需画出有变化的字符。 + 2. 我们可以回滚终端显示的历史字符,也就是缓冲的字符(有限制) + +这种独特的技巧在低功耗系统里很常见。画屏是很耗时的操作,因此我们仅在不得已的时候才去执行这个操作。在这个系统里,我们可以任意改变 `terminalBuffer`,然后调用一个仅拷贝屏幕上字节变化的方法。也就是说我们不需要持续画出每个字符,这样可以节省一大段跨行文本的操作时间。 + +> 你总是需要尝试去设计一个高效的系统,如果在很少变化的情况下这个系统会运行的更快。 + +其他在 `.data` 段的值得含义如下: + + * `terminalStart` + 写入到 `terminalBuffer` 的第一个字符 + * `terminalStop` + 写入到 `terminalBuffer` 的最后一个字符 + * `terminalView` + 表示当前屏幕的第一个字符,这样我们可以控制滚动屏幕 + * `temrinalColour` + 即将被描画的字符颜色 + +`terminalStart` 需要保存起来的原因是 `termainlBuffer` 是一个环状缓冲区。意思是当缓冲区变满时,末尾地方会回滚覆盖开始位置,这样最后一个字符变成了第一个字符。因此我们需要将 `terminalStart` 往前推进,这样我们知道我们已经占满它了。如何实现缓冲区检测:如果索引越界到缓冲区的末尾,就将索引指向缓冲区的开始位置。环状缓冲区是一个比较常见的存储大量数据的高明方法,往往这些数据的最近部分比较重要。它允许无限制的写入,只保证最近一些特定数据有效。这个常常用于信号处理和数据压缩算法。这样的情况,可以允许我们存储 128 行终端记录,超过128行也不会有问题。如果不是这样,当超过第 128 行时,我们需要把 127 行分别向前拷贝一次,这样很浪费时间。 + +![显示 Hellow world 插入到大小为5的循环缓冲区的示意图。][2] + +> 环状缓冲区是**数据结构**一个例子。这是一个组织数据的思路,有时我们通过软件实现这种思路。 + +之前已经提到过 `terminalColour` 几次了。你可以根据你的想法实现终端颜色,但这个文本终端有 16 个前景色和 16 个背景色(这里相当于有 16^2 = 256 种组合)。[CGA][3]终端的颜色定义如下: + + +表格 1.1 - CGA 颜色编码 + +| 序号 | 颜色 (R, G, B) | +| ------ | ------------------------| +| 0 | 黑 (0, 0, 0) | +| 1 | 蓝 (0, 0, ⅔) | +| 2 | 绿 (0, ⅔, 0) | +| 3 | 青色 (0, ⅔, ⅔) | +| 4 | 红色 (⅔, 0, 0) | +| 5 | 品红 (⅔, 0, ⅔) | +| 6 | 棕色 (⅔, ⅓, 0) | +| 7 | 浅灰色 (⅔, ⅔, ⅔) | +| 8 | 灰色 (⅓, ⅓, ⅓) | +| 9 | 淡蓝色 (⅓, ⅓, 1) | +| 10 | 淡绿色 (⅓, 1, ⅓) | +| 11 | 淡青色 (⅓, 1, 1) | +| 12 | 淡红色 (1, ⅓, ⅓) | +| 13 | 浅品红 (1, ⅓, 1) | +| 14 | 黄色 (1, 1, ⅓) | +| 15 | 白色 (1, 1, 1) | + +我们将前景色保存到颜色的低字节,背景色保存到颜色高字节。除了棕色,其他这些颜色遵循一种模式如二进制的高位比特代表增加 ⅓ 到每个组件,其他比特代表增加 ⅔ 到各自组件。这样很容易进行 RGB 颜色转换。 + +> 棕色作为替代色(黑黄色)既不吸引人也没有什么用处。 + +我们需要一个方法从 `TerminalColour` 读取颜色编码的四个比特,然后用 16 比特等效参数调用 `SetForeColour`。尝试你自己实现。如果你感觉麻烦或者还没有完成屏幕系列课程,我们的实现如下: + +``` +.section .text +TerminalColour: +teq r0,#6 +ldreq r0,=0x02B5 +beq SetForeColour + +tst r0,#0b1000 +ldrne r1,=0x52AA +moveq r1,#0 +tst r0,#0b0100 +addne r1,#0x15 +tst r0,#0b0010 +addne r1,#0x540 +tst r0,#0b0001 +addne r1,#0xA800 +mov r0,r1 +b SetForeColour +``` + +### 2、文本显示 + +我们的终端第一个真正需要的方法是 `TerminalDisplay`,它用来把当前的数据从 `terminalBuffer`拷贝到 `terminalScreen` 和实际的屏幕。如上所述,这个方法必须是最小开销的操作,因为我们需要频繁调用它。它主要比较 `terminalBuffer` 与 `terminalDisplay` 的文本,然后只拷贝有差异的字节。请记住 `terminalBuffer` 是以环状缓冲区运行的,这种情况,就是从 `terminalView` 到 `terminalStop`,或者 128*48 个字符,要看哪个来的最快。如果我们遇到 `terminalStop`,我们将会假定在这之后的所有字符是 7f16 (ASCII 删除字符),颜色为 0(黑色前景色和背景色)。 + +让我们看看必须要做的事情: + + 1. 加载 `terminalView`、`terminalStop` 和 `terminalDisplay` 的地址。 + 2. 对于每一行: + 1. 对于每一列: + 1. 如果 `terminalView` 不等于 `terminalStop`,根据 `terminalView` 加载当前字符和颜色 + 2. 否则加载 0x7f 和颜色 0 + 3. 从 `terminalDisplay` 加载当前的字符 + 4. 如果字符和颜色相同,直接跳转到第 10 步 + 5. 存储字符和颜色到 `terminalDisplay` + 6. 用 `r0` 作为背景色参数调用 `TerminalColour` + 7. 用 `r0 = 0x7f`(ASCII 删除字符,一个块)、 `r1 = x`、`r2 = y` 调用 `DrawCharacter` + 8. 用 `r0` 作为前景色参数调用 `TerminalColour` + 9. 用 `r0 = 字符`、`r1 = x`、`r2 = y` 调用 `DrawCharacter` + 10. 对位置参数 `terminalDisplay` 累加 2 + 11. 如果 `terminalView` 不等于 `terminalStop`,`terminalView` 位置参数累加 2 + 12. 如果 `terminalView` 位置已经是文件缓冲器的末尾,将它设置为缓冲区的开始位置 + 13. x 坐标增加 8 + 2. y 坐标增加 16 + +尝试去自己实现吧。如果你遇到问题,我们的方案下面给出来了: + +1、我这里的变量有点乱。为了方便起见,我用 `taddr` 存储 `textBuffer` 的末尾位置。 + +``` +.globl TerminalDisplay +TerminalDisplay: +push {r4,r5,r6,r7,r8,r9,r10,r11,lr} +x .req r4 +y .req r5 +char .req r6 +col .req r7 +screen .req r8 +taddr .req r9 +view .req r10 +stop .req r11 + +ldr taddr,=terminalStart +ldr view,[taddr,#terminalView - terminalStart] +ldr stop,[taddr,#terminalStop - terminalStart] +add taddr,#terminalBuffer - terminalStart +add taddr,#128*128*2 +mov screen,taddr +``` + +2、从 `yLoop` 开始运行。 + +``` +mov y,#0 +yLoop$: +``` + +2.1、 + +``` +mov x,#0 +xLoop$: +``` +从 `xLoop` 开始运行。 + + +2.1.1、为了方便起见,我把字符和颜色同时加载到 `char` 变量了 + +``` +teq view,stop +ldrneh char,[view] +``` + +2.1.2、这行是对上面一行的补充说明:读取黑色的删除字符 + + +``` +moveq char,#0x7f +``` + +2.1.3、为了简便我把字符和颜色同时加载到 `col` 里。 + +``` +ldrh col,[screen] +``` + +2.1.4、 现在我用 `teq` 指令检查是否有数据变化 + +``` +teq col,char +beq xLoopContinue$ +``` + +2.1.5、我可以容易的保存当前值 + + +``` +strh char,[screen] +``` + +2.1.6、我用比特偏移指令 `lsr` 和 `and` 指令从切分 `char` 变量,将颜色放到 `col` 变量,字符放到 `char` 变量,然后再用比特偏移指令 `lsr` 获取背景色后调用 `TerminalColour` 。 + +``` +lsr col,char,#8 +and char,#0x7f +lsr r0,col,#4 +bl TerminalColour +``` + +2.1.7、写入一个彩色的删除字符 + +``` +mov r0,#0x7f +mov r1,x +mov r2,y +bl DrawCharacter +``` + +2.1.8、用 `and` 指令获取 `col` 变量的低半字节,然后调用 `TerminalColour` + +``` +and r0,col,#0xf +bl TerminalColour +``` + +2.1.9、写入我们需要的字符 + +``` +mov r0,char +mov r1,x +mov r2,y +bl DrawCharacter +``` + +2.1.10、自增屏幕指针 + +``` +xLoopContinue$: +add screen,#2 +``` + +2.1.11、如果可能自增 `view` 指针 + +``` +teq view,stop +addne view,#2 +``` + +2.1.12、很容易检测 `view` 指针是否越界到缓冲区的末尾,因为缓冲区的地址保存在 `taddr` 变量里 + +``` +teq view,taddr +subeq view,#128*128*2 +``` + +2.1.13、 如果还有字符需要显示,我们就需要自增 `x` 变量然后到 `xLoop` 循环执行 + +``` +add x,#8 +teq x,#1024 +bne xLoop$ +``` + +2.2、 如果还有更多的字符显示我们就需要自增 `y` 变量,然后到 `yLoop` 循环执行 + +``` +add y,#16 +teq y,#768 +bne yLoop$ +``` + +3、不要忘记最后清除变量 + +``` +pop {r4,r5,r6,r7,r8,r9,r10,r11,pc} +.unreq x +.unreq y +.unreq char +.unreq col +.unreq screen +.unreq taddr +.unreq view +.unreq stop +``` + +### 3、行打印 + +现在我有了自己 `TerminalDisplay` 方法,它可以自动显示 `terminalBuffer` 内容到 `terminalScreen`,因此理论上我们可以画出文本。但是实际上我们没有任何基于字符显示的例程。 首先快速容易上手的方法便是 `TerminalClear`, 它可以彻底清除终端。这个方法不用循环也很容易实现。可以尝试分析下面的方法应该不难: + +``` +.globl TerminalClear +TerminalClear: +ldr r0,=terminalStart +add r1,r0,#terminalBuffer-terminalStart +str r1,[r0] +str r1,[r0,#terminalStop-terminalStart] +str r1,[r0,#terminalView-terminalStart] +mov pc,lr +``` + +现在我们需要构造一个字符显示的基础方法:`Print` 函数。它将保存在 `r0` 的字符串和保存在 `r1` 的字符串长度简单的写到屏幕上。有一些特定字符需要特别的注意,这些特定的操作是确保 `terminalView` 是最新的。我们来分析一下需要做什么: + + 1. 检查字符串的长度是否为 0,如果是就直接返回 + 2. 加载 `terminalStop` 和 `terminalView` + 3. 计算出 `terminalStop` 的 x 坐标 + 4. 对每一个字符的操作: + 1. 检查字符是否为新起一行 + 2. 如果是的话,自增 `bufferStop` 到行末,同时写入黑色删除字符 + 3. 否则拷贝当前 `terminalColour` 的字符 + 4. 检查是否在行末 + 5. 如果是,检查从 `terminalView` 到 `terminalStop` 之间的字符数是否大于一屏 + 6. 如果是,`terminalView` 自增一行 + 7. 检查 `terminalView` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 8. 检查 `terminalStop` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 9. 检查 `terminalStop` 是否等于 `terminalStart`, 如果是的话 `terminalStart` 自增一行。 + 10. 检查 `terminalStart` 是否为缓冲区的末尾,如果是的话将其替换为缓冲区的起始位置 + 5. 存取 `terminalStop` 和 `terminalView` + +试一下自己去实现。我们的方案提供如下: + +1、这个是 `Print` 函数开始快速检查字符串为0的代码 + +``` +.globl Print +Print: +teq r1,#0 +moveq pc,lr +``` + +2、这里我做了很多配置。 `bufferStart` 代表 `terminalStart`, `bufferStop` 代表`terminalStop`, `view` 代表 `terminalView`,`taddr` 代表 `terminalBuffer` 的末尾地址。 + +``` +push {r4,r5,r6,r7,r8,r9,r10,r11,lr} +bufferStart .req r4 +taddr .req r5 +x .req r6 +string .req r7 +length .req r8 +char .req r9 +bufferStop .req r10 +view .req r11 + +mov string,r0 +mov length,r1 + +ldr taddr,=terminalStart +ldr bufferStop,[taddr,#terminalStop-terminalStart] +ldr view,[taddr,#terminalView-terminalStart] +ldr bufferStart,[taddr] +add taddr,#terminalBuffer-terminalStart +add taddr,#128*128*2 +``` + +3、和通常一样,巧妙的对齐技巧让许多事情更容易。由于需要对齐 `terminalBuffer`,每个字符的 x 坐标需要 8 位要除以 2。 + + +``` +and x,bufferStop,#0xfe +lsr x,#1 +``` + +4.1、我们需要检查新行 + +``` +charLoop$: +ldrb char,[string] +and char,#0x7f +teq char,#'\n' +bne charNormal$ +``` + +4.2、循环执行值到行末写入 0x7f;黑色删除字符 + +``` +mov r0,#0x7f +clearLine$: +strh r0,[bufferStop] +add bufferStop,#2 +add x,#1 +teq x,#128 blt clearLine$ + +b charLoopContinue$ +``` + +4.3、存储字符串的当前字符和 `terminalBuffer` 末尾的 `terminalColour` 然后将它和 x 变量自增 + +``` +charNormal$: +strb char,[bufferStop] +ldr r0,=terminalColour +ldrb r0,[r0] +strb r0,[bufferStop,#1] +add bufferStop,#2 +add x,#1 +``` + +4.4、检查 x 是否为行末;128 + + +``` +charLoopContinue$: +cmp x,#128 +blt noScroll$ +``` + +4.5、设置 x 为 0 然后检查我们是否已经显示超过 1 屏。请记住,我们是用的循环缓冲区,因此如果 `bufferStop` 和 `view` 之前的差是负值,我们实际上是环绕了缓冲区。 + +``` +mov x,#0 +subs r0,bufferStop,view +addlt r0,#128*128*2 +cmp r0,#128*(768/16)*2 +``` + +4.6、增加一行字节到 `view` 的地址 + +``` +addge view,#128*2 +``` + +4.7、 如果 `view` 地址是缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 + +``` +teq view,taddr +subeq view,taddr,#128*128*2 +``` + +4.8、如果 `stop` 的地址在缓冲区末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 + +``` +noScroll$: +teq bufferStop,taddr +subeq bufferStop,taddr,#128*128*2 +``` + +4.9、检查 `bufferStop` 是否等于 `bufferStart`。 如果等于增加一行到 `bufferStart`。 + +``` +teq bufferStop,bufferStart +addeq bufferStart,#128*2 +``` + +4.10、如果 `start` 的地址在缓冲区的末尾,我们就从它上面减去缓冲区的长度,让其指向开始位置。我会在开始的时候设置 `taddr` 为缓冲区的末尾地址。 + +``` +teq bufferStart,taddr +subeq bufferStart,taddr,#128*128*2 +``` +循环执行知道字符串结束 + +``` +subs length,#1 +add string,#1 +bgt charLoop$ +``` + +5、保存变量然后返回 + +``` +charLoopBreak$: +sub taddr,#128*128*2 +sub taddr,#terminalBuffer-terminalStart +str bufferStop,[taddr,#terminalStop-terminalStart] +str view,[taddr,#terminalView-terminalStart] +str bufferStart,[taddr] + +pop {r4,r5,r6,r7,r8,r9,r10,r11,pc} +.unreq bufferStart +.unreq taddr +.unreq x +.unreq string +.unreq length +.unreq char +.unreq bufferStop +.unreq view +``` + +这个方法允许我们打印任意字符到屏幕。然而我们用了颜色变量,但实际上没有设置它。一般终端用特性的组合字符去行修改颜色。如 ASCII 转义(1b16)后面跟着一个 0 - f 的 16 进制的数,就可以设置前景色为 CGA 颜色号。如果你自己想尝试实现;在下载页面有一个我的详细的例子。 + +### 4、标志输入 + +现在我们有一个可以打印和显示文本的输出终端。这仅仅是说对了一半,我们需要输入。我们想实现一个方法:`ReadLine`,可以保存文件的一行文本,文本位置由 `r0` 给出,最大的长度由 `r1` 给出,返回 `r0` 里面的字符串长度。棘手的是用户输出字符的时候要回显功能,同时想要退格键的删除功能和命令回车执行功能。它们还需要一个闪烁的下划线代表计算机需要输入。这些完全合理的要求让构造这个方法更具有挑战性。有一个方法完成这些需求就是存储用户输入的文本和文件大小到内存的某个地方。然后当调用 `ReadLine` 的时候,移动 `terminalStop` 的地址到它开始的地方然后调用 `Print`。也就是说我们只需要确保在内存维护一个字符串,然后构造一个我们自己的打印函数。 + +> 按照惯例,许多编程语言中,任意程序可以访问 stdin 和 stdin,它们可以连接到终端的输入和输出流。在图形程序其实也可以进行同样操作,但实际几乎不用。 + +让我们看看 `ReadLine` 做了哪些事情: + + 1. 如果字符串可保存的最大长度为 0,直接返回 + 2. 检索 `terminalStop` 和 `terminalStop` 的当前值 + 3. 如果字符串的最大长度大约缓冲区的一半,就设置大小为缓冲区的一半 + 4. 从最大长度里面减去 1 来确保输入的闪烁字符或结束符 + 5. 向字符串写入一个下划线 + 6. 写入一个 `terminalView` 和 `terminalStop` 的地址到内存 + 7. 调用 `Print` 打印当前字符串 + 8. 调用 `TerminalDisplay` + 9. 调用 `KeyboardUpdate` + 10. 调用 `KeyboardGetChar` + 11. 如果是一个新行直接跳转到第 16 步 + 12. 如果是一个退格键,将字符串长度减 1(如果其大于 0) + 13. 如果是一个普通字符,将它写入字符串(字符串大小确保小于最大值) + 14. 如果字符串是以下划线结束,写入一个空格,否则写入下划线 + 15. 跳转到第 6 步 + 16. 字符串的末尾写入一个新行字符 + 17. 调用 `Print` 和 `TerminalDisplay` + 18. 用结束符替换新行 + 19. 返回字符串的长度 + + +为了方便读者理解,然后然后自己去实现,我们的实现提供如下: + +1. 快速处理长度为 0 的情况 + +``` +.globl ReadLine +ReadLine: +teq r1,#0 +moveq r0,#0 +moveq pc,lr +``` + +2、考虑到常见的场景,我们初期做了很多初始化动作。`input` 代表 `terminalStop` 的值,`view` 代表 `terminalView`。`Length` 默认为 `0`。 + +``` +string .req r4 +maxLength .req r5 +input .req r6 +taddr .req r7 +length .req r8 +view .req r9 + +push {r4,r5,r6,r7,r8,r9,lr} + +mov string,r0 +mov maxLength,r1 +ldr taddr,=terminalStart +ldr input,[taddr,#terminalStop-terminalStart] +ldr view,[taddr,#terminalView-terminalStart] +mov length,#0 +``` + +3、我们必须检查异常大的读操作,我们不能处理超过 `terminalBuffer` 大小的输入(理论上可行,但是 `terminalStart` 移动越过存储的 terminalStop`,会有很多问题)。 + +``` +cmp maxLength,#128*64 +movhi maxLength,#128*64 +``` + +4、由于用户需要一个闪烁的光标,我们需要一个备用字符在理想状况在这个字符串后面放一个结束符。 + +``` +sub maxLength,#1 +``` + +5、写入一个下划线让用户知道我们可以输入了。 + +``` +mov r0,#'_' +strb r0,[string,length] +``` + +6、保存 `terminalStop` 和 `terminalView`。这个对重置一个终端很重要,它会修改这些变量。严格讲也可以修改 `terminalStart`,但是不可逆。 + +``` +readLoop$: +str input,[taddr,#terminalStop-terminalStart] +str view,[taddr,#terminalView-terminalStart] +``` + +7、写入当前的输入。由于下划线因此字符串长度加 1 + +``` +mov r0,string +mov r1,length +add r1,#1 +bl Print +``` + +8、拷贝下一个文本到屏幕 + +``` +bl TerminalDisplay +``` + + +9、获取最近一次键盘输入 + +``` +bl KeyboardUpdate +``` + +10、检索键盘输入键值 + +``` +bl KeyboardGetChar +``` + +11、如果我们有一个回车键,循环中断。如果有结束符和一个退格键也会同样跳出循环。 + +``` +teq r0,#'\n' +beq readLoopBreak$ +teq r0,#0 +beq cursor$ +teq r0,#'\b' +bne standard$ +``` + +12、从 `length` 里面删除一个字符 + +``` +delete$: +cmp length,#0 +subgt length,#1 +b cursor$ +``` + +13、写回一个普通字符 + +``` +standard$: +cmp length,maxLength +bge cursor$ +strb r0,[string,length] +add length,#1 +``` + +14、加载最近的一个字符,如果不是下划线则修改为下换线,如果是则修改为空格 + +``` +cursor$: +ldrb r0,[string,length] +teq r0,#'_' +moveq r0,#' ' +movne r0,#'_' +strb r0,[string,length] +``` + +15、循环执行值到用户输入按下 + +``` +b readLoop$ +readLoopBreak$: +``` + +16、在字符串的结尾处存入一个新行字符 + +``` +mov r0,#'\n' +strb r0,[string,length] +``` + +17、重置 `terminalView` 和 `terminalStop` 然后调用 `Print` 和 `TerminalDisplay` 显示最终的输入 + +``` +str input,[taddr,#terminalStop-terminalStart] +str view,[taddr,#terminalView-terminalStart] +mov r0,string +mov r1,length +add r1,#1 +bl Print +bl TerminalDisplay +``` + +18、写入一个结束符 + +``` +mov r0,#0 +strb r0,[string,length] +``` + +19、返回长度 + +``` +mov r0,length +pop {r4,r5,r6,r7,r8,r9,pc} +.unreq string +.unreq maxLength +.unreq input +.unreq taddr +.unreq length +.unreq view +``` + +### 5、终端:机器进化 + +现在我们理论用终端和用户可以交互了。最显而易见的事情就是拿去测试了!删除 `main.s` 里 `bl UsbInitialise` 后面的代码后如下: + +``` +reset$: + mov sp,#0x8000 + bl TerminalClear + + ldr r0,=welcome + mov r1,#welcomeEnd-welcome + bl Print + +loop$: + ldr r0,=prompt + mov r1,#promptEnd-prompt + bl Print + + ldr r0,=command + mov r1,#commandEnd-command + bl ReadLine + + teq r0,#0 + beq loopContinue$ + + mov r4,r0 + + ldr r5,=command + ldr r6,=commandTable + + ldr r7,[r6,#0] + ldr r9,[r6,#4] + commandLoop$: + ldr r8,[r6,#8] + sub r1,r8,r7 + + cmp r1,r4 + bgt commandLoopContinue$ + + mov r0,#0 + commandName$: + ldrb r2,[r5,r0] + ldrb r3,[r7,r0] + teq r2,r3 + bne commandLoopContinue$ + add r0,#1 + teq r0,r1 + bne commandName$ + + ldrb r2,[r5,r0] + teq r2,#0 + teqne r2,#' ' + bne commandLoopContinue$ + + mov r0,r5 + mov r1,r4 + mov lr,pc + mov pc,r9 + b loopContinue$ + + commandLoopContinue$: + add r6,#8 + mov r7,r8 + ldr r9,[r6,#4] + teq r9,#0 + bne commandLoop$ + + ldr r0,=commandUnknown + mov r1,#commandUnknownEnd-commandUnknown + ldr r2,=formatBuffer + ldr r3,=command + bl FormatString + + mov r1,r0 + ldr r0,=formatBuffer + bl Print + +loopContinue$: + bl TerminalDisplay + b loop$ + +echo: + cmp r1,#5 + movle pc,lr + + add r0,#5 + sub r1,#5 + b Print + +ok: + teq r1,#5 + beq okOn$ + teq r1,#6 + beq okOff$ + mov pc,lr + + okOn$: + ldrb r2,[r0,#3] + teq r2,#'o' + ldreqb r2,[r0,#4] + teqeq r2,#'n' + movne pc,lr + mov r1,#0 + b okAct$ + + okOff$: + ldrb r2,[r0,#3] + teq r2,#'o' + ldreqb r2,[r0,#4] + teqeq r2,#'f' + ldreqb r2,[r0,#5] + teqeq r2,#'f' + movne pc,lr + mov r1,#1 + + okAct$: + + mov r0,#16 + b SetGpio + +.section .data +.align 2 +welcome: .ascii "Welcome to Alex's OS - Everyone's favourite OS" +welcomeEnd: +.align 2 +prompt: .ascii "\n> " +promptEnd: +.align 2 +command: + .rept 128 + .byte 0 + .endr +commandEnd: +.byte 0 +.align 2 +commandUnknown: .ascii "Command `%s' was not recognised.\n" +commandUnknownEnd: +.align 2 +formatBuffer: + .rept 256 + .byte 0 + .endr +formatEnd: + +.align 2 +commandStringEcho: .ascii "echo" +commandStringReset: .ascii "reset" +commandStringOk: .ascii "ok" +commandStringCls: .ascii "cls" +commandStringEnd: + +.align 2 +commandTable: +.int commandStringEcho, echo +.int commandStringReset, reset$ +.int commandStringOk, ok +.int commandStringCls, TerminalClear +.int commandStringEnd, 0 +``` + +这块代码集成了一个简易的命令行操作系统。支持命令:`echo`、`reset`、`ok` 和 `cls`。`echo` 拷贝任意文本到终端,`reset` 命令会在系统出现问题的是复位操作系统,`ok` 有两个功能:设置 OK 灯亮灭,最后 `cls` 调用 TerminalClear 清空终端。 + +试试树莓派的代码吧。如果遇到问题,请参照问题集锦页面吧。 + +如果运行正常,祝贺你完成了一个操作系统基本终端和输入系列的课程。很遗憾这个教程先讲到这里,但是我希望将来能制作更多教程。有问题请反馈至 awc32@cam.ac.uk。 + +你已经在建立了一个简易的终端操作系统。我们的代码在 commandTable 构造了一个可用的命令表格。每个表格的入口是一个整型数字,用来表示字符串的地址,和一个整型数字表格代码的执行入口。 最后一个入口是 为 0 的 `commandStringEnd`。尝试实现你自己的命令,可以参照已有的函数,建立一个新的。函数的参数 `r0` 是用户输入的命令地址,`r1` 是其长度。你可以用这个传递你输入值到你的命令。也许你有一个计算器程序,或许是一个绘图程序或国际象棋。不管你的什么点子,让它跑起来! + + +-------------------------------------------------------------------------------- + +via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/input02.html + +作者:[Alex Chadwick][a] +选题:[lujun9972][b] +译者:[guevaraya](https://github.com/guevaraya) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.cl.cam.ac.uk +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10676-1.html +[2]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/images/circular_buffer.png +[3]: https://en.wikipedia.org/wiki/Color_Graphics_Adapter diff --git a/published/201904/20160301 How To Set Password Policies In Linux.md b/published/201904/20160301 How To Set Password Policies In Linux.md new file mode 100644 index 0000000000..3cfedf6341 --- /dev/null +++ b/published/201904/20160301 How To Set Password Policies In Linux.md @@ -0,0 +1,351 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10698-1.html) +[#]: subject: (How To Set Password Policies In Linux) +[#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +如何设置 Linux 系统的密码策略 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) + +虽然 Linux 的设计是安全的,但还是存在许多安全漏洞的风险,弱密码就是其中之一。作为系统管理员,你必须为用户提供一个强密码。因为大部分的系统漏洞就是由于弱密码而引发的。本教程描述了在基于 DEB 系统的 Linux,比如 Debian、Ubuntu、Linux Mint 等和基于 RPM 系统的 Linux,比如 RHEL、CentOS、Scientific Linux 等的系统下设置像**密码长度**、**密码复杂度**、**密码有效期**等密码策略。 + +### 在基于 DEB 的系统中设置密码长度 + +默认情况下,所有的 Linux 操作系统要求用户**密码长度最少 6 个字符**。我强烈建议不要低于这个限制。并且不要使用你的真实名称、父母、配偶、孩子的名字,或者你的生日作为密码。即便是一个黑客新手,也可以很快地破解这类密码。一个好的密码必须是至少 6 个字符,并且包含数字、大写字母和特殊符号。 + +通常地,在基于 DEB 的操作系统中,密码和身份认证相关的配置文件被存储在 `/etc/pam.d/` 目录中。 + +设置最小密码长度,编辑 `/etc/pam.d/common-password` 文件; + +``` +$ sudo nano /etc/pam.d/common-password +``` + +找到下面这行: + +``` +password [success=2 default=ignore] pam_unix.so obscure sha512 +``` + +![][2] + +在末尾添加额外的文字:`minlen=8`。在这里我设置的最小密码长度为 `8`。 + +``` +password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 +``` + +![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-3-1.jpg) + +保存并关闭该文件。这样一来,用户现在不能设置小于 8 个字符的密码。 + +### 在基于 RPM 的系统中设置密码长度 + +**在 RHEL、CentOS、Scientific Linux 7.x** 系统中, 以 root 身份执行下面的命令来设置密码长度。 + +``` +# authconfig --passminlen=8 --update +``` + +查看最小密码长度,执行: + +``` +# grep "^minlen" /etc/security/pwquality.conf +``` + +**输出样例:** + +``` +minlen = 8 +``` + +**在 RHEL、CentOS、Scientific Linux 6.x** 系统中,编辑 `/etc/pam.d/system-auth` 文件: + +``` +# nano /etc/pam.d/system-auth +``` + +找到下面这行并在该行末尾添加: + +``` +password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 +``` + +![](https://www.ostechnix.com/wp-content/uploads/2016/03/root@server_003-3.jpg) + +如上设置中,最小密码长度是 `8` 个字符。 + +### 在基于 DEB 的系统中设置密码复杂度 + +此设置会强制要求密码中应该包含多少类型,比如大写字母、小写字母和其他字符。 + +首先,用下面命令安装密码质量检测库: + +``` +$ sudo apt-get install libpam-pwquality +``` + +之后,编辑 `/etc/pam.d/common-password` 文件: + +``` +$ sudo nano /etc/pam.d/common-password +``` + +为了设置密码中至少有一个**大写字母**,则在下面这行的末尾添加文字 `ucredit=-1`。 + +``` +password requisite pam_pwquality.so retry=3 ucredit=-1 +``` + +![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_001-7.jpg) + +设置密码中至少有一个**小写字母**,如下所示。 + +``` +password requisite pam_pwquality.so retry=3 dcredit=-1 +``` + +设置密码中至少含有其他字符,如下所示。 + +``` +password requisite pam_pwquality.so retry=3 ocredit=-1 +``` + +正如你在上面样例中看到的一样,我们设置了密码中至少含有一个大写字母、一个小写字母和一个特殊字符。你可以设置被最大允许的任意数量的大写字母、小写字母和特殊字符。 + +你还可以设置密码中被允许的字符类的最大或最小数量。 + +下面的例子展示了设置一个新密码中被要求的字符类的最小数量: + +``` +password requisite pam_pwquality.so retry=3 minclass=2 +``` + +### 在基于 RPM 的系统中设置密码复杂度 + +**在 RHEL 7.x / CentOS 7.x / Scientific Linux 7.x 中:** + +设置密码中至少有一个小写字母,执行: + +``` +# authconfig --enablereqlower --update +``` + +查看该设置,执行: + +``` +# grep "^lcredit" /etc/security/pwquality.conf +``` + +**输出样例:** + +``` +lcredit = -1 +``` + +类似地,使用以下命令去设置密码中至少有一个大写字母: + +``` +# authconfig --enablerequpper --update +``` + +查看该设置: + +``` +# grep "^ucredit" /etc/security/pwquality.conf +``` + +**输出样例:** + +``` +ucredit = -1 +``` + +设置密码中至少有一个数字,执行: + +``` +# authconfig --enablereqdigit --update +``` + +查看该设置,执行: + +``` +# grep "^dcredit" /etc/security/pwquality.conf +``` + +**输出样例:** + +``` +dcredit = -1 +``` + +设置密码中至少含有一个其他字符,执行: + +``` +# authconfig --enablereqother --update +``` + +查看该设置,执行: + +``` +# grep "^ocredit" /etc/security/pwquality.conf +``` + +**输出样例:** + +``` +ocredit = -1 +``` + +在 **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** 中,以 root 身份编辑 `/etc/pam.d/system-auth` 文件: + +``` +# nano /etc/pam.d/system-auth +``` + +找到下面这行并且在该行末尾添加: + +``` +password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 +``` + +如上设置中,密码必须要至少包含 `8` 个字符。另外,密码必须至少包含一个大写字母、一个小写字母、一个数字和一个其他字符。 + +### 在基于 DEB 的系统中设置密码有效期 + +现在,我们将要设置下面的策略。 + + 1. 密码被使用的最长天数。 + 2. 密码更改允许的最小间隔天数。 + 3. 密码到期之前发出警告的天数。 + +设置这些策略,编辑: + +``` +$ sudo nano /etc/login.defs +``` + +在你的每个需求后设置值。 + +``` +PASS_MAX_DAYS 100 +PASS_MIN_DAYS 0 +PASS_WARN_AGE 7 +``` + +![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-8.jpg) + +正如你在上面样例中看到的一样,用户应该每 `100` 天修改一次密码,并且密码到期之前的 `7` 天开始出现警告信息。 + +请注意,这些设置将会在新创建的用户中有效。 + +为已存在的用户设置修改密码的最大间隔天数,你必须要运行下面的命令: + +``` +$ sudo chage -M +``` + +设置修改密码的最小间隔天数,执行: + +``` +$ sudo chage -m +``` + +设置密码到期之前的警告,执行: + +``` +$ sudo chage -W +``` + +显示已存在用户的密码,执行: + +``` +$ sudo chage -l sk +``` + +这里,**sk** 是我的用户名。 + +**输出样例:** + +``` +Last password change : Feb 24, 2017 +Password expires : never +Password inactive : never +Account expires : never +Minimum number of days between password change : 0 +Maximum number of days between password change : 99999 +Number of days of warning before password expires : 7 +``` + +正如你在上面看到的输出一样,该密码是无限期的。 + +修改已存在用户的密码有效期, + +``` +$ sudo chage -E 24/06/2018 -m 5 -M 90 -I 10 -W 10 sk +``` + +上面的命令将会设置用户 `sk` 的密码期限是 `24/06/2018`。并且修改密码的最小间隔时间为 `5` 天,最大间隔时间为 `90` 天。用户账号将会在 `10` 天后被自动锁定,而且在到期之前的 `10` 天前显示警告信息。 + +### 在基于 RPM 的系统中设置密码效期 + +这点和基于 DEB 的系统是相同的。 + +### 在基于 DEB 的系统中禁止使用近期使用过的密码 + +你可以限制用户去设置一个已经使用过的密码。通俗的讲,就是说用户不能再次使用相同的密码。 + +为设置这一点,编辑 `/etc/pam.d/common-password` 文件: + +``` +$ sudo nano /etc/pam.d/common-password +``` + +找到下面这行并且在末尾添加文字 `remember=5`: + +``` +password        [success=2 default=ignore]      pam_unix.so obscure use_authtok try_first_pass sha512 remember=5 +``` + +上面的策略将会阻止用户去使用最近使用过的 5 个密码。 + +### 在基于 RPM 的系统中禁止使用近期使用过的密码 + +这点对于 RHEL 6.x 和 RHEL 7.x 和它们的衍生系统 CentOS、Scientific Linux 是相同的。 + +以 root 身份编辑 `/etc/pam.d/system-auth` 文件, + +``` +# vi /etc/pam.d/system-auth +``` + +找到下面这行,并且在末尾添加文字 `remember=5`。 + +``` +password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5 +``` + +现在你了解了 Linux 中的密码策略,以及如何在基于 DEB 和 RPM 的系统中设置不同的密码策略。 + +就这样,我很快会在这里发表另外一天有趣而且有用的文章。在此之前请保持关注。如果您觉得本教程对你有帮助,请在您的社交,专业网络上分享并支持我们。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-set-password-policies-in-linux/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: http://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_003-2-1.jpg diff --git a/published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md b/published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md similarity index 100% rename from published/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md rename to published/201904/20170710 iWant - The Decentralized Peer To Peer File Sharing Commandline Application.md diff --git a/published/201904/20171117 5 open source fonts ideal for programmers.md b/published/201904/20171117 5 open source fonts ideal for programmers.md new file mode 100644 index 0000000000..20f38b280d --- /dev/null +++ b/published/201904/20171117 5 open source fonts ideal for programmers.md @@ -0,0 +1,99 @@ +5 款适合程序员的开源字体 +====== + +> 编程字体有些在普通字体中没有的特点,这五种字体你可以看看。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn) + +什么是最好的编程字体呢?首先,你需要考虑到字体被设计出来的初衷可能并不相同。当选择一款用于休闲阅读的字体时,读者希望该字体的字母能够顺滑地衔接,提供一种轻松愉悦的体验。一款标准字体的每个字符,类似于拼图的一块,它需要被仔细的设计,从而与整个字体的其他部分融合在一起。 + +然而,在编写代码时,通常来说对字体的要求更具功能性。这也是为什么大多数程序员在选择时更偏爱使用固定宽度的等宽字体。选择一款带有容易分辨的数字和标点的字体在美学上令人愉悦;但它是否拥有满足你需求的版权许可也是非常重要的。 + +某些功能使得字体更适合编程。首先要清楚是什么使得等宽字体看上去井然有序。这里,让我们对比一下字母 `w` 和字母 `i`。当选择一款字体时,重要的是要考虑字母本身及周围的空白。在纸质的书籍和报纸中,有效地利用空间是极为重要的,为瘦小的 `i` 分配较小的空间,为宽大的字母 `w` 分配较大的空间是有意义的。 + +然而在终端中,你没有这些限制。每个字符享有相等的空间将非常有用。这么做的首要好处是你可以随意扫过一段代码来“估测”代码的长度。第二个好处是能够轻松地对齐字符和标点,高亮在视觉上更加明显。另外打印纸张上的等宽字体比均衡字体更加容易通过 OCR 识别。 + +在本篇文章中,我们将探索 5 款卓越的开源字体,使用它们来编程和写代码都非常理想。 + +### 1、Firacode:最佳整套编程字体 + +![FiraCode 示例][1] + +*FiraCode, Andrew Lekashman* + +在我们列表上的首款字体是 [FiraCode][3],一款真正符合甚至超越了其职责的编程字体。FiraCode 是 Fira 的扩展,而后者是由 Mozilla 委托设计的开源字体族。使得 FiraCode 与众不同的原因是它修改了在代码中常使用的一些符号的组合或连字,使得它看上去更具可读性。这款字体有几种不同的风格,特别是还包含 Retina 选项。你可以在它的 [GitHub][3] 主页中找到它被使用到多种编程语言中的例子。 + +![FiraCode compared to Fira Mono][2] + +*FiraCode 与 Fira Mono 的对比,[Nikita Prokopov][3],源自 GitHub* + +### 2、Inconsolata:优雅且由卓越设计者创造 + +![Inconsolata 示例][4] + +*Inconsolata, Andrew Lekashman* + +[Inconsolata][5] 是最为漂亮的等宽字体之一。从 2006 年开始它便一直是一款开源和可免费获取的字体。它的创造者 Raph Levien 在设计 Inconsolata 时秉承的一个基本原则是:等宽字体并不应该那么糟糕。使得 Inconsolata 如此优秀的两个原因是:对于 `0` 和 `o` 这两个字符它们有很大的不同,另外它还特别地设计了标点符号。 + +### 3、DejaVu Sans Mono:许多 Linux 发行版的标准配置,庞大的字形覆盖率 + +![DejaVu Sans Mono example][6] + +*DejaVu Sans Mono, Andrew Lekashman* + +受在 GNOME 中使用的带有版权和闭源的 Vera 字体的启发,[DejaVu Sans Mono][7] 是一个非常受欢迎的编程字体,几乎在每个现代的 Linux 发行版中都带有它。在 Book Variant 风格下 DejaVu 拥有惊人的 3310 个字形,相比于一般的字体,它们含有 100 个左右的字形。在工作中你将不会出现缺少某些字符的情况,它覆盖了 Unicode 的绝大部分,并且一直在活跃地增长着。 + +### 4、Source Code Pro:优雅、可读性强,由 Adobe 中一个小巧但天才的团队打造 + +![Source Code Pro example][8] + +*Source Code Pro, Andrew Lekashman* + +由 Paul Hunt 和 Teo Tuominen 设计,[Source Code Pro][9] 是[由 Adobe 创造的][10],成为了它的首款开源字体。Source Code Pro 值得注意的地方在于它极具可读性,且对于容易混淆的字符和标点,它有着非常好的区分度。Source Code Pro 也是一个字体族,有 7 中不同的风格:Extralight、Light、Regular、Medium、Semibold、Bold 和 Black,每种风格都还有斜体变体。 + +![Differentiating potentially confusable characters][11] + +*潜在易混淆的字符之间的区别,[Paul D. Hunt][10] 源自 Adobe Typekit 博客。* + +![Metacharacters with special meaning in computer languages][12] + +*在计算机领域中有特别含义的特殊元字符, [Paul D. Hunt][10] 源自 Adobe Typekit 博客。* + +### 5、Noto Mono:巨量的语言覆盖率,由 Google 中的一个大团队打造 + +![Noto Mono example][13] + +*Noto Mono, Andrew Lekashman* + +在我们列表上的最后一款字体是 [Noto Mono][14],这是 Google 打造的庞大 Note 字体族中的等宽版本。尽管它并不是专为编程所设计,但它在 209 种语言(包括 emoji 颜文字!)中都可以使用,并且一直在维护和更新。该项目非常庞大,是 Google 宣称 “组织全世界信息” 的使命的延续。假如你想更多地了解它,可以查看这个绝妙的[关于这些字体的视频][15]。 + +### 选择合适的字体 + +无论你选择那个字体,你都有可能在每天中花费数小时面对它,所以请确保它在审美和哲学层面上与你产生共鸣。选择正确的开源字体是确保你拥有最佳生产环境的一个重要部分。这些字体都是很棒的选择,每个都具有让它脱颖而出的功能强大的特性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/11/how-select-open-source-programming-font + +作者:[Andrew Lekashman][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com +[1]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example) +[2]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono) +[3]:https://github.com/tonsky/FiraCode +[4]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example) +[5]:http://www.levien.com/type/myfonts/inconsolata.html +[6]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example) +[7]:https://dejavu-fonts.github.io/ +[8]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example) +[9]:https://github.com/adobe-fonts/source-code-pro +[10]:https://blog.typekit.com/2012/09/24/source-code-pro/ +[11]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters) +[12]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages) +[13]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example) +[14]:https://www.google.com/get/noto/#mono-mono +[15]:https://www.youtube.com/watch?v=AAzvk9HSi84 diff --git a/published/201904/20171226 The shell scripting trap.md b/published/201904/20171226 The shell scripting trap.md new file mode 100644 index 0000000000..8252874879 --- /dev/null +++ b/published/201904/20171226 The shell scripting trap.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (jdh8383) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10772-1.html) +[#]: subject: (The shell scripting trap) +[#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) +[#]: author: (Martin Tournoij https://arp242.net/) + +Shell 脚本编程陷阱 +====== + +Shell 脚本很棒,你可以非常轻松地写出有用的东西来。甚至像是下面这个傻瓜式的命令: + +``` +# 用含有 Go 的词汇起名字: +$ grep -i ^go /usr/share/dict/* | cut -d: -f2 | sort -R | head -n1 +goldfish +``` + +如果用其他编程语言,就需要花费更多的脑力,用多行代码实现,比如用 Ruby 的话: + +``` +puts(Dir['/usr/share/dict/*-english'].map do |f| + File.open(f) + .readlines + .select { |l| l[0..1].downcase == 'go' } +end.flatten.sample.chomp) +``` + +Ruby 版本的代码虽然不是那么长,也并不复杂。但是 shell 版是如此简单,我甚至不用实际测试就可以确保它是正确的。而 Ruby 版的我就没法确定它不会出错了,必须得测试一下。而且它要长一倍,看起来也更复杂。 + +这就是人们使用 Shell 脚本的原因,它简单却实用。下面是另一个例子: + +``` +curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | + grep '^
  • (.+).*
  • |\1|' | + grep -Ev '(^Tabel van|^Lijst van|Nederland)' +``` + +这个脚本可以从维基百科上获取荷兰基层政权的列表。几年前我写了这个临时的脚本,用来快速生成一个数据库,到现在它仍然可以正常运行,当时写它并没有花费我多少精力。但要用 Ruby 完成同样的功能则会麻烦得多。 + +--- + +现在来说说 shell 的缺点吧。随着代码量的增加,你的脚本会变得越来越难以维护,但你也不会想用别的语言重写一遍,因为你已经在这个 shell 版上花费了很多时间。 + +我把这种情况称为“Shell 脚本编程陷阱”,这是[沉没成本谬论][1]的一种特例(LCTT 译注:“沉没成本谬论”是一个经济学概念,可以简单理解为,对已经投入的成本可能被浪费而念念不忘)。 + +实际上许多脚本会增长到超出预期的大小,你经常会花费过多的时间来“修复某个 bug”,或者“添加一个小功能”。如此循环往复,让人头大。 + +如果你从一开始就使用 Python、Ruby 或是其他类似的语言来写这个程序,你可能会在写第一版的时候多花些时间,但以后维护起来就容易很多,bug 也肯定会少很多。 + +以我的 [packman.vim][2] 脚本为例。它起初只包含一个简单的用来遍历所有目录的 `for` 循环,外加一个 `git pull`,但在这之后就刹不住车了,它现在有 200 行左右的代码,这肯定不能算是最复杂的脚本,但假如我一上来就按计划用 Go 来编写它的话,那么增加一些像“打印状态”或者“从配置文件里克隆新的 git 库”这样的功能就会轻松很多;添加“并行克隆”的支持也几乎不算个事儿了,而在 shell 脚本里却很难实现(尽管不是不可能)。事后看来,我本可以节省时间,并且获得更好的结果。 + +出于类似的原因,我很后悔写出了许多这样的 shell 脚本,而我在 2018 年的新年誓言就是不要再犯类似的错误了。 + +### 附录:问题汇总 + +需要指出的是,shell 编程的确存在一些实际的限制。下面是一些例子: + + * 在处理一些包含“空格”或者其他“特殊”字符的文件名时,需要特别注意细节。绝大多数脚本都会犯错,即使是那些经验丰富的作者(比如我)编写的脚本,因为太容易写错了,[只添加引号是不够的][3]。 + * 有许多所谓“正确”和“错误”的做法。你应该用 `which` 还是 `command`?该用 `$@` 还是 `$*`,是不是得加引号?你是该用 `cmd $arg` 还是 `cmd "$arg"`?等等等等。 + * 你没法在变量里存储空字节(0x00);shell 脚本处理二进制数据很麻烦。 + * 虽然你可以非常快速地写出有用的东西,但实现更复杂的算法则要痛苦许多,即使用 ksh/zsh/bash 扩展也是如此。我上面那个解析 HTML 的脚本临时用用是可以的,但你真的不会想在生产环境中使用这种脚本。 + * 很难写出跨平台的通用型 shell 脚本。`/bin/sh` 可能是 `dash` 或者 `bash`,不同的 shell 有不同的运行方式。外部工具如 `grep`、`sed` 等,不一定能支持同样的参数。你能确定你的脚本可以适用于 Linux、macOS 和 Windows 的所有版本吗(无论是过去、现在还是将来)? + * 调试 shell 脚本会很难,特别是你眼中的语法可能会很快变得记不清了,并不是所有人都熟悉 shell 编程的语境。 + * 处理错误会很棘手(检查 `$?` 或是 `set -e`),排查一些超过“出了个小错”级别的复杂错误几乎是不可能的。 + * 除非你使用了 `set -u`,变量未定义将不会报错,而这会导致一些“搞笑事件”,比如 `rm -r ~/$undefined` 会删除用户的整个家目录([瞅瞅 Github 上的这个悲剧][4])。 + * 所有东西都是字符串。一些 shell 引入了数组,能用,但是语法非常丑陋和费解。带分数的数字运算仍然难以应付,并且依赖像 `bc` 或 `dc` 这样的外部工具(`$(( .. ))` 这种方式只能对付一下整数)。 + +**反馈** + +你可以发邮件到 [martin@arp242.net][5],或者[在 GitHub 上创建 issue][6] 来向我反馈,提问等。 + +-------------------------------------------------------------------------------- + +via: https://arp242.net/weblog/shell-scripting-trap.html + +作者:[Martin Tournoij][a] +选题:[lujun9972][b] +译者:[jdh8383](https://github.com/jdh8383) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://arp242.net/ +[b]: https://github.com/lujun9972 +[1]: https://youarenotsosmart.com/2011/03/25/the-sunk-cost-fallacy/ +[2]: https://github.com/Carpetsmoker/packman.vim +[3]: https://dwheeler.com/essays/filenames-in-shell.html +[4]: https://github.com/ValveSoftware/steam-for-linux/issues/3671 +[5]: mailto:martin@arp242.net +[6]: https://github.com/Carpetsmoker/arp242.net/issues/new diff --git a/published/201904/20180118 Rediscovering make- the power behind rules.md b/published/201904/20180118 Rediscovering make- the power behind rules.md new file mode 100644 index 0000000000..4c770d0577 --- /dev/null +++ b/published/201904/20180118 Rediscovering make- the power behind rules.md @@ -0,0 +1,101 @@ +重新发现 make: 规则背后的力量 +====== + +![](https://user-images.githubusercontent.com/4419992/35015638-0529f1c0-faf4-11e7-9801-4995fc4b54f0.jpg) + +我过去认为 makefile 只是一种将一组组的 shell 命令列出来的简便方法;过了一段时间我了解到它们是有多么的强大、灵活以及功能齐全。这篇文章带你领略其中一些有关规则的特性。 + +> 备注:这些全是针对 GNU Makefile 的,如果你希望支持 BSD Makefile ,你会发现有些新的功能缺失。感谢 [zge][5] 指出这点。 + +### 规则 + +规则rule是指示 `make` 应该如何并且何时构建一个被称作为目标target的文件的指令。目标可以依赖于其它被称作为前提prerequisite的文件。 + +你会指示 `make` 如何按步骤recipe构建目标,那就是一套按照出现顺序一次执行一个的 shell 命令。语法像这样: + +``` +target_name : prerequisites + recipe +``` + +一但你定义好了规则,你就可以通过从命令行执行以下命令构建目标: + +``` +$ make target_name +``` + +目标一经构建,除非前提改变,否则 `make` 会足够聪明地不再去运行该步骤。 + +### 关于前提的更多信息 + +前提表明了两件事情: + +* 当目标应当被构建时:如果其中一个前提比目标更新,`make` 假定目的应当被构建。 +* 执行的顺序:鉴于前提可以反过来在 makefile 中由另一套规则所构建,它们同样暗示了一个执行规则的顺序。 + +如果你想要定义一个顺序但是你不想在前提改变的时候重新构建目标,你可以使用一种特别的叫做“唯顺序order only”的前提。这种前提可以被放在普通的前提之后,用管道符(`|`)进行分隔。 + +### 样式 + +为了便利,`make` 接受目标和前提的样式。通过包含 `%` 符号可以定义一种样式。这个符号是一个可以匹配任何长度的文字符号或者空隔的通配符。以下有一些示例: + +* `%`:匹配任何文件 +* `%.md`:匹配所有 `.md` 结尾的文件 +* `prefix%.go`:匹配所有以 `prefix` 开头以 `.go` 结尾的文件 + +### 特殊目标 + +有一系列目标名字,它们对于 `make` 来说有特殊的意义,被称作特殊目标special target。 + +你可以在这个[文档][1]发现全套特殊目标。作为一种经验法则,特殊目标以点开始后面跟着大写字母。 + +以下是几个有用的特殊目标: + +- `.PHONY`:向 `make` 表明此目标的前提可以被当成伪目标。这意味着 `make` 将总是运行,无论有那个名字的文件是否存在或者上次被修改的时间是什么。 +- `.DEFAULT`:被用于任何没有指定规则的目标。 +- `.IGNORE`:如果你指定 `.IGNORE` 为前提,`make` 将忽略执行步骤中的错误。 + +### 替代 + +当你需要以你指定的改动方式改变一个变量的值,替代substitution就十分有用了。 + +替代的格式是 `$(var:a=b)`,它的意思是获取变量 `var` 的值,用值里面的 `b` 替代词末尾的每个 `a` 以代替最终的字符串。例如: + +``` +foo := a.o +bar : = $(foo:.o=.c) # sets bar to a.c +``` + +注意:特别感谢 [Luis Lavena][2] 让我们知道替代的存在。 + +### 档案文件 + +档案文件是用来一起将多个数据文档(类似于压缩文件的概念)收集成一个文件。它们由 `ar` Unix 工具所构建。`ar` 可以用于为任何目的创建档案,但除了[静态库][3],它已经被 `tar` 大量替代。 + +在 `make` 中,你可以使用一个档案文件中的单独一个成员作为目标或者前提,就像这样: + +``` +archive(member) : prerequisite + recipe +``` + +### 最后的想法 + +关于 `make` 还有更多可探索的,但是至少这是一个起点,我强烈鼓励你去查看[文档][4],创建一个笨拙的 makefile 然后就可以探索它了。 + +-------------------------------------------------------------------------------- + +via: https://monades.roperzh.com/rediscovering-make-power-behind-rules/ + +作者:[Roberto Dip][a] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://monades.roperzh.com +[1]:https://www.gnu.org/software/make/manual/make.html#Special-Targets +[2]:https://twitter.com/luislavena/ +[3]:http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html +[4]:https://www.gnu.org/software/make/manual/make.html +[5]:https://lobste.rs/u/zge diff --git a/published/201904/20180205 Rancher - Container Management Application.md b/published/201904/20180205 Rancher - Container Management Application.md new file mode 100644 index 0000000000..82f5a9ef6f --- /dev/null +++ b/published/201904/20180205 Rancher - Container Management Application.md @@ -0,0 +1,229 @@ +Rancher:一个全面的可用于产品环境的容器管理平台 +====== + +Docker 作为一款容器化应用的新兴软件,被大多数 IT 公司使用来减少基础设施平台的成本。 + +通常,没有 GUI 的 Docker 软件对于 Linux 管理员来说很容易,但是对于开发者来就有点困难。当把它搬到生产环境上来,那么它对 Linux 管理员来说也相当不友好。那么,轻松管理 Docker 的最佳解决方案是什么呢? + +唯一的办法就是提供 GUI。Docker API 允许第三方应用接入 Docker。在市场上有许多 Docker GUI 应用。我们已经写过一篇关于 Portainer 应用的文章。今天我们来讨论另一个应用,Rancher。 + +容器让软件开发更容易,让开发者更快的写代码、更好的运行它们。但是,在生产环境上运行容器却很困难。 + +**推荐阅读:** [Portainer:一个简单的 Docker 管理图形工具][1] + +### Rancher 简介 + +[Rancher][2] 是一个全面的容器管理平台,它可以让容器在各种基础设施平台的生产环境上部署和运行更容易。它提供了诸如多主机网络、全局/本地负载均衡和卷快照等基础设施服务。它整合了原生 Docker 的管理能力,如 Docker Machine 和 Docker Swarm。它提供了丰富的用户体验,让 DevOps 管理员在更大规模的生产环境上运行 Docker。 + +访问以下文章可以了解 Linux 系统上安装 Docker。 + +**推荐阅读:** + +- [如何在 Linux 上安装 Docker][3] +- [如何在 Linux 上使用 Docker 镜像][4] +- [如何在 Linux 上使用 Docker 容器][5] +- [如何在 Docker 容器内安装和运行应用][6] + +### Rancher 特性 + + * 可以在两分钟内安装 Kubernetes。 + * 一键启动应用(90 个流行的 Docker 应用)。 + * 部署和管理 Docker 更容易。 + * 全面的生产级容器管理平台。 + * 可以在生产环境上快速部署容器。 + * 强大的自动部署和运营容器技术。 + * 模块化基础设施服务。 + * 丰富的编排工具。 + * Rancher 支持多种认证机制。 + +### 怎样安装 Rancher + +由于 Rancher 是以轻量级的 Docker 容器方式运行,所以它的安装非常简单。Rancher 是由一组 Docker 容器部署的。只需要简单的启动两个容器就能运行 Rancher。一个容器用作管理服务器,另一个容器在各个节点上作为代理。在 Linux 系统下简单的运行下列命令就能部署 Rancher。 + +Rancher 服务器提供了两个不同的安装包标签如 `stable` 和 `latest`。下列命令将会拉取适合的 Rancher 镜像并安装到你的操作系统上。Rancher 服务器仅需要两分钟就可以启动。 + + * `latest`:这个标签是他们的最新开发构建。这些构建将通过 Rancher CI 的自动化框架进行验证,不建议在生产环境使用。 + * `stable`:这是最新的稳定发行版本,推荐在生产环境使用。 + +Rancher 的安装方法有多种。在这篇教程中我们仅讨论两种方法。 + + * 以单一容器的方式安装 Rancher(内嵌 Rancher 数据库) + * 以单一容器的方式安装 Rancher(外部数据库) + +### 方法 - 1 + +运行下列命令以单一容器的方式安装 Rancher 服务器(内嵌数据库) + +``` +$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable +$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:latest +``` + +### 方法 - 2 + +你可以在启动 Rancher 服务器时指向外部数据库,而不是使用自带的内部数据库。首先创建所需的数据库,数据库用户为同一个。 + +``` +> CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8'; +> GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY 'cattle'; +> GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY 'cattle'; +``` + +运行下列命令启动 Rancher 去连接外部数据库。 + +``` +$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server \ + --db-host myhost.example.com --db-port 3306 --db-user username --db-pass password --db-name cattle +``` + +如果你想测试 Rancher 2.0,使用下列的命令去启动。 + +``` +$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/server:preview +``` + +### 通过 GUI 访问 & 安装 Rancher + +浏览器输入 `http://hostname:8080` 或 `http://server_ip:8080` 去访问 rancher GUI. + +![][8] + +### 怎样注册主机 + +注册你的主机 URL 允许它连接到 Rancher API。这是一次性设置。 + +接下来,点击主菜单下面的 “Add a Host” 链接或者点击主菜单上的 “INFRASTRUCTURE >> Add Hosts”,点击 “Save” 按钮。 + +![][9] + +默认情况下,Rancher 里的访问控制认证禁止了访问,因此我们首先需要通过一些方法打开访问控制认证,否则任何人都不能访问 GUI。 + +点击 “>> Admin >> Access Control”,输入下列的值最后点击 “Enable Authentication” 按钮去打开它。在我这里,是通过 “local authentication” 的方式打开的。 + + * “Login UserName”: 输入你期望的登录名 + * “Full Name”: 输入你的全名 + * “Password”: 输入你期望的密码 + * “Confirm Password”: 再一次确认密码 + +![][10] + +注销然后使用新的登录凭证重新登录: + +![][11] + +现在,我能看到本地认证已经被打开。 + +![][12] + +### 怎样添加主机 + +注册你的主机后,它将带你进入下一个页面,在那里你能选择不同云服务提供商的 Linux 主机。我们将添加一个主机运行 Rancher 服务,因此选择“custom”选项然后输入必要的信息。 + +在第 4 步输入你服务器的公有 IP,运行第 5 步列出的命令,最后点击 “close” 按钮。 + +``` +$ sudo docker run -e CATTLE_AGENT_IP="192.168.56.2" --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.11 http://192.168.56.2:8080/v1/scripts/16A52B9BE2BAB87BB0F5:1546214400000:ODACe3sfis5V6U8E3JASL8jQ + +INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.56.2:8080/v1 +INFO: Attempting to connect to: http://192.168.56.2:8080/v1 +INFO: http://192.168.56.2:8080/v1 is accessible +INFO: Configured Host Registration URL info: CATTLE_URL=http://192.168.56.2:8080/v1 ENV_URL=http://192.168.56.2:8080/v1 +INFO: Inspecting host capabilities +INFO: Boot2Docker: false +INFO: Host writable: true +INFO: Token: xxxxxxxx +INFO: Running registration +INFO: Printing Environment +INFO: ENV: CATTLE_ACCESS_KEY=9946BD1DCBCFEF3439F8 +INFO: ENV: CATTLE_AGENT_IP=192.168.56.2 +INFO: ENV: CATTLE_HOME=/var/lib/cattle +INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken +INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx +INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx +INFO: ENV: CATTLE_URL=http://192.168.56.2:8080/v1 +INFO: ENV: DETECTED_CATTLE_AGENT_IP=172.17.0.1 +INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v1.2.11 +INFO: Launched Rancher Agent: e83b22afd0c023dabc62404f3e74abb1fa99b9a178b05b1728186c9bfca71e8d +``` + +![][13] + +等待几秒钟后新添加的主机将会出现。点击 “Infrastructure >> Hosts” 页面。 + +![][14] + +### 怎样查看容器 + +只需要点击下列位置就能列出所有容器。点击 “Infrastructure >> Containers” 页面。 + +![][15] + +### 怎样创建容器 + +非常简单,只需点击下列位置就能创建容器。 + +点击 “Infrastructure >> Containers >> Add Container” 然后输入每个你需要的信息。为了测试,我将创建一个 `latest` 标签的 CentOS 容器。 + +![][16] + +在同样的列表位置,点击 “ Infrastructure >> Containers”。 + +![][17] + +点击容器名展示容器的性能信息,如 CPU、内存、网络和存储。 + +![][18] + +选择特定容器,然后点击最右边的“三点”按钮或者点击“Actions”按钮对容器进行管理,如停止、启动、克隆、重启等。 + +![][19] + +如果你想控制台访问容器,只需要点击 “Actions” 按钮中的 “Execute Shell” 选项即可。 + +![][20] + +### 怎样从应用目录部署容器 + +Rancher 提供了一个应用模版目录,让部署变的很容易,只需要单击一下就可以。 +它维护了多数流行应用,这些应用由 Rancher 社区贡献。 + +![][21] + +点击 “Catalog >> All >> Choose the required application”,最后点击 “Launch” 去部署。 + +![][22] + + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/rancher-a-complete-container-management-platform-for-production-environment/ + +作者:[Magesh Maruthamuthu][a] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://www.2daygeek.com/portainer-a-simple-docker-management-gui/ +[2]:http://rancher.com/ +[3]:https://www.2daygeek.com/install-docker-on-centos-rhel-fedora-ubuntu-debian-oracle-archi-scentific-linux-mint-opensuse/ +[4]:https://www.2daygeek.com/list-search-pull-download-remove-docker-images-on-linux/ +[5]:https://www.2daygeek.com/create-run-list-start-stop-attach-delete-interactive-daemonized-docker-containers-on-linux/ +[6]:https://www.2daygeek.com/install-run-applications-inside-docker-containers/ +[7]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-1.png +[9]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-2.png +[10]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-3.png +[11]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-3a.png +[12]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-4.png +[13]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-5.png +[14]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-6.png +[15]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-7.png +[16]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-8.png +[17]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-9.png +[18]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-10.png +[19]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-11.png +[20]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-12.png +[21]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-13.png +[22]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-14.png diff --git a/published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md new file mode 100644 index 0000000000..a137ed5915 --- /dev/null +++ b/published/201904/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md @@ -0,0 +1,173 @@ +12 个最佳 GNOME(GTK)主题 +====== + +> 让我们来看一些漂亮的 GTK 主题,你不仅可以用在 Ubuntu 上,也可以用在其它使用 GNOME 的 Linux 发行版上。 + +对于我们这些使用 Ubuntu 的人来说,默认的桌面环境从 Unity 变成了 Gnome 使得主题和定制变得前所未有的简单。Gnome 有个相当大的定制用户社区,其中不乏可供用户选择的漂亮的 GTK 主题。最近几个月,我不断找到了一些喜欢的主题。我相信这些是你所能找到的最好的主题之一了。 + +### Ubuntu 和其它 Linux 发行版的最佳主题 + +这不是一个详细清单,可能不包括一些你已经使用和喜欢的主题,但希望你能至少找到一个能让你喜爱的没见过的主题。所有这里提及的主题都可以工作在 Gnome 3 上,不管是 Ubuntu 还是其它 Linux 发行版。有一些主题的屏幕截屏我没有,所以我从官方网站上找到了它们的图片。 + +在这里列出的主题没有特别的次序。 + +但是,在你看这些最好的 GNOME 主题前,你应该学习一下 [如何在 Ubuntu GNOME 中安装主题][1]。 + +#### 1、Arc-Ambiance + +![][2] + +Arc 和 Arc 变体主题已经出现了相当长的时间,普遍认为它们是最好的主题之一。在这个示例中,我选择了 Arc-Ambiance ,因为它是 Ubuntu 中的默认 Ambiance 主题。 + +我是 Arc 主题和默认 Ambiance 主题的粉丝,所以不用说,当我遇到一个融合了两者优点的主题,我不禁长吸了一口气。如果你是 Arc 主题的粉丝,但不是这个特定主题的粉丝,Gnome 的外观上当然还有适合你口味的大量的选择。 + +- [下载 Arc-Ambiance 主题][3] + +#### 2、Adapta Colorpack + +![][4] + +Adapta 主题是我所见过的最喜欢的扁平主题之一。像 Arc 一样,Adapata 被很多 Linux 用户广泛采用。我选择这个配色包,是因为一次下载你就有数个可选择的配色方案。事实上,有 19 个配色方案可以选择,是的,你没看错,19 个呢! + +所以,如果你是如今常见的扁平风格/材料设计风格Material Design Language的粉丝,那么,在这个主题包中很可能至少有一个能满足你喜好的变体。 + +- [下载 Adapta Colorpack 主题][5] + +#### 3、Numix Collection + +![][6] + +啊,Numix! 让我想起了我们一起度过的那些年!对于那些在过去几年装点过桌面环境的人来说,你肯定在某个时间点上遇到过 Numix 主题或图标包。Numix 可能是我爱上的第一个 Linux 现代主题,现在我仍然爱它。虽然经过这些年,但它仍然魅力不失。 + +灰色色调贯穿主题,尤其是默认的粉红色高亮,带来了真正干净而完整的体验。你可能很难找到一个像 Numix 一样精美的主题包。而且在这个主题包中,你还有很多可供选择的余地,简直不要太棒了! + +- [下载 Numix Collection 主题][7] + +#### 4、Hooli + +![][8] + +Hooli 是一个已经出现了一段时间的主题,但是我最近才偶然发现它。我是很多扁平主题的粉丝,但是通常不太喜欢材料设计风格的主题。Hooli 像 Adapta 一样吸取了那些设计风格,但是我认为它和其它的那些有所不同。绿色高亮是我对这个主题最喜欢的部分之一,并且,它在不冲击整个主题方面做的很好。 + +- [下载 Hooli 主题][9] + +#### 5、Arrongin/Telinkrin + +![][10] + +福利:二合一主题!它们是在主题领域中的相对新的竞争者。它们都吸取了 Ubuntu 接近完成的 “[communitheme][11]” 的思路,并带它到了你的桌面。这两个主题我能找到的唯一真正的区别就是颜色。Arrongin 以 Ubuntu 家族的橙色颜色为中心,而 Telinkrin 则更偏向于 KDE Breeze 系的蓝色,我个人更喜欢蓝色,但是两者都是极好的选择! + +- [下载 Arrongin/Telinkrin 主题][12] + +#### 6、Gnome-osx + +![][13] + +我不得不承认,通常,当我看到一个主题有 “osx” 或者在标题中有类似的内容时我就不会不期望太多。大多数受 Apple 启发的主题看起来都比较雷同,我真不能找到使用它们的原因。但我想这两个主题能够打破这种思维定式:这就是 Arc-osc 主题和 Gnome-osx 主题。 + +我喜欢 Gnome-osx 主题的原因是它在 Gnome 桌面上看起来确实很像 OSX。它在融入桌面环境而不至于变的太扁平方面做得很好。所以,对于那些喜欢稍微扁平的主题的人来说,如果你喜欢红黄绿按钮样式(用于关闭、最小化和最大化),这个主题非常适合你。 + +- [下载 Gnome-osx 主题][14] + +#### 7、Ultimate Maia + +![][15] + +曾经有一段时间我使用 Manjaro Gnome。尽管那以后我又回到了 Ubuntu,但是,我希望我能打包带走的一个东西是 Manjaro 主题。如果你对 Manjaro 主题和我一样感受相同,那么你是幸运的,因为你可以带它到你想运行 Gnome 的任何 Linux 发行版! + +丰富的绿色颜色,Breeze 式的关闭、最小化、最大化按钮,以及全面雕琢过的主题使它成为一个不可抗拒的选择。如果你不喜欢绿色,它甚至为你提供一些其它颜色的变体。但是说实话……谁会不喜欢 Manjaro 的绿色呢? + +- [下载 Ultimate Maia 主题][16] + +#### 8、Vimix + +![][17] + +这是一个让我激动的主题。它是现代风格的,吸取了 macOS 的红黄绿按钮的风格,但并不是直接复制了它们,并且减少了多变的主题颜色,使之成为了大多数主题的独特替代品。它带来三个深色的变体和几个彩色配色,我们中大多数人都可以从中找到我们喜欢的。 + +- [下载 Vimix 主题][18] + +#### 9、Ant + +![][19] + +像 Vimix 一样,Ant 从 macOS 的按钮颜色中吸取了灵感,但不是直接复制了样式。在 Vimix 减少了颜色花哨的地方,Ant 却增加了丰富的颜色,在我的 System 76 Galago Pro 屏幕看起来绚丽极了。三个主题变体的变化差异大相径庭,虽然它可能不见得符合每个人的口味,它无疑是最适合我的。 + +- [下载 Ant 主题][20] + +#### 10、Flat Remix + +![][21] + +如果你还没有注意到这点,对于一些关注关闭、最小化、最大化按钮的人来说我就是一个傻瓜。Flat Remix 使用的颜色主题是我从未在其它地方看到过的,它采用红色、蓝色和橙色方式。把这些添加到一个几乎看起来像是一个混合了 Arc 和 Adapta 的主题的上面,就有了 Flat Remix。 + +我本人喜欢它的深色主题,但是换成亮色的也是非常好的。因此,如果你喜欢稍稍透明、风格一致的深色主题,以及偶尔的一点点颜色,那 Flat Remix 就适合你。 + +- [下载 Flat Remix 主题][22] + +#### 11、Paper + +![][23] + +[Paper][24] 已经出现一段时间。我记得第一次使用它是在 2014 年。可以说,Paper 的图标包比其 GTK 主题更出名,但是这并不意味着它自身的主题不是一个极好的选择。即使我从一开始就倾心于 Paper 图标,我不能说当我第一次尝试它的时候我就是一个 Paper 主题忠实粉丝。 + +我觉得鲜亮的色彩和有趣的方式被放到一个主题里是一种“不成熟”的体验。现在,几年后,Paper 在我心目中已经长大,至少可以这样说,这个主题采取的轻快方式是我非常欣赏的一个。 + +- [下载 Paper 主题][25] + +#### 12、Pop + +![][26] + +Pop 在这个列表上是一个较新的主题,是由 [System 76][27] 的人们创造的,Pop GTK 主题是前面列出的 Adapta 主题的一个分支,并带有一个匹配的图标包,图标包是先前提到的 Paper 图标包的一个分支。 + +该主题是在 System 76 发布了 [他们自己的发行版][28] Pop!_OS 之后不久发布的。你可以阅读我的 [Pop!_OS 点评][29] 来了解更多信息。不用说,我认为 Pop 是一个极好的主题,带有华丽的装饰,并为 Gnome 桌面带来了一股清新之风。 + +- [下载 Pop 主题][30] + +#### 结束语 + +很明显,我们有比文中所描述的主题更多的选择,但是这些大多是我在最近几月所使用的最完整、最精良的主题。如果你认为我们错过一些你确实喜欢的主题,或你确实不喜欢我在上面描述的主题,那么在下面的评论区让我们知道,并分享你喜欢的主题更好的原因! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-gtk-themes/ + +作者:[Phillip Prado][a] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com/author/phillip/ +[1]:https://itsfoss.com/install-themes-ubuntu/ +[2]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/arcambaince.png +[3]:https://www.gnome-look.org/p/1193861/ +[4]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/03/adapta.jpg +[5]:https://www.gnome-look.org/p/1190851/ +[6]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/numix.png +[7]:https://www.gnome-look.org/p/1170667/ +[8]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/hooli2.jpg +[9]:https://www.gnome-look.org/p/1102901/ +[10]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/AT.jpg +[11]:https://itsfoss.com/ubuntu-community-theme/ +[12]:https://www.gnome-look.org/p/1215199/ +[13]:https://itsfoss.com/wp-content/uploads/2018/03/gosx-800x473.jpg +[14]:https://www.opendesktop.org/s/Gnome/p/1171688/ +[15]:https://itsfoss.com/wp-content/uploads/2018/03/ultimatemaia-800x450.jpg +[16]:https://www.opendesktop.org/s/Gnome/p/1193879/ +[17]:https://itsfoss.com/wp-content/uploads/2018/03/vimix-800x450.jpg +[18]:https://www.gnome-look.org/p/1013698/ +[19]:https://itsfoss.com/wp-content/uploads/2018/03/ant-800x533.png +[20]:https://www.opendesktop.org/p/1099856/ +[21]:https://itsfoss.com/wp-content/uploads/2018/03/flatremix-800x450.png +[22]:https://www.opendesktop.org/p/1214931/ +[23]:https://itsfoss.com/wp-content/uploads/2018/04/paper-800x450.jpg +[24]:https://itsfoss.com/install-paper-theme-linux/ +[25]:https://snwh.org/paper/download +[26]:https://itsfoss.com/wp-content/uploads/2018/04/pop-800x449.jpg +[27]:https://system76.com/ +[28]:https://itsfoss.com/system76-popos-linux/ +[29]:https://itsfoss.com/pop-os-linux-review/ +[30]:https://github.com/pop-os/gtk-theme/blob/master/README.md diff --git a/published/201904/20180718 3 Emacs modes for taking notes.md b/published/201904/20180718 3 Emacs modes for taking notes.md new file mode 100644 index 0000000000..234175c375 --- /dev/null +++ b/published/201904/20180718 3 Emacs modes for taking notes.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10792-1.html) +[#]: subject: (3 Emacs modes for taking notes) +[#]: via: (https://opensource.com/article/18/7/emacs-modes-note-taking) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +用来记笔记的三个 Emacs 模式 +====== + +> 借助这些 Emacs 模式轻松记录信息。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_) + + +不管你从事哪种工作,你都无可避免地需要记笔记。而且可能还不是一点点。现在这年头,大家都开始以数字的形式来记笔记了。 + +开源软件爱好者有多种途径来以电子的方式记下他们的创意、想法和研究过程。你可以使用 [网页工具][1],可以使用 [桌面应用][2],或者你也可以 [使用命令行工具][3]。 + +如果你使用 [Emacs][4](伪装成文本编辑器的强力操作系统),有多个模式mode可以帮你有效地记录笔记。我们这里列举三个例子。 + +### Deft + +![](https://opensource.com/sites/default/files/uploads/deft.png) + +在少数情况下,我只能使用 Mac时,有一个工具是我不能缺少的:[nvALT][5] 笔记应用。[Deft 模式][6] 为 Emacs 带来了 nvALT 式的体验。 + +Deft 将你的笔记以文本文件的形式存储在电脑中的某个文件夹中。当你进入 Deft 模式,你会看到一系列的笔记及其摘要。这些摘要其实就是文本文件的第一行。若第一行是 Markdown、LaTeX,甚至 Emacs Org 模式的格式的话,Deft 会忽略掉这些格式而只显示文本内容。 + +要打开笔记,只需要向下滚动到该笔记的位置然后按下回车即可。然而 Deft 不仅仅只是这样。根据 Deft 开发者 Jason Blevins 的说法,它的*主要操作是搜索和过滤*。Deft 的实现方式简单而有效。输入关键字然后 Deft 会只显示标题中包含关键字的笔记。这在你要从大量笔记中找到某条笔记时非常有用。 + +### Org 模式 + +![](https://opensource.com/sites/default/files/uploads/orgmode.png) + +如果本文没有包含 [Org 模式][7] 的话,那么我可能会被人所诟病。为什么?它可以说是 Emacs 中最灵活、使用最广泛的记录笔记的方式了。以正确的方式使用它,Org 模式可以极大地增强记笔记的能力。 + +Org 模式的主要优势在于它组织笔记的方式。在 Org 模式中,一个笔记文件会被组织成一个巨大的大纲。每个章节就是大纲里的一个节点,你可以对它进行展开和折叠。这些章节又可以有子章节,这些子章节也可以展开和折叠。这不仅使你一次只关注于某个章节,而且可以让你浏览整个大纲。 + +你可以在多个章节之间 [进行互联][8],无需通过剪切和复制就能快速移动章节,以及 [附加文件][9] 到笔记中。Org 模式支持带格式的字符和表格。如果你需要转换笔记到其他格式,Org 模式也有大量的[导出选项][10]。 + + +### Howm + +![](https://opensource.com/sites/default/files/uploads/howm.png) + +当我使用 Emacs 已经成为一种习惯时,[howm][11] 马上就成为我严重依赖的模式之一了。虽然我特别喜欢使用 Org 模式,但 howm 依然占有一席之地。 + +Howm 就好像是一个小型维基。你可以创建笔记和任务列表,还能在它们之间创建链接。通过输入或点击某个链接,你可以在笔记之间跳转。如果你需要,还可以使用关键字为笔记添加标签。不仅如此,你可以对笔记进行搜索、排序和合并。 + +Howm 不是最漂亮的 Emacs 模式,它的用户体验也不是最佳。它需要你花一点时间来适应它,而一旦你适应了它,记录和查找笔记就是轻而易举的事情了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/emacs-modes-note-taking + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [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/alternatives/evernote +[2]: https://opensource.com/life/16/9/4-desktop-note-taking-applications +[3]: https://opensource.com/article/18/3/command-line-note-taking-applications +[4]: https://www.gnu.org/software/emacs/ +[5]: http://brettterpstra.com/projects/nvalt/ +[6]: https://jblevins.org/projects/deft/ +[7]: https://orgmode.org/ +[8]: https://orgmode.org/org.html#Hyperlinks +[9]: https://orgmode.org/org.html#Attachments +[10]: https://orgmode.org/org.html#Exporting +[11]: https://howm.osdn.jp/ diff --git a/published/201904/20180823 Getting started with Sensu monitoring.md b/published/201904/20180823 Getting started with Sensu monitoring.md new file mode 100644 index 0000000000..a92b168a1d --- /dev/null +++ b/published/201904/20180823 Getting started with Sensu monitoring.md @@ -0,0 +1,301 @@ +Sensu 监控入门 +====== +> 这个开源解决方案可以简单而有效地监控你的云基础设施。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) + +Sensu 是一个开源的基础设施和应用程序监控解决方案,它可以监控服务器、相关服务和应用程序健康状况,并通过第三方集成发送警报和通知。Sensu 用 Ruby 编写,可以使用 [RabbitMQ][1] 或 [Redis][2] 来处理消息,它使用 Redis 来存储数据。 + +如果你想以一种简单而有效的方式监控云基础设施,Sensu 是一个不错的选择。它可以与你的组织已经使用的许多现代 DevOps 组件集成,比如 [Slack][3]、[HipChat][4] 或 [IRC][5],它甚至可以用 [PagerDuty][6] 发送移动或寻呼机的警报。 + +Sensu 的[模块化架构][7]意味着每个组件都可以安装在同一台服务器上或者在完全独立的机器上。 + +### 结构 + +Sensu 的主要通信机制是 Transport。每个 Sensu 组件必须连接到 Transport 才能相互发送消息。Transport 可以使用 RabbitMQ(在生产环境中推荐使用)或 Redis。 + +Sensu 服务器处理事件数据并采取行动。它注册客户端并使用过滤器、增变器和处理程序检查结果和监视事件。服务器向客户端发布检查说明,Sensu API 提供 RESTful API,提供对监控数据和核心功能的访问。 + +[Sensu 客户端][8]执行 Sensu 服务器安排的检查或本地检查定义。Sensu 使用数据存储(Redis)来保存所有的持久数据。最后,[Uchiwa][9] 是与 Sensu API 进行通信的 Web 界面。 + +![][11] + +### 安装 Sensu + +#### 条件 + +* 一个 Linux 系统作为服务器节点(本文使用了 CentOS 7) +* 要监控的一台或多台 Linux 机器(客户机) + +#### 服务器侧 + +Sensu 需要安装 Redis。要安装 Redis,启用 EPEL 仓库: + +``` +$ sudo yum install epel-release -y +``` + +然后安装 Redis: + +``` +$ sudo yum install redis -y +``` + +修改 `/etc/redis.conf` 来禁用保护模式,监听每个地址并设置密码: + +``` +$ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf +$ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf +$ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf +``` + +启用并启动 Redis 服务: + +``` +$ sudo systemctl enable redis +$ sudo systemctl start redis +``` + +Redis 现在已经安装并准备好被 Sensu 使用。 + +现在让我们来安装 Sensu。 + +首先,配置 Sensu 仓库并安装软件包: + +``` +$ sudo tee /etc/yum.repos.d/sensu.repo << EOF +[sensu] +name=sensu +baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +EOF + +$ sudo yum install sensu uchiwa -y +``` + +让我们为 Sensu 创建最简单的配置文件: + +``` +$ sudo tee /etc/sensu/conf.d/api.json << EOF +{ +  "api": { +        "host": "127.0.0.1", +        "port": 4567 +  } +} +EOF +``` + +然后,配置 `sensu-api` 在本地主机上使用端口 4567 监听: + +``` +$ sudo tee /etc/sensu/conf.d/redis.json << EOF +{ +  "redis": { +        "host": "", +        "port": 6379, +        "password": "password123" +  } +} +EOF + + +$ sudo tee /etc/sensu/conf.d/transport.json << EOF +{ +  "transport": { +        "name": "redis" +  } +} +EOF +``` + +在这两个文件中,我们将 Sensu 配置为使用 Redis 作为传输机制,还有 Reids 监听的地址。客户端需要直接连接到传输机制。每台客户机都需要这两个文件。 + +``` +$ sudo tee /etc/sensu/uchiwa.json << EOF +{ +   "sensu": [ +        { +        "name": "sensu", +        "host": "127.0.0.1", +        "port": 4567 +        } +   ], +   "uchiwa": { +        "host": "0.0.0.0", +        "port": 3000 +   } +} +EOF +``` + +在这个文件中,我们配置 Uchiwa 监听每个地址(0.0.0.0)的端口 3000。我们还配置 Uchiwa 使用 `sensu-api`(已配置好)。 + +出于安全原因,更改刚刚创建的配置文件的所有者: + +``` +$ sudo chown -R sensu:sensu /etc/sensu +``` + +启用并启动 Sensu 服务: + +``` +$ sudo systemctl enable sensu-server sensu-api sensu-client +$ sudo systemctl start sensu-server sensu-api sensu-client +$ sudo systemctl enable uchiwa +$ sudo systemctl start uchiwa +``` + +尝试访问 Uchiwa 网站:`http://<服务器的 IP 地址>:3000` + +对于生产环境,建议运行 RabbitMQ 集群作为 Transport 而不是 Redis(虽然 Redis 集群也可以用于生产环境),运行多个 Sensu 服务器实例和 API 实例,以实现负载均衡和高可用性。 + +Sensu 现在安装完成,让我们来配置客户端。 + +#### 客户端侧 + +要添加一个新客户端,你需要通过创建 `/etc/yum.repos.d/sensu.repo` 文件在客户机上启用 Sensu 仓库。 + +``` +$ sudo tee /etc/yum.repos.d/sensu.repo << EOF +[sensu] +name=sensu +baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ +gpgcheck=0 +enabled=1 +EOF +``` + +启用仓库后,安装 Sensu: + +``` +$ sudo yum install sensu -y +``` + +要配置 `sensu-client`,创建在服务器中相同的 `redis.json` 和 `transport.json`,还有 `client.json` 配置文件: + +``` +$ sudo tee /etc/sensu/conf.d/client.json << EOF +{ +  "client": { +        "name": "rhel-client", +        "environment": "development", +        "subscriptions": [ +        "frontend" +        ] +  } +} +EOF +``` + +在 `name` 字段中,指定一个名称来标识此客户机(通常是主机名)。`environment` 字段可以帮助你过滤,而 `subscriptions` 定义了客户机将执行哪些监视检查。 + +最后,启用并启动服务并签入 Uchiwa,因为客户机会自动注册: + +``` +$ sudo systemctl enable sensu-client +$ sudo systemctl start sensu-client +``` + +### Sensu 检查 + +Sensu 检查有两个组件:一个插件和一个定义。 + +Sensu 与 [Nagios 检查插件规范][12]兼容,因此无需修改即可使用用于 Nagios 的任何检查。检查是可执行文件,由 Sensu 客户机运行。 + +检查定义可以让 Sensu 知道如何、在哪以及何时运行插件。 + +#### 客户端侧 + +让我们在客户机上安装一个检查插件。请记住,此插件将在客户机上执行。 + +启用 EPEL 并安装 `nagios-plugins-http`: + +``` +$ sudo yum install -y epel-release +$ sudo yum install -y nagios-plugins-http +``` + +现在让我们通过手动执行它来了解这个插件。尝试检查客户机上运行的 Web 服务器的状态。它应该会失败,因为我们并没有运行 Web 服务器: + +``` +$ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 +connect to address 127.0.0.1 and port 80: Connection refused +HTTP CRITICAL - Unable to open TCP socket +``` + +不出所料,它失败了。检查执行的返回值: + +``` +$ echo $? +2 +``` + +Nagios 检查插件规范定义了插件执行的四个返回值: + +| 插件返回码 | 状态 | +|----------|-----------| +| 0 | OK | +| 1 | WARNING | +| 2 | CRITICAL | +| 3 | UNKNOWN | + +有了这些信息,我们现在可以在服务器上创建检查定义。 + +#### 服务器侧 + +在服务器机器上,创建 `/etc/sensu/conf.d/check_http.json` 文件: + +``` +{ +  "checks": { +    "check_http": { +      "command": "/usr/lib64/nagios/plugins/check_http -I 127.0.0.1", +      "interval": 10, +      "subscribers": [ +        "frontend" +      ] +    } +  } +} +``` + +在 `command` 字段中,使用我们之前测试过的命令。`interval` 会告诉 Sensu 这个检查的频率,以秒为单位。最后,`subscribers` 将定义执行检查的客户机。 + +重新启动 `sensu-api` 和 `sensu-server` 并确认新检查在 Uchiwa 中可用。 + +``` +$ sudo systemctl restart sensu-api sensu-server +``` + +### 接下来 + +Sensu 是一个功能强大的工具,本文只简要介绍它可以干什么。参阅[文档][13]了解更多信息,访问 Sensu 网站了解有关 [Sensu 社区][14]的更多信息。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-solution + +作者:[Michael Zamot][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/mzamot +[1]:https://www.rabbitmq.com/ +[2]:https://redis.io/topics/config +[3]:https://slack.com/ +[4]:https://en.wikipedia.org/wiki/HipChat +[5]:http://www.irc.org/ +[6]:https://www.pagerduty.com/ +[7]:https://docs.sensu.io/sensu-core/1.4/overview/architecture/ +[8]:https://docs.sensu.io/sensu-core/1.4/installation/install-sensu-client/ +[9]:https://uchiwa.io/#/ +[10]:/file/406576 +[11]:https://opensource.com/sites/default/files/uploads/sensu_system.png (sensu_system.png) +[12]:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html +[13]:https://docs.sensu.io/ +[14]:https://sensu.io/community diff --git a/published/201904/20180828 Linux for Beginners- Moving Things Around.md b/published/201904/20180828 Linux for Beginners- Moving Things Around.md new file mode 100644 index 0000000000..9ae8f5d3bf --- /dev/null +++ b/published/201904/20180828 Linux for Beginners- Moving Things Around.md @@ -0,0 +1,201 @@ +Linux 初学者:移动文件 +===================== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) + +在之前的该系列的部分中,[你学习了有关目录][1]和[访问目录][2][的权限][7]是如何工作的。你在这些文章中学习的大多数内容都可应用于文件,除了如何让一个文件变成可执行文件。 + +因此让我们在开始之前先解决这个问题。 + +### 不需要 .exe 扩展名 + +在其他操作系统中,一个文件的性质通常由它的后缀决定。如果一个文件有一个 .jpg 扩展,操作系统会认为它是一幅图像;如果它以 .wav 结尾,它是一个音频文件;如果它在文件名末尾以 .exe 结尾,它就是一个你可以执行的程序。 + +这导致了严重的问题,比如说木马可以伪装成文档文件。幸运的是,在 Linux 下事物不是这样运行的。可以确定的是,你可能会看到有些可执行文件是以 .sh 结尾暗示它们是可执行的脚本,但是这大部分是为了便于人眼找到文件,就像你使用 `ls --color` 将可执行文件的名字以亮绿色显示的方式相同。 + +事实上大多数应用根本没有扩展名。决定一个文件是否是一个真正程序的是 `x` (指*可执行的*)位。你可以通过运行以下命令使任何文件变得可执行, + +``` +chmod a+x some_program +``` + +而不管它的扩展名是什么或者是否存在。在上面命令中的 `x` 设置了 `x` 位,`a` 说明你为*所有*用户设置它。你同样可以为一组用户设置成拥有这个文件(`g+x`),或者只为一个用户——拥有者——设置 (`u+x`)。 + +尽管我们会在该系列之后的部分包含从命令行创建和运行脚本的内容,并学习通过输入它的路径并在结尾加上程序名的方式运行一个程序: + +``` +path/to/directory/some_program +``` + +或者,如果你当前在相同目录,你可以使用: + +``` +./some_program +``` + +还有其他方式可以使你的程序在目录树的任意位置运行 (提示:查询 `$PATH` 环境变量),但是当我们讨论 shell 脚本的时候你会读到这些。 + +### 复制、移动、链接 + +明显地,从命令行修改和处理文件有很多的方式,而不仅仅是处理它们的权限。当你试图打开一个不存在的文件是,大多数应用会创建一个新文件。如果 `test.txt` 当前并不存在,下列命令: + +``` +nano test.txt +``` + +``` +vim test.txt +``` + +([nano][3] 和 [vim][4] 是流行的命令行文本编辑器)都将为你创建一个空的 `test.txt` 文件来编辑。 + +你可以通过 “触摸” (`touch`)来创建一个空的文件, + +``` +touch test.txt +``` + +会创建一个文件,但是不会在任何应用中打开它。 + +你可以使用 `cp` 来拷贝一个文件到另一个位置,或者使用一个不同的名字: + +``` +cp test.txt copy_of_test.txt +``` + +你也可以拷贝一堆文件: + +``` +cp *.png /home/images +``` + +上面的命令拷贝当前目录下的所有 PNG 文件到相对你的主目录下的 `images/` 目录。在你尝试之前 `images/` 目录必须存在, 不然 `cp` 将显示一个错误。同样的,警惕,当你复制一个文件到一个已经包含相同名字的文件的目录时,`cp` 会静默地用新文件覆盖老的文件。 + +你可以使用: + +``` +cp -i *.png /home/images +``` + +如果你想要 `cp` 命令在有任何危险时警告你 (`-i` 选项代表*交互式的*)。 + +你同样可以复制整个目录,但是为了做到这样,你需要 `-r` 选项: + +``` +cp -rv directory_a/ directory_b +``` + +`-r` 选项代表*递归*,意味着 `cp` 会向下探索目录 `directory_a`,复制所有的文件和子目录下内部包含的。我个人喜欢包含 `-v` 选项,因为它使 `cp` 冗长而啰嗦,意味着它会显示你当前它正在做什么而不是仅仅静默的复制然后存在。 + +`mv` 命令移动东西。也就是说,它移动文件从一个位置到另一个位置。最简单的形式,`mv` 表现的更像 `cp`: + +``` +mv test.txt new_test.txt +``` + +上面的命令使 `new_test.txt` 出现,`test.txt` 消失。 + +``` +mv *.png /home/images +``` + +移动当前目录下所有的 PNG 文件到相对于你的主目录的 `images/` 目录。同样的你必须小心你没有意外的覆盖已存在的文件。使用 + +``` +mv -i *.png /home/images + +``` + +如果你想站在安全的角度,你可以使用与 `cp` 相同的方式。 + +除了移动与拷贝的不同外,另一个 `mv` 和 `cp` 之间的不同是当你移动目录时: + +``` +mv directory_a/ directory_b +``` + +不需要添加递归的标志。这是因为你实际做的是重命名一个目录,与第一个例子相同,你做的是重命名文件。实际上,即使你从一个目录到另一个目录 “移动” 一个文件,只要两个目录在相同的存储设备和分区,你就是在重命名文件。 + +你可以做一个实验来证明。 `time` 是一个工具来让你测量一个命令花费多久来执行。找一个非常大的文件,可以是几百 MB 甚至 几 GB (例如一个长视频),像下方这样尝试拷贝到另一个目录: + +``` +$ time cp hefty_file.mkv another_directory/ +real 0m3,868s +user 0m0,016s +sys 0m0,887s +``` + +下面是 `time` 的输出。需要关注的是第一行, real 时间。它花费了几乎 4 秒来拷贝 355 MB 的 `hefty_file.mkv` 到 `another_directory/` 目录。 + +现在让我们尝试移动它: + +``` +$ time mv hefty_file.mkv another_directory/ +real 0m0,004s +user 0m0,000s +sys 0m0,003s +``` + +移动几乎是瞬时的!这是违反直觉的,因为看起来 `mv` 必须复制这个文件然后删除原来的。这是 `mv` 对比 `cp` 命令必须做的两件事。但是,实际上,`mv` 快了 1000 倍。 + +这是因为文件系统结构中,它的所有目录树,只为了让用户便利而存在。在每个分区的开始,有一个称作*分区表*的东西告诉操作系统在实际的物理磁盘上去哪找每个文件。在磁盘上,数据没有分为目录甚至是文件。[作为替代的是轨道、扇区和簇][5]。当你在相同分区 “移动” 一个文件时,操作系统实际做的仅仅是在分区表中改变了那个文件的入口,但它仍然指向磁盘上相同的簇信息。 + +是的!移动是一个谎言!至少在相同分区下是。如果你试图移动一个文件到一个不同的分区或者不同的设备, `mv` 仍然很快,但可以察觉到它比在相同分区下移动文件慢了。这是因为实际上发生了复制和清除数据。 + +### 重命名 + +有几个不同的命令行 `rename` 工具。没有一个像 `cp` 和 `mv` 那样固定,并且它们工作的方式都有一点不同,相同的一点是它们都被用来改变文件名的部分。 + +在 Debian 和 Ubuntu 中, 默认的 `rename` 工具使用 [正则表达式][6](字符组成的字符串模式)来大量的改变目录中的文件。命令: + +``` +rename 's/\.JPEG$/.jpg/' * +``` + +将改变所有扩展名为 `JPEG` 的文件为 `jpg`。文件 `IMG001.JPEG` 变成 `IMG001.jpg`、 `my_pic.JPEG` 变成 `my_pic.jpg`,等等。 + +另一个 `rename` 版本默认在 Manjaro 上可获得,这是一个 Arch 的衍生版,更简单,但是可能没有那么强大: + +``` +rename .JPEG .jpg * +``` + +这和你之前看到的上面做相同的重命名操作。在这个版本,`.JPEG` 是你想改变的字符组成的字符串,`.jpg` 是你想要改变成为的,`*` 表示当前目录下的所有文件。 + +基本原则是如果你所做的仅仅是重命名一个文件或者目录,你最好用 `mv`,这是因为 `mv` 在所有分发版上都是可靠一致的。 + +### 了解更多 + +查看 `mv` 和 `cp` 的 man 页面了解更多。运行 + +``` +man cp +``` + +或者 +``` +man mv +``` + +来阅读这些命令自带的所有选项,这些使他们使用起来更强大和安全。 + +---------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around + +作者:[Paul Brown][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[1]: https://linux.cn/article-10066-1.html +[2]: https://linux.cn/article-10399-1.html +[3]: https://www.nano-editor.org/ +[4]: https://www.vim.org/ +[5]: https://en.wikipedia.org/wiki/Disk_sector +[6]: https://en.wikipedia.org/wiki/Regular_expression +[7]: https://linux.cn/article-10370-1.html + diff --git a/published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md b/published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md new file mode 100644 index 0000000000..80bca6cdb4 --- /dev/null +++ b/published/201904/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10683-1.html) +[#]: subject: (Oomox – Customize And Create Your Own GTK2, GTK3 Themes) +[#]: via: (https://www.ostechnix.com/oomox-customize-and-create-your-own-gtk2-gtk3-themes/) +[#]: author: (EDITOR https://www.ostechnix.com/author/editor/) + +Oomox:定制和创建你自己的 GTK2、GTK3 主题 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-720x340.png) + +主题和可视化定制是 Linux 的主要优势之一。由于所有代码都是开源的,因此你可以比 Windows/Mac OS 更大程度上地改变 Linux 系统的外观和行为方式。GTK 主题可能是人们定制 Linux 桌面的最流行方式。GTK 工具包被各种桌面环境使用,如 Gnome、Cinnamon、Unity、XFC E和 budgie。这意味着为 GTK 制作的单个主题只需很少的修改就能应用于任何这些桌面环境。 + +有很多非常高品质的流行 GTK 主题,例如 **Arc**、**Numix** 和 **Adapta**。但是如果你想自定义这些主题并创建自己的视觉设计,你可以使用 **Oomox**。 + +Oomox 是一个图形应用,可以完全使用自己的颜色、图标和终端风格自定义和创建自己的 GTK 主题。它自带几个预设,你可以在 Numix、Arc 或 Materia 主题样式上创建自己的 GTK 主题。 + +### 安装 Oomox + +在 Arch Linux 及其衍生版中: + +Oomox 可以在 [AUR][1] 中找到,所以你可以使用任何 AUR 助手程序安装它,如 [yay][2]。 + +``` +$ yay -S oomox +``` + +在 Debian/Ubuntu/Linux Mint 中,在[这里][3]下载 `oomox.deb` 包并按如下所示进行安装。在写本指南时,最新版本为 `oomox_1.7.0.5.deb`。 + +``` +$ sudo dpkg -i oomox_1.7.0.5.deb +$ sudo apt install -f +``` + +在 Fedora 上,Oomox 可以在第三方 **COPR** 仓库中找到。 + +``` +$ sudo dnf copr enable tcg/themes +$ sudo dnf install oomox +``` + +Oomox 也有 [Flatpak 应用][4]。确保已按照[本指南][5]中的说明安装了 Flatpak。然后,使用以下命令安装并运行 Oomox: + +``` +$ flatpak install flathub com.github.themix_project.Oomox +$ flatpak run com.github.themix_project.Oomox +``` + +对于其他 Linux 发行版,请进入 Github 上的 Oomox 项目页面(本指南末尾给出链接),并从源代码手动编译和安装。 + +### 自定义并创建自己的 GTK2、GTK3 主题 + +#### 主题定制 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-1-1.png) + +你可以更改几乎每个 UI 元素的颜色,例如: + +1. 标题 +2. 按钮 +3. 标题内的按钮 +4. 菜单 +5. 选定的文字 + +在左边,有许多预设主题,如汽车主题、现代主题,如 Materia 和 Numix,以及复古主题。在窗口的顶部,有一个名为**主题样式**的选项,可让你设置主题的整体视觉样式。你可以在 Numix、Arc 和 Materia 之间进行选择。 + +使用某些像 Numix 这样的样式,你甚至可以更改标题渐变,边框宽度和面板透明度等内容。你还可以为主题添加黑暗模式,该模式将从默认主题自动创建。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-2.png) + +#### 图标集定制 + +你可以自定义用于主题图标的图标集。有两个选项:Gnome Colors 和 Archdroid。你可以更改图标集的基础和笔触颜色。 + +#### 终端定制 + +你还可以自定义终端颜色。该应用有几个预设,但你可以为每个颜色,如红色,绿色,黑色等自定义确切的颜色代码。你还可以自动交换前景色和背景色。 + +#### Spotify 主题 + +这个应用的一个独特功能是你可以根据喜好定义 spotify 主题。你可以更改 spotify 的前景色、背景色和强调色来匹配整体的 GTK 主题。 + +然后,只需按下“应用 Spotify 主题”按钮,你就会看到这个窗口: + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-3.png) + +点击应用即可。 + +#### 导出主题 + +根据自己的喜好自定义主题后,可以通过单击左上角的重命名按钮重命名主题: + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-4.png) + +然后,只需点击“导出主题”将主题导出到你的系统。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-5.png) + +你也可以只导出图标集或终端主题。 + +之后你可以打开桌面环境中的任何可视化自定义应用,例如基于 Gnome 桌面的 Tweaks,或者 “XFCE 外观设置”。选择你导出的 GTK 或者 shell 主题。 + +### 总结 + +如果你是一个 Linux 主题迷,并且你确切知道系统中的每个按钮、每个标题应该怎样,Oomox 值得一试。 对于极致的定制者,它可以让你几乎更改系统外观的所有内容。对于那些只想稍微调整现有主题的人来说,它有很多很多预设,所以你可以毫不费力地得到你想要的东西。 + +你试过吗? 你对 Oomox 有什么看法? 请在下面留言! + +### 资源 + +- [Oomox GitHub 仓库](https://github.com/themix-project/oomox) + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/oomox-customize-and-create-your-own-gtk2-gtk3-themes/ + +作者:[EDITOR][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[1]: https://aur.archlinux.org/packages/oomox/ +[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[3]: https://github.com/themix-project/oomox/releases +[4]: https://flathub.org/apps/details/com.github.themix_project.Oomox +[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ diff --git a/published/20181108 My Google-free Android life.md b/published/201904/20181108 My Google-free Android life.md similarity index 100% rename from published/20181108 My Google-free Android life.md rename to published/201904/20181108 My Google-free Android life.md diff --git a/published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md new file mode 100644 index 0000000000..0771c64582 --- /dev/null +++ b/published/201904/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @@ -0,0 +1,223 @@ +[#]: collector: "lujun9972" +[#]: translator: "Auk7F7" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: subject: "Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline" +[#]: via: "https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/" +[#]: author: "Prakash Subramanian https://www.2daygeek.com/author/prakash/" +[#]: url: "https://linux.cn/article-10694-1.html" + +Arch-Wiki-Man:一个以 Linux Man 手册样式离线浏览 Arch Wiki 的工具 +====== + +现在上网已经很方便了,但技术上会有限制。看到技术的发展,我很惊讶,但与此同时,各种地方也都会出现衰退。 + +当你搜索有关其他 Linux 发行版的某些东西时,大多数时候你会得到的是一个第三方的链接,但是对于 Arch Linux 来说,每次你都会得到 Arch Wiki 页面的结果。 + +因为 Arch Wiki 提供了除第三方网站以外的大多数解决方案。 + +到目前为止,你也许可以使用 Web 浏览器为你的 Arch Linux 系统找到一个解决方案,但现在你可以不用这么做了。 + +一个名为 arch-wiki-man 的工具提供了一个在命令行中更快地执行这个操作的方案。如果你是一个 Arch Linux 爱好者,我建议你阅读 [Arch Linux 安装后指南][1],它可以帮助你调整你的系统以供日常使用。 + +### arch-wiki-man 是什么? + +[arch-wiki-man][2] 工具允许用户从命令行(CLI)中离线搜索 Arch Wiki 页面。它允许用户以 Linux Man 手册样式访问和搜索整个 Wiki 页面。 + +而且,你无需切换到 GUI。更新将每两天自动推送一次,因此,你的 Arch Wiki 本地副本页面将是最新的。这个工具的名字是 `awman`, `awman` 是 “Arch Wiki Man” 的缩写。 + +我们之前写过一篇类似工具 [Arch Wiki 命令行实用程序][3](arch-wiki-cli)的文章。这个工具允许用户从互联网上搜索 Arch Wiki。但你需要在线使用这个实用程序。 + +### 如何安装 arch-wiki-man 工具? + +arch-wiki-man 工具可以在 AUR 仓库(LCTT 译注:AUR 即Arch 用户软件仓库Arch User Repository)中获得,因此,我们需要使用 AUR 工具来安装它。有许多 AUR 工具可用,而且我们曾写了一篇关于流行的 AUR 辅助工具: [Yaourt AUR helper][4] 和 [Packer AUR helper][5] 的文章。 + +``` +$ yaourt -S arch-wiki-man +``` + +或 + +``` +$ packer -S arch-wiki-man +``` + +或者,我们可以使用 npm 包管理器来安装它,确保你已经在你的系统上安装了 [NodeJS][6]。然后运行以下命令来安装它。 + +``` +$ npm install -g arch-wiki-man +``` + +### 如何更新 Arch Wiki 本地副本? + +正如前面更新的那样,更新每两天自动推送一次,也可以通过运行以下命令来完成更新。 + +``` +$ sudo awman-update +[sudo] password for daygeek: +[email protected] /usr/lib/node_modules/arch-wiki-man +└── [email protected] + +arch-wiki-md-repo has been successfully updated or reinstalled. +``` + +`awman-update` 是一种更快、更方便的更新方法。但是,你也可以通过运行以下命令重新安装 arch-wiki-man 来获取更新。 + +``` +$ yaourt -S arch-wiki-man +``` + +或 + +``` +$ packer -S arch-wiki-man +``` + +### 如何在终端中使用 Arch Wiki ? + +它有着简易的接口且易于使用。想要搜索,只需要运行 `awman` 加搜索项目。一般语法如下所示。 + +``` +$ awman Search-Term +``` + +### 如何搜索多个匹配项? + +如果希望列出包含 “installation” 字符串的所有结果的标题,运行以下格式的命令,如果输出有多个结果,那么你将会获得一个选择菜单来浏览每个项目。 + +``` +$ awman installation +``` + +![][8] + +详细页面的截屏: + +![][9] + +### 在标题和描述中搜索给定的字符串 + +`-d` 或 `--desc-search` 选项允许用户在标题和描述中搜索给定的字符串。 + +``` +$ awman -d mirrors +``` + +或 + +``` +$ awman --desc-search mirrors +? Select an article: (Use arrow keys) +❯ [1/3] Mirrors: Related articles + [2/3] DeveloperWiki-NewMirrors: Contents + [3/3] Powerpill: Powerpill is a pac +``` + +### 在内容中搜索给定的字符串 + +`-k` 或 `--apropos` 选项也允许用户在内容中搜索给定的字符串。但须注意,此选项会显著降低搜索速度,因为此选项会扫描整个 Wiki 页面的内容。 + +``` +$ awman -k openjdk +``` + +或 + +``` +$ awman --apropos openjdk +? Select an article: (Use arrow keys) +❯ [1/26] Hadoop: Related articles + [2/26] XDG Base Directory support: Related articles + [3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first. + [4/26] Android: Related articles + [5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul.. + [6/26] LibreOffice: Related articles + [7/26] Browser plugins: Related articles +(Move up and down to reveal more choices) +``` + +### 在浏览器中打开搜索结果 + +`-w` 或 `--web` 选项允许用户在 Web 浏览器中打开搜索结果。 + +``` +$ awman -w AUR helper +``` + +或 + +``` +$ awman --web AUR helper +``` + +![][10] + +### 以其他语言搜索 + +想要查看支持的语言列表,请运行以下命令。 + +``` +$ awman --list-languages +arabic +bulgarian +catalan +chinesesim +chinesetrad +croatian +czech +danish +dutch +english +esperanto +finnish +greek +hebrew +hungarian +indonesian +italian +korean +lithuanian +norwegian +polish +portuguese +russian +serbian +slovak +spanish +swedish +thai +ukrainian +``` + +使用你的首选语言运行 `awman` 命令以查看除英语以外的其他语言的结果。 + +``` +$ awman -l chinesesim deepin +``` + +![][11] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[Auk7F7](https://github.com/Auk7F7) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/ +[2]: https://github.com/greg-js/arch-wiki-man +[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/ +[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ +[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ +[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png +[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png +[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png +[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png diff --git a/published/201904/20190104 Take to the virtual skies with FlightGear.md b/published/201904/20190104 Take to the virtual skies with FlightGear.md new file mode 100644 index 0000000000..eac736b98e --- /dev/null +++ b/published/201904/20190104 Take to the virtual skies with FlightGear.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10709-1.html) +[#]: subject: (Take to the virtual skies with FlightGear) +[#]: via: (https://opensource.com/article/19/1/flightgear) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +使用 FlightGear 翱翔天空 +====== + +> 你梦想驾驶飞机么?试试开源飞行模拟器 FlightGear 吧。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/flightgear_cockpit_plane_sky.jpg?itok=LRy0lpOS) + +如果你曾梦想驾驶飞机,你会喜欢 [FlightGear][1] 的。它是一个功能齐全的[开源][2]飞行模拟器,可在 Linux、MacOS 和 Windows 中运行。 + +FlightGear 项目始于 1996 年,原因是对商业飞行模拟程序的不满,因为这些程序无法扩展。它的目标是创建一个复杂、强大、可扩展、开放的飞行模拟器框架,来用于学术界和飞行员培训,以及任何想要玩飞行模拟场景的人。 + +### 入门 + +FlightGear 的硬件要求适中,包括支持 OpenGL 以实现平滑帧速的加速 3D 显卡。它在我的配备 i5 处理器和仅 4GB 的内存的 Linux 笔记本上运行良好。它的文档包括[在线手册][3]、一个面向[用户][5]和[开发者][6]的 [wiki][4] 门户网站,还有大量的教程(例如它的默认飞机 [Cessna 172p][7])教你如何操作它。 + +在 [Fedora][8] 和 [Ubuntu][9] Linux 中很容易安装。Fedora 用户可以参考 [Fedora 安装页面][10]来运行 FlightGear。 + +在 Ubuntu 18.04 中,我需要安装一个仓库: + +``` +$ sudo add-apt-repository ppa:saiarcot895/flightgear +$ sudo apt-get update +$ sudo apt-get install flightgear +``` + +安装完成后,我从 GUI 启动它,但你也可以通过输入以下命令从终端启动应用: + +``` +$ fgfs +``` + +### 配置 FlightGear + +应用窗口左侧的菜单提供配置选项。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_menu.png) + +“Summary” 返回应用的主页面。 + +“Aircraft” 显示你已安装的飞机,并提供了 FlightGear 的默认“机库”中安装多达 539 种其他飞机的选项。我安装了 Cessna 150L、Piper J-3 Cub 和 Bombardier CRJ-700。一些飞机(包括 CRJ-700)有教你如何驾驶商用喷气式飞机的教程。我发现这些教程内容翔实且准确。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_aircraft.png) + +要选择驾驶的飞机,请将其高亮显示,然后单击菜单底部的 “Fly!”。我选择了默认的 Cessna 172p 并发现驾驶舱的刻画非常准确。 + +![](https://opensource.com/sites/default/files/uploads/flightgear_cockpit-view.png) + +默认机场是檀香山,但你在 “Location” 菜单中提供你最喜欢机场的 [ICAO 机场代码] [11]进行修改。我找到了一些小型的本地无塔机场,如 Olean 和 Dunkirk,纽约,以及包括 Buffalo,O'Hare 和 Raleigh 在内的大型机场,甚至可以选择特定的跑道。 + +在 “Environment” 下,你可以调整一天中的时间、季节和天气。模拟包括高级天气建模和从 [NOAA][12] 下载当前天气的能力。 + +“Settings” 提供在暂停模式中开始模拟的选项。同样在设置中,你可以选择多人模式,这样你就可以与 FlightGear 支持者的全球服务器网络上的其他玩家一起“飞行”。你必须有比较快速的互联网连接来支持此功能。 + +“Add-ons” 菜单允许你下载飞机和其他场景。 + +### 开始飞行 + +为了“起飞”我的 Cessna,我使用了罗技操纵杆,它用起来不错。你可以使用顶部 “File” 菜单中的选项校准操纵杆。 + +总的来说,我发现模拟非常准确,图形界面也很棒。你自己试下 FlightGear —— 我想你会发现它是一个非常有趣和完整的模拟软件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/1/flightgear + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: http://home.flightgear.org/ +[2]: http://wiki.flightgear.org/GNU_General_Public_License +[3]: http://flightgear.sourceforge.net/getstart-en/getstart-en.html +[4]: http://wiki.flightgear.org/FlightGear_Wiki +[5]: http://wiki.flightgear.org/Portal:User +[6]: http://wiki.flightgear.org/Portal:Developer +[7]: http://wiki.flightgear.org/Cessna_172P +[8]: http://rpmfind.net/linux/rpm2html/search.php?query=flightgear +[9]: https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear +[10]: https://apps.fedoraproject.org/packages/FlightGear/ +[11]: https://en.wikipedia.org/wiki/ICAO_airport_code +[12]: https://www.noaa.gov/ diff --git a/published/201904/20190108 How To Understand And Identify File types in Linux.md b/published/201904/20190108 How To Understand And Identify File types in Linux.md new file mode 100644 index 0000000000..1fc8bc6aac --- /dev/null +++ b/published/201904/20190108 How To Understand And Identify File types in Linux.md @@ -0,0 +1,348 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10716-1.html) +[#]: subject: (How To Understand And Identify File types in Linux) +[#]: via: (https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +怎样理解和识别 Linux 中的文件类型 +====== + +众所周知,在 Linux 中一切皆为文件,包括硬盘和显卡等。在 Linux 中导航时,大部分的文件都是普通文件和目录文件。但是也有其他的类型,对应于 5 类不同的作用。因此,理解 Linux 中的文件类型在许多方面都是非常重要的。 + +如果你不相信,那只需要浏览全文,就会发现它有多重要。如果你不能理解文件类型,就不能够毫无畏惧的做任意的修改。 + +如果你做了一些错误的修改,会毁坏你的文件系统,那么当你操作的时候请小心一点。在 Linux 系统中文件是非常重要的,因为所有的设备和守护进程都被存储为文件。 + +### 在 Linux 中有多少种可用类型? + +据我所知,在 Linux 中总共有 7 种类型的文件,分为 3 大类。具体如下。 + + * 普通文件 + * 目录文件 + * 特殊文件(该类有 5 个文件类型) + * 链接文件 + * 字符设备文件 + * Socket 文件 + * 命名管道文件 + * 块文件 + +参考下面的表可以更好地理解 Linux 中的文件类型。 + +| 符号  | 意义                  | +| ------- | --------------------------------- | +| `–`   | 普通文件。长列表中以下划线 `_` 开头。       | +| `d`   | 目录文件。长列表中以英文字母 `d` 开头。     | +| `l`   | 链接文件。长列表中以英文字母 `l` 开头。      | +| `c`   | 字符设备文件。长列表中以英文字母 `c` 开头。    | +| `s`   | Socket 文件。长列表中以英文字母 `s` 开头。     | +| `p`   | 命名管道文件。长列表中以英文字母 `p` 开头。    | +| `b`   | 块文件。长列表中以英文字母 `b` 开头。       | + + +### 方法1:手动识别 Linux 中的文件类型 + +如果你很了解 Linux,那么你可以借助上表很容易地识别文件类型。 + +#### 在 Linux 中如何查看普通文件? + +在 Linux 中使用下面的命令去查看普通文件。在 Linux 文件系统中普通文件可以出现在任何地方。 +普通文件的颜色是“白色”。 + +``` +# ls -la | grep ^- +-rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history +-rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout +-rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile +-rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc +-rw-r--r--. 1 root root 26 Dec 27 17:55 liks +-rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat +-rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip +-rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip +-rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt +-rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt +-rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt +``` + +#### 在 Linux 中如何查看目录文件? + +在 Linux 中使用下面的命令去查看目录文件。在 Linux 文件系统中目录文件可以出现在任何地方。目录文件的颜色是“蓝色”。 + +``` +# ls -la | grep ^d +drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ +drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ +drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ +drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ +``` + +#### 在 Linux 中如何查看链接文件? + +在 Linux 中使用下面的命令去查看链接文件。在 Linux 文件系统中链接文件可以出现在任何地方。 +链接文件有两种可用类型,软连接和硬链接。链接文件的颜色是“浅绿宝石色”。 + +``` +# ls -la | grep ^l +lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link +lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder +``` + +#### 在 Linux 中如何查看字符设备文件? + +在 Linux 中使用下面的命令查看字符设备文件。字符设备文件仅出现在特定位置。它出现在目录 `/dev` 下。字符设备文件的颜色是“黄色”。 + +``` +# ls -la | grep ^c +# ls -la | grep ^c +crw-------. 1 root root 5, 1 Jan 28 14:05 console +crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency +crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash +crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 +crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full +crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse +``` + +#### 在 Linux 中如何查看块文件? + +在 Linux 中使用下面的命令查看块文件。块文件仅出现在特定位置。它出现在目录 `/dev` 下。块文件的颜色是“黄色”。 + +``` +# ls -la | grep ^b +brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 +brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 +brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 +brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 +brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 +``` + +#### 在 Linux 中如何查看 Socket 文件? + +在 Linux 中使用下面的命令查看 Socket 文件。Socket 文件可以出现在任何地方。Scoket 文件的颜色是“粉色”。(LCTT 译注:此处及下面关于 Socket 文件、命名管道文件可出现的位置原文描述有误,已修改。) + +``` +# ls -la | grep ^s +srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket +``` + +#### 在 Linux 中如何查看命名管道文件? + +在 Linux 中使用下面的命令查看命名管道文件。命名管道文件可以出现在任何地方。命名管道文件的颜色是“黄色”。 + +``` +# ls -la | grep ^p +prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| +prw-------. 1 root root 0 Jan 28 14:06 stats-mail| +``` + +### 方法2:在 Linux 中如何使用 file 命令识别文件类型 + +在 Linux 中 `file` 命令允许我们去确定不同的文件类型。这里有三个测试集,按此顺序进行三组测试:文件系统测试、魔术字节测试和用于识别文件类型的语言测试。 + +#### 在 Linux 中如何使用 file 命令查看普通文件 + +在你的终端简单地输入 `file` 命令跟着普通文件。`file` 命令将会读取提供的文件内容并且准确地显示文件的类型。 + +这就是我们看到对于每个普通文件有不同结果的原因。参考下面普通文件的不同结果。 + +``` +# file 2daygeek_access.log +2daygeek_access.log: ASCII text, with very long lines + +# file powertop.html +powertop.html: HTML document, ASCII text, with very long lines + +# file 2g-test +2g-test: JSON data + +# file powertop.txt +powertop.txt: HTML document, UTF-8 Unicode text, with very long lines + +# file 2g-test-05-01-2019.tar.gz +2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 +``` + +#### 在 Linux 中如何使用 file 命令查看目录文件? + +在你的终端简单地输入 `file` 命令跟着目录。参阅下面的结果。 + +``` +# file Pictures/ +Pictures/: directory +``` + +#### 在 Linux 中如何使用 file 命令查看链接文件? + +在你的终端简单地输入 `file` 命令跟着链接文件。参阅下面的结果。 + +``` +# file log +log: symbolic link to /run/systemd/journal/dev-log +``` + +#### 在 Linux 中如何使用 file 命令查看字符设备文件? + +在你的终端简单地输入 `file` 命令跟着字符设备文件。参阅下面的结果。 + +``` +# file vcsu +vcsu: character special (7/64) +``` + +#### 在 Linux 中如何使用 file 命令查看块文件? + +在你的终端简单地输入 `file` 命令跟着块文件。参阅下面的结果。 + +``` +# file sda1 +sda1: block special (8/1) +``` + +#### 在 Linux 中如何使用 file 命令查看 Socket 文件? + +在你的终端简单地输入 `file` 命令跟着 Socket 文件。参阅下面的结果。 + +``` +# file system_bus_socket +system_bus_socket: socket +``` + +#### 在 Linux 中如何使用 file 命令查看命名管道文件? + +在你的终端简单地输入 `file` 命令跟着命名管道文件。参阅下面的结果。 + +``` +# file pipe-test +pipe-test: fifo (named pipe) +``` + +### 方法 3:在 Linux 中如何使用 stat 命令识别文件类型? + +`stat` 命令允许我们去查看文件类型或文件系统状态。该实用程序比 `file` 命令提供更多的信息。它显示文件的大量信息,例如大小、块大小、IO 块大小、Inode 值、链接、文件权限、UID、GID、文件的访问/更新和修改的时间等详细信息。 + +#### 在 Linux 中如何使用 stat 命令查看普通文件? + +在你的终端简单地输入 `stat` 命令跟着普通文件。参阅下面的结果。 + +``` +# stat 2daygeek_access.log + File: 2daygeek_access.log + Size: 14406929 Blocks: 28144 IO Block: 4096 regular file +Device: 10301h/66305d Inode: 1727555 Links: 1 +Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2019-01-03 14:05:26.430328867 +0530 +Modify: 2019-01-03 14:05:26.460328868 +0530 +Change: 2019-01-03 14:05:26.460328868 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看目录文件? + +在你的终端简单地输入 `stat` 命令跟着目录文件。参阅下面的结果。 + +``` +# stat Pictures/ + File: Pictures/ + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 10301h/66305d Inode: 1703982 Links: 3 +Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2018-11-24 03:22:11.090000828 +0530 +Modify: 2019-01-05 18:27:01.546958817 +0530 +Change: 2019-01-05 18:27:01.546958817 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看链接文件? + +在你的终端简单地输入 `stat` 命令跟着链接文件。参阅下面的结果。 + +``` +# stat /dev/log + File: /dev/log -> /run/systemd/journal/dev-log + Size: 28 Blocks: 0 IO Block: 4096 symbolic link +Device: 6h/6d Inode: 278 Links: 1 +Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) +Access: 2019-01-05 16:36:31.033333447 +0530 +Modify: 2019-01-05 16:36:30.766666768 +0530 +Change: 2019-01-05 16:36:30.766666768 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看字符设备文件? + +在你的终端简单地输入 `stat` 命令跟着字符设备文件。参阅下面的结果。 + +``` +# stat /dev/vcsu + File: /dev/vcsu + Size: 0 Blocks: 0 IO Block: 4096 character special file +Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 +Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) +Access: 2019-01-05 16:36:31.056666781 +0530 +Modify: 2019-01-05 16:36:31.056666781 +0530 +Change: 2019-01-05 16:36:31.056666781 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看块文件? + +在你的终端简单地输入 `stat` 命令跟着块文件。参阅下面的结果。 + +``` +# stat /dev/sda1 + File: /dev/sda1 + Size: 0 Blocks: 0 IO Block: 4096 block special file +Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 +Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) +Access: 2019-01-05 16:36:31.596666806 +0530 +Modify: 2019-01-05 16:36:31.596666806 +0530 +Change: 2019-01-05 16:36:31.596666806 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看 Socket 文件? + +在你的终端简单地输入 `stat` 命令跟着 Socket 文件。参阅下面的结果。 + +``` +# stat /var/run/dbus/system_bus_socket + File: /var/run/dbus/system_bus_socket + Size: 0 Blocks: 0 IO Block: 4096 socket +Device: 15h/21d Inode: 576 Links: 1 +Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) +Access: 2019-01-05 16:36:31.823333482 +0530 +Modify: 2019-01-05 16:36:31.810000149 +0530 +Change: 2019-01-05 16:36:31.810000149 +0530 + Birth: - +``` + +#### 在 Linux 中如何使用 stat 命令查看命名管道文件? + +在你的终端简单地输入 `stat` 命令跟着命名管道文件。参阅下面的结果。 + +``` +# stat pipe-test + File: pipe-test + Size: 0 Blocks: 0 IO Block: 4096 fifo +Device: 10301h/66305d Inode: 1705583 Links: 1 +Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) +Access: 2019-01-06 02:00:03.040394731 +0530 +Modify: 2019-01-06 02:00:03.040394731 +0530 +Change: 2019-01-06 02:00:03.040394731 +0530 + Birth: - +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 diff --git a/translated/tech/20190118 Secure Email Service Tutanota Has a Desktop App Now.md b/published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md similarity index 68% rename from translated/tech/20190118 Secure Email Service Tutanota Has a Desktop App Now.md rename to published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md index b7f354a2bc..dc1cc6eac2 100644 --- a/translated/tech/20190118 Secure Email Service Tutanota Has a Desktop App Now.md +++ b/published/201904/20190118 Secure Email Service Tutanota Has a Desktop App Now.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10688-1.html) [#]: subject: (Secure Email Service Tutanota Has a Desktop App Now) [#]: via: (https://itsfoss.com/tutanota-desktop) [#]: author: (John Paul https://itsfoss.com/author/john/) @@ -10,32 +10,33 @@ 加密邮件服务 Tutanota 现在有桌面应用了 ====== +![][18] + [Tutanota][1] 最近[宣布][2]发布针对其电子邮件服务的桌面应用。该 Beta 版适用于 Linux、Windows 和 macOS。 ### 什么是 Tutanota? -网上有大量免费的、带有广告的电子邮件服务。但是,大多数电子邮件服务并不完全安全或在意隐私。在这个后[[斯诺登][3]世界中,[Tutanota][4] 提供了免费、安全的电子邮件服务,它专注于隐私。 +网上有大量免费的、带有广告的电子邮件服务。但是,大多数电子邮件服务并不完全安全或在意隐私。在这个后[斯诺登][3]世界中,[Tutanota][4] 提供了免费、安全的电子邮件服务,它专注于隐私。 Tutanota 有许多引人注目的功能,例如: - * 端到端加密邮箱 -  * 端到端加密地址簿 -  * 用户之间自动端到端加密邮件 -  * 使用共享密码将端到端加密电子邮件发送到任何电子邮件地址 -  * 安全密码重置,使 Tutanota 完全无法访问 -  * 从发送和接收的电子邮件中去除 IP 地址 -  * 运行Tutanota 的代码是[开源][5]的 -  * 双重身份验证 -  * 专注于隐私 -  * 密码加盐,并本地使用 Bcrypt 哈希 -  * 位于德国的安全服务器 -  * 支持PFS、DMARC、DKIM、DNSSEC 和 DANE 的 TLS -  * 本地执行加密数据的全文搜索 - - +* 端到端加密邮箱 +* 端到端加密地址簿 +* 用户之间自动端到端加密邮件 +* 通过分享密码将端到端加密电子邮件发送到任何电子邮件地址 +* 安全密码重置,使 Tutanota 完全无法访问 +* 从发送和接收的电子邮件中去除 IP 地址 +* 运行 Tutanota 的代码是[开源][5]的 +* 双因子身份验证 +* 专注于隐私 +* 加盐的密码,并本地使用 Bcrypt 哈希 +* 位于德国的安全服务器 +* 支持 PFS、DMARC、DKIM、DNSSEC 和 DANE 的 TLS +* 本地执行加密数据的全文搜索 ![][6] -web 中的 Tutanota + +*web 中的 Tutanota* 你可以[免费注册一个帐户][7]。你还可以升级帐户获取其他功能,例如自定义域、自定义域登录、域规则、额外的存储和别名。他们还提供企业帐户。 @@ -45,35 +46,33 @@ Tutanota 也可以在移动设备上使用。事实上,它的 [Android 应用 ### Tutanota 的新桌面应用 -Tutanota 在圣诞节前宣布了桌面应用的 [Beta 版][2]。该应用基于 [Electron][10]。 +Tutanota 在去年圣诞节前宣布了桌面应用的 [Beta 版][2]。该应用基于 [Electron][10]。 ![][11] -Tutanota 桌面应用 + +*Tutanota 桌面应用* 他们选择 Electron 的原因: - * 以最小的成本支持三个主流操作系统。 -  * 快速调整新桌面客户端,使其与添加到网页客户端的新功能一致。 -  * 将开发时间留给桌面功能,例如离线可用、电子邮件导入,将同时在所有三个桌面客户端中提供。 - - +* 以最小的成本支持三个主流操作系统。 +* 快速调整新桌面客户端,使其与添加到网页客户端的新功能一致。 +* 将开发时间留给桌面功能,例如离线可用、电子邮件导入,将同时在所有三个桌面客户端中提供。 由于这是 Beta 版,因此应用中缺少一些功能。Tutanota 的开发团队正在努力添加以下功能: - * 电子邮件导入和与外部邮箱同步。这将“使 Tutanota 能够从外部邮箱导入电子邮件,并在将数据存储在 Tutanota 服务器上之前在设备本地加密数据。” -  * 电子邮件的离线可用 -  * 双重身份验证 - - +* 电子邮件导入和与外部邮箱同步。这将“使 Tutanota 能够从外部邮箱导入电子邮件,并在将数据存储在 Tutanota 服务器上之前在设备本地加密数据。” +* 电子邮件的离线可用 +* 双因子身份验证 ### 如何安装 Tutanota 桌面客户端? ![][12] -在 Tutanota 中写邮件 + +*在 Tutanota 中写邮件* 你可以直接从 Tutanota 的网站[下载][2] Beta 版应用。它们有[适用于 Linux 的 AppImage 文件][13]、适用于 Windows 的 .exe 文件和适用于 macOS 的 .app 文件。你可以将你遇到的任何 bug 发布到 Tutanota 的 [GitHub 帐号中][14]。 -为了证明应用的安全性,Tutanota 签名了每个版本。 “签名确保桌面客户端以及任何更新直接来自我们且未被篡改。”你可以使用 Tutanota 的 [GitHub 页面][15]来验证签名。 +为了证明应用的安全性,Tutanota 签名了每个版本。“签名确保桌面客户端以及任何更新直接来自我们且未被篡改。”你可以使用 Tutanota 的 [GitHub 页面][15]来验证签名。 请记住,你需要先创建一个 Tutanota 帐户才能使用它。该邮件客户端设计上只能用在 Tutanota。 @@ -83,9 +82,8 @@ Tutanota 桌面应用 你曾经使用过 [Tutanota][16] 么?如果没有,你最喜欢的关心隐私的邮件服务是什么?请在下面的评论中告诉我们。 -如果你觉得这篇文章很有趣,请花些时间在社交媒体、Hacker News 或 [Reddit][17] 上分享。 +如果你觉得这篇文章很有趣,请花些时间在社交媒体上分享。 -![][18] -------------------------------------------------------------------------------- @@ -94,7 +92,7 @@ via: https://itsfoss.com/tutanota-desktop 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md new file mode 100644 index 0000000000..7a0b39efa2 --- /dev/null +++ b/published/201904/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10727-1.html) +[#]: subject: (7 Methods To Identify Disk Partition/FileSystem UUID On Linux) +[#]: via: (https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux 中获取硬盘分区或文件系统的 UUID 的七种方法 +====== + +作为一个 Linux 系统管理员,你应该知道如何去查看分区的 UUID 或文件系统的 UUID。因为现在大多数的 Linux 系统都使用 UUID 挂载分区。你可以在 `/etc/fstab` 文件中可以验证。 + +有许多可用的实用程序可以查看 UUID。本文我们将会向你展示多种查看 UUID 的方法,并且你可以选择一种适合于你的方法。 + +### 何为 UUID? + +UUID 意即通用唯一识别码Universally Unique Identifier,它可以帮助 Linux 系统识别一个磁盘分区而不是块设备文件。 + +自内核 2.15.1 起,libuuid 就是 util-linux-ng 包中的一部分,它被默认安装在 Linux 系统中。UUID 由该库生成,可以合理地认为在一个系统中 UUID 是唯一的,并且在所有系统中也是唯一的。 + +这是在计算机系统中用来标识信息的一个 128 位(比特)的数字。UUID 最初被用在阿波罗网络计算机系统Apollo Network Computing System(NCS)中,之后 UUID 被开放软件基金会Open Software Foundation(OSF)标准化,成为分布式计算环境Distributed Computing Environment(DCE)的一部分。 + +UUID 以 32 个十六进制的数字表示,被连字符分割为 5 组显示,总共的 36 个字符的格式为 8-4-4-4-12(32 个字母或数字和 4 个连字符)。 + +例如: `d92fa769-e00f-4fd7-b6ed-ecf7224af7fa` + +我的 `/etc/fstab` 文件示例: + +``` +# cat /etc/fstab + +# /etc/fstab: static file system information. +# +# Use 'blkid' to print the universally unique identifier for a device; this may +# be used with UUID= as a more robust way to name devices that works even if +# disks are added and removed. See fstab(5). +# +# +UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f / ext4 defaults,noatime 0 1 +UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 +``` + +我们可以使用下面的 7 个命令来查看。 + + * `blkid` 命令:定位或打印块设备的属性。 + * `lsblk` 命令:列出所有可用的或指定的块设备的信息。 + * `hwinfo` 命令:硬件信息工具,是另外一个很好的实用工具,用于查询系统中已存在硬件。 + * `udevadm` 命令:udev 管理工具 + * `tune2fs` 命令:调整 ext2/ext3/ext4 文件系统上的可调文件系统参数。 + * `dumpe2fs` 命令:查询 ext2/ext3/ext4 文件系统的信息。  + * 使用 `by-uuid` 路径:该目录下包含有 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 + +### Linux 中如何使用 blkid 命令查看磁盘分区或文件系统的 UUID? + +`blkid` 是定位或打印块设备属性的命令行实用工具。它利用 libblkid 库在 Linux 系统中获得到磁盘分区的 UUID。 + +``` +# blkid +/dev/sda1: UUID="d92fa769-e00f-4fd7-b6ed-ecf7224af7fa" TYPE="ext4" PARTUUID="eab59449-01" +/dev/sdc1: UUID="d17e3c31-e2c9-4f11-809c-94a549bc43b7" TYPE="ext2" PARTUUID="8cc8f9e5-01" +/dev/sdc3: UUID="ca307aa4-0866-49b1-8184-004025789e63" TYPE="ext4" PARTUUID="8cc8f9e5-03" +/dev/sdc5: PARTUUID="8cc8f9e5-05" +``` + +### Linux 中如何使用 lsblk 命令查看磁盘分区或文件系统的 UUID? + +`lsblk` 列出所有有关可用或指定块设备的信息。`lsblk` 命令读取 sysfs 文件系统和 udev 数据库以收集信息。 + +如果 udev 数据库不可用或者编译的 lsblk 不支持 udev,它会试图从块设备中读取卷标、UUID 和文件系统类型。这种情况下,必须以 root 身份运行。该命令默认会以类似于树的格式打印出所有的块设备(RAM 盘除外)。 + +``` +# lsblk -o name,mountpoint,size,uuid +NAME MOUNTPOINT SIZE UUID +sda 30G +└─sda1 / 20G d92fa769-e00f-4fd7-b6ed-ecf7224af7fa +sdb 10G +sdc 10G +├─sdc1 1G d17e3c31-e2c9-4f11-809c-94a549bc43b7 +├─sdc3 1G ca307aa4-0866-49b1-8184-004025789e63 +├─sdc4 1K +└─sdc5 1G +sdd 10G +sde 10G +sr0 1024M +``` + +### Linux 中如何使用 by-uuid 路径查看磁盘分区或文件系统的 UUID? + +该目录包含了 UUID 和实际的块设备文件,UUID 与实际的块设备文件链接在一起。 + +``` +# ls -lh /dev/disk/by-uuid/ +total 0 +lrwxrwxrwx 1 root root 10 Jan 29 08:34 ca307aa4-0866-49b1-8184-004025789e63 -> ../../sdc3 +lrwxrwxrwx 1 root root 10 Jan 29 08:34 d17e3c31-e2c9-4f11-809c-94a549bc43b7 -> ../../sdc1 +lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> ../../sda1 +``` + +### Linux 中如何使用 hwinfo 命令查看磁盘分区或文件系统的 UUID? + +[hwinfo][1] 意即硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。 + +``` +# hwinfo --block | grep by-uuid | awk '{print $3,$7}' +/dev/sdc1, /dev/disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 +/dev/sdc3, /dev/disk/by-uuid/ca307aa4-0866-49b1-8184-004025789e63 +/dev/sda1, /dev/disk/by-uuid/d92fa769-e00f-4fd7-b6ed-ecf7224af7fa +``` + +### Linux 中如何使用 udevadm 命令查看磁盘分区或文件系统的 UUID? + +`udevadm` 需要命令和命令特定的操作。它控制 systemd-udevd 的运行时行为,请求内核事件、管理事件队列并且提供简单的调试机制。 + +``` +# udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 +S: disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 +``` + +### Linux 中如何使用 tune2fs 命令查看磁盘分区或文件系统的 UUID? + +`tune2fs` 允许系统管理员在 Linux 的 ext2、ext3、ext4 文件系统中调整各种可调的文件系统参数。这些选项的当前值可以使用选项 `-l` 显示。 + +``` +# tune2fs -l /dev/sdc1 | grep UUID +Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 +``` + +### Linux 中如何使用 dumpe2fs 命令查看磁盘分区或文件系统的 UUID? + +`dumpe2fs` 打印出现在设备文件系统中的超级块和块组的信息。 + +``` +# dumpe2fs /dev/sdc1 | grep UUID +dumpe2fs 1.43.5 (04-Aug-2017) +Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/hwinfo-check-display-detect-system-hardware-information-linux/ diff --git a/published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md b/published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md new file mode 100644 index 0000000000..2d1f6bcb35 --- /dev/null +++ b/published/201904/20190204 Enjoy Netflix- You Should Thank FreeBSD.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10774-1.html) +[#]: subject: (Enjoy Netflix? You Should Thank FreeBSD) +[#]: via: (https://itsfoss.com/netflix-freebsd-cdn/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +喜欢 Netflix 么?你应该感谢 FreeBSD +====== + +![][7] + +Netflix 是世界上最受欢迎的流媒体服务之一。对,你已经知道了。但你可能不知道的是 Netflix 使用 [FreeBSD][1] 向你提供内容。 + +是的。Netflix 依靠 FreeBSD 来构建其内部内容交付网络(CDN)。 + +[CDN][2] 是一组位于世界各地的服务器。它主要用于向终端用户分发像图像和视频这样的“大文件”。 + +Netflix 没有选择商业 CDN 服务,而是建立了自己的内部 CDN,名为 [Open Connect][3]。 + +Open Connect 使用[自定义硬件][4]:Open Connect Appliance。你可以在下面的图片中看到它。它可以每秒处理 40Gb 的数据,存储容量为 248 TB。 + +![Netflix’s Open Connect Appliance runs FreeBSD][5] + +Netflix 免费为合格的互联网服务提供商(ISP) 提供 Open Connect Appliance。通过这种方式,大量的 Netflix 流量得到了本地化,ISP 可以更高效地提供 Netflix 内容。 + +Open Connect Appliance 运行在 FreeBSD 操作系统上,并且[几乎完全运行开源软件][6]。 + +### Open Connect 使用最新版 FreeBSD + + +你或许会觉得 Netflix 会在这样一个关键基础设施上使用 FreeBSD 的稳定版本,但 Netflix 会跟踪 [FreeBSD 最新/当前版本][8]。Netflix 表示,跟踪“最新版”可以让他们“保持前瞻性,专注于创新”。 + +以下是 Netflix 跟踪最新版 FreeBSD 的好处: + +* 更快的功能迭代 +* 更快地使用 FreeBSD 的新功能 +* 更快的 bug 修复 +* 实现协作 +* 尽量减少合并冲突 +* 摊销合并“成本” + +> 运行 FreeBSD “最新版” 可以让我们非常高效地向用户分发大量数据,同时保持高速的功能开发。 +> +> Netflix + +请记得,甚至[谷歌也使用 Debian][9] 测试版而不是 Debian 稳定版。也许这些企业更喜欢最先进的功能。 + +与谷歌一样,Netflix 也计划向上游提供代码。这应该有助于 FreeBSD 和其他基于 FreeBSD 的 BSD 发行版。 + +那么 Netflix 用 FreeBSD 实现了什么?以下是一些统计数据: + +> 使用 FreeBSD 和商业硬件,我们在 16 核 2.6 GHz CPU 上使用约 55% 的 CPU,实现了 90 Gb/s 的 TLS 加密连接。 +> +> Netflix + +如果你想了解更多关于 Netflix 和 FreeBSD 的信息,可以参考 [FOSDEM 的这个演示文稿][10]。你还可以在[这里][11]观看演示文稿的视频。 + +目前,大型企业主要依靠 Linux 来实现其服务器基础架构,但 Netflix 已经信任了 BSD。这对 BSD 社区来说是一件好事,因为如果像 Netflix 这样的行业领导者重视 BSD,那么其他人也可以跟上。你怎么看? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/netflix-freebsd-cdn/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.freebsd.org/ +[2]: https://www.cloudflare.com/learning/cdn/what-is-a-cdn/ +[3]: https://openconnect.netflix.com/en/ +[4]: https://openconnect.netflix.com/en/hardware/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-open-connect-appliance.jpeg?fit=800%2C533&ssl=1 +[6]: https://openconnect.netflix.com/en/software/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/netflix-freebsd.png?resize=800%2C450&ssl=1 +[8]: https://www.bsdnow.tv/tutorials/stable-current +[9]: https://itsfoss.com/goobuntu-glinux-google/ +[10]: https://fosdem.org/2019/schedule/event/netflix_freebsd/attachments/slides/3103/export/events/attachments/netflix_freebsd/slides/3103/FOSDEM_2019_Netflix_and_FreeBSD.pdf +[11]: http://mirror.onet.pl/pub/mirrors/video.fosdem.org/2019/Janson/netflix_freebsd.webm diff --git a/published/201904/20190208 Which programming languages should you learn.md b/published/201904/20190208 Which programming languages should you learn.md new file mode 100644 index 0000000000..6535e6cd64 --- /dev/null +++ b/published/201904/20190208 Which programming languages should you learn.md @@ -0,0 +1,48 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10769-1.html) +[#]: subject: (Which programming languages should you learn?) +[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +你应该学习哪种编程语言? +====== + +> 学习一门新的编程语言是在你的职业生涯中继续前进的好方法,但是应该学习哪一门呢? + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) + +如果你想要开始你的编程生涯或继续前进,那么学习一门新语言是一个聪明的主意。但是,大量活跃使用的语言引发了一个问题:哪种编程语言是最好的?要回答这个问题,让我们从一个简单的问题开始:你想做什么样的程序? + +如果你想在客户端进行网络编程,那么特定语言 HTML、CSS 和 JavaScript(看似无穷无尽的方言之一)是必须要学习的。 + +如果你想在服务器端进行 Web 编程,那么选择包括常见的通用语言:C++、Golang、Java、C#、 Node.js、Perl、Python、Ruby 等等。当然,服务器程序与数据存储(例如关系数据库和其他数据库)打交道,这意味着 SQL 等查询语言可能会发挥作用。 + +如果你正在为移动设备编写原生应用程序,那么了解目标平台非常重要。对于 Apple 设备,Swift 已经取代 Objective C 成为首选语言。对于 Android 设备,Java(带有专用库和工具集)仍然是主要语言。有一些特殊语言,如与 C# 一起使用的 Xamarin,可以为 Apple、Android 和 Windows 设备生成特定于平台的代码。 + +那么通用语言呢?通常有各种各样的选择。在*动态*或*脚本*语言(如 Perl、Python 和 Ruby)中,有一些新东西,如 Node.js。而 Java 和 C# 的相似之处比它们的粉丝愿意承认的还要多,仍然是针对虚拟机(分别是 JVM 和 CLR)的主要*静态编译*语言。在可以编译为*原生可执行文件*的语言中,C++ 仍在使用,还有后来出现的 Golang 和 Rust 等。通用的*函数式*语言比比皆是(如 Clojure、Haskell、Erlang、F#、Lisp 和 Scala),它们通常都有热情投入的社区。值得注意的是,面向对象语言(如 Java 和 C#)已经添加了函数式构造(特别是 lambdas),而动态语言从一开始就有函数式构造。 + +让我以 C 语言结尾,它是一种小巧、优雅、可扩展的语言,不要与 C++ 混淆。现代操作系统主要用 C 语言编写,其余部分用汇编语言编写。任何平台上的标准库大多数都是用 C 语言编写的。例如,任何打印 `Hello, world!` 这种问候都是通过调用名为 `write` 的 C 库函数来实现的。 + +C 作为一种可移植的汇编语言,公开了其他高级语言有意隐藏的底层系统的详细信息。因此,理解 C 可以更好地掌握程序如何竞争执行所需的共享系统资源(如处理器、内存和 I/O 设备)。C 语言既高级又接近硬件,因此在性能方面无与伦比,当然,汇编语言除外。最后,C 是编程语言中的通用语言,几乎所有通用语言都支持某种形式的 C 调用。 + +有关现代 C 语言的介绍,参考我的书籍 《[C 语言编程:可移植的汇编器介绍][1]》。无论你怎么做,学习 C 语言,你会学到比另一种编程语言多得多的东西。 + +你认为学习哪些编程语言很重要?你是否同意这些建议?在评论告知我们! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 diff --git a/published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md b/published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md new file mode 100644 index 0000000000..d43ad53c67 --- /dev/null +++ b/published/201904/20190211 Ubuntu 14.04 is Reaching the End of Life. Here are Your Options.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10723-1.html) +[#]: subject: (Ubuntu 14.04 is Reaching the End of Life. Here are Your Options) +[#]: via: (https://itsfoss.com/ubuntu-14-04-end-of-life/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Ubuntu 14.04 即将结束支持,你该怎么办? +====== + +Ubuntu 14.04 即将于 2019 年 4 月 30 日结束支持。这意味着在此日期之后 Ubuntu 14.04 用户将无法获得安全和维护更新。 + +你甚至不会获得已安装应用的更新,并且不手动修改 `sources.list` 则无法使用 `apt` 命令或软件中心安装新应用。 + +Ubuntu 14.04 大约在五年前发布。这是 Ubuntu 长期支持版本(LTS)。 + +[检查 Ubuntu 版本][1]并查看你是否仍在使用 Ubuntu 14.04。如果是桌面或服务器版,你可能想知道在这种情况下你应该怎么做。 + +我来帮助你。告诉你在这种情况下你有些什么选择。 + +![][2] + +### 升级到 Ubuntu 16.04 LTS(最简单的方式) + +如果你可以连接互联网,你可以从 Ubuntu 14.04 升级到 Ubuntu 16.04 LTS。 + +Ubuntu 16.04 也是一个长期支持版本,它将支持到 2021 年 4 月。这意味着下次升级前你还有两年的时间。 + +我建议阅读这个[升级 Ubuntu 版本][3]的教程。它最初是为了将 Ubuntu 16.04 升级到 Ubuntu 18.04 而编写的,但这些步骤也适用于你的情况。 + +### 做好备份,全新安装 Ubuntu 18.04 LTS(非常适合桌面用户) + +另一个选择是备份你的文档、音乐、图片、下载和其他任何你不想丢失数据的文件夹。 + +我说的备份指的是将这些文件夹复制到外部 USB 盘。换句话说,你应该有办法将数据复制回计算机,因为你将格式化你的系统。 + +我建议桌面用户使用此选项。Ubuntu 18.04 是目前的长期支持版本,它将至少在 2023 年 4 月之前得到支持。在你被迫进行下次升级之前,你将有四年的时间。 + +### 支付扩展安全维护费用并继续使用 Ubuntu 14.04 + +这适用于企业客户。Canonical 是 Ubuntu 的母公司,它提供 Ubuntu Advantage 计划,客户可以支付电话电子邮件支持和其他益处。 + +Ubuntu Advantage 计划用户还有[扩展安全维护][4](ESM)功能。即使给定版本的生命周期结束后,此计划也会提供安全更新。 + +这需要付出金钱。服务器用户每个物理节点每年花费 225 美元。对于桌面用户,价格为每年 150 美元。你可以在[此处][5]了解 Ubuntu Advantage 计划的详细定价。 + +### 还在使用 Ubuntu 14.04 吗? + +如果你还在使用 Ubuntu 14.04,那么你应该开始了解这些选择,因为你还有不到一个月的时间。 + +在任何情况下,你都不能在 2019 年 4 月 30 日之后使用 Ubuntu 14.04,因为你的系统由于缺乏安全更新而容易受到攻击。无法安装新应用将是一个额外的痛苦。 + +那么,你会做什么选择?升级到 Ubuntu 16.04 或 18.04 或付费 ESM? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-14-04-end-of-life/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/ubuntu-14-04-end-of-life-featured.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/upgrade-ubuntu-version/ +[4]: https://www.ubuntu.com/esm +[5]: https://www.ubuntu.com/support/plans-and-pricing diff --git a/translated/tech/20190309 Emulators and Native Linux games on the Raspberry Pi.md b/published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md similarity index 80% rename from translated/tech/20190309 Emulators and Native Linux games on the Raspberry Pi.md rename to published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md index ab2f9b7396..9f883c1447 100644 --- a/translated/tech/20190309 Emulators and Native Linux games on the Raspberry Pi.md +++ b/published/201904/20190309 Emulators and Native Linux games on the Raspberry Pi.md @@ -1,15 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10682-1.html) [#]: subject: (Emulators and Native Linux games on the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/play-games-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -树莓派上的模拟器和原生 Linux 游戏 +树莓派使用入门:树莓派上的模拟器和原生 Linux 游戏 ====== -树莓派是一个很棒的游戏平台。在我们的系列文章的第九篇中学习如何开始使用树莓派。 + +> 树莓派是一个很棒的游戏平台。在我们的系列文章的第九篇中学习如何开始使用树莓派。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_minecraft_copy.png?itok=iz4RF7f8) @@ -17,13 +18,13 @@ ### 使用模拟器玩游戏 -模拟器是一种能让你在树莓派上玩不同系统,不同年代游戏的软件。在如今众多的模拟器中,[RetroPi][2] 是树莓派中最受欢迎的。你可以用它来玩 Apple II、Amiga、Atari 2600、Commodore 64、Game Boy Advance 和[其他许多][3]游戏。 +模拟器是一种能让你在树莓派上玩不同系统、不同年代游戏的软件。在如今众多的模拟器中,[RetroPi][2] 是树莓派中最受欢迎的。你可以用它来玩 Apple II、Amiga、Atari 2600、Commodore 64、Game Boy Advance 和[其他许多][3]游戏。 如果 RetroPi 听起来有趣,请阅读[这些说明][4]开始使用,玩得开心! ### 原生 Linux 游戏 -树莓派的操作系统 Raspbian 上也有很多原生 Linux 游戏。“Make Use Of” 有一篇关于如何在树莓派上[玩 10 个老经典游戏][5]如 Doom 和 Nuke Dukem 3D 的文章。 +树莓派的操作系统 Raspbian 上也有很多原生 Linux 游戏。“Make Use Of” 有一篇关于如何在树莓派上[玩 10 个老经典游戏][5],如 Doom 和 Nuke Dukem 3D 的文章。 你也可以将树莓派用作[游戏服务器][6]。例如,你可以在树莓派上安装 Terraria、Minecraft 和 QuakeWorld 服务器。 @@ -34,13 +35,13 @@ via: https://opensource.com/article/19/3/play-games-raspberry-pi 作者:[Anderson Silva][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/ansilva [b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/19/3/teach-kids-program-raspberry-pi +[1]: https://linux.cn/article-10653-1.html [2]: https://retropie.org.uk/ [3]: https://retropie.org.uk/about/systems [4]: https://opensource.com/article/19/1/retropie diff --git a/translated/tech/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md b/published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md similarity index 79% rename from translated/tech/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md rename to published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md index 386f257e69..bd4c5e0ec8 100644 --- a/translated/tech/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md +++ b/published/201904/20190310 Let-s get physical- How to use GPIO pins on the Raspberry Pi.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10687-1.html) [#]: subject: (Let's get physical: How to use GPIO pins on the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/gpio-pins-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -进入物理世界:如何使用树莓派的 GPIO 针脚 +树莓派使用入门:进入物理世界 —— 如何使用树莓派的 GPIO 针脚 ====== -在树莓派使用入门的第十篇文章中,我们将学习如何使用 GPIO。 + +> 在树莓派使用入门的第十篇文章中,我们将学习如何使用 GPIO。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspbery_pi_zero_wireless_hardware.jpg?itok=9YFzdxFQ) 到目前为止,本系列文章主要专注于树莓派的软件方面,而今天我们将学习硬件。在树莓派最初发布时,最让我感兴趣的主要特性之一就是它的 [通用输入输出][1](GPIO)针脚。GPIO 可以让你的树莓派程序与连接到它上面的传感器、继电器、和其它类型的电子元件与物理世界来交互。 ![](https://opensource.com/sites/default/files/uploads/raspberrypi_10_gpio-pins-pi2.jpg) -树莓派上的每个 GPIO 针脚要么有一个预定义的功能,要么被设计为通用的。另外,不同的树莓派型号要么 26 个,要么有 40 个 GPIO 针脚是你可以随意使用的。在维基百科上有一个 [关于每个针脚的非常详细的说明][2] 以及它的功能介绍。 +树莓派上的每个 GPIO 针脚要么有一个预定义的功能,要么被设计为通用的。另外,不同的树莓派型号要么 26 个,要么有 40 个 GPIO 针脚,你可以根据情况使用的。在维基百科上有一个 [关于每个针脚的非常详细的说明][2] 以及它的功能介绍。 你可以使用树莓派的 GPIO 针脚做更多的事情。关于它的 GPIO 的使用我写过一些文章,包括使用树莓派来控制节日彩灯的三篇文章([第一篇][3]、 [第二篇][4]、和 [第三篇][5]),在这些文章中我通过使用开源程序让灯光随着音乐起舞。 -树莓派社区在不同编程语言上创建不同的库方面做了非常好的一些工作,因此,你能够使用 [C][6]、[Python][7]、 [Scratch][8]、和其它语言与 GPIO 进行交互。 +树莓派社区在用不同编程语言创建不同的库方面做了非常好的一些工作,因此,你能够使用 [C][6]、[Python][7]、 [Scratch][8] 和其它语言与 GPIO 进行交互。 -另外,如果你想在树莓派与物理世界交互方面获得更好的体验,你可以选用 [Raspberry Pi Sense Hat][9],它是插入树莓派 GPIO 针脚上的一个很便宜的电路板,借助它你可以通过程序与 LED、驾驶杆、气压计、温度计、温度计、 陀螺仪、加速度计、以及磁力仪来交互。 +另外,如果你想在树莓派与物理世界交互方面获得更好的体验,你可以选用 [Raspberry Pi Sense Hat][9],它是插入树莓派 GPIO 针脚上的一个很便宜的电路板,借助它你可以通过程序与 LED、驾驶杆、气压计、温度计、温度计、 陀螺仪、加速度计以及磁力仪来交互。 -------------------------------------------------------------------------------- @@ -31,7 +33,7 @@ via: https://opensource.com/article/19/3/gpio-pins-raspberry-pi 作者:[Anderson Silva][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md b/published/201904/20190311 7 resources for learning to use your Raspberry Pi.md similarity index 51% rename from translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md rename to published/201904/20190311 7 resources for learning to use your Raspberry Pi.md index ee0b1451b1..d3f24ba5d2 100644 --- a/translated/tech/20190311 7 resources for learning to use your Raspberry Pi.md +++ b/published/201904/20190311 7 resources for learning to use your Raspberry Pi.md @@ -1,41 +1,42 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10707-1.html) [#]: subject: (7 resources for learning to use your Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/resources-raspberry-pi) [#]: author: (Manuel Dewald https://opensource.com/users/ntlx) 学习使用树莓派的 7 个资源 ====== -缩短树莓派学习曲线的书籍、课程和网站。 + +> 一些缩短树莓派学习曲线的书籍、课程和网站。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/reading_book_stars_list.png?itok=Iwa1oBOl) -[树莓派][1]是一款小型单板计算机,最初用于教学和学习编程和计算机科学。但如今它有更多用处。它是一种经济、低功耗计算机,人们将它用于各种各样的事情 - 从家庭娱乐到服务器应用,再到物联网 (IoT) 项目。 +[树莓派][1]是一款小型单板计算机,最初用于教学和学习编程和计算机科学。但如今它有更多用处。它是一种经济的低功耗计算机,人们将它用于各种各样的事情 —— 从家庭娱乐到服务器应用,再到物联网(IoT) 项目。 -关于这个主题有很多资源,你可以做很多不同的项目,很难知道从哪里开始。以下是一些资源,可以帮助你开始使用树莓派。愉快地浏览,但不要停留在这里。到处看下,深入下去你就会发现树莓派的新世界。 +关于这个主题有很多资源,你可以做很多不同的项目,却很难知道从哪里开始。以下是一些资源,可以帮助你开始使用树莓派。看看这篇文章,但不要满足于此。到处看下,深入下去你就会发现树莓派的新世界。 ### 书籍 -关于树莓派有很多不同语言的书籍。这两本将帮助你开始了解,然后深入了解树莓派。 +关于树莓派有很多不同语言的书籍。这两本书将帮助你开始了解,然后深入了解树莓派。 -#### 由 Simon Monk 编写的 Raspberry Pi Cookbook:软件和硬件问题及解决方案 +#### 由 Simon Monk 编写的《树莓派手边书:软件和硬件问题及解决方案》 -Simon Monk 是一名软件工程师,并且多年来一直是手工业余爱好者。他最初被 Arduino 这块易于使用的开发板所吸引,后来出版了一本关于它的[书][2]。后来,他开始使用树莓派并写了 [Raspberry Pi Cookbook:软件和硬件问题和解决方案][3]这本书。在本书中,你可以找到大量树莓派项目的最佳时间,以及你可能面对的各种挑战的解决方案。 +Simon Monk 是一名软件工程师,并且多年来一直是业余手工爱好者。他最初被 Arduino 这块易于使用的开发板所吸引,后来出版了一本关于它的[书][2]。后来,他开始使用树莓派并写了《[树莓派手边书:软件和硬件问题和解决方案][3]》这本书。在本书中,你可以找到大量树莓派项目的最佳时间,以及你可能面对的各种挑战的解决方案。 -####由 Simon Monk 编写的树莓派编程:从 Python 入门 +#### 由 Simon Monk 编写的《树莓派编程:从 Python 入门》 -Python 已经发展成为开始树莓派项目的首选编程语言,因为它易于学习和使用,即使你没有任何编程经验。此外,它的许多库可以帮助你专注于使你的项目变得特别,而不是实现协议反复地与传感器不断通信。Monk 在 Raspberry Pi Cookbook 中写了两章关于 Python 编程,但[树莓派编程:从 Python 入门][4]是一个更全面的快速入门。它向你介绍了 Python,并向你展示了可以在树莓派上使用它创建的一些项目。 +Python 已经发展成为开始一个树莓派项目的首选编程语言,因为它易于学习和使用,即使你没有任何编程经验。此外,它的许多库可以帮助你专注于使你的项目变得特别,而不是实现协议以与传感器反复通信。Monk 在《树莓派手边书》中写了两章关于 Python 编程,但《[树莓派编程:从 Python 入门][4]》是一个更全面的快速入门。它向你介绍了 Python,并向你展示了可以在树莓派上使用它创建的一些项目。 ### 在线课程 新的树莓派用户可以选择许多在线课程和教程,包括这个入门课程。 -#### Raspberry Pi Class - -Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓派的全面介绍。它从树莓派和 Linux 操作基础开始,然后进入 Python 编程和 GPIO 通信。如果你是这方面的新手,并希望快速入门,这使它成为一个很好的从上到下的树莓派指南。 +#### 树莓派课程 +Instructables 免费的在线[树莓派课程][5]提供了对树莓派的全面介绍。它从树莓派和 Linux 操作基础开始,然后进入 Python 编程和 GPIO 通信。如果你是这方面的新手,并希望快速入门,这使它成为一个很好的自上而下的树莓派指南。 ### 网站 @@ -43,7 +44,7 @@ Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓 #### RaspberryPi.org -官方的[树莓派][6]网站是最好的入门之一。许多关于特定项目的文章有链接到基础知识的链接,如将 Raspbian 安装到树莓派上。 (这是我倾向的,而不是在每个操作中重复说明。)你还可以找到学生技术[教育][8]方面的[示例项目][7]和课程。 +官方的[树莓派][6]网站是最好的入门之一。有许多关于特定项目的文章会链接到这里的基础知识,如将 Raspbian 安装到树莓派上。(这是我倾向的做法,而不是在每篇文章中重复说明。)你还可以找到学生技术[教育][8]方面的[示例项目][7]和课程。 #### Opensource.com @@ -51,7 +52,7 @@ Instructables 的免费 [Raspberry Pi Class][5] 在线课程提供了对树莓 #### Instructables 和 Hackaday -你想造自己的复古街机么?或者在镜子上显示当天的天气信息、时间和第一事务?你是否想要为派对创建一个文字时钟或者相簿?你可以在 [Instructables][10] 和 [Hackaday][11] 这样的网站上找到如何使用树莓派完成所有这些(以及更多!)的说明。如果你不确定是否要买树莓派,请浏览这些网站,你会发现有很多理由可以购买。 +你想造自己的复古街机么?或者在镜子上显示当天的天气信息、时间和第一事务?你是否想要为派对创建一个文字时钟或者相簿?你可以在 [Instructables][10] 和 [Hackaday][11] 这样的网站上找到如何使用树莓派完成所有这些(以及更多!)的说明。如果你不确定是否要买树莓派,请浏览这些网站,你会发现有很多理由值得购买。 你最喜欢的树莓派资源是什么?请在评论中分享! @@ -62,7 +63,7 @@ via: https://opensource.com/article/19/3/resources-raspberry-pi 作者:[Manuel Dewald][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md b/published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md new file mode 100644 index 0000000000..ace60ec7e9 --- /dev/null +++ b/published/201904/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (sanfusu) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10689-1.html) +[#]: subject: (Blockchain 2.0: Redefining Financial Services [Part 3]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/) +[#]: author: (ostechnix https://www.ostechnix.com/author/editor/) + +区块链 2.0:重新定义金融服务(三) +====== + +![](https://www.ostechnix.com/wp-content/uploads/2019/03/Financial-Services-1-720x340.png) + +[本系列的前一篇文章][1]侧重于建立背景,以阐明为什么将现有的金融系统向充满未来主义的[区块链][2]体系迈进是“货币”改革的下一个自然步骤。我们将继续了解哪些区块链特性将有助于这一迁移。但是,金融市场十分复杂,并且人们的交易由众多组成部分组成,而不仅仅是货币。 + +本部分将探索哪些区块链特性能够让金融机构向区块链平台迁移,并将传统银行和金融系统与其合并。如之前讨论证明的那样,如果有足够的人参与到给定的区块链网络并且支持交易协议,则赋给“代币”的面值将提升并变得更稳定。以比特币(BTC)为例,就和我们习惯使用的纸币一样,像比特币和以太币这样的加密货币,都可以用于所有前者的目的,从购买食物到船只,乃至贷款和购买保险。 + +事实上,你所涉及的银行或其他金融机构很可能已经[利用了区块链分类账本技术][r1]。金融行业中区块链技术最显著的用途是建立支付基础设施、基金交易技术和数字身份管理。传统上,后两者是由金融服务业传统的系统处理的。但由于区块链处理上的效率,这些系统正逐渐的向区块链迁移合并。区块链还为这些金融服务业的公司提供了高质量的数据分析解决方案,这一方面之所以能够快速的得到重视,主要得益于最近的数据科学的发展。 + +从这一领域前沿阵地的初创企业和项目入手考察,区块链似乎能有所保证,因为这些企业或项目的产品已经开始在市场上扩展开来。 + +PayPal,这是一家创建于 1998 年的在线支付公司,现为此类平台中最大的一个,常被视作运营和技术能力的基准。PayPal 很大程度上派生自现有的货币体系。它的创新贡献来自于如何收集并利用消费者数据,以提供即时的在线服务。如今,在线交易已被认为是理所当然的事,其所基于的技术方面,在该行业里的创新极少。拥有坚实的基础是一件好事,但在快速发展的 IT 行业里并不能提供任何竞争力,毕竟每天都有新的标准和新的技术。2014 年,PayPal 子公司 **Braintree** [宣布][r2]与流行的加密货币支付方案解决商 [Coinbase][r3] 和 **GoCoin** 建立了合作关系,以便逐步将比特币和其它加密货币整合到它们的服务平台上。这基本上给了加密货币支付方案解决商的消费者在 PayPal 可靠且熟悉的平台下探索和体验的一个机会。事实上,打车公司 **Uber** 和 Braintree 具有独家合作关系,允许消费者在打车的时候使用比特币。 + +**瑞波(Ripple)** 正在让人们在多个区块链之间的操作变得更简单。瑞波已经成为美国各地区银行向前发展的头条新闻,比如,在不需要第三方中介的情况下,将资金双边转移给其他地区银行,从而降低了成本和时间管理费用。[瑞波的 Codius 平台][r4]允许区块链之间互相操作,并为智能合约编入系统提供了方便之门,以最大限度地减少篡改和混乱。建立在这种先进、安全并且可根据需要扩展的平台上,瑞波拥有像瑞银和[渣打银行][r5] 在内的客户列表,更多的银行客户也在期待加入。 + +**Kraken**,是一个在全球各地运营的美国加密货币交易所,因其可靠的**加密货币量**估算而闻名,甚至向彭博终端实时提供比特币定价数据。在 2015 年,[他们与菲多尔银行][r6]合作建立世界上第一个提供银行业务和加密货币交易的加密货币银行。 + +另一家金融科技公司 [Circle][r7] 则是目前同类公司中规模最大的一家,允许用户投资和交易加密货币衍生资产,类似于传统的货币市场资产。 + +如今,像 [Wyre][r8] 和 **Stellar** 这样的公司已经将国际电汇的提前期从平均 3 天降到了 6 小时。有人声称,一旦建立了适当的监管体系,同样的 6 小时可以缩短至几秒钟。 + +虽然现在上述内容集中在相关的初创项目上,但是不应忽视更受尊敬的老派金融机构的影响力和能力。这些全球范围内交易量达数十亿美元,已经存在了数十年乃至上百年的机构,在利用区块链及其潜力上有着相当的兴趣。 + +前面的文章中我们已经提到,**摩根大通**最近披露了他们在开发加密货币和企业级别的区块链基础分类帐本上的计划。该项目被称为 [Quorum][r9],被定义为 **“企业级分布式分类帐和智能合约平台”**。这一平台的主要目标是将大量的银行操作逐渐的迁移到 Quorum 中,从而削减像摩根大通这样的公司在保证隐私、安全和透明度上的重大开销。他们声称自己是行业中唯一完整拥有全部的区块链、协议和代币系统的玩家。他们也发布了一个称为 **JPM 硬币** 的加密货币,用于大额即时结算。JPM 硬币是由摩根大通等主要银行支持的首批“稳定币”。稳定币是其价格与现存主要货币系统相关联的加密货币。Quorum 也因其每秒几近 100 次远高于同行的交易量而倍受吹捧,这远远领先于同时代。 + +据报道,英国跨国金融巨头巴克莱已经[注册了两项基于区块链的专利][r10],旨在简化资金转移和 KYC 规程。巴克莱更多的是旨在提高自身的银行操作效率。其中一个应用是创建一个私有区块链网络,用于存储客户的 KYC 信息。经过验证、存储和确认后,这些详细信息将不可变,并且无需再进一步验证。若能实施这一应用,该协议将取消对 KYC 信息多次验证的需求。像印度这样有着高密度人口的发展中国家,其中大部分人口的 KYC 信息尚未被引入正式的银行系统中,若能引入这种具有革新意义的 KYC 系统,将有助于减少随机错误并减少交付时间。据传,巴克莱同时也在探索区块链系统的功能,以便解决信用状态评级和保险赔偿问题。 + +这种以区块链作支撑的系统,被用来消除不必要的维护成本,并利用智能合约来为那些需要慎重、安全和速度的企业在行业内赢得竞争力。这些企业产品建立在一个能够确保完整交易以及合同隐私的协议之上,同时建立了可使腐败和贿赂无效的共识机制。 + +[普华永道 2017 年的全球金融科技报告][r11] 表示到 2020 年,所有金融科技公司中约有 77% 将转向基于区块链的技术和流程。高达 90% 的受访者表示他们计划在 2020 年之前将区块链技术作为生产系统的一部分。他们的判断没错,因为从监管的角度来看,通过转移到基于区块链的系统上,可以确保显著的成本节约和透明度增加。 + +由于区块链平台默认内置了监管能力,因此企业从传统系统迁移到运行区块链分类账本的现代网络也是行业监管机构所欢迎的举措。交易和贸易运动可以一劳永逸地进行验证和跟踪。从长远来看,这可能会带来更好的监管和风险管理,更不用说改善了公司和个人的责任。 + +虽然对跨越式创新的投资是由企业进行的大量投资顺带所致,但如果认为这些措施不会渗透到最终用户的利益中是具有误导性的。随着银行和金融机构开始采用区块链,这将为他们带来更多的成本节约和效率,而这最终也将对终端消费者有利。透明度和欺诈保护带来的额外好处将改善客户的感受,更重要的是提高人们对银行和金融系统的信任。通过区块链及其与传统服务的整合,金融服务行业急需的革命将成为可能。 在本系列的下一部分中,我们将讨论[房地产中的区块链][3]。 + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/ + +作者:[ostechnix][a] +选题:[lujun9972][b] +译者:[sanfusu](https://github.com/sanfusu) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10668-1.html +[2]: https://linux.cn/article-10650-1.html +[3]: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ +[r1]: https://www.forbes.com/sites/bernardmarr/2018/01/22/35-amazing-real-world-examples-of-how-blockchain-is-changing-our-world/#170df8de43b5 +[r2]: https://publicpolicy.paypal-corp.com/issues/blockchain +[r3]: https://blog.coinbase.com/coinbase-adds-support-for-paypal-and-credit-cards-21968661d508 +[r4]: http://fortune.com/2018/06/06/ripple-codius/ +[r5]: https://www.finextra.com/newsarticle/32048/standard-chartered-to-extend-use-of-ripplenet-to-more-countries +[r6]: https://99bitcoins.com/fidor-and-kraken-team-up-for-cryptocurrency-bank/ +[r7]: https://www.bloomberg.com/research/stocks/private/snapshot.asp?privcapId=249292386 +[r8]: https://www.forbes.com/sites/julianmitchell/2018/07/31/wyre-the-blockchain-platform-taking-the-lead-in-cross-border-transactions/#6bc69ade69d7 +[r9]: https://www.jpmorgan.com/global/Quorum +[r10]: https://cointelegraph.com/news/barclays-files-two-digital-currency-and-blockchain-patents-with-u-s-patent-office +[r11]: https://www.pwc.com/jg/en/media-release/global-fintech-survey-2017.html diff --git a/published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md b/published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md new file mode 100644 index 0000000000..a8c449d838 --- /dev/null +++ b/published/201904/20190311 Learn about computer security with the Raspberry Pi and Kali Linux.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10690-1.html) +[#]: subject: (Learn about computer security with the Raspberry Pi and Kali Linux) +[#]: via: (https://opensource.com/article/19/3/computer-security-raspberry-pi) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva) + +树莓派使用入门:通过树莓派和 kali Linux 学习计算机安全 +====== + +> 树莓派是学习计算机安全的一个好方法。在我们这个系列的第十一篇文章中会进行学习。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_privacy_lock.png?itok=ZWjrpFzx) + +在技术方面是否有比保护你的计算机更热门的话题?一些专家会告诉你,没有绝对安全的系统。他们开玩笑说,如果你想要你的服务器或者应用程序真正的安全,就关掉你的服务器,从网络上断线,然后把它放在一个安全的地方。但问题是显而易见的:没人能用的应用程序或者服务器有什么用? + +这是围绕安全的一个难题,我们如何才能在保证安全性的同时,让服务器或应用程序依然可用且有价值?我无论如何都不是一个安全专家,虽然我希望有一天我能是。因此,分享可以用树莓派来做些什么以学习计算机安全的知识,我认为是有意义的。 + +我要提示一下,就像本系列中其他写给树莓派初学者的文章一样,我的目标不是深入研究,而是起个头,让你有兴趣去了解更多与这些主题相关的东西。 + +### Kali Linux + +当我们谈到“做一些安全方面的事”的时候,出现在脑海中的一个 Linux 发行版就是 [Kali Linux][1]。Kali Linux 的开发主要集中在调查取证和渗透测试方面。它有超过 600 个已经预先安装好了的用来测试你的计算机的安全性的[渗透测试工具][2],还有一个[取证模式][3],它可以避免自身接触到被检查系统的内部的硬盘驱动器或交换空间。 + +![](https://opensource.com/sites/default/files/uploads/raspberrypi_11_kali.png) + +就像 Raspbian 一样,Kali Linux 基于 Debian 的发行版,你可以在 Kali 的主要[文档门户][4]的网页上找到将它安装在树莓派上的文档。如果你已经在你的树莓派上安装了 Raspbian 或者是其它的 Linux 发行版。那么你装 Kali 应该是没问题的,Kali 的创造者甚至将[培训、研讨会和职业认证][5]整合到了一起,以此来帮助提升你在安全领域内的职业生涯。 + +### 其他的 Linux 发行版 + +大多数的标准 Linux 发行版,比如 Raspbian、Ubuntu 和 Fedora 这些,在它们的仓库里同样也有[很多可用的安全工具][6]。一些很棒的探测工具你可以试试,包括 [Nmap][7]、[Wireshark][8]、[auditctl][9],和 [SELinux][10]。 + +### 项目 + +你可以在树莓派上运行很多其他的安全相关的项目,例如[蜜罐][11],[广告拦截器][12]和 [USB 清洁器][13]。花些时间了解它们! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/computer-security-raspberry-pi + +作者:[Anderson Silva][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://www.kali.org/ +[2]: https://en.wikipedia.org/wiki/Kali_Linux#Development +[3]: https://docs.kali.org/general-use/kali-linux-forensics-mode +[4]: https://docs.kali.org/kali-on-arm/install-kali-linux-arm-raspberry-pi +[5]: https://www.kali.org/penetration-testing-with-kali-linux/ +[6]: https://linuxblog.darkduck.com/2019/02/9-best-linux-based-security-tools.html +[7]: https://nmap.org/ +[8]: https://www.wireshark.org/ +[9]: https://linux.die.net/man/8/auditctl +[10]: https://opensource.com/article/18/7/sysadmin-guide-selinux +[11]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ +[12]: https://pi-hole.net/ +[13]: https://www.circl.lu/projects/CIRCLean/ diff --git a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md b/published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md similarity index 69% rename from translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md rename to published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md index 74d8c6798d..a27ee216f8 100644 --- a/translated/tech/20190312 Do advanced math with Mathematica on the Raspberry Pi.md +++ b/published/201904/20190312 Do advanced math with Mathematica on the Raspberry Pi.md @@ -1,19 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10711-1.html) [#]: subject: (Do advanced math with Mathematica on the Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/do-math-raspberry-pi) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -在树莓派上使用 Mathematica 进行高级数学运算 +树莓派使用入门:在树莓派上使用 Mathematica 进行高级数学运算 ====== -Wolfram 将一个版本 Mathematica 捆绑到了 Raspbian 中。在我们关于树莓派入门系列的第 12 篇文章中学习如何使用它。 + +> Wolfram 在 Raspbian 中捆绑了一个版本的 Mathematica。在我们的树莓派入门系列的第 12 篇文章中将学习如何使用它。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/edu_math_formulas.png?itok=B59mYTG3) -在 90 年代中期,我进入了大学数学专业,即使我以计算机科学学位毕业,第二专业数学我已经上了足够的课程,但还有两门小课没有上。当时,我被介绍了 [Wolfram][2] 中一个名为[Mathematica][1] 的应用,我们可以将黑板上的许多代数和微分方程输入计算机。我每月花几个小时在实验室学习 Wolfram 语言并在 Mathematica 上解决积分等问题。 +在 90 年代中期,我进入了大学数学专业,虽然我是以计算机科学学位毕业的,但是我就差两门课程就拿到了双学位,包括数学专业的学位。当时,我接触到了 [Wolfram][2] 的一个名为 [Mathematica][1] 的应用,我们可以将黑板上的许多代数和微分方程输入计算机。我每月花几个小时在实验室学习 Wolfram 语言,并在 Mathematica 上解决积分等问题。 对于大学生来说 Mathematica 是闭源而且昂贵的,因此在差不多 20 年后,看到 Wolfram 将一个版本的 Mathematica 与 Raspbian 和 Raspberry Pi 捆绑在一起是一个惊喜。如果你决定使用另一个基于 Debian 的发行版,你可以从这里[下载][3]。请注意,此版本仅供非商业用途免费使用。 @@ -23,7 +24,7 @@ Wolfram 将一个版本 Mathematica 捆绑到了 Raspbian 中。在我们关于 要深入了解 Mathematica,请查看 [Wolfram 语言文档][5]。如果你只是想解决一些基本的微积分问题,请[查看它的函数][6]部分。如果你想[绘制一些 2D 和 3D 图形][7],请阅读链接的教程。 -或者,如果你想在做数学运算时坚持使用开源工具,请查看命令行工具 **expr**、**factor** 和 **bc**。(记住使用 [**man** 命令][8] 阅读使用帮助)如果想画图,[Gnuplot][9] 是个不错的选择。 +或者,如果你想在做数学运算时坚持使用开源工具,请查看命令行工具 `expr`、`factor` 和 `bc`。(记住使用 [man 命令][8] 阅读使用帮助)如果想画图,[Gnuplot][9] 是个不错的选择。 -------------------------------------------------------------------------------- @@ -32,7 +33,7 @@ via: https://opensource.com/article/19/3/do-math-raspberry-pi 作者:[Anderson Silva][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -46,4 +47,4 @@ via: https://opensource.com/article/19/3/do-math-raspberry-pi [6]: https://reference.wolfram.com/language/guide/Calculus.html [7]: https://reference.wolfram.com/language/howto/PlotAGraph.html [8]: https://opensource.com/article/19/3/learn-linux-raspberry-pi -[9]: http://gnuplot.info/ \ No newline at end of file +[9]: http://gnuplot.info/ diff --git a/published/201904/20190313 How to contribute to the Raspberry Pi community.md b/published/201904/20190313 How to contribute to the Raspberry Pi community.md new file mode 100644 index 0000000000..208cb7fc44 --- /dev/null +++ b/published/201904/20190313 How to contribute to the Raspberry Pi community.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10731-1.html) +[#]: subject: (How to contribute to the Raspberry Pi community) +[#]: via: (https://opensource.com/article/19/3/contribute-raspberry-pi-community) +[#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva/users/kepler22b/users/ansilva) + +树莓派使用入门:如何为树莓派社区做出贡献 +====== + +> 在我们的入门系列的第 13 篇文章中,发现参与树莓派社区的方法。 + +![][1] + +这个系列已经逐渐接近尾声,我已经写了很多它的乐趣,我大多希望它能帮助人们使用树莓派进行教育或娱乐。也许这些文章能说服你买你的第一个树莓派,或者让你重新发现抽屉里的吃灰设备。如果这里有真的,那么我认为这个系列就是成功的。 + +如果你想买一台,并宣传这块绿色的小板子有多么多功能,这里有几个方法帮你与树莓派社区建立连接: + + * 帮助改进[官方文档][2] +  * 贡献代码给依赖的[项目][3] +  * 用 Raspbian 报告 [bug][4] +  * 报告不同 ARM 架构分发版的的 bug +  * 看一眼英国国内的树莓派基金会的[代码俱乐部][5]或英国境外的[国际代码俱乐部][6],帮助孩子学习编码 +  * 帮助[翻译][7] +  * 在 [Raspberry Jam][8] 当志愿者 + +这些只是你可以为树莓派社区做贡献的几种方式。最后但同样重要的是,你可以加入我并[投稿文章][9]到你最喜欢的开源网站 [Opensource.com][10]。 :-) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/contribute-raspberry-pi-community + +作者:[Anderson Silva (Red Hat)][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/ansilva/users/kepler22b/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_community.jpg?itok=dcKwb5et +[2]: https://www.raspberrypi.org/documentation/CONTRIBUTING.md +[3]: https://www.raspberrypi.org/github/ +[4]: https://www.raspbian.org/RaspbianBugs +[5]: https://www.codeclub.org.uk/ +[6]: https://www.codeclubworld.org/ +[7]: https://www.raspberrypi.org/translate/ +[8]: https://www.raspberrypi.org/jam/ +[9]: https://opensource.com/participate +[10]: http://Opensource.com diff --git a/published/201904/20190314 14 days of celebrating the Raspberry Pi.md b/published/201904/20190314 14 days of celebrating the Raspberry Pi.md new file mode 100644 index 0000000000..697781da3e --- /dev/null +++ b/published/201904/20190314 14 days of celebrating the Raspberry Pi.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10734-1.html) +[#]: subject: (14 days of celebrating the Raspberry Pi) +[#]: via: (https://opensource.com/article/19/3/happy-pi-day) +[#]: author: (Anderson Silva (Red Hat) https://opensource.com/users/ansilva) + +树莓派使用入门:庆祝树莓派的 14 天 +====== + +> 在我们关于树莓派入门系列的第 14 篇也是最后一篇文章中,回顾一下我们学到的所有东西。 + +![][1] + +### 派节快乐! + +每年的 3 月 14 日,我们这些极客都会庆祝派节。我们用这种方式缩写日期: `MMDD`,3 月 14 于是写成 03/14,它的数字上提醒我们 3.14,或者说 [π][2] 的前三位数字。许多美国人没有意识到的是,世界上几乎没有其他国家使用这种[日期格式][3],因此派节几乎只适用于美国,尽管它在全球范围内得到了庆祝。 + +无论你身在何处,让我们一起庆祝树莓派,并通过回顾过去两周我们所涉及的主题来结束本系列: + +* 第 1 天:[你应该选择哪种树莓派?][4] +* 第 2 天:[如何购买树莓派][5] +* 第 3 天:[如何启动一个新的树莓派][6] +* 第 4 天:[用树莓派学习 Linux][7] +* 第 5 天:[教孩子们用树莓派学编程的 5 种方法][8] +* 第 6 天:[可以使用树莓派学习的 3 种流行编程语言][9] +* 第 7 天:[如何更新树莓派][10] +* 第 8 天:[如何使用树莓派来娱乐][11] +* 第 9 天:[树莓派上的模拟器和原生 Linux 游戏][12] +* 第 10 天:[进入物理世界 —— 如何使用树莓派的 GPIO 针脚][13] +* 第 11 天:[通过树莓派和 kali Linux 学习计算机安全][14] +* 第 12 天:[在树莓派上使用 Mathematica 进行高级数学运算][15] +* 第 13 天:[如何为树莓派社区做出贡献][16] + +![Pi Day illustration][18] + +我将结束本系列,感谢所有关注的人,尤其是那些在过去 14 天里从中学到了东西的人!我还想鼓励大家不断扩展他们对树莓派以及围绕它构建的所有开源(和闭源)技术的了解。 + +我还鼓励你了解其他文化、哲学、宗教和世界观。让我们成为人类的是这种惊人的 (有时是有趣的) 能力,我们不仅要适应外部环境,而且要适应智力环境。 + +不管你做什么,保持学习! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/happy-pi-day + +作者:[Anderson Silva (Red Hat)][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/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry-pi-juggle.png?itok=oTgGGSRA +[2]: https://www.piday.org/million/ +[3]: https://en.wikipedia.org/wiki/Date_format_by_country +[4]: https://linux.cn/article-10611-1.html +[5]: https://linux.cn/article-10615-1.html +[6]: https://linux.cn/article-10644-1.html +[7]: https://linux.cn/article-10645-1.html +[8]: https://linux.cn/article-10653-1.html +[9]: https://linux.cn/article-10661-1.html +[10]: https://linux.cn/article-10665-1.html +[11]: https://linux.cn/article-10669-1.html +[12]: https://linux.cn/article-10682-1.html +[13]: https://linux.cn/article-10687-1.html +[14]: https://linux.cn/article-10690-1.html +[15]: https://linux.cn/article-10711-1.html +[16]: https://linux.cn/article-10731-1.html +[17]: /file/426561 +[18]: https://opensource.com/sites/default/files/uploads/raspberrypi_14_piday.jpg (Pi Day illustration) diff --git a/published/201904/20190314 A Look Back at the History of Firefox.md b/published/201904/20190314 A Look Back at the History of Firefox.md new file mode 100644 index 0000000000..ac9341d9a0 --- /dev/null +++ b/published/201904/20190314 A Look Back at the History of Firefox.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (Moelf) +[#]: reviewer: (acyanbird, wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10714-1.html) +[#]: subject: (A Look Back at the History of Firefox) +[#]: via: (https://itsfoss.com/history-of-firefox) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +回顾 Firefox 历史 +====== + +从很久之前开始,火狐浏览器就一直是开源社区的一根顶梁柱。这些年来它几乎是所有 Linux 发行版的默认浏览器,并且曾是阻挡微软彻底争霸浏览器界的最后一块磐石。这款浏览器的起源可以一直回溯到互联网创生的时代。本周(LCTT 译注:此文发布于 2019.3.14)是互联网成立 30 周年的纪念日,趁这个机会回顾一下我们熟悉并爱戴的火狐浏览器实在是再好不过了。 + +### 发源 + +在上世纪 90 年代早期,一个叫 [Marc Andreessen][1] 的年轻人正在伊利诺伊大学攻读计算机科学学士学位。在那里,他开始为[国家超算应用中心(NCSA)][2]工作。就在这段时间内,[蒂姆·伯纳斯·李][3]Tim Berners-Lee 爵士发布了今天已经为我们所熟知的 Web 的早期标准。Marc 在那时候[了解][4]到了一款叫 [ViolaWWW][5] 的化石级浏览器。Marc 和 Eric Bina 看到了这种技术的潜力,他们开发了一个易于安装的基于 Unix 平台的浏览器,并取名 [NCSA Mosaic][6]。第一个 alpha 版本发布于 1993 年 6 月。到 9 月的时候,浏览器已经有 Windows 和 Macintosh 移植版本了。因为比当时其他任何浏览器软件都易于使用,Mosaic 很快变得相当流行。 + +1994 年,Marc 毕业并移居到加州。一个叫 Jim Clark 的人结识了他,Clark 那时候通过卖电脑软硬件赚了点钱。Clark 也用过 Mosaic 浏览器并且看到了互联网的经济前景。Clark 创立了一家公司并且雇了 Marc 和 Eric 专做互联网软件。公司一开始叫 “Mosaic 通讯”,但是伊利诺伊大学并不喜欢他们用 [Mosaic 这个名字][7]。所以公司转而改名为 “网景Netscape通讯”。 + +该公司的第一个项目是给任天堂 64 开发在线对战网络,然而不怎么成功。他们第一个以公司名义发布的产品是一款叫做 Mosaic Netscape 0.9 的浏览器,很快这款浏览器被改名叫 Netscape Navigator。在内部,浏览器的开发代号就是 mozilla,意即 “Mosaic 杀手”。一位员工还创作了一幅[哥斯拉风格的][8]卡通画。他们当时想在竞争中彻底胜出。 + +![Early Firefox Mascot][9] + +*早期 Mozilla 在 Netscape 的吉祥物* + +他们取得了辉煌的胜利。那时,Netscape 最大的优势是他们的浏览器在各种操作系统上体验极为一致。Netscape 将其宣传为给所有人平等的互联网体验。 + +随着越来越多的人使用 Netscape Navigator,NCSA Mosaic 的市场份额逐步下降。到了 1995 年,Netscape 公开上市了。[上市首日][10],股价从开盘的 $28,直窜到 $78,收盘于 $58。Netscape 那时所向披靡。 + +但好景不长。在 1994 年的夏天,微软发布了 Internet Explorer 1.0,这款浏览器基于 Spyglass Mosaic,而后者又直接基于 NCSA Mosaic。[浏览器战争][11] 就此展开。 + +在接下来的几年里,Netscape 和微软就浏览器霸主地位展开斗争。他们各自加入了很多新特性以取得优势。不幸的是,IE 有和 Windows 操作系统捆绑的巨大优势。更甚于此,微软也有更多的程序员和资本可以调动。在 1997 年年底,Netscape 公司开始遇到财务问题。 + +### 迈向开源 + +![Mozilla Firefox][12] + +1998 年 1 月,Netscape 开源了 Netscape Communicator 4.0 软件套装的代码。[旨在][13] “集合互联网成千上万的程序员的才智,把最好的功能加入 Netscape 的软件。这一策略旨在加速开发,并且让 Netscape 在未来能向个人和商业用户免费提供高质量的 Netscape Communicator 版本”。 + +这个项目由新创立的 Mozilla 机构管理。然而,Netscape Communicator 4.0 的代码由于大小和复杂程度而很难开发。雪上加霜的是,浏览器的一些组件由于第三方的许可证问题而不能被开源。到头来,他们决定用新兴的 [Gecko][14] 渲染引擎重新开发浏览器。 + +到了 1998 年的 11 月,Netscape 被美国在线(AOL)以[价值 42 亿美元的股权][15]收购。 + +从头来过是一项艰巨的任务。Mozilla Firefox(最初名为 Phoenix)直到 2002 年 6 月才面世,它同样可以运行在多种操作系统上:Linux、Mac OS、Windows 和 Solaris。 + +1999 年,AOL 宣布他们将停止浏览器开发。随后创建了 Mozilla 基金会,用于管理 Mozilla 的商标和项目相关的融资事宜。最早 Mozilla 基金会从 AOL、IBM、Sun Microsystems 和红帽(Red Hat)收到了总计 200 万美金的捐赠。 + +到了 2003 年 3 月,因为套件越来越臃肿,Mozilla [宣布][16] 计划把该套件分割成单独的应用。这个单独的浏览器一开始起名 Phoenix。但是由于和 BIOS 制造企业凤凰科技的商标官司,浏览器改名 Firebird(火鸟) —— 结果和火鸟数据库的开发者又起了冲突。浏览器只能再次被重命名,才有了现在家喻户晓的 Firefox(火狐)。 + +那时,[Mozilla 说][17],”我们在过去一年里学到了很多关于起名的技巧(不是因为我们愿意才学的)。我们现在很小心地研究了名字,确保不会再有什么夭蛾子了。我们已经开始向美国专利商标局注册我们新商标”。 + +![Mozilla Firefox 1.0][18] + +*Firefox 1.0 : [图片致谢][19]* + +第一个正式的 Firefox 版本是 [0.8][20],发布于 2004 年 2 月 8 日。紧接着 11 月 9 日他们发布了 1.0 版本。2.0 和 3.0 版本分别在 06 年 10 月 和 08 年 6 月问世。每个大版本更新都带来了很多新的特性和提升。从很多角度上讲,Firefox 都领先 IE 不少,无论是功能还是技术先进性,即便如此 IE 还是有更多用户。 + +一切都在 Google 发布 Chrome 浏览器的时候改变了。在 Chrome 发布(2008 年 9 月)的前几个月,Firefox 占有 30% 的[浏览器份额][21] 而 IE 有超过 60%。而在 StatCounter 的 [2019 年 1 月][22]报告里,Firefox 有不到 10% 的份额,而 Chrome 有超过 70%。 + +> 趣味知识点 + +> 和大家以为的不一样,火狐的 logo 其实没有狐狸。那其实是个 [小熊猫][23]Red Panda。在中文里,“火狐狸”是小熊猫的另一个名字。 + +### 展望未来 + +如上文所说的一样,Firefox 正在经历很长一段以来的份额低谷。曾经有那么一段时间,有很多浏览器都基于 Firefox 开发,比如早期的 [Flock 浏览器][24]。而现在大多数浏览器都基于谷歌的技术了,比如 Opera 和 Vivaldi。甚至连微软都放弃开发自己的浏览器而转而[加入 Chromium 帮派][25]。 + +这也许看起来和 Netscape 当年的辉煌形成鲜明的对比。但让我们不要忘记 Firefox 已经有的许多成就。一群来自世界各地的程序员,就这么开发出了这个星球上第二大份额的浏览器。他们在微软垄断如日中天的时候还占据这 30% 的份额,他们可以再次做到这一点。无论如何,他们都有我们。开源社区坚定地站在他们身后。 + +抗争垄断是我使用 Firefox [的众多原因之一][26]。随着 Mozilla 在改头换面的 [Firefox Quantum][27] 上赢回了一些份额,我相信它将一路向上攀爬。 + +你还想了解 Linux 和开源历史上的什么其他事件?欢迎在评论区告诉我们。 + +如果你觉得这篇文章不错,请在社交媒体上分享!比如 Hacker News 或者 [Reddit][28]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/history-of-firefox + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[Moelf](https://github.com/Moelf) +校对:[acyanbird](https://github.com/acyanbird), [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://en.wikipedia.org/wiki/Marc_Andreessen +[2]: https://en.wikipedia.org/wiki/National_Center_for_Supercomputing_Applications +[3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee +[4]: https://www.w3.org/DesignIssues/TimBook-old/History.html +[5]: http://viola.org/ +[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser) +[7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ +[8]: http://www.davetitus.com/mozilla/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 +[10]: https://www.marketwatch.com/story/netscape-ipo-ignited-the-boom-taught-some-hard-lessons-20058518550 +[11]: https://en.wikipedia.org/wiki/Browser_wars +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?resize=800%2C450&ssl=1 +[13]: https://web.archive.org/web/20021001071727/wp.netscape.com/newsref/pr/newsrelease558.html +[14]: https://en.wikipedia.org/wiki/Gecko_(software) +[15]: http://news.cnet.com/2100-1023-218360.html +[16]: https://web.archive.org/web/20050618000315/http://www.mozilla.org/roadmap/roadmap-02-Apr-2003.html +[17]: https://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/firefox-1.jpg?ssl=1 +[19]: https://www.iceni.com/blog/firefox-1-0-introduced-2004/ +[20]: https://en.wikipedia.org/wiki/Firefox_version_history +[21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers +[22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar +[23]: https://en.wikipedia.org/wiki/Red_panda +[24]: https://en.wikipedia.org/wiki/Flock_(web_browser) +[25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 +[26]: https://itsfoss.com/why-firefox/ +[27]: https://itsfoss.com/firefox-quantum-ubuntu/ +[28]: http://reddit.com/r/linuxusersgroup +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?fit=800%2C450&ssl=1 diff --git a/published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md new file mode 100644 index 0000000000..55f899a321 --- /dev/null +++ b/published/201904/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10732-1.html) +[#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) +[#]: via: (https://opensource.com/article/19/3/tool-find-home) +[#]: author: (Jeff Macharyas (Community Moderator) ) + +Sweet Home 3D:一个帮助你寻找梦想家庭的开源工具 +====== + +> 室内设计应用可以轻松渲染你喜欢的房子,不管是真实的或是想象的。 + +![Houses in a row][1] + +我最近接受了一份在弗吉尼亚州的新工作。由于我妻子一直在纽约工作,看着我们在纽约的房子直至出售,我有责任出去为我们和我们的猫找一所新房子。在我们搬进去之前她看不到新房子。 + +我和一个房地产经纪人签约,并看了几间房子,拍了许多照片,写下了潦草的笔记。晚上,我会将照片上传到 Google Drive 文件夹中,我和我老婆会通过手机同时查看这些照片,同时我还要记住房间是在右边还是左边,是否有风扇等。 + +由于这是一个相当繁琐且不太准确的展示我的发现的方式,我因此去寻找一个开源解决方案,以更好地展示我们未来的梦想之家将会是什么样的,而不会取决于我的模糊记忆和模糊的照片。 + +[Sweet Home 3D][2] 完全满足了我的要求。Sweet Home 3D 可在 Sourceforge 上获取,并在 GNU 通用公共许可证下发布。它的[网站][3]信息非常丰富,我能够立即启动并运行。Sweet Home 3D 由总部位于巴黎的 eTeks 的 Emmanuel Puybaret 开发。 + +### 绘制内墙 + +我将 Sweet Home 3D 下载到我的 MacBook Pro 上,并添加了 PNG 版本的平面楼层图,用作背景底图。 + +在此处,使用 Rooms 面板跟踪图案并设置“真实房间”尺寸是一件简单的事情。在我绘制房间后,我添加了墙壁,我可以定制颜色、厚度、高度等。 + +![Sweet Home 3D floorplan][5] + +现在我画完了“内墙”,我从网站下载了各种“家具”,其中包括实际的家具以及门、窗、架子等。每个项目都以 ZIP 文件的形式下载,因此我创建了一个包含所有未压缩文件的文件夹。我可以自定义每件家具和重复的物品比如门,可以方便地复制粘贴到指定的地方。 + +在我将所有墙壁和门窗都布置完后,我就使用这个应用的 3D 视图浏览房屋。根据照片和记忆,我对所有物体进行了调整,直到接近房屋的样子。我可以花更多时间添加纹理,附属家具和物品,但这已经达到了我需要的程度。 + +![Sweet Home 3D floorplan][7] + +完成之后,我将该项目导出为 OBJ 文件,它可在各种程序中打开,例如 [Blender][8] 和 Mac 上的“预览”中,方便旋转房屋并从各个角度查看。视频功能最有用,我可以创建一个起点,然后在房子中绘制一条路径,并记录“旅程”。我将视频导出为 MOV 文件,并使用 QuickTime 在 Mac 上打开和查看。 + +我的妻子能够(几乎)能看到所有我看到的,我们甚至可以开始在搬家前布置家具。现在,我所要做的就是把行李装上卡车搬到新家。 + +Sweet Home 3D 在我的新工作中也是有用的。我正在寻找一种方法来改善学院建筑的地图,并计划在 [Inkscape][9] 或 Illustrator 或其他软件中重新绘制它。但是,由于我有平面地图,我可以使用 Sweet Home 3D 创建平面图的 3D 版本并将其上传到我们的网站以便更方便地找到地方。 + +### 开源犯罪现场? + +一件有趣的事:根据 [Sweet Home 3D 的博客][10],“法国法医办公室(科学警察)最近选择 Sweet Home 3D 作为设计规划表示路线和犯罪现场的工具。这是法国政府建议优先考虑自由开源解决方案的具体应用。“ + +这是公民和政府如何利用开源解决方案创建个人项目、解决犯罪和建立世界的又一点证据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/tool-find-home + +作者:[Jeff Macharyas (Community Moderator)][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) +[2]: https://sourceforge.net/projects/sweethome3d/ +[3]: http://www.sweethome3d.com/ +[4]: /file/426441 +[5]: https://opensource.com/sites/default/files/uploads/virginia-house-create-screenshot.png (Sweet Home 3D floorplan) +[6]: /file/426451 +[7]: https://opensource.com/sites/default/files/uploads/virginia-house-3d-screenshot.png (Sweet Home 3D floorplan) +[8]: https://opensource.com/article/18/5/blender-hotkey-cheat-sheet +[9]: https://opensource.com/article/19/1/inkscape-cheat-sheet +[10]: http://www.sweethome3d.com/blog/2018/12/10/customization_for_the_forensic_police.html diff --git a/published/201904/20190317 How To Configure sudo Access In Linux.md b/published/201904/20190317 How To Configure sudo Access In Linux.md new file mode 100644 index 0000000000..efbd663b44 --- /dev/null +++ b/published/201904/20190317 How To Configure sudo Access In Linux.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10746-1.html) +[#]: subject: (How To Configure sudo Access In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 中配置 sudo 访问权限 +====== + +Linux 系统中 root 用户拥有 Linux 中全部控制权力。Linux 系统中 root 是拥有最高权力的用户,可以在系统中实施任意的行为。 + +如果其他用户想去实施一些行为,不能为所有人都提供 root 访问权限。因为如果他或她做了一些错误的操作,没有办法去纠正它。 + +为了解决这个问题,有什么方案吗? + +我们可以把 sudo 权限发放给相应的用户来克服这种情况。 + +`sudo` 命令提供了一种机制,它可以在不用分享 root 用户的密码的前提下,为信任的用户提供系统的管理权限。 + +他们可以执行大部分的管理操作,但又不像 root 一样有全部的权限。 + +### 什么是 sudo? + +`sudo` 是一个程序,普通用户可以使用它以超级用户或其他用户的身份执行命令,是由安全策略指定的。 + +sudo 用户的访问权限是由 `/etc/sudoers` 文件控制的。 + +### sudo 用户有什么优点? + +在 Linux 系统中,如果你不熟悉一个命令,`sudo` 是运行它的一个安全方式。 + +* Linux 系统在 `/var/log/secure` 和 `/var/log/auth.log` 文件中保留日志,并且你可以验证 sudo 用户实施了哪些行为操作。 +* 每一次它都为当前的操作提示输入密码。所以,你将会有时间去验证这个操作是不是你想要执行的。如果你发觉它是不正确的行为,你可以安全地退出而且没有执行此操作。 + +基于 RHEL 的系统(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL))和基于 Debian 的系统(如 Debian、Ubuntu 和 LinuxMint)在这点是不一样的。 + +我们将会教你如何在本文中提及的两种发行版中执行该操作。 + +这里有三种方法可以应用于两个发行版本。 + +* 增加用户到相应的组。基于 RHEL 的系统,我们需要添加用户到 `wheel` 组。基于 Debain 的系统,我们添加用户到 `sudo` 或 `admin` 组。 +* 手动添加用户到 `/etc/group` 文件中。 +* 用 `visudo` 命令添加用户到 `/etc/sudoers` 文件中。 + +### 如何在 RHEL/CentOS/OEL 系统中配置 sudo 访问权限? + +在基于 RHEL 的系统中(如 Redhat (RHEL)、 CentOS 和 Oracle Enterprise Linux (OEL)),使用下面的三个方法就可以做到。 + +#### 方法 1:在 Linux 中如何使用 wheel 组为普通用户授予超级用户访问权限? + +wheel 是基于 RHEL 的系统中的一个特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 + +注意,应该在 `/etc/sudoers` 文件中激活 `wheel` 组来获得该访问权限。 + +``` +# grep -i wheel /etc/sudoers + +## Allows people in group wheel to run all commands +%wheel ALL=(ALL) ALL +# %wheel ALL=(ALL) NOPASSWD: ALL +``` + +假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `daygeek` 这个用户账号。 + +执行下面的命令,添加用户到 `wheel` 组。 + +``` +# usermod -aG wheel daygeek +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group wheel +wheel:x:10:daygeek +``` + +我将要检测用户 `daygeek` 是否可以访问属于 root 用户的文件。 + +``` +$ tail -5 /var/log/secure +tail: cannot open /var/log/secure for reading: Permission denied +``` + +当我试图以普通用户身份访问 `/var/log/secure` 文件时出现错误。 我将使用 `sudo` 访问同一个文件,让我们看看这个魔术。 + +``` +$ sudo tail -5 /var/log/secure +[sudo] password for daygeek: +Mar 17 07:01:56 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure +Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) +Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure +Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) +``` + +#### 方法 2:在 RHEL/CentOS/OEL 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? + +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `wheel` 组。 + +只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 + +``` +$ grep -i wheel /etc/group +wheel:x:10:daygeek,user1 +``` + +在该例中,我将使用 `user1` 这个用户账号。 + +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user1` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart httpd +[sudo] password for user1: + +$ sudo grep -i user1 /var/log/secure +[sudo] password for user1: +Mar 17 07:09:47 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd +Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd +Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure +``` + +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? + +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中 的 `wheel` 组下即可。 + +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 + +``` +# grep -i user2 /etc/sudoers +user2 ALL=(ALL) ALL +``` + +在该例中,我将使用 `user2` 这个用户账号。 + +我将要通过在系统中重启 MariaDB 服务来检查用户 `user2` 是不是拥有 sudo 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart mariadb +[sudo] password for user2: + +$ sudo grep -i mariadb /var/log/secure +[sudo] password for user2: +Mar 17 07:23:10 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart mariadb +Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/grep -i mariadb /var/log/secure +``` + +### 在 Debian/Ubuntu 系统中如何配置 sudo 访问权限? + +在基于 Debian 的系统中(如 Debian、Ubuntu 和 LinuxMint),使用下面的三个方法就可以做到。 + +#### 方法 1:在 Linux 中如何使用 sudo 或 admin 组为普通用户授予超级用户访问权限? + +`sudo` 或 `admin` 是基于 Debian 的系统中的特殊组,它提供额外的权限,可以授权用户像超级用户一样执行受到限制的命令。 + +注意,应该在 `/etc/sudoers` 文件中激活 `sudo` 或 `admin` 组来获得该访问权限。 + +``` +# grep -i 'sudo\|admin' /etc/sudoers + +# Members of the admin group may gain root privileges +%admin ALL=(ALL) ALL + +# Allow members of group sudo to execute any command +%sudo ALL=(ALL:ALL) ALL +``` + +假设我们已经创建了一个用户账号来执行这些操作。在此,我将会使用 `2gadmin` 这个用户账号。 + +执行下面的命令,添加用户到 `sudo` 组。 + +``` +# usermod -aG sudo 2gadmin +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group sudo +sudo:x:27:2gadmin +``` + +我将要检测用户 `2gadmin` 是否可以访问属于 root 用户的文件。 + +``` +$ less /var/log/auth.log +/var/log/auth.log: Permission denied +``` + +当我试图以普通用户身份访问 `/var/log/auth.log` 文件时出现错误。 我将要使用 `sudo` 访问同一个文件,让我们看看这个魔术。 + +``` +$ sudo tail -5 /var/log/auth.log +[sudo] password for 2gadmin: +Mar 17 20:39:47 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/bin/bash +Mar 17 20:39:47 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) +Mar 17 20:40:23 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 20:40:48 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/usr/bin/tail -5 /var/log/auth.log +Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) +``` + +或者,我们可以通过添加用户到 `admin` 组来执行相同的操作。 + +运行下面的命令,添加用户到 `admin` 组。 + +``` +# usermod -aG admin user1 +``` + +我们可以通过下面的命令来确定这一点。 + +``` +# getent group admin +admin:x:1011:user1 +``` + +让我们看看输出信息。 + +``` +$ sudo tail -2 /var/log/auth.log +[sudo] password for user1: +Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/usr/bin/tail -2 /var/log/auth.log +Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) +``` + +#### 方法 2:在 Debian/Ubuntu 中如何使用 /etc/group 文件为普通用户授予超级用户访问权限? + +我们可以通过编辑 `/etc/group` 文件来手动地添加用户到 `sudo` 组或 `admin` 组。 + +只需打开该文件,并在恰当的组后追加相应的用户就可完成这一点。 + +``` +$ grep -i sudo /etc/group +sudo:x:27:2gadmin,user2 +``` + +在该例中,我将使用 `user2` 这个用户账号。 + +我将要通过在系统中重启 Apache httpd 服务来检查用户 `user2` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart apache2 +[sudo] password for user2: + +$ sudo tail -f /var/log/auth.log +[sudo] password for user2: +Mar 17 21:01:04 Ubuntu18 systemd-logind[559]: New session 22 of user user2. +Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened for user user2 by (uid=0) +Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 +``` + +#### 方法 3:在 Linux 中如何使用 /etc/sudoers 文件为普通用户授予超级用户访问权限? + +sudo 用户的访问权限是被 `/etc/sudoers` 文件控制的。因此,只需将用户添加到 `sudoers` 文件中的 `sudo` 或 `admin` 组下即可。 + +只需通过 `visudo` 命令将期望的用户追加到 `/etc/sudoers` 文件中。 + +``` +# grep -i user3 /etc/sudoers +user3 ALL=(ALL:ALL) ALL +``` + +在该例中,我将使用 `user3` 这个用户账号。 + +我将要通过在系统中重启 MariaDB 服务来检查用户 `user3` 是不是拥有 `sudo` 访问权限。让我们看看这个魔术。 + +``` +$ sudo systemctl restart mariadb +[sudo] password for user3: + +$ sudo tail -f /var/log/auth.log +[sudo] password for user3: +Mar 17 21:12:32 Ubuntu18 systemd-logind[559]: New session 24 of user user3. +Mar 17 21:12:49 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/bin/systemctl restart mariadb +Mar 17 21:12:49 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) +Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root +Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log +Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 diff --git a/published/20190318 10 Python image manipulation tools.md b/published/201904/20190318 10 Python image manipulation tools.md similarity index 100% rename from published/20190318 10 Python image manipulation tools.md rename to published/201904/20190318 10 Python image manipulation tools.md diff --git a/published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md b/published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md similarity index 100% rename from published/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md rename to published/201904/20190318 3 Ways To Check Whether A Port Is Open On The Remote Linux System.md diff --git a/sources/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md b/published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md similarity index 52% rename from sources/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md rename to published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md index cdb6115bc3..6136d80dd4 100644 --- a/sources/tech/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md +++ b/published/201904/20190320 Quickly Go Back To A Specific Parent Directory Using bd Command In Linux.md @@ -1,93 +1,91 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10695-1.html) [#]: subject: (Quickly Go Back To A Specific Parent Directory Using bd Command In Linux) [#]: via: (https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory-in-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Quickly Go Back To A Specific Parent Directory Using bd Command In Linux +在 Linux 中使用 bd 命令快速返回到特定的父目录 ====== -Two days back we had written an article about autocd. It’s a builtin shell variable that helps us to **[navigate to inside a directory without cd command][1]**. +两天前我们写了一篇关于 `autocd` 的文章,它是一个内置的 shell 变量,可以帮助我们在[没有 cd 命令的情况下导航到目录中][1]。 -If you want to come back to previous directory then you have to type `cd ..`. +如果你想回到上一级目录,那么你需要输入 `cd ..`。 -If you want to go back to two directories then you have to type `cd ../..`. +如果你想回到上两级目录,那么你需要输入 `cd ../..`。 -It’s normal in Linux but if you want to come back from 9th directory to 3rd directory, then it’s horrible to use cd command. +这在 Linux 中是正常的,但如果你想从第九级目录回到第三级目录,那么使用 `cd` 命令是很糟糕的。 -What will be the solution for this. +有什么解决方案呢? -Yes, we have a solution in Linux for everything. We can go with bd command, to make easy this kind of situation. +是的,在 Linux 中有一个解决方案。我们可以使用 `bd` 命令来轻松应对这种情况。 -### What Is bd Command? +### 什么是 bd 命令? -bd command allow users to quickly go back to a parent directory in Linux instead of typing `cd ../../..` repeatedly. +`bd` 命令允许用户快速返回 Linux 中的父目录,而不是反复输入 `cd ../../..`。 -You can list the contents of a given directory without mentioning the full path `ls `bd Directory_Name``. It supports following other commands such as ls, ln, echo, zip, tar etc.. +你可以列出给定目录的内容,而不用提供完整路径 ls `bd Directory_Name`。它支持以下其它命令,如 `ls`、`ln`、`echo`、`zip`、`tar` 等。 -Also, it allow us to execute a shell file without mentioning the full path `bd p`/shell_file.sh`. +另外,它还允许我们执行 shell 文件而不用提供完整路径 bd p`/shell_file.sh`。 -### How To Install bd Command in Linux? +### 如何在 Linux 中安装 bd 命令? -There is no official distribution package for bd except Debian/Ubuntu. Hence, we need to perform manual method. +除了 Debian/Ubuntu 之外,`bd` 没有官方发行包。因此,我们需要手动执行方法。 -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][2]** or **[APT Command][3]** to install bd. +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][2]或[APT 命令][3]来安装 `bd`。 ``` $ sudo apt install bd ``` -For other Linux distributions. - -Download the bd executable binary file using **[wget command][4]**. +对于其它 Linux 发行版,使用 [wget 命令][4]下载 `bd` 可执行二进制文件。 ``` $ sudo wget --no-check-certificate -O /usr/local/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd ``` -Set executable permission to the bd binary file. +设置 `bd` 二进制文件的可执行权限。 ``` $ sudo chmod +rx /usr/local/bin/bd ``` -Append the below values in the `.bashrc` file. +在 `.bashrc` 文件中添加以下值。 ``` $ echo 'alias bd=". bd -si"' >> ~/.bashrc ``` -Run the following command to make the changes to take effect. +运行以下命令以使更改生效。 ``` $ source ~/.bashrc ``` -To enable auto completion, perform the following two steps. +要启用自动完成,执行以下两个步骤。 ``` $ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd $ sudo source /etc/bash_completion.d/bd ``` -We have successfully installed and configured the bd utility on the system. It’s time to test it. +我们已经在系统上成功安装并配置了 `bd` 实用程序,现在是时候测试一下了。 -I’m going to take the below directory path for this testing. +我将使用下面的目录路径进行测试。 -Run the `pwd` command or `dirs` command or `tree` command to know your current location. +运行 `pwd` 命令或 `dirs` 命令,亦或是 `tree` 命令来了解你当前的路径。 ``` daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ pwd -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ dirs /usr/share/icons/Adwaita/256x256/apps ``` -I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go to `icons` directory quickly then simple type the following command. +我现在在 `/usr/share/icons/Adwaita/256x256/apps` 目录,如果我想快速跳转到 `icons` 目录,那么只需输入以下命令即可。 ``` daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ bd icons @@ -95,7 +93,7 @@ daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ bd icons daygeek@Ubuntu18:/usr/share/icons$ ``` -Even, you no need to type full directory name instead you can type few letters. +甚至,你不需要输入完整的目录名称,也可以输入几个字母。 ``` daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ bd i @@ -103,13 +101,13 @@ daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ bd i daygeek@Ubuntu18:/usr/share/icons$ ``` -`Note:` If there are more than one directories with same name up in the hierarchy, bd will take you to the closest. (Not considering the immediate parent.) +注意:如果层次结构中有多个同名的目录,`bd` 会将你带到最近的目录。(不考虑直接的父目录) -If you would like to list a given directory contents then the following format. It prints the contents of `/usr/share/icons/`. +如果要列出给定的目录内容,使用以下格式。它会打印出 `/usr/share/icons/` 的内容。 ``` $ ls -lh `bd icons` -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ ls -lh `bd i` total 64K drwxr-xr-x 12 root root 4.0K Jul 25 2018 Adwaita @@ -131,11 +129,11 @@ drwxr-xr-x 10 root root 4.0K Feb 25 15:46 ubuntu-mono-light drwxr-xr-x 3 root root 4.0K Jul 25 2018 whiteglass ``` -If you want to execute a file somewhere in a parent directory then use the following format. It will run the following shell file `/usr/share/icons/users-list.sh`. +如果要在父目录中的某个位置执行文件,使用以下格式。它将运行 shell 文件 `/usr/share/icons/users-list.sh`。 ``` $ `bd i`/users-list.sh -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ `bd icon`/users-list.sh daygeek thanu @@ -150,16 +148,16 @@ user2 user3 ``` -If you reside in `/usr/share/icons/Adwaita/256x256/apps` and would you like to navigate to different parent directory then use the following format. The below command will navigate to `/usr/share/icons/gnome` directory. +如果你位于 `/usr/share/icons/Adwaita/256x256/apps` 中,想要导航到不同的父目录,使用以下格式。以下命令将导航到 `/usr/share/icons/gnome` 目录。 ``` $ cd `bd i`/gnome -or +或 daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ cd `bd icon`/gnome daygeek@Ubuntu18:/usr/share/icons/gnome$ ``` -If you reside in `/usr/share/icons/Adwaita/256x256/apps` and would you like to create a new directory under `/usr/share/icons/` then use the following format. +如果你位于 `/usr/share/icons/Adwaita/256x256/apps` ,你想在 `/usr/share/icons/` 下创建一个新目录,使用以下格式。 ``` $ daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ sudo mkdir `bd icons`/2g @@ -168,9 +166,9 @@ daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ ls -ld `bd icon`/2g drwxr-xr-x 2 root root 4096 Mar 16 05:44 /usr/share/icons//2g ``` -This tutorial allows you to quickly go back to a specific parent directory but there is no option to move forward quickly. +本教程允许你快速返回到特定的父目录,但没有快速前进的选项。 -We have another solution for this, will come up with new solution shortly. Please stay tune with us. +我们有另一个解决方案,很快就会提出,请保持关注。 -------------------------------------------------------------------------------- @@ -179,7 +177,7 @@ via: https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md b/published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md new file mode 100644 index 0000000000..073cd7b1b3 --- /dev/null +++ b/published/201904/20190321 How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command.md @@ -0,0 +1,183 @@ +[#]: collector: "lujun9972" +[#]: translator: "zero-MK" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10766-1.html" +[#]: subject: "How To Check If A Port Is Open On Multiple Remote Linux System Using Shell Script With nc Command?" +[#]: via: "https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" + + +如何检查多个远程 Linux 系统是否打开了指定端口? +====== + +我们最近写了一篇文章关于如何检查远程 Linux 服务器是否打开指定端口。它能帮助你检查单个服务器。 + +如果要检查五个服务器有没有问题,可以使用以下任何一个命令,如 `nc`(netcat)、`nmap` 和 `telnet`。但是如果想检查 50 多台服务器,那么你的解决方案是什么? + +要检查所有服务器并不容易,如果你一个一个这样做,完全没有必要,因为这样你将会浪费大量的时间。为了解决这种情况,我使用 `nc` 命令编写了一个 shell 小脚本,它将允许我们扫描任意数量服务器给定的端口。 + +如果你要查找单个服务器扫描,你有多个选择,你只需阅读 [检查远程 Linux 系统上的端口是否打开?][1] 了解更多信息。 + +本教程中提供了两个脚本,这两个脚本都很有用。这两个脚本都用于不同的目的,你可以通过阅读标题轻松理解其用途。 + +在你阅读这篇文章之前,我会问你几个问题,如果你不知道答案你可以通过阅读这篇文章来获得答案。 + +如何检查一个远程 Linux 服务器上指定的端口是否打开? + +如何检查多个远程 Linux 服务器上指定的端口是否打开? + +如何检查多个远程 Linux 服务器上是否打开了多个指定的端口? + +### 什么是 nc(netcat)命令? + +`nc` 即 netcat。它是一个简单实用的 Unix 程序,它使用 TCP 或 UDP 协议进行跨网络连接进行数据读取和写入。 + +它被设计成一个可靠的 “后端” 工具,我们可以直接使用或由其他程序和脚本轻松驱动它。 + +同时,它也是一个功能丰富的网络调试和探索工具,因为它可以创建你需要的几乎任何类型的连接,并具有几个有趣的内置功能。 + +netcat 有三个主要的模式。分别是连接模式,监听模式和隧道模式。 + +`nc`(netcat)的通用语法: + +``` +$ nc [-options] [HostName or IP] [PortNumber] +``` + +### 如何检查多个远程 Linux 服务器上的端口是否打开? + +如果要检查多个远程 Linux 服务器上给定端口是否打开,请使用以下 shell 脚本。 + +在我的例子中,我们将检查端口 22 是否在以下远程服务器中打开,确保你已经更新文件中的服务器列表而不是使用我的服务器列表。 + +你必须确保已经更新服务器列表 :`server-list.txt` 。每个服务器(IP)应该在单独的行中。 + +``` +# cat server-list.txt +192.168.1.2 +192.168.1.3 +192.168.1.4 +192.168.1.5 +192.168.1.6 +192.168.1.7 +``` + +使用以下脚本可以达到此目的。 + +``` +# vi port_scan.sh + +#!/bin/sh +for server in `more server-list.txt` +do + #echo $i + nc -zvw3 $server 22 +done +``` + +设置 `port_scan.sh` 文件的可执行权限。 + +``` +$ chmod +x port_scan.sh +``` + +最后运行脚本来达到此目的。 + +``` +# sh port_scan.sh + +Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! +``` + +### 如何检查多个远程 Linux 服务器上是否打开多个端口? + +如果要检查多个服务器中的多个端口,请使用下面的脚本。 + +在我的例子中,我们将检查给定服务器的 22 和 80 端口是否打开。确保你必须替换所需的端口和服务器名称而不使用是我的。 + +你必须确保已经将要检查的端口写入 `port-list.txt` 文件中。每个端口应该在一个单独的行中。 + +``` +# cat port-list.txt +22 +80 +``` + +你必须确保已经将要检查的服务器(IP 地址)写入 `server-list.txt` 到文件中。每个服务器(IP) 应该在单独的行中。 + +``` +# cat server-list.txt +192.168.1.2 +192.168.1.3 +192.168.1.4 +192.168.1.5 +192.168.1.6 +192.168.1.7 +``` + +使用以下脚本来达成此目的。 + +``` +# vi multiple_port_scan.sh + +#!/bin/sh +for server in `more server-list.txt` +do + for port in `more port-list.txt` + do + #echo $server + nc -zvw3 $server $port + echo "" + done +done +``` + +设置 `multiple_port_scan.sh` 文件的可执行权限。 + +``` +$ chmod +x multiple_port_scan.sh +``` + +最后运行脚本来实现这一目的。 + +``` +# sh multiple_port_scan.sh +Connection to 192.168.1.2 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.2 80 port [tcp/http] succeeded! + +Connection to 192.168.1.3 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.3 80 port [tcp/http] succeeded! + +Connection to 192.168.1.4 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.4 80 port [tcp/http] succeeded! + +Connection to 192.168.1.5 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.5 80 port [tcp/http] succeeded! + +Connection to 192.168.1.6 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.6 80 port [tcp/http] succeeded! + +Connection to 192.168.1.7 22 port [tcp/ssh] succeeded! +Connection to 192.168.1.7 80 port [tcp/http] succeeded! +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[zero-MK](https://github.com/zero-mk) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10675-1.html diff --git a/published/201904/20190325 Getting started with Vim- The basics.md b/published/201904/20190325 Getting started with Vim- The basics.md new file mode 100644 index 0000000000..bcdc0ffe20 --- /dev/null +++ b/published/201904/20190325 Getting started with Vim- The basics.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10752-1.html) +[#]: subject: (Getting started with Vim: The basics) +[#]: via: (https://opensource.com/article/19/3/getting-started-vim) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +Vim 入门:基础 +====== + +> 为工作或者新项目学习足够的 Vim 知识。 + +![Person standing in front of a giant computer screen with numbers, data][1] + +我还清晰地记得我第一次接触 Vim 的时候。那时我还是一名大学生,计算机学院的机房里都装着 Ubuntu 系统。尽管我在上大学前也曾接触过不同的 Linux 发行版(比如 RHEL —— Red Hat 在百思买出售它的 CD),但这却是我第一次要在日常中频繁使用 Linux 系统,因为我的课程要求我这样做。当我开始使用 Linux 时,正如我的前辈和将来的后继者们一样,我感觉自己像是一名“真正的程序员”了。 + +![Real Programmers comic][2] + +*真正的程序员,来自 [xkcd][3]* + +学生们可以使用像 [Kate][4] 一样的图形文本编辑器,这也安装在学校的电脑上了。对于那些可以使用 shell 但不习惯使用控制台编辑器的学生,最流行的选择是 [Nano][5],它提供了很好的交互式菜单和类似于 Windows 图形文本编辑器的体验。 + +我有时会用 Nano,但当我听说 [Vi/Vim][6] 和 [Emacs][7] 能做一些很棒的事情时我决定试一试它们(主要是因为它们看起来很酷,而且我也很好奇它们有什么特别之处)。第一次使用 Vim 时吓到我了 —— 我不想搞砸任何事情!但是,一旦我掌握了它的诀窍,事情就变得容易得多,我就可以欣赏这个编辑器的强大功能了。至于 Emacs,呃,我有点放弃了,但我很高兴我坚持和 Vim 在一起。 + +在本文中,我将介绍一下 Vim(基于我的个人经验),这样你就可以在 Linux 系统上用它来作为编辑器使用了。这篇文章不会让你变成 Vim 的专家,甚至不会触及 Vim 许多强大功能的皮毛。但是起点总是很重要的,我想让开始的经历尽可能简单,剩下的则由你自己去探索。 + +### 第 0 步:打开一个控制台窗口 + +在使用 Vim 前,你需要做一些准备工作。在 Linux 操作系统打开控制台终端。(因为 Vim 也可以在 MacOS 上使用,Mac 用户也可以使用这些说明)。 + +打开终端窗口后,输入 `ls` 命令列出当前目录下的内容。然后,输入 `mkdir Tutorial` 命令创建一个名为 `Tutorial` 的新目录。通过输入 `cd Tutorial` 来进入该目录。 + +![Create a folder][8] + +这就是全部的准备工作。现在是时候转到有趣的部分了——开始使用 Vim。 + +### 第 1 步:创建一个 Vim 文件和不保存退出 + +还记得我一开始说过我不敢使用 Vim 吗?我当时在害怕“如果我改变了一个现有的文件,把事情搞砸了怎么办?”毕竟,一些计算机科学作业要求我修改现有的文件。我想知道:_如何在不保存更改的情况下打开和关闭文件?_ + +好消息是你可以使用相同的命令在 Vim 中创建或打开文件:`vim `,其中 `` 表示要创建或修改的目标文件名。让我们通过输入 `vim HelloWorld.java` 来创建一个名为 `HelloWorld.java` 的文件。 + +你好,Vim!现在,讲一下 Vim 中一个非常重要的概念,可能也是最需要记住的:Vim 有多种模式,下面是 Vim 基础中需要知道的的三种: + +模式 | 描述 +---|--- +正常模式 | 默认模式,用于导航和简单编辑 +插入模式 | 用于直接插入和修改文本 +命令行模式 | 用于执行如保存,退出等命令 + +Vim 也有其他模式,例如可视模式、选择模式和命令模式。不过上面的三种模式对我们来说已经足够用了。 + +你现在正处于正常模式,如果有文本,你可以用箭头键移动或使用其他导航键(将在稍后看到)。要确定你正处于正常模式,只需按下 `esc` (Escape)键即可。 + +> **提示:** `Esc` 切换到正常模式。即使你已经在正常模式下,点击 `Esc` 只是为了练习。 + +现在,有趣的事情发生了。输入 `:` (冒号键)并接着 `q!` (完整命令:`:q!`)。你的屏幕将显示如下: + +![Editing Vim][9] + +在正常模式下输入冒号会将 Vim 切换到命令行模式,执行 `:q!` 命令将退出 Vim 编辑器而不进行保存。换句话说,你放弃了所有的更改。你也可以使用 `ZQ` 命令;选择你认为更方便的选项。 + +一旦你按下 `Enter` (回车),你就不再在 Vim 中。重复练习几次来掌握这条命令。熟悉了这部分内容之后,请转到下一节,了解如何对文件进行更改。 + +### 第 2 步:在 Vim 中修改并保存 + +通过输入 `vim HelloWorld.java` 和回车键来再次打开这个文件。你可以在插入模式中修改文件。首先,通过 `Esc` 键来确定你正处于正常模式。接着输入 `i` 来进入插入模式(没错,就是字母 **i**)。 + +在左下角,你将看到 `-- INSERT --`,这标志着你这处于插入模式。 + +![Vim insert mode][10] + +写一些 Java 代码。你可以写任何你想写的,不过这也有一份你可以参照的例子。你的屏幕将显示如下: + +``` +public class HelloWorld { + public static void main([String][11][] args) { + } +} +``` + +非常漂亮!注意文本是如何在 Java 语法中高亮显示的。因为这是个 Java 文件,所以 Vim 将自动检测语法并高亮颜色。 + +保存文件:按下 `Esc` 来退出插入模式并进入命令行模式。输入 `:` 并接着 `x!` (完整命令:`:x!`),按回车键来保存文件。你也可以输入 `wq` 来执行相同的操作。 + +现在,你知道了如何使用插入模式输入文本并使用以下命令保存文件:`:x!` 或者 `:wq`。 + +### 第 3 步:Vim 中的基本导航 + +虽然你总是可以使用上箭头、下箭头、左箭头和右箭头在文件中移动,但在一个几乎有数不清行数的大文件中,这将是非常困难的。能够在一行中跳跃光标将会是很有用的。虽然 Vim 提供了不少很棒的导航功能,不过在一开始,我想向你展示如何在 Vim 中到达某一特定的行。 + +单击 `Esc` 来确定你处于正常模式,接着输入 `:set number` 并键入回车。 + +瞧!你现在可以在每一行的左侧看到行号。 + +![Showing Line Numbers][12] + +好,你也许会说,“这确实很酷,不过我该怎么跳到某一行呢?”再一次的,确认你正处于正常模式。接着输入 `:`,在这里 `` 是你想去的那一行的行数。按下回车键来试着移动到第二行。 + +``` +:2 +``` + +现在,跳到第三行。 + +![Jump to line 3][13] + +但是,假如你正在处理一个一千多行的文件,而你正想到文件底部。这该怎么办呢?确认你正处于正常模式,接着输入 `:$` 并按下回车。 + +你将来到最后一行! + +现在,你知道如何在行间跳跃了,作为补充,我们来学一下如何移动到一行的行尾。确认你正处于有文本内容的一行,如第三行,接着输入 `$`。 + +![Go to the last character][14] + +你现在来到这行的最后一个字节了。在此示例中,高亮左大括号以显示光标移动到的位置,右大括号被高亮是因为它是高亮的左大括号的匹配字符。 + +这就是 Vim 中的基本导航功能。等等,别急着退出文件。让我们转到 Vim 中的基本编辑。不过,你可以暂时顺便喝杯咖啡或茶休息一下。 + +### 第 4 步:Vim 中的基本编辑 + +现在,你已经知道如何通过跳到想要的一行来在文件中导航,你可以使用这个技能在 Vim 中进行一些基本编辑。切换到插入模式。(还记得怎么做吗?是不是输入 `i` ?)当然,你可以使用键盘逐一删除或插入字符来进行编辑,但是 Vim 提供了更快捷的方法来编辑文件。 + +来到第三行,这里的代码是 `public static void main(String[] args) {`。双击 `d` 键,没错,就是 `dd`。如果你成功做到了,你将会看到,第三行消失了,剩下的所有行都向上移动了一行。(例如,第四行变成了第三行)。 + +![Deleting A Line][15] + +这就是删除delete命令。不要担心,键入 `u`,你会发现这一行又回来了。喔,这就是撤销undo命令。 + +![Undoing a change in Vim][16] + +下一课是学习如何复制和粘贴文本,但首先,你需要学习如何在 Vim 中突出显示文本。按下 `v` 并向左右移动光标来选择或反选文本。当你向其他人展示代码并希望标识你想让他们注意到的代码时,这个功能也非常有用。 + +![Highlighting text in Vim][17] + +来到第四行,这里的代码是 `System.out.println("Hello, Opensource");`。高亮这一行的所有内容。好了吗?当第四行的内容处于高亮时,按下 `y`。这就叫做复制yank模式,文本将会被复制到剪贴板上。接下来,输入 `o` 来创建新的一行。注意,这将让你进入插入模式。通过按 `Esc` 退出插入模式,然后按下 `p`,代表粘贴paste。这将把复制的文本从第三行粘贴到第四行。 + +![Pasting in Vim][18] + +作为练习,请重复这些步骤,但也要修改新创建的行中的文字。此外,请确保这些行对齐工整。 + +> **提示:** 您需要在插入模式和命令行模式之间来回切换才能完成此任务。 + +当你完成了,通过 `x!` 命令保存文件。以上就是 Vim 基本编辑的全部内容。 + +### 第 5 步:Vim 中的基本搜索 + +假设你的团队领导希望你更改项目中的文本字符串。你该如何快速完成任务?你可能希望使用某个关键字来搜索该行。 + +Vim 的搜索功能非常有用。通过 `Esc` 键来进入命令模式,然后输入冒号 `:`,我们可以通过输入 `/` 来搜索关键词, `` 指你希望搜索的字符串。在这里,我们搜索关键字符串 `Hello`。在下面的图示中没有显示冒号,但这是必须输入的。 + +![Searching in Vim][19] + +但是,一个关键字可以出现不止一次,而这可能不是你想要的那一个。那么,如何找到下一个匹配项呢?只需按 `n` 键即可,这代表下一个next。执行此操作时,请确保你没有处于插入模式! + +### 附加步骤:Vim 中的分割模式 + +以上几乎涵盖了所有的 Vim 基础知识。但是,作为一个额外奖励,我想给你展示 Vim 一个很酷的特性,叫做分割split模式。 + +退出 `HelloWorld.java` 并创建一个新文件。在控制台窗口中,输入 `vim GoodBye.java` 并按回车键来创建一个名为 `GoodBye.java` 的新文件。 + +输入任何你想输入的让内容,我选择输入 `Goodbye`。保存文件(记住你可以在命令模式中使用 `:x!` 或者 `:wq`)。 + +在命令模式中,输入 `:split HelloWorld.java`,来看看发生了什么。 + +![Split mode in Vim][20] + +Wow!快看! `split` 命令将控制台窗口水平分割成了两个部分,上面是 `HelloWorld.java`,下面是 `GoodBye.java`。该怎么能在窗口之间切换呢? 按住 `Control` 键(在 Mac 上)或 `Ctrl` 键(在 PC 上),然后按下 `ww` (即双击 `w` 键)。 + +作为最后一个练习,尝试通过复制和粘贴 `HelloWorld.java` 来编辑 `GoodBye.java` 以匹配下面屏幕上的内容。 + +![Modify GoodBye.java file in Split Mode][21] + +保存两份文件,成功! + +> **提示 1:** 如果你想将两个文件窗口垂直分割,使用 `:vsplit ` 命令。(代替 `:split ` 命令,`` 指你想要使用分割模式打开的文件名)。 +> +> **提示 2:** 你可以通过调用任意数量的 `split` 或者 `vsplit` 命令来打开两个以上的文件。试一试,看看它效果如何。 + +### Vim 速查表 + +在本文中,您学会了如何使用 Vim 来完成工作或项目,但这只是你开启 Vim 强大功能之旅的开始,可以查看其他很棒的教程和技巧。 + +为了让一切变得简单些,我已经将你学到的一切总结到了 [一份方便的速查表][22] 中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/getting-started-vim + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[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://opensource.com/sites/default/files/uploads/1_xkcdcartoon.jpg (Real Programmers comic) +[3]: https://xkcd.com/378/ +[4]: https://kate-editor.org +[5]: https://www.nano-editor.org +[6]: https://www.vim.org +[7]: https://www.gnu.org/software/emacs +[8]: https://opensource.com/sites/default/files/uploads/2_createtestfolder.jpg (Create a folder) +[9]: https://opensource.com/sites/default/files/uploads/4_existingvim.jpg (Editing Vim) +[10]: https://opensource.com/sites/default/files/uploads/6_insertionmode.jpg (Vim insert mode) +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[12]: https://opensource.com/sites/default/files/uploads/10_setnumberresult_0.jpg (Showing Line Numbers) +[13]: https://opensource.com/sites/default/files/uploads/12_jumpintoline3.jpg (Jump to line 3) +[14]: https://opensource.com/sites/default/files/uploads/14_gotolastcharacter.jpg (Go to the last character) +[15]: https://opensource.com/sites/default/files/uploads/15_deletinglines.jpg (Deleting A Line) +[16]: https://opensource.com/sites/default/files/uploads/16_undoingtheline.jpg (Undoing a change in Vim) +[17]: https://opensource.com/sites/default/files/uploads/17_highlighting.jpg (Highlighting text in Vim) +[18]: https://opensource.com/sites/default/files/uploads/19_pasting.jpg (Pasting in Vim) +[19]: https://opensource.com/sites/default/files/uploads/22_searchmode.jpg (Searching in Vim) +[20]: https://opensource.com/sites/default/files/uploads/26_copytonewfiles.jpg (Split mode in Vim) +[21]: https://opensource.com/sites/default/files/uploads/27_exercise.jpg (Modify GoodBye.java file in Split Mode) +[22]: https://opensource.com/downloads/cheat-sheet-vim diff --git a/published/201904/20190326 Using Square Brackets in Bash- Part 1.md b/published/201904/20190326 Using Square Brackets in Bash- Part 1.md new file mode 100644 index 0000000000..d58ee923bf --- /dev/null +++ b/published/201904/20190326 Using Square Brackets in Bash- Part 1.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10717-1.html) +[#]: subject: (Using Square Brackets in Bash: Part 1) +[#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +在 Bash 中使用[方括号] (一) +====== + +![square brackets][1] + +> 这篇文章将要介绍方括号及其在命令行中的不同用法。 + +看完[花括号在命令行中的用法][3]之后,现在我们继续来看方括号(`[]`)在上下文中是如何发挥作用的。 + +### 通配 + +方括号最简单的用法就是通配。你可能在知道“Globbing”这个概念之前就已经通过通配来匹配内容了,列出具有相同特征的多个文件就是一个很常见的场景,例如列出所有 JPEG 文件: + +``` +ls *.jpg +``` + +使用通配符wildcard来得到符合某个模式的所有内容,这个过程就叫通配。 + +在上面的例子当中,星号(`*`)就代表“0 个或多个字符”。除此以外,还有代表“有且仅有一个字符”的问号(`?`)。因此 + +``` +ls d*k* +``` + +可以列出 `darkly` 和 `ducky`,而且 `dark` 和 `duck` 也是可以被列出的,因为 `*` 可以匹配 0 个字符。而 + +``` +ls d*k? +``` + +则只能列出 `ducky`,不会列出 `darkly`、`dark` 和 `duck`。 + +方括号也可以用于通配。为了便于演示,可以创建一个用于测试的目录,并在这个目录下创建文件: + +``` +touch file0{0..9}{0..9} +``` + +(如果你还不清楚上面这个命令的原理,可以看一下[另一篇介绍花括号的文章][3]) + +执行上面这个命令之后,就会创建 `file000`、`file001`、……、`file099` 这 100 个文件。 + +如果要列出这些文件当中第二位数字是 7 或 8 的文件,可以执行: + +``` +ls file0[78]? +``` + +如果要列出 `file022`、`file027`、`file028`、`file052`、`file057`、`file058`、`file092`、`file097`、`file098`,可以执行: + +``` +ls file0[259][278] +``` + +当然,不仅仅是 `ls`,很多其它的命令行工具都可以使用方括号来进行通配操作。但在删除文件、移动文件、复制文件的过程中使用通配,你需要有一点横向思维。 + +例如将 `file010` 到 `file029` 这 30 个文件复制成 `archive010` 到 `archive029` 这 30 个副本,不可以这样执行: + +``` +cp file0[12]? archive0[12]? +``` + +因为通配只能针对已有的文件,而 `archive` 开头的文件并不存在,不能进行通配。 + +而这条命令 + +``` +cp file0[12]? archive0[1..2][0..9] +``` + +也同样不行,因为 `cp` 并不允许将多个文件复制到多个文件。在复制多个文件的情况下,只能将多个文件复制到一个指定的目录下: + +``` +mkdir archive +cp file0[12]? archive +``` + +这条命令是可以正常运行的,但它只会把这 30 个文件以同样的名称复制到 `archive/` 目录下,而这并不是我们想要的效果。 + +如果你阅读过我[关于花括号的文章][3],你大概会记得可以使用 `%` 来截掉字符串的末尾部分,而使用 `#` 则可以截掉字符串的开头部分。 + +例如: + +``` +myvar="Hello World" +echo Goodbye Cruel ${myvar#Hello} +``` + +就会输出 `Goodbye Cruel World`,因为 `#Hello` 将 `myvar` 变量中开头的 `Hello` 去掉了。 + +在通配的过程中,也可以使用这一个技巧。 + +``` +for i in file0[12]?;\ +do\ +cp $i archive${i#file};\ +done +``` + +上面的第一行命令告诉 Bash 需要对所有 `file01` 开头或者 `file02` 开头,且后面只跟一个任意字符的文件进行操作,第二行的 `do` 和第四行的 `done` 代表需要对这些文件都执行这一块中的命令。 + +第三行就是实际的复制操作了,这里使用了两次 `$i` 变量:第一次在 `cp` 命令中直接作为源文件的文件名使用,第二次则是截掉文件名开头的 `file` 部分,然后在开头补上一个 `archive`,也就是这样: + +``` +"archive" + "file019" - "file" = "archive019" +``` + +最终整个 `cp` 命令展开为: + +``` +cp file019 archive019 +``` + +最后,顺带说明一下反斜杠 `\` 的作用是将一条长命令拆分成多行,这样可以方便阅读。 + +在下一节,我们会了解方括号的更多用法,敬请关注。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-gabriele-diwald-475007-unsplash.jpg?itok=cKmysLfd "square brackets" +[2]: https://www.linux.com/LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://linux.cn/article-10624-1.html + diff --git a/published/201904/20190327 Setting kernel command line arguments with Fedora 30.md b/published/201904/20190327 Setting kernel command line arguments with Fedora 30.md new file mode 100644 index 0000000000..3521176e6b --- /dev/null +++ b/published/201904/20190327 Setting kernel command line arguments with Fedora 30.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10715-1.html) +[#]: subject: (Setting kernel command line arguments with Fedora 30) +[#]: via: (https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) +[#]: author: (Laura Abbott https://fedoramagazine.org/makes-fedora-kernel/) + +如何在 Fedora 30 中设置内核命令行参数 +====== + +![][1] + +在调试或试验内核时,向内核命令行添加选项是一项常见任务。即将发布的 Fedora 30 版本改为使用 Bootloader 规范([BLS][2])。根据你修改内核命令行选项的方式,你的工作流可能会更改。继续阅读获取更多信息。 + +要确定你的系统是使用 BLS 还是旧的规范,请查看文件: + +``` +/etc/default/grub +``` + +如果你看到: + +``` +GRUB_ENABLE_BLSCFG=true +``` + +看到这个,你运行的是 BLS,你可能需要更改设置内核命令行参数的方式。 + +如果你只想修改单个内核条目(例如,暂时解决显示问题),可以使用 `grubby` 命令: + +``` +$ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --args="amdgpu.dc=0" +``` + +要删除内核参数,可以传递 `--remove-args` 参数给 `grubby`: + +``` +$ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --remove-args="amdgpu.dc=0" +``` + +如果有应该添加到每个内核命令行的选项(例如,你希望禁用 `rdrand` 指令生成随机数),则可以运行 `grubby` 命令: + +``` +$ grubby --update-kernel=ALL --args="nordrand" +``` + +这将更新所有内核条目的命令行,并保存作为将来条目的命令行选项。 + +如果你想要从所有内核中删除该选项,则可以再次使用 `--remove-args` 和 `--update-kernel=ALL`: + +``` +$ grubby --update-kernel=ALL --remove-args="nordrand" +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/ + +作者:[Laura Abbott][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://fedoramagazine.org/makes-fedora-kernel/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/f30-kernel-1-816x345.jpg +[2]: https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault diff --git a/published/201904/20190328 How to run PostgreSQL on Kubernetes.md b/published/201904/20190328 How to run PostgreSQL on Kubernetes.md new file mode 100644 index 0000000000..e8c4ceb539 --- /dev/null +++ b/published/201904/20190328 How to run PostgreSQL on Kubernetes.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10762-1.html) +[#]: subject: (How to run PostgreSQL on Kubernetes) +[#]: via: (https://opensource.com/article/19/3/how-run-postgresql-kubernetes) +[#]: author: (Jonathan S. Katz https://opensource.com/users/jkatz05) + +怎样在 Kubernetes 上运行 PostgreSQL +====== + +> 创建统一管理的,具备灵活性的云原生生产部署来部署一个个性化的数据库即服务(DBaaS)。 + +![cubes coming together to create a larger cube][1] + +通过在 [Kubernetes][2] 上运行 [PostgreSQL][3] 数据库,你能创建统一管理的,具备灵活性的云原生生产部署应用来部署一个个性化的数据库即服务为你的特定需求进行量身定制。 + +对于 Kubernetes,使用 Operator 允许你提供额外的上下文去[管理有状态应用][4]。当使用像PostgreSQL 这样开源的数据库去执行包括配置、扩展、高可用和用户管理时,Operator 也很有帮助。 + +让我们来探索如何在 Kubernetes 上启动并运行 PostgreSQL。 + +### 安装 PostgreSQL Operator + +将 PostgreSQL 和 Kubernetes 结合使用的第一步是安装一个 Operator。在针对 Linux 系统的Crunchy 的[快速启动脚本][6]的帮助下,你可以在任意基于 Kubernetes 的环境下启动和运行开源的[Crunchy PostgreSQL Operator][5]。 + +快速启动脚本有一些必要前提: + + * [Wget][7] 工具已安装。 + * [kubectl][8] 工具已安装。 + * 在你的 Kubernetes 中已经定义了一个 [StorageClass][9]。 + * 拥有集群权限的可访问 Kubernetes 的用户账号,以安装 Operator 的 [RBAC][10] 规则。 + * 一个 PostgreSQL Operator 的 [命名空间][11]。 + +执行这个脚本将提供给你一个默认的 PostgreSQL Operator 部署,其默认假设你采用 [动态存储][12]和一个名为 `standard` 的 StorageClass。这个脚本允许用户采用自定义的值去覆盖这些默认值。 + +通过下列命令,你能下载这个快速启动脚本并把它的权限设置为可执行: + +``` +wget +chmod +x ./quickstart.sh +``` + +然后你运行快速启动脚本: + +``` +./examples/quickstart.sh +``` + +在脚本提示你相关的 Kubernetes 集群基本信息后,它将执行下列操作: + + * 下载 Operator 配置文件 + * 将 `$HOME/.pgouser` 这个文件设置为默认设置 + * 以 Kubernetes [Deployment][13] 部署 Operator + * 设置你的 `.bashrc` 文件包含 Operator 环境变量 + * 设置你的 `$HOME/.bash_completion` 文件为 `pgo bash_completion` 文件 + +在快速启动脚本的执行期间,你将会被提示在你的 Kubernetes 集群设置 RBAC 规则。在另一个终端,执行快速启动命令所提示你的命令。 + +一旦这个脚本执行完成,你将会得到提示设置一个端口以转发到 PostgreSQL Operator pod。在另一个终端,执行这个端口转发操作;这将允许你开始对 PostgreSQL Operator 执行命令!尝试输入下列命令创建集群: + +``` +pgo create cluster mynewcluster +``` + +你能输入下列命令测试你的集群运行状况: + +``` +pgo test mynewcluster +``` + +现在,你能在 Kubernetes 环境下管理你的 PostgreSQL 数据库了!你可以在[官方文档][14]找到非常全面的命令,包括扩容,高可用,备份等等。 + +这篇文章部分参考了该作者为 Crunchy 博客而写的[在 Kubernetes 上开始运行 PostgreSQL][15]。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/how-run-postgresql-kubernetes + +作者:[Jonathan S. Katz][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jkatz05 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://www.postgresql.org/ +[3]: https://kubernetes.io/ +[4]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators +[5]: https://github.com/CrunchyData/postgres-operator +[6]: https://crunchydata.github.io/postgres-operator/stable/installation/#quickstart-script +[7]: https://www.gnu.org/software/wget/ +[8]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[9]: https://kubernetes.io/docs/concepts/storage/storage-classes/ +[10]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[11]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[12]: https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ +[13]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[14]: https://crunchydata.github.io/postgres-operator/stable/#documentation +[15]: https://info.crunchydata.com/blog/get-started-runnning-postgresql-on-kubernetes diff --git a/published/201904/20190401 3 cool text-based email clients.md b/published/201904/20190401 3 cool text-based email clients.md new file mode 100644 index 0000000000..b29c55f83e --- /dev/null +++ b/published/201904/20190401 3 cool text-based email clients.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10722-1.html) +[#]: subject: (3 cool text-based email clients) +[#]: via: (https://fedoramagazine.org/3-cool-text-based-email-clients/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +3 个很酷的基于文本的邮件客户端 +====== + +![][1] + +编写和接收电子邮件是每个人日常工作的重要组成部分,选择电子邮件客户端通常是一个重要决定。Fedora 系统提供了大量的电子邮件客户端可供选择,其中包括基于文本的电子邮件应用。 + +### Mutt + +Mutt 可能是最受欢迎的基于文本的电子邮件客户端之一。它有人们期望的所有常用功能。Mutt 支持颜色代码、邮件会话、POP3 和 IMAP。但它最好的功能之一是它具有高度可配置性。实际上,用户可以轻松地更改键绑定,并创建宏以使工具适应特定的工作流程。 + +要尝试 Mutt,请[使用 sudo][2] 和 `dnf` 安装它: + +``` +$ sudo dnf install mutt +``` + +为了帮助新手入门,Mutt 有一个非常全面的充满了宏示例和配置技巧的 [wiki][3]。 + +### Alpine + +Alpine 也是最受欢迎的基于文本的电子邮件客户端。它比 Mutt 更适合初学者,你可以通过应用本身配置大部分功能而无需编辑配置文件。Alpine 的一个强大功能是能够对电子邮件进行评分。这对那些订阅含有大量邮件的邮件列表如 Fedora 的[开发列表][4]的用户来说尤其有趣。通过使用分数,Alpine 可以根据用户的兴趣对电子邮件进行排序,首先显示高分的电子邮件。 + +也可以使用 `dnf` 从 Fedora 的仓库安装 Alpine。 + +``` +$ sudo dnf install alpine +``` + +使用 Alpine 时,你可以按 `Ctrl+G` 组合键轻松访问文档。 + +### nmh + +nmh(new Mail Handling)遵循 UNIX 工具哲学。它提供了一组用于发送、接收、保存、检索和操作电子邮件的单一用途程序。这使你可以将 `nmh` 命令与其他程序交换,或利用 `nmh` 编写脚本来创建更多自定义工具。例如,你可以将 Mutt 与 `nmh` 一起使用。 + +使用 `dnf` 可以轻松安装 `nmh`。 + +``` +$ sudo dnf install nmh +``` + +要了解有关 `nmh` 和邮件处理的更多信息,你可以阅读这本 GPL 许可的[书][5]。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-cool-text-based-email-clients/ + +作者:[Clément Verna][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://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2018/07/email-clients-816x345.png +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://gitlab.com/muttmua/mutt/wikis/home +[4]: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ +[5]: https://rand-mh.sourceforge.io/book/ diff --git a/published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md b/published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md new file mode 100644 index 0000000000..8b5e45287b --- /dev/null +++ b/published/201904/20190401 How to create a filesystem on a Linux partition or logical volume.md @@ -0,0 +1,161 @@ +[#]: collector: (lujun9972) +[#]: translator: (liujing97) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10705-1.html) +[#]: subject: (How to create a filesystem on a Linux partition or logical volume) +[#]: via: (https://opensource.com/article/19/4/create-filesystem-linux-partition) +[#]: 作者: (Kedar Vijay Kulkarni (Red Hat) https://opensource.com/users/kkulkarn) + +如何在 Linux 分区或逻辑卷中创建文件系统 +====== + +> 学习在你的系统中创建一个文件系统,并且长期或者非长期地挂载它。 + +![Filing papers and documents][1] + +在计算技术中,文件系统控制如何存储和检索数据,并且帮助组织存储媒介中的文件。如果没有文件系统,信息将被存储为一个大数据块,而且你无法知道一条信息在哪结束,下一条信息在哪开始。文件系统通过为存储数据的文件提供名称,并且在文件系统中的磁盘上维护文件和目录表以及它们的开始和结束位置、总的大小等来帮助管理所有的这些信息。 + +在 Linux 中,当你创建一个硬盘分区或者逻辑卷之后,接下来通常是通过格式化这个分区或逻辑卷来创建文件系统。这个操作方法假设你已经知道如何创建分区或逻辑卷,并且你希望将它格式化为包含有文件系统,并且挂载它。 + +### 创建文件系统 + +假设你为你的系统添加了一块新的硬盘并且在它上面创建了一个叫 `/dev/sda1` 的分区。 + +1、为了验证 Linux 内核已经发现这个分区,你可以 `cat` 出 `/proc/partitions` 的内容,就像这样: + +``` +[root@localhost ~]# cat /proc/partitions +major minor #blocks name + + 253 0 10485760 vda + 253 1 8192000 vda1 + 11 0 1048575 sr0 + 11 1 374 sr1 + 8 0 10485760 sda + 8 1 10484736 sda1 + 252 0 3145728 dm-0 + 252 1 2097152 dm-1 + 252 2 1048576 dm-2 + 8 16 1048576 sdb +``` + + +2、决定你想要去创建的文件系统种类,比如 ext4、XFS,或者其他的一些。这里是一些可选项: + +``` +[root@localhost ~]# mkfs. +mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.minix mkfs.xfs +``` + + +3、为了这次练习的目的,选择 ext4。(我喜欢 ext4,因为如果你需要的话,它可以允许你去压缩文件系统,这对于 XFS 并不简单。)这里是完成它的方法(输出可能会因设备名称或者大小而不同): + +``` +[root@localhost ~]# mkfs.ext4 /dev/sda1 +mke2fs 1.42.9 (28-Dec-2013) +Filesystem label= +OS type: Linux +Block size=4096 (log=2) +Fragment size=4096 (log=2) +Stride=0 blocks, Stripe width=8191 blocks +194688 inodes, 778241 blocks +38912 blocks (5.00%) reserved for the super user +First data block=0 +Maximum filesystem blocks=799014912 +24 block groups +32768 blocks per group, 32768 fragments per group +8112 inodes per group +Superblock backups stored on blocks: + 32768, 98304, 163840, 229376, 294912 + +Allocating group tables: done +Writing inode tables: done +Creating journal (16384 blocks): done +Writing superblocks and filesystem accounting information: done +``` + +4、在上一步中,如果你想去创建不同的文件系统,请使用不同变种的 `mkfs` 命令。 + +### 挂载文件系统 + +当你创建好文件系统后,你可以在你的操作系统中挂载它。 + +1、首先,识别出新文件系统的 UUID 编码。使用 `blkid` 命令列出所有可识别的块存储设备并且在输出信息中查找 `sda1`: + +``` +[root@localhost ~]# blkid +/dev/vda1: UUID="716e713d-4e91-4186-81fd-c6cfa1b0974d" TYPE="xfs" +/dev/sr1: UUID="2019-03-08-16-17-02-00" LABEL="config-2" TYPE="iso9660" +/dev/sda1: UUID="wow9N8-dX2d-ETN4-zK09-Gr1k-qCVF-eCerbF" TYPE="LVM2_member" +/dev/mapper/test-test1: PTTYPE="dos" +/dev/sda1: UUID="ac96b366-0cdd-4e4c-9493-bb93531be644" TYPE="ext4" +[root@localhost ~]# +``` + +2、运行下面的命令挂载 `/dev/sd1` 设备: + +``` +[root@localhost ~]# mkdir /mnt/mount_point_for_dev_sda1 +[root@localhost ~]# ls /mnt/ +mount_point_for_dev_sda1 +[root@localhost ~]# mount -t ext4 /dev/sda1 /mnt/mount_point_for_dev_sda1/ +[root@localhost ~]# df -h +Filesystem Size Used Avail Use% Mounted on +/dev/vda1 7.9G 920M 7.0G 12% / +devtmpfs 443M 0 443M 0% /dev +tmpfs 463M 0 463M 0% /dev/shm +tmpfs 463M 30M 434M 7% /run +tmpfs 463M 0 463M 0% /sys/fs/cgroup +tmpfs 93M 0 93M 0% /run/user/0 +/dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 +[root@localhost ~]# +``` + +命令 `df -h` 显示了每个文件系统被挂载的挂载点。查找 `/dev/sd1`。上面的挂载命令使用的设备名称是 `/dev/sda1`。用 `blkid` 命令中的 UUID 编码替换它。注意,在 `/mnt` 下一个被新创建的目录挂载了 `/dev/sda1`。 + +3、直接在命令行下使用挂载命令(就像上一步一样)会有一个问题,那就是挂载不会在设备重启后存在。为使永久性地挂载文件系统,编辑 `/etc/fstab` 文件去包含你的挂载信息: + +``` +UUID=ac96b366-0cdd-4e4c-9493-bb93531be644 /mnt/mount_point_for_dev_sda1/ ext4 defaults 0 0 +``` + +4、编辑完 `/etc/fstab` 文件后,你可以 `umount /mnt/mount_point_for_fev_sda1` 并且运行 `mount -a` 命令去挂载被列在 `/etc/fstab` 文件中的所有设备文件。如果一切顺利的话,你可以使用 `df -h` 列出并且查看你挂载的文件系统: + +``` +root@localhost ~]# umount /mnt/mount_point_for_dev_sda1/ +[root@localhost ~]# mount -a +[root@localhost ~]# df -h +Filesystem Size Used Avail Use% Mounted on +/dev/vda1 7.9G 920M 7.0G 12% / +devtmpfs 443M 0 443M 0% /dev +tmpfs 463M 0 463M 0% /dev/shm +tmpfs 463M 30M 434M 7% /run +tmpfs 463M 0 463M 0% /sys/fs/cgroup +tmpfs 93M 0 93M 0% /run/user/0 +/dev/sda1 2.9G 9.0M 2.7G 1% /mnt/mount_point_for_dev_sda1 +``` + +5、你也可以检测文件系统是否被挂载: + +``` +[root@localhost ~]# mount | grep ^/dev/sd +/dev/sda1 on /mnt/mount_point_for_dev_sda1 type ext4 (rw,relatime,seclabel,stripe=8191,data=ordered) +``` + +现在你已经知道如何去创建文件系统并且长期或者非长期的挂载在你的系统中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/create-filesystem-linux-partition + +作者:[Kedar Vijay Kulkarni][a] +选题:[lujun9972][b] +译者:[liujing97](https://github.com/liujing97) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/kkulkarn +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) diff --git a/published/201904/20190402 Parallel computation in Python with Dask.md b/published/201904/20190402 Parallel computation in Python with Dask.md new file mode 100644 index 0000000000..818b242cc6 --- /dev/null +++ b/published/201904/20190402 Parallel computation in Python with Dask.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10742-1.html) +[#]: subject: (Parallel computation in Python with Dask) +[#]: via: (https://opensource.com/article/19/4/parallel-computation-python-dask) +[#]: author: (Moshe Zadka (Community Moderator) https://opensource.com/users/moshez) + +使用 Dask 在 Python 中进行并行计算 +====== + +> Dask 库可以将 Python 计算扩展到多个核心甚至是多台机器。 + +![Pair programming][1] + +关于 Python 性能的一个常见抱怨是[全局解释器锁][2](GIL)。由于 GIL,同一时刻只能有一个线程执行 Python 字节码。因此,即使在现代的多核机器上,使用线程也不会加速计算。 + +但当你需要并行化到多核时,你不需要放弃使用 Python:[Dask][3] 库可以将计算扩展到多个内核甚至多个机器。某些设置可以在数千台机器上配置 Dask,每台机器都有多个内核。虽然存在扩展规模的限制,但一般达不到。 + +虽然 Dask 有许多内置的数组操作,但举一个非内置的例子,我们可以计算[偏度][4]: + +``` +import numpy +import dask +from dask import array as darray + +arr = dask.from_array(numpy.array(my_data), chunks=(1000,)) +mean = darray.mean() +stddev = darray.std(arr) +unnormalized_moment = darry.mean(arr * arr * arr) +## See formula in wikipedia: +skewness = ((unnormalized_moment - (3 * mean * stddev ** 2) - mean ** 3) / + stddev ** 3) +``` + +请注意,每个操作将根据需要使用尽可能多的内核。这将在所有核心上并行化执行,即使在计算数十亿个元素时也是如此。 + +当然,并不是我们所有的操作都可由这个库并行化,有时我们需要自己实现并行性。 + +为此,Dask 有一个“延迟”功能: + +``` +import dask + +def is_palindrome(s): + return s == s[::-1] + +palindromes = [dask.delayed(is_palindrome)(s) for s in string_list] +total = dask.delayed(sum)(palindromes) +result = total.compute() +``` + +这将计算字符串是否是回文并返回回文的数量。 + +虽然 Dask 是为数据科学家创建的,但它绝不仅限于数据科学。每当我们需要在 Python 中并行化任务时,我们可以使用 Dask —— 无论有没有 GIL。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/parallel-computation-python-dask + +作者:[Moshe Zadka (Community Moderator)][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/collab-team-pair-programming-code-keyboard.png?itok=kBeRTFL1 (Pair programming) +[2]: https://wiki.python.org/moin/GlobalInterpreterLock +[3]: https://github.com/dask/dask +[4]: https://en.wikipedia.org/wiki/Skewness#Definition diff --git a/published/201904/20190402 Using Square Brackets in Bash- Part 2.md b/published/201904/20190402 Using Square Brackets in Bash- Part 2.md new file mode 100644 index 0000000000..22ca8b3ee9 --- /dev/null +++ b/published/201904/20190402 Using Square Brackets in Bash- Part 2.md @@ -0,0 +1,165 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10761-1.html) +[#]: subject: (Using Square Brackets in Bash: Part 2) +[#]: via: (https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +在 Bash 中使用[方括号](二) +====== + +![square brackets][1] + +> 我们继续来看方括号的用法,它们甚至还可以在 Bash 当中作为一个命令使用。 + +欢迎回到我们的方括号专题。在[前一篇文章][3]当中,我们介绍了方括号在命令行中可以用于通配操作,如果你已经读过前一篇文章,就可以从这里继续了。 + +方括号还可以以一个命令的形式使用,就像这样: + +``` +[ "a" = "a" ] +``` + +上面这种 `[ ... ]` 的形式就可以看成是一个可执行的命令。要注意,方括号内部的内容 `"a" = "a"` 和方括号 `[`、`]` 之间是有空格隔开的。因为这里的方括号被视作一个命令,因此要用空格将命令和它的参数隔开。 + +上面这个命令的含义是“判断字符串 `"a"` 和字符串 `"a"` 是否相同”,如果判断结果为真,那么 `[ ... ]` 就会以状态码status code 0 退出,否则以状态码 1 退出。在[之前的文章][4]中,我们也有介绍过状态码的概念,可以通过 `$?` 变量获取到最近一个命令的状态码。 + +分别执行 + +``` +[ "a" = "a" ] +echo $? +``` + +以及 + +``` +[ "a" = "b" ] +echo $? +``` + +这两段命令中,前者会输出 0(判断结果为真),后者则会输出 1(判断结果为假)。在 Bash 当中,如果一个命令的状态码是 0,表示这个命令正常执行完成并退出,而且其中没有出现错误,对应布尔值 `true`;如果在命令执行过程中出现错误,就会返回一个非零的状态码,对应布尔值 `false`。而 `[ ... ]` 也同样遵循这样的规则。 + +因此,`[ ... ]` 很适合在 `if ... then`、`while` 或 `until` 这种在代码块结束前需要判断是否达到某个条件结构中使用。 + +对应使用的逻辑判断运算符也相当直观: + +``` +[ STRING1 = STRING2 ] => 检查字符串是否相等 +[ STRING1 != STRING2 ] => 检查字符串是否不相等 +[ INTEGER1 -eq INTEGER2 ] => 检查整数 INTEGER1 是否等于 INTEGER2 +[ INTEGER1 -ge INTEGER2 ] => 检查整数 INTEGER1 是否大于等于 INTEGER2 +[ INTEGER1 -gt INTEGER2 ] => 检查整数 INTEGER1 是否大于 INTEGER2 +[ INTEGER1 -le INTEGER2 ] => 检查整数 INTEGER1 是否小于等于 INTEGER2 +[ INTEGER1 -lt INTEGER2 ] => 检查整数 INTEGER1 是否小于 INTEGER2 +[ INTEGER1 -ne INTEGER2 ] => 检查整数 INTEGER1 是否不等于 INTEGER2 +等等…… +``` + +方括号的这种用法也可以很有 shell 风格,例如通过带上 `-f` 参数可以判断某个文件是否存在: + +``` +for i in {000..099}; \ + do \ + if [ -f file$i ]; \ + then \ + echo file$i exists; \ + else \ + touch file$i; \ + echo I made file$i; \ + fi; \ +done +``` + +如果你在上一篇文章使用到的测试目录中运行以上这串命令,其中的第 3 行会判断那几十个文件当中的某个文件是否存在。如果文件存在,会输出一条提示信息;如果文件不存在,就会把对应的文件创建出来。最终,这个目录中会完整存在从 `file000` 到 `file099` 这一百个文件。 + +上面这段命令还可以写得更加简洁: + +``` +for i in {000..099};\ +do\ + if [ ! -f file$i ];\ + then\ + touch file$i;\ + echo I made file$i;\ + fi;\ +done +``` + +其中 `!` 运算符表示将判断结果取反,因此第 3 行的含义就是“如果文件 `file$i` 不存在”。 + +可以尝试一下将测试目录中那几十个文件随意删除几个,然后运行上面的命令,你就可以看到它是如何把被删除的文件重新创建出来的。 + +除了 `-f` 之外,还有很多有用的参数。`-d` 参数可以判断某个目录是否存在,`-h` 参数可以判断某个文件是不是一个符号链接。可以用 `-G` 参数判断某个文件是否属于某个用户组,用 `-ot` 参数判断某个文件的最后更新时间是否早于另一个文件,甚至还可以判断某个文件是否为空文件。 + +运行下面的几条命令,可以向几个文件中写入一些内容: + +``` +echo "Hello World" >> file023 +echo "This is a message" >> file065 +echo "To humanity" >> file010 +``` + +然后运行: + +``` +for i in {000..099};\ +do\ + if [ ! -s file$i ];\ + then\ + rm file$i;\ + echo I removed file$i;\ + fi;\ +done +``` + +你就会发现所有空文件都被删除了,只剩下少数几个非空的文件。 + +如果你还想了解更多别的参数,可以执行 `man test` 来查看 `test` 命令的 man 手册(`test` 是 `[ ... ]` 的命令别名)。 + +有时候你还会看到 `[[ ... ]]` 这种双方括号的形式,使用起来和单方括号差别不大。但双方括号支持的比较运算符更加丰富:例如可以使用 `==` 来判断某个字符串是否符合某个模式pattern,也可以使用 `<`、`>` 来判断两个字符串的出现顺序。 + +可以在 [Bash 表达式文档][5]中了解到双方括号支持的更多运算符。 + +### 下一集 + +在下一篇文章中,我们会开始介绍圆括号 `()` 在 Linux 命令行中的用法,敬请关注! + +### 更多 + +- [Linux 工具:点的含义][6] +- [理解 Bash 中的尖括号][7] +- [Bash 中尖括号的更多用法][8] +- [Linux 中的 &][9] +- [Bash 中的 & 符号和文件描述符][10] +- [Bash 中的逻辑和(&)][4] +- [浅析 Bash 中的 {花括号}][11] +- [在 Bash 中使用[方括号] (一)][3] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/4/using-square-brackets-bash-part-2 + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-brackets-3734552_1920.jpg?itok=hv9D6TBy "square brackets" +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://linux.cn/article-10717-1.html +[4]: https://linux.cn/article-10596-1.html +[5]: https://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions +[6]: https://linux.cn/article-10465-1.html +[7]: https://linux.cn/article-10502-1.html +[8]: https://linux.cn/article-10529-1.html +[9]: https://linux.cn/article-10587-1.html +[10]: https://linux.cn/article-10591-1.html +[11]: https://linux.cn/article-10624-1.html + diff --git a/published/201904/20190403 5 useful open source log analysis tools.md b/published/201904/20190403 5 useful open source log analysis tools.md new file mode 100644 index 0000000000..13618cda41 --- /dev/null +++ b/published/201904/20190403 5 useful open source log analysis tools.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10757-1.html) +[#]: subject: (5 useful open source log analysis tools) +[#]: via: (https://opensource.com/article/19/4/log-analysis-tools) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +5 个有用的开源日志分析工具 +====== + +> 监控网络活动既重要又繁琐,以下这些工具可以使它更容易。 + +![People work on a computer server][1] + +监控网络活动是一项繁琐的工作,但有充分的理由这样做。例如,它允许你查找和调查工作站和连接到网络的设备及服务器上的可疑登录,同时确定管理员滥用了什么。你还可以跟踪软件安装和数据传输,以实时识别潜在问题,而不是在损坏发生后才进行跟踪。 + +这些日志还有助于使你的公司遵守适用于在欧盟范围内运营的任何实体的[通用数据保护条例][2](GDPR)。如果你的网站在欧盟可以浏览,那么你就有遵守的该条例的资格。 + +日志记录,包括跟踪和分析,应该是任何监控基础设置中的一个基本过程。要从灾难中恢复 SQL Server 数据库,需要事务日志文件。此外,通过跟踪日志文件,DevOps 团队和数据库管理员(DBA)可以保持最佳的数据库性能,又或者,在网络攻击的情况下找到未经授权活动的证据。因此,定期监视和分析系统日志非常重要。这是一种重新创建导致出现任何问题的事件链的可靠方式。 + +现在有很多开源日志跟踪器和分析工具可供使用,这使得为活动日志选择合适的资源比你想象的更容易。自由和开源软件社区提供的日志设计适用于各种站点和操作系统。以下是五个我用过的最好的工具,它们并没有特别的顺序。 + +### Graylog + +[Graylog][3] 于 2011 年在德国创立,现在作为开源工具或商业解决方案提供。它被设计成一个集中式日志管理系统,接受来自不同服务器或端点的数据流,并允许你快速浏览或分析该信息。 + +![Graylog screenshot][4] + +Graylog 在系统管理员中有着良好的声誉,因为它易于扩展。大多数 Web 项目都是从小规模开始的,但它们可能指数级增长。Graylog 可以均衡后端服务网络中的负载,每天可以处理几 TB 的日志数据。 + +IT 管理员会发现 Graylog 的前端界面易于使用,而且功能强大。Graylog 是围绕仪表板的概念构建的,它允许你选择你认为最有价值的指标或数据源,并快速查看一段时间内的趋势。 + +当发生安全或性能事件时,IT 管理员希望能够尽可能地根据症状追根溯源。Graylog 的搜索功能使这变得容易。它有内置的容错功能,可运行多线程搜索,因此你可以同时分析多个潜在的威胁。 + +### Nagios + +[Nagios][5] 始于 1999 年,最初是由一个开发人员开发的,现在已经发展成为管理日志数据最可靠的开源工具之一。当前版本的 Nagios 可以与运行 Microsoft Windows、Linux 或 Unix 的服务器集成。 + +![Nagios Core][6] + +它的主要产品是日志服务器,旨在简化数据收集并使系统管理员更容易访问信息。Nagios 日志服务器引擎将实时捕获数据,并将其提供给一个强大的搜索工具。通过内置的设置向导,可以轻松地与新端点或应用程序集成。 + +Nagios 最常用于需要监控其本地网络安全性的组织。它可以审核一系列与网络相关的事件,并帮助自动分发警报。如果满足特定条件,甚至可以将 Nagios 配置为运行预定义的脚本,从而允许你在人员介入之前解决问题。 + +作为网络审计的一部分,Nagios 将根据日志数据来源的地理位置过滤日志数据。这意味着你可以使用地图技术构建全面的仪表板,以了解 Web 流量是如何流动的。 + +### Elastic Stack (ELK Stack) + +[Elastic Stack][7],通常称为 ELK Stack,是需要筛选大量数据并理解其日志系统的组织中最受欢迎的开源工具之一(这也是我个人的最爱)。 + +![ELK Stack][8] + +它的主要产品由三个独立的产品组成:Elasticsearch、Kibana 和 Logstash: + + * 顾名思义, Elasticsearch 旨在帮助用户使用多种查询语言和类型在数据集之中找到匹配项。速度是它最大的优势。它可以扩展成由数百个服务器节点组成的集群,轻松处理 PB 级的数据。 + * Kibana 是一个可视化工具,与 Elasticsearch 一起工作,允许用户分析他们的数据并构建强大的报告。当你第一次在服务器集群上安装 Kibana 引擎时,你会看到一个显示着统计数据、图表甚至是动画的界面。 + * ELK Stack 的最后一部分是 Logstash,它作为一个纯粹的服务端管道进入 Elasticsearch 数据库。你可以将 Logstash 与各种编程语言和 API 集成,这样你的网站和移动应用程序中的信息就可以直接提供给强大的 Elastic Stalk 搜索引擎中。 + +ELK Stack 的一个独特功能是,它允许你监视构建在 WordPress 开源网站上的应用程序。与[跟踪管理日志和 PHP 日志][9]的大多数开箱即用的安全审计日志工具相比,ELK Stack 可以筛选 Web 服务器和数据库日志。 + +糟糕的日志跟踪和数据库管理是导致网站性能不佳的最常见原因之一。没有定期检查、优化和清空数据库日志,不仅会降低站点的运行速度,还可能导致其完全崩溃。因此,ELK Stack 对于每个 WordPress 开发人员的工具包来说都是一个优秀的工具。 + +### LOGalyze + +[LOGalyze][11] 是一个位于匈牙利的组织,它为系统管理员和安全专家构建开源工具,以帮助他们管理服务器日志,并将其转换为有用的数据点。其主要产品可供个人或商业用户免费下载。 + +![LOGalyze][12] + +LOGalyze 被设计成一个巨大的管道,其中多个服务器、应用程序和网络设备可以使用简单对象访问协议(SOAP)方法提供信息。它提供了一个前端界面,管理员可以登录界面来监控数据集并开始分析数据。 + +在 LOGalyze 的 Web 界面中,你可以运行动态报告,并将其导出到 Excel 文件、PDF 文件或其他格式。这些报告可以基于 LOGalyze 后端管理的多维统计信息。它甚至可以跨服务器或应用程序组合数据字段,借此来帮助你发现性能趋势。 + +LOGalyze 旨在不到一个小时内完成安装和配置。它具有预先构建的功能,允许它以法律所要求的格式收集审计数据。例如,LOGalyze 可以很容易地运行不同的 HIPAA 报告,以确保你的组织遵守健康法律并保持合规性。 + +### Fluentd + +如果你所在组织的数据源位于许多不同的位置和环境中,那么你的目标应该是尽可能地将它们集中在一起。否则,你将难以监控性能并防范安全威胁。 + +[Fluentd][13] 是一个强大的数据收集解决方案,它是完全开源的。它没有提供完整的前端界面,而是作为一个收集层来帮助组织不同的管道。Fluentd 在被世界上一些最大的公司使用,但是也可以在较小的组织中实施。 + +![Fluentd architecture][14] + +Fluentd 最大的好处是它与当今最常用的技术工具兼容。例如,你可以使用 Fluentd 从 Web 服务器(如 Apache)、智能设备传感器和 MongoDB 的动态记录中收集数据。如何处理这些数据完全取决于你。 + +Fluentd 基于 JSON 数据格式,它可以与由卓越的开发人员创建的 [500 多个插件][15]一起使用。这使你可以将日志数据扩展到其他应用程序中,并通过最少的手工操作从中获得更好的分析。 + +### 写在最后 + +如果出于安全原因、政府合规性和衡量生产力的原因,你还没有使用活动日志,那么现在开始改变吧。市场上有很多插件,它们可以与多种环境或平台一起工作,甚至可以在内部网络上使用。不要等发生了严重的事件,才采取一个积极主动的方法去维护和监督日志。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/log-analysis-tools + +作者:[Sam Bocetta][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sambocetta +[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) +[2]: https://opensource.com/article/18/4/gdpr-impact +[3]: https://www.graylog.org/products/open-source +[4]: https://opensource.com/sites/default/files/uploads/graylog-data.png (Graylog screenshot) +[5]: https://www.nagios.org/downloads/ +[6]: https://opensource.com/sites/default/files/uploads/nagios_core_4.0.8.png (Nagios Core) +[7]: https://www.elastic.co/products +[8]: https://opensource.com/sites/default/files/uploads/elk-stack.png (ELK Stack) +[9]: https://www.wpsecurityauditlog.com/benefits-wordpress-activity-log/ +[10]: https://websitesetup.org/how-to-speed-up-wordpress/ +[11]: http://www.logalyze.com/ +[12]: https://opensource.com/sites/default/files/uploads/logalyze.jpg (LOGalyze) +[13]: https://www.fluentd.org/ +[14]: https://opensource.com/sites/default/files/uploads/fluentd-architecture.png (Fluentd architecture) +[15]: https://opensource.com/article/18/9/open-source-log-aggregation-tools diff --git a/published/201904/20190405 Streaming internet radio with RadioDroid.md b/published/201904/20190405 Streaming internet radio with RadioDroid.md new file mode 100644 index 0000000000..801098b3a1 --- /dev/null +++ b/published/201904/20190405 Streaming internet radio with RadioDroid.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10741-1.html) +[#]: subject: (Streaming internet radio with RadioDroid) +[#]: via: (https://opensource.com/article/19/4/radiodroid-internet-radio-player) +[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) + +使用 RadioDroid 流传输网络广播 +====== + +> 通过简单的设置使用你家中的音响收听你最爱的网络电台。 + +![][1] + +最近网络媒体对 [Google 的 Chromecast 音频设备的下架][2]发出叹息。该设备在音频媒体界备受[好评][3],因此我已经在考虑入手一个。基于 Chromecast 退场的消息,我决定在它们全部被打包扔进垃圾堆之前以一个合理价位买一个。 + +我在 [MobileFun][4] 上找到一个放进我的订单中。这个设备最终到货了。它被包在一个普普通通、简简单单的 Google 包装袋中,外面打印着非常简短的使用指南。 + +![Google Chromecast 音频][5] + +我通过我的数模转换器的光纤 S/PDIF 连接接入到家庭音响,希望以此能提供最佳的音质。 + +安装过程并无纰漏,在五分钟后我就可以播放一些音乐了。我知道一些安卓应用支持 Chromecast,因此我决定用 Google Play Music 测试它。意料之中,它工作得不错,音乐效果听上去也相当好。然而作为一个具有开源精神的人,我决定看看我能找到什么开源播放器能兼容 Chromecast。 + +### RadioDroid 的救赎 + +[RadioDroid 安卓应用][6] 满足条件。它是开源的,并且可从 [GitHub][7]、Google Play 以及 [F-Droid][8] 上获取。根据帮助文档,RadioDroid 从 [Community Radio Browser][9] 网页寻找播放流。因此我决定在我的手机上安装尝试一下。 + +![RadioDroid][10] + +安装过程快速顺利,RadioDroid 打开展示当地电台十分迅速。你可以在这个屏幕截图的右上方附近看到 Chromecast 按钮(看上去像一个有着波阵面的长方形图标)。 + +我尝试了几个当地电台。这个应用可靠地在我手机喇叭上播放了音乐。但是我不得不摆弄 Chromecast 按钮来通过 Chromecast 把音乐传到流上。但是它确实可以做到流传输。 + +我决定找一下我喜爱的网络广播电台:法国马赛的 [格雷诺耶广播电台][11]。在 RadioDroid 上有许多找到电台的方法。其中一种是使用标签——“当地”、“最流行”等——就在电台列表上方。其中一个标签是国家,我找到法国,在其 1500 个电台中划来划去寻找格雷诺耶广播电台。另一种办法是使用屏幕上方的查询按钮;查询迅速找到了那家美妙的电台。我尝试了其它几次查询它们都返回了合理的信息。 + +回到“当地”标签,我在列表中翻来覆去,发现“当地”的定义似乎是“在同一个国家”。因此尽管西雅图、波特兰、旧金山、洛杉矶和朱诺比多伦多更靠近我的家,我并没有在“当地”标签中看到它们。然而通过使用查询功能,我可以发现所有名字中带有西雅图的电台。 + +“语言”标签使我找到所有用葡语(及葡语方言)播报的电台。我很快发现了另一个最爱的电台 [91 Rock Curitiba][12]。 + +接着灵感来了,虽然现在是春天了,但又如何呢?让我们听一些圣诞音乐。意料之中,搜寻圣诞把我引到了 [181.FM – Christmas Blender][13]。不错,一两分钟的欣赏对我就够了。 + +因此总的来说,我推荐把 RadioDroid 和 Chromecast 的组合作为一种用家庭音响以合理价位播放网络电台的良好方式。 + +### 对于音乐方面…… + +最近我从 [Blue Coast Music][16] 商店里选了一个 [Qua Continuum][15] 创作的叫作 [Continuum One][14] 的有趣的氛围(甚至无节拍)音乐专辑。 + +Blue Coast 有许多可提供给开源音乐爱好者的。音乐可以无需通过那些奇怪的平台专用下载管理器下载(有时以物理形式)。它通常提供几种形式,包括 WAV、FLAC 和 DSD;WAV 和 FLAC 还提供不同的字长和比特率,包括 16/44.1、24/96 和 24/192,针对 DSD 则有 2.8、5.6 和 11.2 MHz。音乐是用优秀的仪器精心录制的。不幸的是,我并没有找到许多符合我口味的音乐,尽管我喜欢 Blue Coast 上能获取的几个艺术家,包括 Qua Continuum,[Art Lande][17] 以及 [Alex De Grassi][18]。 + +在 [Bandcamp][19] 上,我挑选了 [Emancipator's Baralku][20] 和 [Framework's Tides][21],两个都是我喜欢的。两位艺术家创作的音乐符合我的口味——电音但又(总体来说)不是舞蹈,它们的音乐旋律优美,副歌也很好听。有许多可以让开源音乐发烧友爱上 Bandcamp 的东西,比如买前试听整首歌的服务;没有垃圾软件下载器;与大量音乐家的合作;以及对 [Creative Commons music][22] 的支持。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/radiodroid-internet-radio-player + +作者:[Chris Hermansen (Community Moderator)][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (woman programming) +[2]: https://www.theverge.com/2019/1/11/18178751/google-chromecast-audio-discontinued-sale +[3]: https://www.whathifi.com/google/chromecast-audio/review +[4]: https://www.mobilefun.com/google-chromecast-audio-black-70476 +[5]: https://opensource.com/sites/default/files/uploads/internet-radio_chromecast.png (Google Chromecast Audio) +[6]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[7]: https://github.com/segler-alex/RadioDroid +[8]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[9]: http://www.radio-browser.info/gui/#!/ +[10]: https://opensource.com/sites/default/files/uploads/internet-radio_radiodroid.png (RadioDroid) +[11]: http://www.radiogrenouille.com/ +[12]: https://91rock.com.br/ +[13]: http://player.181fm.com/?station=181-xblender +[14]: https://www.youtube.com/watch?v=PqLCQXPS8iQ +[15]: https://bluecoastmusic.com/artists/qua-continuum +[16]: https://bluecoastmusic.com/store +[17]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aart%20lande +[18]: https://bluecoastmusic.com/store?f%5B0%5D=search_api_multi_aggregation_1%3Aalex%20de%20grassi +[19]: https://bandcamp.com/ +[20]: https://emancipator.bandcamp.com/album/baralku +[21]: https://frameworksuk.bandcamp.com/album/tides +[22]: https://bandcamp.com/tag/creative-commons diff --git a/published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md b/published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md new file mode 100644 index 0000000000..b19c1a1a42 --- /dev/null +++ b/published/201904/20190407 Fixing Ubuntu Freezing at Boot Time.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: (Raverstern) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10756-1.html) +[#]: subject: (Fixing Ubuntu Freezing at Boot Time) +[#]: via: (https://itsfoss.com/fix-ubuntu-freezing/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +解决 Ubuntu 在启动时冻结的问题 +====== + +> 本文将向你一步步展示如何通过安装 NVIDIA 专有驱动来处理 Ubuntu 在启动过程中冻结的问题。本教程仅在一个新安装的 Ubuntu 系统上操作验证过,不过在其它情况下也理应可用。 + +不久前我买了台[宏碁掠夺者][1]笔记本电脑来测试各种 Linux 发行版。这台庞大且笨重的机器与我喜欢的,类似[戴尔 XPS][3]那般小巧轻便的笔记本电脑大相径庭。 + +我即便不打游戏也选择这台电竞笔记本电脑的原因,就是为了 [NVIDIA 的显卡][4]。宏碁掠夺者 Helios 300 上搭载了一块 [NVIDIA Geforce][5] GTX 1050Ti 显卡。 + +NVIDIA 那糟糕的 Linux 兼容性为人们所熟知。过去很多 It’s FOSS 的读者都向我求助过关于 NVIDIA 笔记本电脑的问题,而我当时无能为力,因为我手头上没有使用 NVIDIA 显卡的系统。 + +所以当我决定搞一台专门的设备来测试 Linux 发行版时,我选择了带有 NVIDIA 显卡的笔记本电脑。 + +这台笔记本原装的 Windows 10 系统安装在 120 GB 的固态硬盘上,并另外配有 1 TB 的机械硬盘来存储数据。在此之上我配置好了 [Windows 10 和 Ubuntu 18.04 双系统][6]。整个的安装过程舒适、方便、快捷。 + +随后我启动了 [Ubuntu][7]。那熟悉的紫色界面展现了出来,然后我就发现它卡在那儿了。鼠标一动不动,我也输入不了任何东西,然后除了长按电源键强制关机以外我啥事儿都做不了。 + +然后再次尝试启动,结果一模一样。整个系统就一直卡在那个紫色界面,随后的登录界面也出不来。 + +这听起来很耳熟吧?下面就让我来告诉你如何解决这个 Ubuntu 在启动过程中冻结的问题。 + +> 如果你用的不是 Ubuntu + +> 请注意,尽管是在 Ubuntu 18.04 上操作的,本教程应该也能用于其他基于 Ubuntu 的发行版,例如 Linux Mint、elementary OS 等等。关于这点我已经在 Zorin OS 上确认过。 + +### 解决 Ubuntu 启动中由 NVIDIA 驱动引起的冻结问题 + +![][8] + +我介绍的解决方案适用于配有 NVIDIA 显卡的系统,因为你所面临的系统冻结问题是由开源的 [NVIDIA Nouveau 驱动][9]所导致的。 + +事不宜迟,让我们马上来看看如何解决这个问题。 + +#### 步骤 1:编辑 Grub + +在启动系统的过程中,请你在如下图所示的 Grub 界面上停下。如果你没看到这个界面,在启动电脑时请按住 `Shift` 键。 + +在这个界面上,按 `E` 键进入编辑模式。 + +![按“E”按键][10] + +你应该看到一些如下图所示的代码。此刻你应关注于以 “linux” 开头的那一行。 + +![前往 Linux 开头的那一行][11] + +#### 步骤 2:在 Grub 中临时修改 Linux 内核参数 + +回忆一下,我们的问题出在 NVIDIA 显卡驱动上,是开源版 NVIDIA 驱动的不适配导致了我们的问题。所以此处我们能做的就是禁用这些驱动。 + +此刻,你有多种方式可以禁用这些驱动。我最喜欢的方式是通过 `nomodeset` 来禁用所有显卡的驱动。 + +请把下列文本添加到以 “linux” 开头的那一行的末尾。此处你应该可以正常输入。请确保你把这段文本加到了行末。 + +``` + nomodeset +``` + +现在你屏幕上的显示应如下图所示: + +![通过向内核添加 nomodeset 来禁用显卡驱动][12] + +按 `Ctrl+X` 或 `F10` 保存并退出。下次你就将以修改后的内核参数来启动。 + +> 对以上操作的解释 + +> 所以我们究竟做了些啥?那个 `nomodeset` 又是个什么玩意儿?让我来向你简单地解释一下。 + +> 通常来说,显卡是在 X 或者是其他显示服务器开始执行后才被启用的,也就是在你登录系统并看到图形界面以后。 + +> 但近来,视频模式的设置被移进了内核。这么做的众多优点之一就是能你看到一个漂亮且高清的启动画面。 + +> 若你往内核中加入 `nomodeset` 参数,它就会指示内核在显示服务启动后才加载显卡驱动。 + +> 换句话说,你在此时禁止视频驱动的加载,由此产生的冲突也会随之消失。你在登录进系统以后,还是能看到一切如旧,那是因为显卡驱动在随后的过程中被加载了。 + +#### 步骤 3:更新你的系统并安装 NVIDIA 专有驱动 + +别因为现在可以登录系统了就过早地高兴起来。你之前所做的只是临时措施,在下次启动的时候,你的系统依旧会尝试加载 Nouveau 驱动而因此冻结。 + +这是否意味着你将不得不在 Grub 界面上不断地编辑内核?可喜可贺,答案是否定的。 + +你可以在 Ubuntu 上为 NVIDIA 显卡[安装额外的驱动][13]。在使用专有驱动后,Ubuntu 将不会在启动过程中冻结。 + +我假设这是你第一次登录到一个新安装的系统。这意味着在做其他事情之前你必须先[更新 Ubuntu][14]。通过 Ubuntu 的 `Ctrl+Alt+T` [系统快捷键][15]打开一个终端,并输入以下命令: + +``` +sudo apt update && sudo apt upgrade -y +``` + +在上述命令执行完以后,你可以尝试安装额外的驱动。不过根据我的经验,在安装新驱动之前你需要先重启一下你的系统。在你重启时,你还是需要按我们之前做的那样修改内核参数。 + +当你的系统已经更新和重启完毕,按下 `Windows` 键打开一个菜单栏,并搜索“软件与更新Software & Updates”。 + +![点击“软件与更新”(Software & Updates)][16] + +然后切换到“额外驱动Additional Drivers”标签页,并等待数秒。然后你就能看到可供系统使用的专有驱动了。在这个列表上你应该可以找到 NVIDIA。 + +选择专有驱动并点击“应用更改Apply Changes”。 + +![NVIDIA 驱动安装中][17] + +新驱动的安装会费点时间。若你的系统启用了 UEFI 安全启动,你将被要求设置一个密码。*你可以将其设置为任何容易记住的密码*。它的用处我将在步骤 4 中说明。 + +![你可能需要设置一个安全启动密码][18] + +安装完成后,你会被要求重启系统以令之前的更改生效。 + +![在新驱动安装好后重启你的系统][19] + +#### 步骤 4:处理 MOK(仅针对启用了 UEFI 安全启动的设备) + +如果你之前被要求设置安全启动密码,此刻你会看到一个蓝色界面,上面写着 “MOK management”。这是个复杂的概念,我试着长话短说。 + +对 MOK([设备所有者密码][20])的要求是因为安全启动的功能要求所有内核模块都必须被签名。Ubuntu 中所有随 ISO 镜像发行的内核模块都已经签了名。由于你安装了一个新模块(也就是那个额外的驱动),或者你对内核模块做了修改,你的安全系统可能视之为一个未经验证的外部修改,从而拒绝启动。 + +因此,你可以自己对系统模块进行签名(以告诉 UEFI 系统莫要大惊小怪,这些修改是你做的),或者你也可以简单粗暴地[禁用安全启动][21]。 + +现在你对[安全启动和 MOK][22] 有了一定了解,那咱们就来看看在遇到这个蓝色界面后该做些什么。 + +如果你选择“继续启动”,你的系统将有很大概率如往常一样启动,并且你啥事儿也不用做。不过在这种情况下,新驱动的有些功能有可能工作不正常。 + +这就是为什么,你应该“选择注册 MOK”。 + +![][23] + +它会在下一个页面让你点击“继续”,然后要你输入一串密码。请输入在上一步中,在安装额外驱动时设置的密码。 + +> 别担心! + +> 如果你错过了这个关于 MOK 的蓝色界面,或不小心点了“继续启动”而不是“注册 MOK”,不必惊慌。你的主要目的是能够成功启动系统,而通过禁用 Nouveau 显卡驱动,你已经成功地实现了这一点。 + +> 最坏的情况也不过就是你的系统切换到 Intel 集成显卡而不再使用 NVIDIA 显卡。你可以之后的任何时间安装 NVIDIA 显卡驱动。你的首要任务是启动系统。 + +#### 步骤 5:享受安装了专有 NVIDIA 驱动的 Linux 系统 + +当新驱动被安装好后,你需要再次重启系统。别担心!目前的情况应该已经好起来了,并且你不必再去修改内核参数,而是能够直接启动 Ubuntu 系统了。 + +我希望本教程帮助你解决了 Ubuntu 系统在启动中冻结的问题,并让你能够成功启动 Ubuntu 系统。 + +如果你有任何问题或建议,请在下方评论区给我留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fix-ubuntu-freezing/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[Raverstern](https://github.com/Raverstern) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://amzn.to/2YVV6rt +[2]: https://itsfoss.com/affiliate-policy/ +[3]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[4]: https://www.nvidia.com/en-us/ +[5]: https://www.nvidia.com/en-us/geforce/ +[6]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[7]: https://www.ubuntu.com/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/fixing-frozen-ubuntu.png?resize=800%2C450&ssl=1 +[9]: https://nouveau.freedesktop.org/wiki/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/edit-grub-menu.jpg?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue.jpg?resize=800%2C343&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/editing-grub-to-fix-nvidia-issue-2.jpg?resize=800%2C320&ssl=1 +[13]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[14]: https://itsfoss.com/update-ubuntu/ +[15]: https://itsfoss.com/ubuntu-shortcuts/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/activities_software_updates_search-e1551416201782-800x228.png?resize=800%2C228&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-nvidia-driver-ubuntu.jpg?resize=800%2C520&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/secure-boot-nvidia.jpg?ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/nvidia-drivers-installed-Ubuntu.jpg?resize=800%2C510&ssl=1 +[20]: https://firmware.intel.com/blog/using-mok-and-uefi-secure-boot-suse-linux +[21]: https://itsfoss.com/disable-secure-boot-in-acer/ +[22]: https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/MOK-Secure-boot.jpg?resize=800%2C350&ssl=1 diff --git a/published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md b/published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md new file mode 100644 index 0000000000..25400372b3 --- /dev/null +++ b/published/201904/20190407 Happy 14th anniversary Git- What do you love about Git.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (zhs852) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10702-1.html) +[#]: subject: (Happy 14th anniversary Git: What do you love about Git?) +[#]: via: (https://opensource.com/article/19/4/what-do-you-love-about-git) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/seth) + +Git 十四周年:你喜欢 Git 的哪一点? +====== + +> Git 为软件开发所带来的巨大影响是其它工具难以企及的。 + +![arrows cycle symbol for failing faster][1] + +在 Linus Torvalds 开发 Git 后的十四年间,它为软件开发所带来的影响是其它工具难以企及的:在 [StackOverflow 的 2018 年开发者调查][2] 中,87% 的受访者都表示他们使用 Git 来作为他们项目的版本控制工具。显然,没有其它工具能撼动 Git 版本控制管理工具(SCM)之王的地位。 + +为了在 4 月 7 日 Git 的十四周年这一天向 Git 表示敬意,我问了一些爱好者他们最喜欢 Git 的哪一点。以下便是他们所告诉我的: + +*(为了便于理解,部分回答已经进行了小幅修改)* + +“我无法忍受 Git。无论是难以理解的术语还是它的分布式。使用 Gerrit 这样的插件才能使它像 Subversion 或 Perforce 这样的集中式仓库管理器使用的工具的一半好用。不过既然这次的问题是‘你喜欢 Git 的什么?’,我还是希望回答:Git 使得对复杂的源代码树操作成为可能,并且它的回滚功能使得实现一个要 20 次修改才能更正的问题变得简单起来。” — _[Sweet Tea Dorminy][3]_ + +“我喜欢 Git 是因为它不会强制我执行特定的工作流程,并且开发团队可以自由地以适合自己的方式来进行团队开发,无论是拉取请求、以电子邮件递送差异文件或是给予所有人推送的权限。” — _[Andy Price][4]_ + +“我从 2006、2007 年的样子就开始使用 Git 了。我喜欢 Git 是因为,它既适用于那种从未离开过我电脑的小项目,也适用于大型的团队合作的分布式项目。Git 使你可以从(几乎)所有的错误提交中回滚到先前版本,这个功能显著地减轻了我在软件版本管理方面的压力。” — _[Jonathan S. Katz][5]_ + +“我很欣赏 Git 那种 [底层命令和高层命令][6] 的理念。用户可以使用 Git 有效率地分享任何形式的信息,而不需要知道其内部工作原理。而好奇的人可以透过其表层的命令,而发现其为许多代码分享平台提供了支持的可以定位内容的文件系统。” — _[Matthew Broberg][7]_ + +“我喜欢 Git 是因为浏览、开发、构建、测试和向我的 Git 仓库中提交代码的工作几乎都能用它来完成。它经常会调动起我参与开源项目的积极性。” — _[Daniel Oh][8]_ + +“Git 是我用过的首个版本控制工具。数年间,它从一个可怕的工具变成了一个友好的工具。我喜欢它使你在修改代码的时候更加自信,因为它能保证你主分支的安全(除非你强制提交了一段考虑不周的代码到主分支)。你可以检出先前的提交来撤销更改,这一点也是很棒的。” — _[Kedar Vijay Kulkarni][9]_ + +“我之所以喜欢 Git 是因为它淘汰了一些其它的版本控制工具。没人使用 VSS,而 Subversion 可以和 git-svn 一起使用(如果必要),BitKeeper 则和 Monotone 一样只为老一辈所知。当然,我们还有 Mercurial,不过在我几年之前用它来为 Firefox 添加 AArch64 支持时,我觉得它仍是那种还未完善的工具。部分人可能还会提到 Perforce、SourceSafe 或是其它企业级的解决方案,我只想说它们在开源世界里并不流行。” — _[Marcin Juszkiewicz][10]_ + +“我喜欢内置的 SHA1 化对象模型(commit → tree → blob)的简易性。我也喜欢它的高层命令。同时我也将它作为对 JBoss/Red Hat Fuse 的补丁机制。并且这种机制确实有效。我还喜欢 Git 的 [三棵树的故事][11]。” — _[Grzegorz Grzybek][12]_ + +“我喜欢 [自动生成的 Git 说明页][13](这个页面虽然听起来是有关 Git 的,但是事实上这是一个没有实际意义的页面,不过它总是会给人一种像是真的 Git 页面的感觉…),这使得我对 Git 的敬意油然而生。” — _[Marko Myllynen][14]_ + +“Git 改变了我作为开发者的生活。它使得 SCM 问题从世界上消失得无影无踪。”— _[Joel Takvorian][15]_ + +* * * + +看完这十个爱好者的回答之后,就轮到你了:你最欣赏 Git 的什么?请在评论区分享你的看法! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/what-do-you-love-about-git + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[zhs852](https://github.com/zhs852) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster) +[2]: https://insights.stackoverflow.com/survey/2018/#work-_-version-control +[3]: https://github.com/sweettea +[4]: https://www.linkedin.com/in/andrew-price-8771796/ +[5]: https://opensource.com/users/jkatz05 +[6]: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain +[7]: https://opensource.com/users/mbbroberg +[8]: https://opensource.com/users/daniel-oh +[9]: https://opensource.com/users/kkulkarn +[10]: https://github.com/hrw +[11]: https://speakerdeck.com/schacon/a-tale-of-three-trees +[12]: https://github.com/grgrzybek +[13]: https://git-man-page-generator.lokaltog.net/ +[14]: https://github.com/myllynen +[15]: https://github.com/jotak diff --git a/published/201904/20190408 Bash vs. Python- Which language should you use.md b/published/201904/20190408 Bash vs. Python- Which language should you use.md new file mode 100644 index 0000000000..c665f00cbf --- /dev/null +++ b/published/201904/20190408 Bash vs. Python- Which language should you use.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10725-1.html) +[#]: subject: (Bash vs. Python: Which language should you use?) +[#]: via: (https://opensource.com/article/19/4/bash-vs-python) +[#]: author: (Archit Modi Red Hat https://opensource.com/users/architmodi/users/greg-p/users/oz123) + +Bash vs Python:你该使用哪个? +====== + +> 两种编程语言都各有优缺点,它们在某些任务方面互有胜负。 + +![][1] + +[Bash][2] 和 [Python][3] 是大多数自动化工程师最喜欢的编程语言。它们都各有优缺点,有时很难选择应该使用哪一个。所以,最诚实的答案是:这取决于任务、范围、背景和任务的复杂性。 + +让我们来比较一下这两种语言,以便更好地理解它们各自的优点。 + +### Bash + + * 是一种 Linux/Unix shell 命令语言 + * 非常适合编写使用命令行界面(CLI)实用程序的 shell 脚本,利用一个命令的输出传递给另一个命令(管道),以及执行简单的任务(可以多达 100 行代码) + * 可以按原样使用命令行命令和实用程序 + * 启动时间比 Python 快,但执行时性能差 + * Windows 中默认没有安装。你的脚本可能不会兼容多个操作系统,但是 Bash 是大多数 Linux/Unix 系统的默认 shell + * 与其它 shell (如 csh、zsh、fish) *不* 完全兼容。 + * 通过管道(`|`)传递 CLI 实用程序如 `sed`、`awk`、`grep` 等会降低其性能 + * 缺少很多函数、对象、数据结构和多线程支持,这限制了它在复杂脚本或编程中的使用 + * 缺少良好的调试工具和实用程序 + +### Python + + * 是一种面对对象编程语言(OOP),因此它比 Bash 更加通用 + * 几乎可以用于任何任务 + * 适用于大多数操作系统,默认情况下它在大多数 Unix/Linux 系统中都有安装 + * 与伪代码非常相似 + * 具有简单、清晰、易于学习和阅读的语法 + * 拥有大量的库、文档以及一个活跃的社区 + * 提供比 Bash 更友好的错误处理特性 + * 有比 Bash 更好的调试工具和实用程序,这使得它在开发涉及到很多行代码的复杂软件应用程序时是一种很棒的语言 + * 应用程序(或脚本)可能包含许多第三方依赖项,这些依赖项必须在执行前安装 + * 对于简单任务,需要编写比 Bash 更多的代码 + +我希望这些列表能够让你更好地了解该使用哪种语言以及在何时使用它。 + +你在日常工作中更多会使用哪种语言,Bash 还是 Python?请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/bash-vs-python + +作者:[Archit Modi (Red Hat)][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/architmodi/users/greg-p/users/oz123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_happy_sad_developer_programming.png?itok=72nkfSQ_ +[2]: /article/18/7/admin-guide-bash +[3]: /article/17/11/5-approaches-learning-python diff --git a/published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md b/published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md new file mode 100644 index 0000000000..2e63380c76 --- /dev/null +++ b/published/201904/20190409 Cisco, Google reenergize multicloud-hybrid cloud joint development.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10747-1.html) +[#]: subject: (Cisco, Google reenergize multicloud/hybrid cloud joint development) +[#]: via: (https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科、谷歌重新赋能多/混合云共同开发 +====== +> 思科、VMware、HPE 等公司开始采用了新的 Google Cloud Athos 云技术。 + +![Thinkstock][1] + +思科与谷歌已扩展它们的混合云开发活动,以帮助其客户可以在从本地数据中心到公共云上的任何地方更轻松地搭建安全的多云以及混合云应用。 + +这次扩张围绕着谷歌被称作 Anthos 的新的开源混合云包展开,它是在这周的 Google Next 活动上推出的。Anthos 基于并取代了谷歌现有的谷歌云服务测试版。Anthos 将让客户们无须修改应用就可以在现有的本地硬件或公共云上运行应用。据谷歌说,它可以在[谷歌云平台][5] (GCP) 与 [谷歌 Kubernetes 引擎][6] (GKE) 或者在数据中心中与 [GKE On-Prem][7] 一同使用。谷歌说,Anthos 首次让客户们可以无需管理员和开发者了解不同的坏境和 API 就能从谷歌平台上管理在第三方云上(如 AWS 和 Azure)的工作负荷。 + +关键在于,Athos 提供了一个单一的托管服务,它使得客户们无须担心不同的环境或 API 就能跨云管理、部署工作负荷。 + +作为首秀的一部分,谷歌也宣布一个叫做 [Anthos Migrate][8] 的测试计划,它能够从本地环境或者其它云自动迁移虚拟机到 GKE 上的容器中。谷歌说,“这种独特的迁移技术使你无须修改原来的虚拟机或者应用就能以一种行云流水般的方式迁移、更新你的基础设施”。谷歌称它给予了公司按客户节奏转移本地应用到云环境的灵活性。 + +### 思科和谷歌 + +就思科来说,它宣布对 Anthos 的支持并承诺将它紧密集成进思科的数据中心技术中,例如 HyperFlex 超融合包、应用中心基础设施(思科的旗舰 SDN 方案)、SD-WAN 和 StealthWatch 云。思科说,无论是本地的还是在云端的,这次集成将通过自动更新到最新版本和安全补丁,给予一种一致的、云般的感觉。 + +“谷歌云在容器(Kubernetes)和服务网格service mesh(Istio)上的专业与它们在开发者社区的领导力,再加上思科的企业级网络、计算、存储和安全产品及服务,将为我们的顾客促成一次强强联合。”思科的云平台和解决方案集团资深副总裁 Kip Compton 这样[写道][9],“思科对于 Anthos 的集成将会帮助顾客跨本地数据中心和公共云搭建、管理多云/混合云应用,让他们专注于创新和灵活性,同时不会影响安全性或增加复杂性。” + +### 谷歌云和思科 + +谷歌云工程副总裁 Eyal Manor [写道][10] 通过思科对 Anthos 的支持,客户将能够: + +* 受益于全托管服务例如 GKE 以及思科的超融合基础设施、网络和安全技术; +* 在企业数据中心和云中一致运行 +* 在企业数据中心使用云服务 +* 用最新的云技术更新本地基础设施 + +思科和谷歌从 2017 年 10 月就在紧密合作,当时他们表示正在开发一个能够连接本地基础设施和云环境的开放混合云平台。该套件,即[思科为谷歌云打造的混合云平台][11],大致在 2018 年 9 月上市。它使得客户们能通过谷歌云托管 Kubernetes 容器开发企业级功能,包含思科网络和安全技术以及来自 Istio 的服务网格监控。 + +谷歌说开源的 Istio 的容器和微服务优化技术给开发者提供了一种一致的方式,通过服务级的 mTLS (双向传输层安全)身份验证访问控制来跨云连接、保护、管理和监听微服务。因此,客户能够轻松实施新的可移植的服务,并集中配置和管理这些服务。 + +思科不是唯一宣布对 Anthos 支持的供应商。谷歌表示,至少 30 家大型合作商包括 [VMware][12]、[Dell EMC][13]、[HPE][14]、Intel 和联想致力于为他们的客户在它们自己的超融合基础设施上提供 Anthos 服务。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.techhive.com/images/article/2016/12/hybrid_cloud-100700390-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://cloud.google.com/ +[6]: https://cloud.google.com/kubernetes-engine/ +[7]: https://cloud.google.com/gke-on-prem/ +[8]: https://cloud.google.com/contact/ +[9]: https://blogs.cisco.com/news/next-phase-cisco-google-cloud +[10]: https://cloud.google.com/blog/topics/partners/google-cloud-partners-with-cisco-on-hybrid-cloud-next19?utm_medium=unpaidsocial&utm_campaign=global-googlecloud-liveevent&utm_content=event-next +[11]: https://cloud.google.com/cisco/ +[12]: https://blogs.vmware.com/networkvirtualization/2019/04/vmware-and-google-showcase-hybrid-cloud-deployment.html/ +[13]: https://www.dellemc.com/en-us/index.htm +[14]: https://www.hpe.com/us/en/newsroom/blog-post/2019/04/hpe-and-google-cloud-join-forces-to-accelerate-innovation-with-hybrid-cloud-solutions-optimized-for-containerized-applications.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world + diff --git a/published/201904/20190409 Enhanced security at the edge.md b/published/201904/20190409 Enhanced security at the edge.md new file mode 100644 index 0000000000..3932005a41 --- /dev/null +++ b/published/201904/20190409 Enhanced security at the edge.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10773-1.html) +[#]: subject: (Enhanced security at the edge) +[#]: via: (https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +增强边缘计算的安全性 +====== + +> 边缘计算环境带来的安全风险迫使公司必须特别关注它的安全措施。 + +![](https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg) + +说数据安全是高管们和董事会最关注的问题已经是陈词滥调了。但问题是:数据安全问题不会自己消失。 + +骇客和攻击者一直在寻找利用缺陷的新方法。就像公司开始使用人工智能和机器学习等新兴技术来自动化地保护他们的组织一样,那些不良分子们也在使用这些技术来达成他们的目的。 + +简而言之,安全问题是一定不能忽视的。现在,随着越来越多的公司开始使用边缘计算,如何保护这些边缘计算环境,需要有新的安全考量。 + +### 边缘计算的风险更高 + +正如 Network World 的一篇文章所说,边缘计算的安全架构应该将重点放在物理安全上。这并不是说要忽视保护传输过程中的数据。而是说,实际的物理环境和物理设备更加值得关注。 + +例如,边缘计算的硬件设备通常位于较大的公司或者广阔空间中,有时候是在很容易进入的共享办公室和公共区域里。从表面上看,这节省了成本,能更快地访问到相关的数据,而不必在后端的数据中心和前端的设备之间往返。 + +但是,如果没有任何级别的访问控制,这台设备就会暴露在恶意操作和简单人为错误的双重风险之下。想象一下办公室的清洁工意外地关掉了设备,以及随之而来的停机所造成的后果。 + +另一个风险是 “影子边缘 IT”。有时候非 IT 人员会部署一个边缘设备来快速启动项目,却没有及时通知 IT 部门这个设备正在连接到网络。例如,零售商店可能会主动安装他们自己的数字标牌,或者,销售团队会将物联网传感器应用到电视中,并在销售演示中实时地部署它们。 + +在这种情况下,IT 部门很少甚至完全看不到这些边缘设备,这就使得网络可能暴露在外。 + +### 保护边缘计算环境 + +部署微型数据中心(MDC)是规避上述风险的一个简单方法。 + +> “在历史上,大多数这些[边缘]环境都是不受控制的,”施耐德电气安全能源部门的首席技术官和创新高级副总裁 Kevin Brown 说。“它们可能是第 1 级,但很可能是第 0 级类型的设计 —— 它们就像开放的配线柜。它们现在需要像微型数据中心一样的对待。你管理它需要像管理关键任务数据中心一样” + +单说听起来的感觉,这个解决方案是一个安全、独立的机箱,它包括在室内和室外运行程序所需的所有存储空间、处理性能和网络资源。它同样包含必要的电源、冷却、安全和管理工具。 + +而它最重要的是高级别的安全性。这个装置是封闭的,有上锁的门,可以防止非法入侵。通过合适的供应商,DMC 可以进行定制,包括用于远程数字化管理的监控摄像头、传感器和监控技术。 + +随着越来越多的公司开始利用边缘计算的优势,他们必须利用安全解决方案的优势来保护他们的数据和边缘环境。 + +在 APC.com 上了解保护你的边缘计算环境的最佳方案。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388130/enhanced-security-at-the-edge.html + +作者:[Anne Taylor][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1091707448-100793312-large.jpg +[2]: https://www.csoonline.com/article/3250144/6-ways-hackers-will-use-machine-learning-to-launch-attacks.html +[3]: https://www.marketwatch.com/press-release/edge-computing-market-2018-global-analysis-opportunities-and-forecast-to-2023-2018-08-20 +[4]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[5]: https://www.youtube.com/watch?v=1NLk1cXEukQ +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/published/201904/20190409 Four Methods To Add A User To Group In Linux.md b/published/201904/20190409 Four Methods To Add A User To Group In Linux.md new file mode 100644 index 0000000000..96d54fd161 --- /dev/null +++ b/published/201904/20190409 Four Methods To Add A User To Group In Linux.md @@ -0,0 +1,340 @@ +[#]: collector: (lujun9972) +[#]: translator: (NeverKnowsTomorrow) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10768-1.html) +[#]: subject: (Four Methods To Add A User To Group In Linux) +[#]: via: (https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +在 Linux 中把用户添加到组的四个方法 +====== + +Linux 组是用于管理 Linux 中用户帐户的组织单位。对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号。它被称为 用户 ID(UID)和组 ID(GID)。组的主要目的是为组的成员定义一组特权。它们都可以执行特定的操作,但不能执行其他操作。 + +Linux 中有两种类型的默认组。每个用户应该只有一个 主要组primary group 和任意数量的 次要组secondary group。 + +* **主要组:** 创建用户帐户时,已将主要组添加到用户。它通常是用户的名称。在执行诸如创建新文件(或目录)、修改文件或执行命令等任何操作时,主要组将应用于用户。用户的主要组信息存储在 `/etc/passwd` 文件中。 +* **次要组:** 它被称为次要组。它允许用户组在同一组成员文件中执行特定操作。例如,如果你希望允许少数用户运行 Apache(httpd)服务命令,那么它将非常适合。 + +你可能对以下与用户管理相关的文章感兴趣。 + +* [在 Linux 中创建用户帐户的三种方法?][1] +* [如何在 Linux 中创建批量用户?][2] +* [如何在 Linux 中使用不同的方法更新/更改用户密码?][3] + +可以使用以下四种方法实现。 + +* `usermod`:修改系统帐户文件,以反映在命令行中指定的更改。 +* `gpasswd`:用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 +* Shell 脚本:可以让管理员自动执行所需的任务。 +* 手动方式:我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 + +我假设你已经拥有此操作所需的组和用户。在本例中,我们将使用以下用户和组:`user1`、`user2`、`user3`,另外的组是 `mygroup` 和 `mygroup1`。 + +在进行更改之前,我希望检查一下用户和组信息。详见下文。 + +我可以看到下面的用户与他们自己的组关联,而不是与其他组关联。 + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1) + +# id user2 +uid=1009(user2) gid=1009(user2) groups=1009(user2) + +# id user3 +uid=1010(user3) gid=1010(user3) groups=1010(user3) +``` + +我可以看到这个组中没有关联的用户。 + +``` +# getent group mygroup +mygroup:x:1012: + +# getent group mygroup1 +mygroup1:x:1013: +``` + +### 方法 1:使用 usermod 命令 + +`usermod` 命令修改系统帐户文件,以反映命令行上指定的更改。 + +#### 如何使用 usermod 命令将现有的用户添加到次要组或附加组? + +要将现有用户添加到辅助组,请使用带有 `-G` 选项和组名称的 `usermod` 命令。 + +语法: + +``` +# usermod [-G] [GroupName] [UserName] +``` + +如果系统中不存在给定的用户或组,你将收到一条错误消息。如果没有得到任何错误,那么用户已经被添加到相应的组中。 + +``` +# usermod -a -G mygroup user1 +``` + +让我使用 `id` 命令查看输出。是的,添加成功。 + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) +``` + +#### 如何使用 usermod 命令将现有的用户添加到多个次要组或附加组? + +要将现有用户添加到多个次要组中,请使用带有 `-G` 选项的 `usermod` 命令和带有逗号分隔的组名称。 + +语法: + +``` +# usermod [-G] [GroupName1,GroupName2] [UserName] +``` + +在本例中,我们将把 `user2` 添加到 `mygroup` 和 `mygroup1` 中。 + +``` +# usermod -a -G mygroup,mygroup1 user2 +``` + +让我使用 `id` 命令查看输出。是的,`user2` 已成功添加到 `myGroup` 和 `myGroup1` 中。 + +``` +# id user2 +uid=1009(user2) gid=1009(user2) groups=1009(user2),1012(mygroup),1013(mygroup1) +``` + +#### 如何改变用户的主要组? + +要更改用户的主要组,请使用带有 `-g` 选项和组名称的 `usermod` 命令。 + +语法: + +``` +# usermod [-g] [GroupName] [UserName] +``` + +我们必须使用 `-g` 改变用户的主要组。 + +``` +# usermod -g mygroup user3 +``` + +让我们看看输出。是的,已成功更改。现在,显示`user3` 主要组是 `mygroup` 而不是 `user3`。 + +``` +# id user3 +uid=1010(user3) gid=1012(mygroup) groups=1012(mygroup) +``` + +### 方法 2:使用 gpasswd 命令 + +`gpasswd` 命令用于管理 `/etc/group` 和 `/etc/gshadow`。每个组都可以有管理员、成员和密码。 + +#### 如何使用 gpasswd 命令将现有用户添加到次要组或者附加组? + +要将现有用户添加到次要组,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 + +语法: + +``` +# gpasswd [-M] [UserName] [GroupName] +``` + +在本例中,我们将把 `user1 ` 添加到 `mygroup` 中。 + +``` +# gpasswd -M user1 mygroup +``` + +让我使用 `id` 命令查看输出。是的,`user1` 已成功添加到 `mygroup` 中。 + +``` +# id user1 +uid=1008(user1) gid=1008(user1) groups=1008(user1),1012(mygroup) +``` + +#### 如何使用 gpasswd 命令添加多个用户到次要组或附加组中? + +要将多个用户添加到辅助组中,请使用带有 `-M` 选项和组名称的 `gpasswd` 命令。 + +语法: + +``` +# gpasswd [-M] [UserName1,UserName2] [GroupName] +``` + +在本例中,我们将把 `user2` 和 `user3` 添加到 `mygroup1` 中。 + +``` +# gpasswd -M user2,user3 mygroup1 +``` + +让我使用 `getent` 命令查看输出。是的,`user2` 和 `user3` 已成功添加到 `myGroup1` 中。 + +``` +# getent group mygroup1 +mygroup1:x:1013:user2,user3 +``` + +#### 如何使用 gpasswd 命令从组中删除一个用户? + +要从组中删除用户,请使用带有 `-d` 选项的 `gpasswd` 命令以及用户和组的名称。 + +语法: + +``` +# gpasswd [-d] [UserName] [GroupName] +``` + +在本例中,我们将从 `mygroup` 中删除 `user1` 。 + +``` +# gpasswd -d user1 mygroup +Removing user user1 from group mygroup +``` + +### 方法 3:使用 Shell 脚本 + +基于上面的例子,我知道 `usermod` 命令没有能力将多个用户添加到组中,可以通过 `gpasswd` 命令完成。但是,它将覆盖当前与组关联的现有用户。 + +例如,`user1` 已经与 `mygroup` 关联。如果要使用 `gpasswd` 命令将 `user2` 和 `user3` 添加到 `mygroup` 中,它将不会按预期生效,而是对组进行修改。 + +如果要将多个用户添加到多个组中,解决方案是什么? + +两个命令中都没有默认选项来实现这一点。 + +因此,我们需要编写一个小的 shell 脚本来实现这一点。 + +#### 如何使用 gpasswd 命令将多个用户添加到次要组或附加组? + +如果要使用 `gpasswd` 命令将多个用户添加到次要组或附加组,请创建以下 shell 脚本。 + +创建用户列表。每个用户应该在单独的行中。 + +```bash +$ cat user-lists.txt +user1 +user2 +user3 +``` + +使用以下 shell 脚本将多个用户添加到单个次要组。 + +```bash +vi group-update.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do +usermod -a -G mygroup $user +done +``` + +设置 `group-update.sh` 文件的可执行权限。 + +``` +# chmod + group-update.sh +``` + +最后运行脚本来实现它。 + +``` +# sh group-update.sh +``` + +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 + +``` +# getent group mygroup +mygroup:x:1012:user1,user2,user3 +``` + +#### 如何使用 gpasswd 命令将多个用户添加到多个次要组或附加组? + +如果要使用 `gpasswd` 命令将多个用户添加到多个次要组或附加组中,请创建以下 shell 脚本。 + +创建用户列表。每个用户应该在单独的行中。 + +```bash +$ cat user-lists.txt +user1 +user2 +user3 +``` + +创建组列表。每组应在单独的行中。 + +```bash +$ cat group-lists.txt +mygroup +mygroup1 +``` + +使用以下 shell 脚本将多个用户添加到多个次要组。 + +```bash +#!/bin/sh +for user in `more user-lists.txt` +do +for group in `more group-lists.txt` +do +usermod -a -G $group $user +done +``` + +设置 `group-update-1.sh` 文件的可执行权限。 + +``` +# chmod +x group-update-1.sh +``` + +最后运行脚本来实现它。 + +``` +# sh group-update-1.sh +``` + +让我看看使用 `getent` 命令的输出。 是的,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup` 中。 + +``` +# getent group mygroup +mygroup:x:1012:user1,user2,user3 +``` + +此外,`user1`、`user2` 和 `user3` 已成功添加到 `mygroup1` 中。 + +``` +# getent group mygroup1 +mygroup1:x:1013:user1,user2,user3 +``` + +### 方法 4:在 Linux 中将用户添加到组中的手动方法 + +我们可以通过编辑 `/etc/group` 文件手动将用户添加到任何组中。 + +打开 `/etc/group` 文件并搜索要更新用户的组名。最后将用户更新到相应的组中。 + +``` +# vi /etc/group +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-add-user-to-group-primary-secondary-group-usermod-gpasswd/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[NeverKnowsTomorrow](https://github.com/NeverKnowsTomorrow) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/linux-user-account-creation-useradd-adduser-newusers/ +[2]: https://www.2daygeek.com/how-to-create-the-bulk-users-in-linux/ +[3]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/ diff --git a/published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md b/published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md new file mode 100644 index 0000000000..246405796b --- /dev/null +++ b/published/201904/20190409 How To Install And Enable Flatpak Support On Linux.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10751-1.html) +[#]: subject: (How To Install And Enable Flatpak Support On Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上安装并启用 Flatpak 支持? +====== + +目前,我们都在使用 Linux 发行版的官方软件包管理器来安装所需的软件包。 + +在 Linux 中,它做得很好,没有任何问题。(它不打折扣地很好的完成了它应该做的工作) + +但在一些方面它也有一些限制,所以会让我们考虑其他替代解决方案来解决。 + +是的,默认情况下,我们不能从发行版官方软件包管理器获取到最新版本的软件包,因为这些软件包是在构建当前 OS 版本时构建的。它们只会提供安全更新,直到下一个主要版本发布。 + +那么,这种情况有什么解决办法吗?是的,我们有多种解决方案,而且我们大多数人已经开始使用其中的一些了。 + +有些什么呢,它们有什么好处? + + * **对于基于 Ubuntu 的系统:** PPA + * **对于基于 RHEL 的系统:** [EPEL 仓库][1]、[ELRepo 仓库][2]、[nux-dextop 仓库][3]、[IUS 社区仓库][4]、[RPMfusion 仓库][5] 和 [Remi 仓库][6] + +使用上面的仓库,我们将获得最新的软件包。这些软件包通常都得到了很好的维护,还有大多数社区的推荐。但这些只是建议,可能并不总是安全的。 + +近年来,出现了一下通用软件包封装格式,并且得到了广泛的应用。 + + * Flatpak:它是独立于发行版的包格式,主要贡献者是 Fedora 项目团队。大多数主要的 Linux 发行版都采用了 Flatpak 框架。 + * Snaps:Snappy 是一种通用的软件包封装格式,最初由 Canonical 为 Ubuntu 手机及其操作系统设计和构建的。后来,更多的发行版都接纳了它。 + * AppImage:AppImage 是一种可移植的包格式,可以在不安装和不需要 root 权限的情况下运行。 + +我们之前已经介绍过 [Snap 包管理器和包封装格式][7]。今天我们将讨论 Flatpak 包封装格式。 + +### 什么是 Flatpak? + +Flatpak(以前称为 X Desktop Group 或 xdg-app)是一个软件实用程序。它提供了一种通用的包封装格式,可以在任何 Linux 发行版中使用。 + +它提供了一个沙箱(隔离的)环境来运行应用程序,不会影响其他应用程序和发行版核心软件包。我们还可以安装并运行不同版本的软件包。 + +Flatpak 的一个缺点是不像 Snap 和 AppImage 那样支持服务器操作系统,它只在少数桌面环境下工作。 + +比如说,如果你想在系统上运行两个版本的 php,那么你可以轻松安装并按照你的意愿运行。 + +这就是现在通用包封装格式非常有名的地方。 + +### 如何在 Linux 中安装 Flatpak? + +大多数 Linux 发行版官方仓库都提供 Flatpak 软件包。因此,可以使用它们来进行安装。 + +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 flatpak。 + +``` +$ sudo dnf install flatpak +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][9] 或 [APT 命令][10] 来安装 flatpak。 + +``` +$ sudo apt install flatpak +``` + +对于较旧的 Ubuntu 版本: + +``` +$ sudo add-apt-repository ppa:alexlarsson/flatpak +$ sudo apt update +$ sudo apt install flatpak +``` + +对于基于 Arch Linux 的系统,使用 [Pacman 命令][11] 来安装 flatpak。 + +``` +$ sudo pacman -S flatpak +``` + +对于 RHEL/CentOS 系统,使用 [YUM 命令][12] 来安装 flatpak。 + +``` +$ sudo yum install flatpak +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][13] 来安装 flatpak。 + +``` +$ sudo zypper install flatpak +``` + +### 如何在 Linux 上启用 Flathub 支持? + +Flathub 网站是一个应用程序商店,你可以在其中找到 flatpak 软件包。它是一个中央仓库,所有的 flatpak 应用程序都可供用户使用。 + +运行以下命令在 Linux 上启用 Flathub 支持: + +``` +$ sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +为 GNOME 桌面环境安装 Software Flatpak 插件。 + +``` +$ sudo apt install gnome-software-plugin-flatpak +``` + +此外,如果你使用的是 GNOME 桌面环境,则可以启用 GNOME 仓库。它包含所有 GNOME 核心应用程序。 + +``` +$ wget https://sdk.gnome.org/keys/gnome-sdk.gpg +$ sudo flatpak remote-add --gpg-import=gnome-sdk.gpg --if-not-exists gnome-apps https://sdk.gnome.org/repo-apps/ +``` + +### 如何列出已配置的 flakpak 仓库? + +如果要查看系统上已配置的 flatpak 仓库列表,运行以下命令: + +``` +$ flatpak remotes +Name Options +flathub system +gnome-apps system +``` + +### 如何列出已配置仓库中的可用软件包? + +如果要查看已配置仓库中的可用软件包的列表(它将显示所有软件包,如应用程序和运行环境),运行以下命令: + +``` +$ flatpak remote-ls | head -10 + +org.freedesktop.GlxInfo gnome-apps +org.gnome.Books gnome-apps +org.gnome.Builder gnome-apps +org.gnome.Calculator gnome-apps +org.gnome.Calendar gnome-apps +org.gnome.Characters gnome-apps +org.gnome.Devhelp gnome-apps +org.gnome.Dictionary gnome-apps +org.gnome.Documents gnome-apps +org.gnome.Epiphany gnome-apps +``` + +仅列出应用程序: + +``` +$ flatpak remote-ls --app +``` + +列出特定的仓库应用程序: + +``` +$ flatpak remote-ls gnome-apps +``` + +### 如何从 flatpak 安装包? + +运行以下命令从 flatpak 仓库安装软件包: + +``` +$ sudo flatpak install flathub com.github.muriloventuroso.easyssh + +Required runtime for com.github.muriloventuroso.easyssh/x86_64/stable (runtime/org.gnome.Platform/x86_64/3.30) found in remote flathub +Do you want to install it? [y/n]: y +Installing in system: +org.gnome.Platform/x86_64/3.30 flathub 4e93789f42ac +org.gnome.Platform.Locale/x86_64/3.30 flathub 6abf9c0e2b72 +org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub d6abde36c0be +com.github.muriloventuroso.easyssh/x86_64/stable flathub 337db43043d2 + permissions: ipc, network, wayland, x11, dri + file access: home, xdg-run/dconf, ~/.config/dconf:ro + dbus access: ca.desrt.dconf +com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub af837356b222 +Is this ok [y/n]: y +Installing: org.gnome.Platform/x86_64/3.30 from flathub +[####################] 1 metadata, 14908 content objects fetched; 228018 KiB transferred in 364 seconds +Now at 4e93789f42ac. +Installing: org.gnome.Platform.Locale/x86_64/3.30 from flathub +[####################] 4 metadata, 1 content objects fetched; 16 KiB transferred in 2 seconds +Now at 6abf9c0e2b72. +Installing: org.freedesktop.Platform.html5-codecs/x86_64/18.08 from flathub +[####################] 26 metadata, 131 content objects fetched; 2737 KiB transferred in 8 seconds +Now at d6abde36c0be. +Installing: com.github.muriloventuroso.easyssh/x86_64/stable from flathub +[####################] 191 metadata, 3633 content objects fetched; 24857 KiB transferred in 117 seconds +Now at 337db43043d2. +Installing: com.github.muriloventuroso.easyssh.Locale/x86_64/stable from flathub +[####################] 3 metadata, 1 content objects fetched; 14 KiB transferred in 2 seconds +Now at af837356b222. +``` + +所有已安装的应用程序都将放在以下位置: + +``` +$ ls /var/lib/flatpak/app/ +com.github.muriloventuroso.easyssh +``` + +### 如何运行已安装的应用程序? + +运行以下命令以启动所需的应用程序,确保替换为你的应用程序名称: + +``` +$ flatpak run com.github.muriloventuroso.easyssh +``` + +### 如何查看已安装的应用程序? + +运行以下命令来查看已安装的应用程序: + +``` +$ flatpak list +Ref Options +com.github.muriloventuroso.easyssh/x86_64/stable system,current +org.freedesktop.Platform.html5-codecs/x86_64/18.08 system,runtime +org.gnome.Platform/x86_64/3.30 system,runtime +``` + +### 如何查看有关已安装应用程序的详细信息? + +运行以下命令以查看有关已安装应用程序的详细信息: + +``` +$ flatpak info com.github.muriloventuroso.easyssh + +Ref: app/com.github.muriloventuroso.easyssh/x86_64/stable +ID: com.github.muriloventuroso.easyssh +Arch: x86_64 +Branch: stable +Origin: flathub +Collection ID: org.flathub.Stable +Date: 2019-01-08 13:36:32 +0000 +Subject: Update com.github.muriloventuroso.easyssh.json (cd35819c) +Commit: 337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f +Parent: 6e49096146f675db6ecc0ce7c5347b4b4f049b21d83a6cc4d01ff3f27c707cb6 +Location: /var/lib/flatpak/app/com.github.muriloventuroso.easyssh/x86_64/stable/337db43043d282c74d14a9caecdc780464b5e526b4626215d534d38b0935049f +Installed size: 100.0 MB +Runtime: org.gnome.Platform/x86_64/3.30 +Sdk: org.gnome.Sdk/x86_64/3.30 +``` + +### 如何更新已安装的应用程序? + +运行以下命令将已安装的应用程序更新到最新版本: + +``` +$ flatpak update +``` + +对于特定应用程序,使用以下格式: + +``` +$ flatpak update com.github.muriloventuroso.easyssh +``` + +### 如何移除已安装的应用程序? + +运行以下命令来移除已安装的应用程序: + +``` +$ sudo flatpak uninstall com.github.muriloventuroso.easyssh +``` + +进入 man 页面以获取更多细节和选项: + +``` +$ flatpak --help +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-and-enable-flatpak-support-on-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-scientific-linux-oracle-linux/ +[2]: https://www.2daygeek.com/install-enable-elrepo-on-rhel-centos-scientific-linux/ +[3]: https://www.2daygeek.com/install-enable-nux-dextop-repository-on-centos-rhel-scientific-linux/ +[4]: https://www.2daygeek.com/install-enable-ius-community-repository-on-rhel-centos/ +[5]: https://www.2daygeek.com/install-enable-rpm-fusion-repository-on-centos-fedora-rhel/ +[6]: https://www.2daygeek.com/install-enable-remi-repository-on-centos-rhel-fedora/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[10]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[11]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[12]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[13]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/published/201904/20190410 How To Check The List Of Open Ports In Linux.md b/published/201904/20190410 How To Check The List Of Open Ports In Linux.md new file mode 100644 index 0000000000..0242d3cec2 --- /dev/null +++ b/published/201904/20190410 How To Check The List Of Open Ports In Linux.md @@ -0,0 +1,231 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10736-1.html) +[#]: subject: (How To Check The List Of Open Ports In Linux?) +[#]: via: (https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何检查 Linux 中的开放端口列表? +====== + +最近,我们就同一主题写了两篇文章。这些文章内容帮助你如何检查远程服务器中给定的端口是否打开。 + +如果你想 [检查远程 Linux 系统上的端口是否打开][1] 请点击链接浏览。如果你想 [检查多个远程 Linux 系统上的端口是否打开][2] 请点击链接浏览。如果你想 [检查多个远程 Linux 系统上的多个端口状态][2] 请点击链接浏览。 + +但是本文帮助你检查本地系统上的开放端口列表。 + +在 Linux 中很少有用于此目的的实用程序。然而,我提供了四个最重要的 Linux 命令来检查这一点。 + +你可以使用以下四个命令来完成这个工作。这些命令是非常出名的并被 Linux 管理员广泛使用。 + + * `netstat`:netstat (“network statistics”) 是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表, 伪装连接,多点传送成员和网络端口。 + * `nmap`:Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络。 + * `ss`: ss 被用于转储套接字统计信息。它也可以类似 netstat 使用。相比其他工具它可以展示更多的TCP状态信息。 + * `lsof`: lsof 是 List Open File 的缩写. 它用于输出被某个进程打开的所有文件。 + +### 如何使用 Linux 命令 netstat 检查系统中的开放端口列表 + +`netstat` 是 Network Statistics 的缩写,是一个显示网络连接(进和出)相关信息命令行工具,例如:路由表、伪装连接、多播成员和网络端口。 + +它可以列出所有的 tcp、udp 连接和所有的 unix 套接字连接。 + +它用于发现发现网络问题,确定网络连接数量。 + +``` +# netstat -tplugn + +Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name +tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2038/master +tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 1396/snmpd +tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1398/httpd +tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1388/sshd +tcp6 0 0 :::25 :::* LISTEN 2038/master +tcp6 0 0 :::22 :::* LISTEN 1388/sshd +udp 0 0 0.0.0.0:39136 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:56130 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:40105 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:11584 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:30105 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:50656 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:1632 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:28265 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:40764 0.0.0.0:* 1396/snmpd +udp 0 0 10.90.56.21:123 0.0.0.0:* 895/ntpd +udp 0 0 127.0.0.1:123 0.0.0.0:* 895/ntpd +udp 0 0 0.0.0.0:123 0.0.0.0:* 895/ntpd +udp 0 0 0.0.0.0:53390 0.0.0.0:* 1396/snmpd +udp 0 0 0.0.0.0:161 0.0.0.0:* 1396/snmpd +udp6 0 0 :::123 :::* 895/ntpd + +IPv6/IPv4 Group Memberships +Interface RefCnt Group +--------------- ------ --------------------- +lo 1 224.0.0.1 +eth0 1 224.0.0.1 +lo 1 ff02::1 +lo 1 ff01::1 +eth0 1 ff02::1 +eth0 1 ff01::1 +``` + +你也可以使用下面的命令检查特定的端口。 + +``` +# # netstat -tplugn | grep :22 + +tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1388/sshd +tcp6 0 0 :::22 :::* LISTEN 1388/sshd +``` + +### 如何使用 Linux 命令 ss 检查系统中的开放端口列表? + +`ss` 被用于转储套接字统计信息。它也可以显示类似 `netstat` 的信息。相比其他工具它可以展示更多的 TCP 状态信息。 + +``` +# ss -lntu + +Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port +udp UNCONN 0 0 *:39136 *:* +udp UNCONN 0 0 *:56130 *:* +udp UNCONN 0 0 *:40105 *:* +udp UNCONN 0 0 *:11584 *:* +udp UNCONN 0 0 *:30105 *:* +udp UNCONN 0 0 *:50656 *:* +udp UNCONN 0 0 *:1632 *:* +udp UNCONN 0 0 *:28265 *:* +udp UNCONN 0 0 *:40764 *:* +udp UNCONN 0 0 10.90.56.21:123 *:* +udp UNCONN 0 0 127.0.0.1:123 *:* +udp UNCONN 0 0 *:123 *:* +udp UNCONN 0 0 *:53390 *:* +udp UNCONN 0 0 *:161 *:* +udp UNCONN 0 0 :::123 :::* +tcp LISTEN 0 100 *:25 *:* +tcp LISTEN 0 128 127.0.0.1:199 *:* +tcp LISTEN 0 128 *:80 *:* +tcp LISTEN 0 128 *:22 *:* +tcp LISTEN 0 100 :::25 :::* +tcp LISTEN 0 128 :::22 :::* +``` + +你也可以使用下面的命令检查特定的端口。 + +``` +# # ss -lntu | grep ':25' + +tcp LISTEN 0 100 *:25 *:* +tcp LISTEN 0 100 :::25 :::* +``` + +### 如何使用 Linux 命令 nmap 检查系统中的开放端口列表? + +Nmap (“Network Mapper”) 是一个网络探索与安全审计的开源工具。它旨在快速扫描大型网络,当然它也可以工作在独立主机上。 + +Nmap 使用裸 IP 数据包以一种新颖的方式来确定网络上有哪些主机可用,这些主机提供什么服务(应用程序名称和版本),它们运行什么操作系统(版本),使用什么类型的数据包过滤器/防火墙,以及许多其他特征。 + +虽然 Nmap 通常用于安全审计,但许多系统和网络管理员发现它对于日常工作也非常有用,例如网络资产清点、管理服务升级计划以及监控主机或服务正常运行时间。 + +``` +# nmap -sTU -O localhost + +Starting Nmap 6.40 ( http://nmap.org ) at 2019-03-20 09:57 CDT +Nmap scan report for localhost (127.0.0.1) +Host is up (0.00028s latency). +Other addresses for localhost (not scanned): 127.0.0.1 +Not shown: 1994 closed ports + +PORT STATE SERVICE +22/tcp open ssh +25/tcp open smtp +80/tcp open http +199/tcp open smux +123/udp open ntp +161/udp open snmp + +Device type: general purpose +Running: Linux 3.X +OS CPE: cpe:/o:linux:linux_kernel:3 +OS details: Linux 3.7 - 3.9 +Network Distance: 0 hops + +OS detection performed. Please report any incorrect results at http://nmap.org/submit/ . +Nmap done: 1 IP address (1 host up) scanned in 1.93 seconds +``` + +你也可以使用下面的命令检查特定的端口。 + +``` +# nmap -sTU -O localhost | grep 123 + +123/udp open ntp +``` + +### 如何使用 Linux 命令 lsof 检查系统中的开放端口列表? + +它向你显示系统上打开的文件列表以及打开它们的进程。还会向你显示与文件相关的其他信息。 + +``` +# lsof -i + +COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME +ntpd 895 ntp 16u IPv4 18481 0t0 UDP *:ntp +ntpd 895 ntp 17u IPv6 18482 0t0 UDP *:ntp +ntpd 895 ntp 18u IPv4 18487 0t0 UDP localhost:ntp +ntpd 895 ntp 20u IPv4 23020 0t0 UDP CentOS7.2daygeek.com:ntp +sshd 1388 root 3u IPv4 20065 0t0 TCP *:ssh (LISTEN) +sshd 1388 root 4u IPv6 20067 0t0 TCP *:ssh (LISTEN) +snmpd 1396 root 6u IPv4 22739 0t0 UDP *:snmp +snmpd 1396 root 7u IPv4 22729 0t0 UDP *:40105 +snmpd 1396 root 8u IPv4 22730 0t0 UDP *:50656 +snmpd 1396 root 9u IPv4 22731 0t0 UDP *:pammratc +snmpd 1396 root 10u IPv4 22732 0t0 UDP *:30105 +snmpd 1396 root 11u IPv4 22733 0t0 UDP *:40764 +snmpd 1396 root 12u IPv4 22734 0t0 UDP *:53390 +snmpd 1396 root 13u IPv4 22735 0t0 UDP *:28265 +snmpd 1396 root 14u IPv4 22736 0t0 UDP *:11584 +snmpd 1396 root 15u IPv4 22737 0t0 UDP *:39136 +snmpd 1396 root 16u IPv4 22738 0t0 UDP *:56130 +snmpd 1396 root 17u IPv4 22740 0t0 TCP localhost:smux (LISTEN) +httpd 1398 root 3u IPv4 20337 0t0 TCP *:http (LISTEN) +master 2038 root 13u IPv4 21638 0t0 TCP *:smtp (LISTEN) +master 2038 root 14u IPv6 21639 0t0 TCP *:smtp (LISTEN) +sshd 9052 root 3u IPv4 1419955 0t0 TCP CentOS7.2daygeek.com:ssh->Ubuntu18-04.2daygeek.com:11408 (ESTABLISHED) +httpd 13371 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13372 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13373 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +``` + +你也可以使用下面的命令检查特定的端口。 + +``` +# lsof -i:80 + +COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME +httpd 1398 root 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13371 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13372 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13373 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13374 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +httpd 13375 apache 3u IPv4 20337 0t0 TCP *:http (LISTEN) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-scan-check-open-ports-using-netstat-ss-nmap/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10675-1.html +[2]: https://www.2daygeek.com/check-a-open-port-on-multiple-remote-linux-server-using-nc-command/ diff --git a/published/201904/20190410 Managing Partitions with sgdisk.md b/published/201904/20190410 Managing Partitions with sgdisk.md new file mode 100644 index 0000000000..bb8187a940 --- /dev/null +++ b/published/201904/20190410 Managing Partitions with sgdisk.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10771-1.html) +[#]: subject: (Managing Partitions with sgdisk) +[#]: via: (https://fedoramagazine.org/managing-partitions-with-sgdisk/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 sgdisk 管理分区 +====== + +![][1] + +[Roderick W. Smith][2] 的 `sgdisk` 命令可在命令行中管理硬盘的分区。下面将介绍使用它所需的基础知识。 + +使用 sgdisk 的大多数基本功能只需要了解以下六个参数: + +1、`-p` *打印* 分区表: + +``` +# sgdisk -p /dev/sda +``` + +2、 `-d x` *删除* 分区 x: + +``` +# sgdisk -d 1 /dev/sda +``` + +3、 `-n x:y:z` 创建一个编号 x 的*新*分区,从 y 开始,从 z 结束: + +``` +# sgdisk -n 1:1MiB:2MiB /dev/sda +``` + +4、`-c x:y` *更改*分区 x 的名称为 y: + +``` +# sgdisk -c 1:grub /dev/sda +``` + +5、`-t x:y` 将分区 x 的*类型*更改为 y: + +``` +# sgdisk -t 1:ef02 /dev/sda +``` + +6、`–list-types` 列出分区类型代码: + +``` +# sgdisk --list-types +``` + +![The SGDisk Command][3] + +如你在上面的例子中所见,大多数命令都要求将要操作的硬盘的[设备文件名][4]指定为最后一个参数。 + +可以组合上面的参数,这样你可以一次定义所有分区: + +``` +# sgdisk -n 1:1MiB:2MiB -t 1:ef02 -c 1:grub /dev/sda +``` + +在值的前面加上 `+` 或 `–` 符号,可以为某些字段指定相对值。如果你使用相对值,`sgdisk` 会为你做数学运算。例如,上面的例子可以写成: + +``` +# sgdisk -n 1:1MiB:+1MiB -t 1:ef02 -c 1:grub /dev/sda +``` + +`0` 值对于以下几个字段有特殊意义: + +* 对于*分区号*字段,0 表示应使用下一个可用编号(编号从 1 开始)。 +* 对于*起始地址*字段,0 表示使用最大可用空闲块的头。硬盘开头的一些空间始终保留给分区表本身。 +* 对于*结束地址*字段,0 表示使用最大可用空闲块的末尾。 + +通过在适当的字段中使用 `0` 和相对值,你可以创建一系列分区,而无需预先计算任何绝对值。例如,如果在一块空白硬盘中,以下 `sgdisk` 命令序列将创建典型 Linux 安装所需的所有基本分区: + +``` +# sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub /dev/sda +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot /dev/sda +# sgdisk -n 0:0:+4GiB -t 0:8200 -c 0:swap /dev/sda +# sgdisk -n 0:0:0 -t 0:8300 -c 0:root /dev/sda +``` + +上面的例子展示了如何为基于 BIOS 的计算机分区硬盘。基于 UEFI 的计算机上不需要 [grub 分区][5]。由于 `sgdisk` 在上面的示例中为你计算了所有绝对值,因此你可以在基于 UEFI 的计算机上跳过第一个命令,并且可以无需修改即可运行其余命令。同样,你可以跳过创建交换分区,并且不需要修改其余命令。 + +还有使用一个命令删除硬盘上所有分区的快捷方式: + +``` +# sgdisk --zap-all /dev/sda +``` + +关于最新和详细信息,请查看手册页: + +``` +$ man sgdisk +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-partitions-with-sgdisk/ + +作者:[Gregory Bartholomew][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://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/managing-partitions-816x345.png +[2]: https://www.rodsbooks.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/sgdisk.jpg +[4]: https://en.wikipedia.org/wiki/Device_file +[5]: https://en.wikipedia.org/wiki/BIOS_boot_partition diff --git a/published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md b/published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md new file mode 100644 index 0000000000..d852b7036e --- /dev/null +++ b/published/201904/20190413 How to Zip Files and Folders in Linux -Beginner Tip.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10778-1.html) +[#]: subject: (How to Zip Files and Folders in Linux [Beginner Tip]) +[#]: via: (https://itsfoss.com/linux-zip-folder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +初级:如何在 Linux 中 zip 压缩文件和文件夹 +====== + +> 本文向你展示了如何在 Ubuntu 和其他 Linux 发行版中创建一个 zip 文件夹。终端和 GUI 方法都有。 + +zip 是最流行的归档文件格式之一。使用 zip,你可以将多个文件压缩到一个文件中。这不仅节省了磁盘空间,还节省了网络带宽。这就是为什么你几乎一直会看到 zip 文件的原因。 + +作为普通用户,大多数情况下你会在 Linux 中解压缩文件夹。但是如何在 Linux 中压缩文件夹?本文可以帮助你回答这个问题。 + +**先决条件:验证是否安装了 zip** + +通常 [zip][1] 已经安装,但验证下也没坏处。你可以运行以下命令来安装 `zip` 和 `unzip`。如果它尚未安装,它将立即安装。 + +``` +sudo apt install zip unzip +``` + +现在你知道你的系统有 zip 支持,你可以继续了解如何在 Linux 中压缩一个目录。 + +![][2] + +### 在 Linux 命令行中压缩文件夹 + +`zip` 命令的语法非常简单。 + +``` +zip [option] output_file_name input1 input2 +``` + +虽然有几个选项,但我不希望你将它们混淆。如果你只想要将一堆文件变成一个 zip 文件夹,请使用如下命令: + +``` +zip -r output_file.zip file1 folder1 +``` + +`-r` 选项将递归目录并压缩其内容。输出文件中的 .zip 扩展名是可选的,因为默认情况下会添加 .zip。 + +你应该会在 zip 操作期间看到要添加到压缩文件夹中的文件。 + +``` +zip -r myzip abhi-1.txt abhi-2.txt sample_directory + adding: abhi-1.txt (stored 0%) + adding: abhi-2.txt (stored 0%) + adding: sample_directory/ (stored 0%) + adding: sample_directory/newfile.txt (stored 0%) + adding: sample_directory/agatha.txt (deflated 41%) +``` + +你可以使用 `-e` 选项[在 Linux 中创建密码保护的 zip 文件夹][3]。 + +你并不是只能通过终端创建 zip 归档文件。你也可以用图形方式做到这一点。下面是如何做的! + +### 在 Ubuntu Linux 中使用 GUI 压缩文件夹 + +*虽然我在这里使用 Ubuntu,但在使用 GNOME 或其他桌面环境的其他发行版中,方法应该基本相同。* + +如果要在 Linux 桌面中压缩文件或文件夹,只需点击几下即可。 + +进入到你想将文件(和文件夹)压缩到一个 zip 文件夹的所在文件夹。 + +在这里,选择文件和文件夹。现在,右键单击并选择“压缩”。你也可以对单个文件执行相同操作。 + +![Select the files, right click and click compress][4] + +现在,你可以使用 zip、tar xz 或 7z 格式创建压缩归档文件。如果你好奇,这三个都是各种压缩算法,你可以使用它们来压缩文件。 + +输入一个你想要的名字,并点击“创建”。 + +![Create archive file][5] + +这不会花很长时间,你会同一目录中看到一个归档文件。 + +![][6] + +好了,就是这些。你已经成功地在 Linux 中创建了一个 zip 文件夹。 + +我希望这篇文章能帮助你了解 zip 文件。请随时分享你的建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-zip-folder/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Zip_(file_format) +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-folder-linux.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/password-protect-zip-file/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-file-ubuntu.jpg?resize=800%2C428&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/create-zip-folder-ubuntu-1.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/zip-file-created-in-ubuntu.png?resize=800%2C277&ssl=1 diff --git a/published/201904/20190413 The Fargate Illusion.md b/published/201904/20190413 The Fargate Illusion.md new file mode 100644 index 0000000000..ef0cc6153e --- /dev/null +++ b/published/201904/20190413 The Fargate Illusion.md @@ -0,0 +1,443 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10740-1.html) +[#]: subject: (The Fargate Illusion) +[#]: via: (https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html) +[#]: author: (Lee Briggs https://leebriggs.co.uk/) + +破除对 AWS Fargate 的幻觉 +====== + +我在 $work 建立了一个基于 Kubernetes 的平台已经快一年了,而且有点像 Kubernetes 的布道者了。真的,我认为这项技术太棒了。然而我并没有对它的运营和维护的困难程度抱过什么幻想。今年早些时候我读了[这样][1]的一篇文章,并对其中某些观点深以为然。如果我在一家规模较小的、有 10 到 15 个工程师的公司,假如有人建议管理和维护一批 Kubernetes 集群,那我会感到害怕的,因为它的运维开销太高了! + +尽管我现在对 Kubernetes 的一切都很感兴趣,但我仍然对“无服务器Serverless”计算会消灭运维工程师的说法抱有好奇。这种好奇心主要来源于我希望在未来仍然能有一份有报酬的工作 —— 如果我们前景光明的未来不需要运维工程师,那我得明白到底是怎么回事。我已经在 Lamdba 和Google Cloud Functions 上做了一些实验,结果让我印象十分深刻,但我仍然坚信无服务器解决方案只是解决了一部分问题。 + +我关注 [AWS Fargate][2] 已经有一段时间了,这就是 $work 的开发人员所推崇为“无服务器计算”的东西 —— 主要是因为 Fargate,用它你就可以无需管理底层节点而运行你的 Docker 容器。我想看看它到底意味着什么,所以我开始尝试从头开始在 Fargate 上运行一个应用,看看是否可以成功。这里我对成功的定义是一个与“生产级”应用程序相近的东西,我想应该包含以下内容: + +* 一个在 Fargate 上运行的容器 +* 配置信息以环境变量的形式下推 +* “秘密信息” 不能是明文的 +* 位于负载均衡器之后 +* 有效的 SSL 证书的 TLS 通道 + +我以“基础设施即代码”的角度来开始整个任务,不遵循默认的 AWS 控制台向导,而是使用 terraform 来定义基础架构。这很可能让整个事情变得复杂,但我想确保任何部署都是可重现的,任何想要遵循此步骤的人都可发现我的结论。 + +上述所有标准通常都可以通过基于 Kubernetes 的平台使用一些外部的附加组件和插件来实现,所以我确实是以一种比较的心态来处理整个任务的,因为我要将它与我的常用工作流程进行比较。我的主要目标是看看Fargate 有多容易,特别是与 Kubernetes 相比时。结果让我感到非常惊讶。 + +### AWS 是有开销的 + +我有一个干净的 AWS 账户,并决定从零到部署一个 webapp。与 AWS 中的其它基础设施一样,我必须首先使基本的基础设施正常工作起来,因此我需要先定义一个 VPC。 + +遵循最佳实践,因此我将这个 VPC 划分为跨可用区(AZ)的子网,一个公共子网和私有子网。这时我想到,只要这种设置基础设施的需求存在,我就能找到一份这种工作。AWS 是"免"运维的这一概念一直让我感到愤怒。开发者社区中的许多人理所当然地认为在设置和定义一个设计良好的 AWS 账户和基础设施是不需要付出多少工作和努力的。而这种想当然甚至发生在开始谈论多帐户架构*之前*就有了——现在我仍然使用单一帐户,我已经必须定义好基础设施和传统的网络设备。 + +这里也值得记住,我已经做了很多次,所以我*很清楚*该做什么。我可以在我的帐户中使用默认的 VPC 以及预先提供的子网,我觉得很多刚开始的人也可以使用它。这大概花了我半个小时才运行起来,但我不禁想到,即使我想运行 lambda 函数,我仍然需要某种连接和网络。定义 NAT 网关和在 VPC 中路由根本不会让你觉得很“Serverless”,但要往下进行这就是必须要做的。 + +### 运行简单的容器 + +在我启动运行了基本的基础设施之后,现在我想让我的 Docker 容器运行起来。我开始翻阅 Fargate 文档并浏览 [入门][3] 文档,这些就马上就展现在了我面前: + +![][4] + +等等,只是让我的容器运行就至少要有**三个**步骤?这完全不像我所想的,不过还是让我们开始吧。 + +#### 任务定义 + +“任务定义Task Definition”用来定义要运行的实际容器。我在这里遇到的问题是,任务定义这件事非常复杂。这里有很多选项都很简单,比如指定 Docker 镜像和内存限制,但我还必须定义一个网络模型以及我并不熟悉的其它各种选项。真需要这样吗?如果我完全没有 AWS 方面的知识就进入到这个过程里,那么在这个阶段我会感觉非常的不知所措。可以在 AWS 页面上找到这些 [参数][5] 的完整列表,这个列表很长。我知道我的容器需要一些环境变量,它需要暴露一个端口。所以我首先在一个神奇的 [terraform 模块][6] 的帮助下定义了这一点,这真的让这件事更容易了。如果没有这个模块,我就得手写 JSON 来定义我的容器定义。 + +首先我定义了一些环境变量: + +``` +container_environment_variables = [ + { + name = "USER" + value = "${var.user}" + }, + { + name = "PASSWORD" + value = "${var.password}" + } +] +``` + +然后我使用上面提及的模块组成了任务定义: + +``` +module "container_definition_app" { + source = "cloudposse/ecs-container-definition/aws" + version = "v0.7.0" + + container_name = "${var.name}" + container_image = "${var.image}" + + container_cpu = "${var.ecs_task_cpu}" + container_memory = "${var.ecs_task_memory}" + container_memory_reservation = "${var.container_memory_reservation}" + + port_mappings = [ + { + containerPort = "${var.app_port}" + hostPort = "${var.app_port}" + protocol = "tcp" + }, + ] + + environment = "${local.container_environment_variables}" + +} +``` + +在这一点上我非常困惑,我需要在这里定义很多配置才能运行,而这时什么都没有开始呢,但这是必要的 —— 运行 Docker 容器肯定需要了解一些容器配置的知识。我 [之前写过][7] 关于 Kubernetes 和配置管理的问题的文章,在这里似乎遇到了同样的问题。 + +接下来,我在上面的模块中定义了任务定义(幸好从我这里抽象出了所需的 JSON —— 如果我不得不手写JSON,我可能已经放弃了)。 + +当我定义模块参数时,我突然意识到我漏掉了一些东西。我需要一个 IAM 角色!好吧,让我来定义: + +``` +resource "aws_iam_role" "ecs_task_execution" { + name = "${var.name}-ecs_task_execution" + + assume_role_policy = <secret 管理secret management部分的方式是使用 [AWS SSM][12](此服务的全名是 AWS 系统管理器参数存储库 Systems Manager Parameter Store,但我不想使用这个名称,因为坦率地说这个名字太愚蠢了)。 + +AWS 文档很好的[涵盖了这个内容][13],因此我开始将其转换为 terraform。 + +##### 指定秘密信息 + +首先,你必须定义一个参数并为其命名。在 terraform 中,它看起来像这样: + +``` +resource "aws_ssm_parameter" "app_password" { + name = "${var.app_password_param_name}" # The name of the value in AWS SSM + type = "SecureString" + value = "${var.app_password}" # The actual value of the password, like correct-horse-battery-stable +} +``` + +显然,这里的关键部分是 “SecureString” 类型。这会使用默认的 AWS KMS 密钥来加密数据,这对我来说并不是很直观。这比 Kubernetes 的 Secret 管理具有巨大优势,默认情况下,这些 Secret 在 etcd 中是不加密的。 + +然后我为 ECS 指定了另一个本地值映射,并将其作为 Secret 参数传递: + +``` +container_secrets = [ + { + name = "PASSWORD" + valueFrom = "${var.app_password_param_name}" + }, +] + +module "container_definition_app" { + source = "cloudposse/ecs-container-definition/aws" + version = "v0.7.0" + + container_name = "${var.name}" + container_image = "${var.image}" + + container_cpu = "${var.ecs_task_cpu}" + container_memory = "${var.ecs_task_memory}" + container_memory_reservation = "${var.container_memory_reservation}" + + port_mappings = [ + { + containerPort = "${var.app_port}" + hostPort = "${var.app_port}" + protocol = "tcp" + }, + ] + + environment = "${local.container_environment_variables}" + secrets = "${local.container_secrets}" +``` + +##### 出了个问题 + +此刻,我重新部署了我的任务定义,并且非常困惑。为什么任务没有正确拉起?当新的任务定义(版本 8)可用时,我一直在控制台中看到正在运行的应用程序仍在使用先前的任务定义(版本 7)。解决这件事花费的时间比我预期的要长,但是在控制台的事件屏幕上,我注意到了 IAM 错误。我错过了一个步骤,容器无法从 AWS SSM 中读取 Secret 信息,因为它没有正确的 IAM 权限。这是我第一次真正对整个这件事情感到沮丧。从用户体验的角度来看,这里的反馈非常*糟糕*。如果我没有发觉的话,我会认为一切都很好,因为仍然有一个任务正在运行,我的应用程序仍然可以通过正确的 URL 访问 —— 只不过是旧的配置而已。 + +在 Kubernetes 里,我会清楚地看到 pod 定义中的错误。Fargate 可以确保我的应用不会停止,这绝对是太棒了,但作为一名运维,我需要一些关于发生了什么的实际反馈。这真的不够好。我真的希望 Fargate 团队的人能够读到这篇文章,改善这种体验。 + +### 就这样了 + +到这里就结束了,我的应用程序正在运行,也符合我的所有标准。我确实意识到我做了一些改进,其中包括: + +* 定义一个 cloudwatch 日志组,这样我就可以正确地写日志了 +* 添加了一个 route53 托管区域,使整个事情从 DNS 角度更容易自动化 +* 修复并重新调整了 IAM 权限,这里太宽泛了 + +但老实说,现在我想反思一下这段经历。我写了一个关于我的经历的 [推特会话][14],然后花了其余时间思考我在这里的真实感受。 + +### 代价 + +经过一夜的反思,我意识到无论你是使用 Fargate 还是 Kubernetes,这个过程都大致相同。最让我感到惊讶的是,尽管我经常听说 Fargate “更容易”,但我真的没有看到任何超过 Kubernetes 平台的好处。现在,如果你正在构建 Kubernetes 集群,我绝对可以看到这里的价值 —— 管理节点和控制面板只是不必要的开销,问题是 —— 基于 Kubernetes 的平台的大多数消费者都*没有*这样做。如果你很幸运能够使用 GKE,你几乎不需要考虑集群的管理,你可以使用单个 `gcloud` 命令来运行集群。我经常使用 Digital Ocean 的 Kubernetes 托管服务,我可以肯定地说它就像操作 Fargate 集群一样简单,实际上在某种程度上它更容易。 + +必须定义一些基础设施来运行你的容器就是此时的代价。谷歌本周可能刚刚使用他们的 [Google Cloud Run][15] 产品改变了游戏规则,但他们在这一领域的领先优势远远领先于其他所有人。 + +从这整个经历中,我可以肯定的说:*大规模运行容器仍然很难。*它需要思考,需要领域知识,需要运维和开发人员之间的协作。它还需要一个基础来构建 —— 任何基于 AWS 的操作都需要事先定义和运行一些基础架构。我对一些公司似乎渴望的 “NoOps” 概念非常感兴趣。我想如果你正在运行一个无状态应用程序,你可以把它全部放在一个 lambda 函数和一个 API 网关中,这可能不错,但我们是否真的适合在任何一种企业环境中这样做?我真的不这么认为。 + +#### 公平比较 + +令我印象深刻的另一个现实是,技术 A 和技术 B 之间的比较通常不太公平,我经常在 AWS 上看到这一点。这种实际情况往往与 Jeff Barr 博客文章截然不同。如果你是一家足够小的公司,你可以使用 AWS 控制台在 AWS 中部署你的应用程序并接受所有默认值,这绝对更容易。但是,我不想使用默认值,因为默认值几乎是不适用于生产环境的。一旦你开始剥离掉云服务商服务的层面,你就会开始意识到最终你仍然是在运行软件 —— 它仍然需要设计良好、部署良好、运行良好。我相信 AWS 和 Kubernetes 以及所有其他云服务商的增值服务使得它更容易运行、设计和操作,但它绝对不是免费的。 + +#### Kubernetes 的争议 + +最后就是:如果你将 Kubernetes 纯粹视为一个容器编排工具,你可能会喜欢 Fargate。然而,随着我对 Kubernetes 越来越熟悉,我开始意识到它作为一种技术的重要性 —— 不仅因为它是一个伟大的容器编排工具,而且因为它的设计模式 —— 它是声明性的、API 驱动的平台。 在*整个* Fargate 过程期间发生的一个简单的事情是,如果我删除这里某个东西,Fargate 不一定会为我重新创建它。自动缩放很不错,不需要管理服务器和操作系统的补丁及更新也很棒,但我觉得因为无法使用 Kubernetes 自我修复和 API 驱动模型而失去了很多。当然,Kubernetes 有一个学习曲线,但从这里的体验来看,Fargate 也是如此。 + +### 总结 + +尽管我在这个过程中遭遇了困惑,但我确实很喜欢这种体验。我仍然相信 Fargate 是一项出色的技术,AWS 团队对 ECS/Fargate 所做的工作确实非常出色。然而,我的观点是,这绝对不比 Kubernetes “更容易”,只是……难点不同。 + +在生产环境中运行容器时出现的问题大致相同。如果你从这篇文章中有所收获,它应该是这样的:*不管你选择的哪种方式都有运维开销*。不要相信你选择一些东西你的世界就变得更轻松。我个人的意见是:如果你有一个运维团队,而你的公司要为多个应用程序团队部署容器 —— 选择一种技术并围绕它构建流程和工具以使其更容易。 + +人们说的一点肯定没错,用点技巧可以更容易地使用某种技术。在这个阶段,谈到 Fargate,下面的漫画这总结了我的感受: + +![][16] + +-------------------------------------------------------------------------------- + +via: https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion.html + +作者:[Lee Briggs][a] +选题:[lujun9972][b] +译者:[Bestony](https://github.com/Bestony) +校对:[wxy](https://github.com/wxy), 临石(阿里云智能技术专家) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://leebriggs.co.uk/ +[b]: https://github.com/lujun9972 +[1]: https://matthias-endler.de/2019/maybe-you-dont-need-kubernetes/ +[2]: https://aws.amazon.com/fargate/ +[3]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html +[4]: https://i.imgur.com/YfMyXBdl.png +[5]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html +[6]: https://github.com/cloudposse/terraform-aws-ecs-container-definition +[7]: https://leebriggs.co.uk/blog/2018/05/08/kubernetes-config-mgmt.html +[8]: https://github.com/kubernetes-incubator/external-dns +[9]: https://github.com/jetstack/cert-manager +[10]: https://github.com/terraform-aws-modules/terraform-aws-ecs +[11]: https://kubernetes.io/docs/concepts/configuration/secret/ +[12]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html +[13]: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html +[14]: https://twitter.com/briggsl/status/1116870900719030272 +[15]: https://cloud.google.com/run/ +[16]: https://i.imgur.com/Bx7Q50Jl.jpg diff --git a/published/201904/20190415 Getting started with Mercurial for version control.md b/published/201904/20190415 Getting started with Mercurial for version control.md new file mode 100644 index 0000000000..e95ac5fb98 --- /dev/null +++ b/published/201904/20190415 Getting started with Mercurial for version control.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10780-1.html) +[#]: subject: (Getting started with Mercurial for version control) +[#]: via: (https://opensource.com/article/19/4/getting-started-mercurial) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Mercurial 版本控制入门 +====== + +> 了解 Mercurial 的基础知识,它是一个用 Python 写的分布式版本控制系统。 + +![][1] + +[Mercurial][2] 是一个用 Python 编写的分布式版本控制系统。因为它是用高级语言编写的,所以你可以用 Python 函数编写一个 Mercurial 扩展。 + +在[官方文档中][3]说明了几种安装 Mercurial 的方法。我最喜欢的一种方法不在里面:使用 `pip`。这是开发本地扩展的最合适方式! + +目前,Mercurial 仅支持 Python 2.7,因此你需要创建一个 Python 2.7 虚拟环境: + +``` +python2 -m virtualenv mercurial-env +./mercurial-env/bin/pip install mercurial +``` + +为了让命令简短一些,以及满足人们对化学幽默的渴望,该命令称之为 `hg`。 + +``` +$ source mercurial-env/bin/activate +(mercurial-env)$ mkdir test-dir +(mercurial-env)$ cd test-dir +(mercurial-env)$ hg init +(mercurial-env)$ hg status +(mercurial-env)$ +``` + +由于还没有任何文件,因此状态为空。添加几个文件: + +``` +(mercurial-env)$ echo 1 > one +(mercurial-env)$ echo 2 > two +(mercurial-env)$ hg status +? one +? two +(mercurial-env)$ hg addremove +adding one +adding two +(mercurial-env)$ hg commit -m 'Adding stuff' +(mercurial-env)$ hg log +changeset: 0:1f1befb5d1e9 +tag: tip +user: Moshe Zadka <[moshez@zadka.club][4]> +date: Fri Mar 29 12:42:43 2019 -0700 +summary: Adding stuff +``` + +`addremove` 命令很有用:它将任何未被忽略的新文件添加到托管文件列表中,并移除任何已删除的文件。 + +如我所说,Mercurial 扩展用 Python 写成,它们只是常规的 Python 模块。 + +这是一个简短的 Mercurial 扩展示例: + +``` +from mercurial import registrar +from mercurial.i18n import _ + +cmdtable = {} +command = registrar.command(cmdtable) + +@command('say-hello', +[('w', 'whom', '', _('Whom to greet'))]) +def say_hello(ui, repo, `opts): +ui.write("hello ", opts['whom'], "\n") +``` + +简单的测试方法是将它手动加入虚拟环境中的文件中: + +``` +`$ vi ../mercurial-env/lib/python2.7/site-packages/hello_ext.py` +``` + +然后你需要*启用*扩展。你可以仅在当前仓库中启用它: + +``` +$ cat >> .hg/hgrc +[extensions] +hello_ext = +``` + +现在,问候有了: + +``` +(mercurial-env)$ hg say-hello --whom world +hello world +``` + +大多数扩展会做更多有用的东西,甚至可能与 Mercurial 有关。 `repo` 对象是 `mercurial.hg.repository` 的对象。 + +有关 Mercurial API 的更多信息,请参阅[官方文档][5]。并访问[官方仓库][6]获取更多示例和灵感。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-mercurial + +作者:[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/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://www.mercurial-scm.org/ +[3]: https://www.mercurial-scm.org/wiki/UnixInstall +[4]: mailto:moshez@zadka.club +[5]: https://www.mercurial-scm.org/wiki/MercurialApi#Repositories +[6]: https://www.mercurial-scm.org/repo/hg/file/tip/hgext diff --git a/published/201904/20190415 How to identify duplicate files on Linux.md b/published/201904/20190415 How to identify duplicate files on Linux.md new file mode 100644 index 0000000000..f723c02a16 --- /dev/null +++ b/published/201904/20190415 How to identify duplicate files on Linux.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10777-1.html) +[#]: subject: (How to identify duplicate files on Linux) +[#]: via: (https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何识别 Linux 上的文件分身 +====== + +> Linux 系统上的一些文件可能出现在多个位置。按照本文指示查找并识别这些“同卵双胞胎”,还可以了解为什么硬链接会如此有利。 + +![Archana Jarajapu \(CC BY 2.0\)][1] + +识别使用同一个磁盘空间的文件依赖于利用文件使用相同的 inode 这一事实。这种数据结构存储除了文件名和内容之外的所有信息。如果两个或多个文件具有不同的名称和文件系统位置,但共享一个 inode,则它们还共享内容、所有权、权限等。 + +这些文件通常被称为“硬链接”,不像符号链接(即软链接)那样仅仅通过包含它们的名称指向其他文件,符号链接很容易在文件列表中通过第一个位置的 `l` 和引用文件的 `->` 符号识别出来。 + +``` +$ ls -l my* +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 myfile +lrwxrwxrwx 1 shs shs 6 Apr 15 11:18 myref -> myfile +-rw-r--r-- 4 shs shs 228 Apr 12 19:37 mytwin +``` + +在单个目录中的硬链接并不是很明显,但它仍然非常容易找到。如果使用 `ls -i` 命令列出文件并按 inode 编号排序,则可以非常容易地挑选出硬链接。在这种类型的 `ls` 输出中,第一列显示 inode 编号。 + +``` +$ ls -i | sort -n | more + ... + 788000 myfile <== + 788000 mytwin <== + 801865 Name_Labels.pdf + 786692 never leave home angry + 920242 NFCU_Docs + 800247 nmap-notes +``` + +扫描输出,查找相同的 inode 编号,任何匹配都会告诉你想知道的内容。 + +另一方面,如果你只是想知道某个特定文件是否是另一个文件的硬链接,那么有一种方法比浏览数百个文件的列表更简单,即 `find` 命令的 `-samefile` 选项将帮助你完成工作。 + +``` +$ find . -samefile myfile +./myfile +./save/mycopy +./mytwin +``` + +注意,提供给 `find` 命令的起始位置决定文件系统会扫描多少来进行匹配。在上面的示例中,我们正在查看当前目录和子目录。 + +使用 `find` 的 `-ls` 选项添加输出的详细信息可能更有说服力: + +``` +$ find . -samefile myfile -ls + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 ./mytwin +``` + +第一列显示 inode 编号,然后我们会看到文件权限、链接、所有者、文件大小、日期信息以及引用相同磁盘内容的文件的名称。注意,在这种情况下,链接字段是 “4” 而不是我们可能期望的 “3”。这告诉我们还有另一个指向同一个 inode 的链接(但不在我们的搜索范围内)。 + +如果你想在一个目录中查找所有硬链接的实例,可以尝试以下的脚本来创建列表并为你查找副本: + +``` +#!/bin/bash + +# seaches for files sharing inodes + +prev="" + +# list files by inode +ls -i | sort -n > /tmp/$0 + +# search through file for duplicate inode #s +while read line +do + inode=`echo $line | awk '{print $1}'` + if [ "$inode" == "$prev" ]; then + grep $inode /tmp/$0 + fi + prev=$inode +done < /tmp/$0 + +# clean up +rm /tmp/$0 +``` + +``` +$ ./findHardLinks + 788000 myfile + 788000 mytwin +``` + +你还可以使用 `find` 命令按 inode 编号查找文件,如命令中所示。但是,此搜索可能涉及多个文件系统,因此可能会得到错误的结果。因为相同的 inode 编号可能会在另一个文件系统中使用,代表另一个文件。如果是这种情况,文件的其他详细信息将不相同。 + +``` +$ find / -inum 788000 -ls 2> /dev/null + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /tmp/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/myfile + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/save/mycopy + 788000 4 -rw-r--r-- 4 shs shs 228 Apr 12 19:37 /home/shs/mytwin +``` + +注意,错误输出被重定向到 `/dev/null`,这样我们就不必查看所有 “Permission denied” 错误,否则这些错误将显示在我们不允许查看的其他目录中。 + +此外,扫描包含相同内容但不共享 inode 的文件(即,简单的文本拷贝)将花费更多的时间和精力。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/reflections-candles-100793651-large.jpg +[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/published/201904/20190416 How to Install MySQL in Ubuntu Linux.md b/published/201904/20190416 How to Install MySQL in Ubuntu Linux.md new file mode 100644 index 0000000000..af456e45a0 --- /dev/null +++ b/published/201904/20190416 How to Install MySQL in Ubuntu Linux.md @@ -0,0 +1,236 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10789-1.html) +[#]: subject: (How to Install MySQL in Ubuntu Linux) +[#]: via: (https://itsfoss.com/install-mysql-ubuntu/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +怎样在 Ubuntu Linux 上安装 MySQL +====== + +> 本教程教你如何在基于 Ubuntu 的 Linux 发行版上安装 MySQL。对于首次使用的用户,你将会学习到如何验证你的安装和第一次怎样去连接 MySQL。 + +[MySQL][1] 是一个典型的数据库管理系统。它被用于许多技术栈中,包括流行的 [LAMP][2] (Linux、Apache、MySQL、PHP)技术栈。它已经被证实了其稳定性。另一个让 MySQL 受欢迎的原因是它是开源的。 + +MySQL 是关系型数据库(基本上是表格数据)。以这种方式它很容易去存储、组织和访问数据。它使用SQL(结构化查询语言)来管理数据。 + +这这篇文章中,我将向你展示如何在 Ubuntu 18.04 安装和使用 MySQL 8.0。让我们一起来看看吧! + +### 在 Ubuntu 上安装 MySQL + +![][3] + +我将会介绍两种在 Ubuntu 18.04 上安装 MySQL 的方法: + + 1. 从 Ubuntu 仓库上安装 MySQL。非常简单,但不是最新版(5.7) + 2. 从官方仓库安装 MySQL。你将额外增加一些步处理过程,但不用担心。你将会拥有最新版的MySQL(8.0) + +有必要的时候,我将会提供屏幕截图去引导你。但这篇文章中的大部分步骤,我将直接在终端(默认热键: `CTRL+ALT+T`)输入命令。别害怕! + +#### 方法 1、从 Ubuntu 仓库安装 MySQL + +首先,输入下列命令确保你的仓库已经被更新: + +``` +sudo apt update +``` + +现在,安装 MySQL 5.7,简单输入下列命令: + +``` +sudo apt install mysql-server -y +``` + +就是这样!简单且高效。 + +#### 方法 2、使用官方仓库安装 MySQL + +虽然这个方法多了一些步骤,但我将逐一介绍,并尝试写下清晰的笔记。 + +首先浏览 MySQL 官方网站的[下载页面][4]。 + +![][5] + +在这里,选择 DEB 软件包,点击“Download”链接。 + +![][6] + +滑到有关于 Oracle 网站信息的底部,右键 “No thanks, just start my download.”,然后选择 “Copy link location”。 + +现在回到终端,我们将使用 [Curl][7] 命令去下载这个软件包: + +``` +curl -OL https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb +``` + +`https://dev.mysql.com/get/mysql-apt-config_0.8.12-1_all.deb` 是我刚刚从网页上复制的链接。根据当前的 MySQL 版本,它有可能不同。让我们使用 `dpkg` 去开始安装 MySQL: + +``` +sudo dpkg -i mysql-apt-config* +``` + +更新你的仓库: + +``` +sudo apt update +``` + +要实际安装 MySQL,我们将使用像第一个方法中同样的命令来安装: + +``` +sudo apt install mysql-server -y +``` + +这样做会在你的终端中打开包配置的提示。使用向下箭头选择“Ok”选项。 + +![][8] + +点击回车。这应该会提示你输入密码:这是在为 MySQL 设置 root 密码。不要与 [Ubuntu 的 root 密码混淆][9]。 + +![][10] + +输入密码然后点击 Tab 键去选择“Ok“。点击回车键,你将重新输入密码。操作完之后,再次键入 Tab 去选择 “Ok”。按下回车键。 + +![][11] + +将会展示一些关于 MySQL Server 的配置信息。再次按下 Tab 去选择 “Ok” 和按下回车键: + +![][12] + +这里你需要去选择默认验证插件。确保选择了“Use Strong Password Encryption”。按下 Tab 键和回车键。 + +就是这样!你已经成功地安装了 MySQL。 + +#### 验证你的 MySQL 安装 + +要验证 MySQL 已经正确安装,使用下列命令: + +``` +sudo systemctl status mysql.service +``` + +这将展示一些关于 MySQL 服务的信息: + +![][13] + +你应该在那里看到 “Active: active (running)”。如果你没有看到,使用下列命令去开始这个服务: + +``` +sudo systemctl start mysql.service +``` + +#### 配置/保护 MySQL + +对于刚安装的 MySQL,你应该运行它提供的安全相关的更新命令。就是: + +``` +sudo mysql_secure_installation +``` + +这样做首先会询问你是否想使用 “密码有效强度validate password component”。如果你想使用它,你将必须选择一个最小密码强度(0 – 低,1 – 中,2 – 高)。你将无法输入任何不遵守所选规则的密码。如果你没有使用强密码的习惯(本应该使用),这可能会配上用场。如果你认为它可能有帮助,那你就键入 `y` 或者 `Y`,按下回车键,然后为你的密码选择一个强度等级和输入一个你想使用的密码。如果成功,你将继续强化过程;否则你将重新输入一个密码。 + +但是,如果你不想要此功能(我不会),只需按回车或任何其他键即可跳过使用它。 + +对于其他选项,我建议开启它们(对于每一步输入 `y` 或者 `Y` 和按下回车)。它们(依序)是:“移除匿名用户remove anonymous user”,“禁止 root 远程登录disallow root login remotely”,“移除测试数据库及其访问remove test database and access to it”。“重新载入权限表reload privilege tables now”。 + +#### 链接与断开 MySQL Server + +为了运行 SQL 查询,你首先必须使用 MySQL 连到服务器并在 MySQL 提示符使用。 + +执行此操作的命令是: + +``` +mysql -h host_name -u user -p +``` + +* `-h` 用来指定一个主机名(如果这个服务被安装到其他机器上,那么会有用;如果没有,忽略它) +* `-u` 指定登录的用户 +* `-p` 指定你想输入的密码. + +虽然出于安全原因不建议,但是你可以在命令行最右边的 `-p` 后直接输入密码。例如,如果用户`test_user` 的密码是 `1234`,那么你可以在你使用的机器上尝试去连接,你可以这样使用: + +``` +mysql -u test_user -p1234 +``` + +如果你成功输入了必要的参数,你将会收到由 MySQL shell 提示符提供的欢迎(`mysql >`): + +![][14] + +要从服务端断开连接和离开 MySQL 提示符,输入: + +``` +QUIT +``` + +输入 `quit` (MySQL 不区分大小写)或者 `\q` 也能工作。按下回车退出。 + +你使用简单的命令也能输出关于版本的信息: + +``` +sudo mysqladmin -u root version -p +``` + +如果你想看命令行选项列表,使用: + +``` +mysql --help +``` + +#### 卸载 MySQL + +如果您决定要使用较新版本或只是想停止使用 MySQL。 + +首先,关闭服务: + +``` +sudo systemctl stop mysql.service && sudo systemctl disable mysql.service +``` + +确保你备份了你的数据库,以防你之后想使用它们。你可以通过运行下列命令卸载 MySQL: + +``` +sudo apt purge mysql* +``` + +清理依赖: + +``` +sudo apt autoremove +``` + +### 小结 + +在这篇文章中,我已经介绍如何在 Ubuntu Linux 上安装 Mysql。我很高兴如果这篇文章能帮助到那些正为此挣扎的用户或者刚刚开始的用户。 + +如果你发现这篇文章是一个很有用的资源,在评论里告诉我们。你为了什么使用 MySQL? 我们渴望收到你的任何反馈、印象和建议。感谢阅读,并毫不犹豫地尝试这个很棒的工具! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-mysql-ubuntu/ + +作者:[Sergiu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://www.mysql.com/ +[2]: https://en.wikipedia.org/wiki/LAMP_(software_bundle) +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/install-mysql-ubuntu.png?resize=800%2C450&ssl=1 +[4]: https://dev.mysql.com/downloads/repo/apt/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_apt_download_page.jpg?fit=800%2C280&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_deb_download_link.jpg?fit=800%2C507&ssl=1 +[7]: https://linuxhandbook.com/curl-command-examples/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_package_configuration_ok.jpg?fit=800%2C587&ssl=1 +[9]: https://itsfoss.com/change-password-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_enter_password.jpg?fit=800%2C583&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_information_on_configuring.jpg?fit=800%2C581&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_default_authentication_plugin.jpg?fit=800%2C586&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_service_information.jpg?fit=800%2C402&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/mysql_shell_prompt-2.jpg?fit=800%2C423&ssl=1 diff --git a/published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md b/published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md new file mode 100644 index 0000000000..b6d1b5d17b --- /dev/null +++ b/published/201904/20190417 HTTPie - A Modern Command Line HTTP Client For Curl And Wget Alternative.md @@ -0,0 +1,311 @@ +[#]: collector: (lujun9972) +[#]: translator: (zgj1024) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10765-1.html) +[#]: subject: (HTTPie – A Modern Command Line HTTP Client For Curl And Wget Alternative) +[#]: via: (https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +HTTPie:替代 Curl 和 Wget 的现代 HTTP 命令行客户端 +====== + +大多数时间我们会使用 `curl` 命令或是 `wget` 命令下载文件或者做其他事。 + +我们以前曾写过 [最佳命令行下载管理器][1] 的文章。你可以点击相应的 URL 连接来浏览这些文章。 + +* [aria2 – Linux 下的多协议命令行下载工具][2] +* [Axel – Linux 下的轻量级命令行下载加速器][3] +* [Wget – Linux 下的标准命令行下载工具][4] +* [curl – Linux 下的实用的命令行下载工具][5] + +今天我们将讨论同样的话题。这个实用程序名为 HTTPie。 + +它是现代命令行 http 客户端,也是 `curl` 和 `wget` 命令的最佳替代品。 + +### 什么是 HTTPie? + +HTTPie (发音是 aitch-tee-tee-pie) 是一个 HTTP 命令行客户端。 + +HTTPie 工具是现代的 HTTP 命令行客户端,它能通过命令行界面与 Web 服务进行交互。 + +它提供一个简单的 `http` 命令,允许使用简单而自然的语法发送任意的 HTTP 请求,并会显示彩色的输出。 + +HTTPie 能用于测试、调试及与 HTTP 服务器交互。 + +### 主要特点 + + * 具表达力的和直观语法 + * 格式化的及彩色化的终端输出 + * 内置 JSON 支持 + * 表单和文件上传 + * HTTPS、代理和认证 + * 任意请求数据 + * 自定义头部 + * 持久化会话 + * 类似 `wget` 的下载 + * 支持 Python 2.7 和 3.x + +### 在 Linux 下如何安装 HTTPie + +大部分 Linux 发行版都提供了系统包管理器,可以用它来安装。 + +Fedora 系统,使用 [DNF 命令][6] 来安装 httpie: + +``` +$ sudo dnf install httpie +``` + +Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 来安装 HTTPie。 + +``` +$ sudo apt install httpie +``` + +基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 HTTPie。 + +``` +$ sudo pacman -S httpie +``` + +RHEL/CentOS 的系统,使用 [YUM 命令][10] 来安装 HTTPie。 + +``` +$ sudo yum install httpie +``` + +openSUSE Leap 系统,使用 [Zypper 命令][11] 来安装 HTTPie。 + +``` +$ sudo zypper install httpie +``` + +### 用法 + +#### 如何使用 HTTPie 请求 URL? + +HTTPie 的基本用法是将网站的 URL 作为参数。 + +``` +# http 2daygeek.com +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a618d0c02ce6d-LHR +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:21:28 GMT +Expires: Tue, 09 Apr 2019 07:21:28 GMT +Location: https://2daygeek.com/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +#### 如何使用 HTTPie 下载文件 + +你可以使用带 `--download` 参数的 HTTPie 命令下载文件。类似于 `wget` 命令。 + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a65d5ca360a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:24:23 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:24:23 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=dd2034b2f95ae42047e082f59f2b964f71554791063; expires=Wed, 08-Apr-20 06:24:23 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png" +Done. 31.31 kB in 0.01187s (2.58 MB/s) +``` + +你还可以使用 `-o` 参数用不同的名称保存输出文件。 + +``` +# http --download https://www.2daygeek.com/wp-content/uploads/2019/04/Anbox-Easy-Way-To-Run-Android-Apps-On-Linux.png -o Anbox-1.png +HTTP/1.1 200 OK +Accept-Ranges: bytes +CF-Cache-Status: HIT +CF-RAY: 4c4a68194daa0a66-LHR +Cache-Control: public, max-age=7200 +Connection: keep-alive +Content-Length: 32066 +Content-Type: image/png +Date: Tue, 09 Apr 2019 06:25:56 GMT +Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" +Expires: Tue, 09 Apr 2019 08:25:56 GMT +Last-Modified: Mon, 08 Apr 2019 04:54:25 GMT +Server: cloudflare +Set-Cookie: __cfduid=d3eea753081690f9a2d36495a74407dd71554791156; expires=Wed, 08-Apr-20 06:25:56 GMT; path=/; domain=.2daygeek.com; HttpOnly; Secure +Vary: Accept-Encoding + +Downloading 31.31 kB to "Anbox-1.png" +Done. 31.31 kB in 0.01551s (1.97 MB/s) +``` + +#### 如何使用 HTTPie 恢复部分下载? + +你可以使用带 `-c` 参数的 HTTPie 继续下载。 + +``` +# http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.bin +HTTP/1.1 206 Partial Content +Connection: keep-alive +Content-Length: 100442112 +Content-Range: bytes 4415488-104857599/104857600 +Content-Type: application/octet-stream +Date: Tue, 09 Apr 2019 06:32:52 GMT +ETag: "5253f0fd-6400000" +Last-Modified: Tue, 08 Oct 2013 11:48:13 GMT +Server: nginx +Strict-Transport-Security: max-age=15768000; includeSubDomains + +Downloading 100.00 MB to "100MB.bin" + | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C +``` + +你根据下面的输出验证是否同一个文件: + +``` +[email protected]:/var/log# ls -lhtr 100MB.bin +-rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin +``` + +#### 如何使用 HTTPie 上传文件? + +你可以通过使用带有小于号 `<` 的 HTTPie 命令上传文件 + +``` +$ http https://transfer.sh < Anbox-1.png +``` + +#### 如何使用带有重定向符号 > 下载文件? + +你可以使用带有重定向 `>` 符号的 HTTPie 命令下载文件。 + +``` +# http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png + +# ls -ltrh Flatpak.png +-rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png +``` + +#### 发送一个 HTTP GET 请求? + +您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。 + + +``` +# http GET httpie.org +HTTP/1.1 301 Moved Permanently +CF-RAY: 4c4a83a3f90dcbe6-SIN +Cache-Control: max-age=3600 +Connection: keep-alive +Date: Tue, 09 Apr 2019 06:44:44 GMT +Expires: Tue, 09 Apr 2019 07:44:44 GMT +Location: https://httpie.org/ +Server: cloudflare +Transfer-Encoding: chunked +Vary: Accept-Encoding +``` + +#### 提交表单? + +使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。 + +``` +# http -f POST Ubuntu18.2daygeek.com hello='World' +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:12 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +运行下面的指令以查看正在发送的请求。 + +``` +# http -v Ubuntu18.2daygeek.com +GET / HTTP/1.1 +Accept: */* +Accept-Encoding: gzip, deflate +Connection: keep-alive +Host: ubuntu18.2daygeek.com +User-Agent: HTTPie/0.9.8 + +hello=World + +HTTP/1.1 200 OK +Accept-Ranges: bytes +Connection: Keep-Alive +Content-Encoding: gzip +Content-Length: 3138 +Content-Type: text/html +Date: Tue, 09 Apr 2019 06:48:30 GMT +ETag: "2aa6-5844bf1b047fc-gzip" +Keep-Alive: timeout=5, max=100 +Last-Modified: Sun, 17 Mar 2019 15:29:55 GMT +Server: Apache/2.4.29 (Ubuntu) +Vary: Accept-Encoding +``` + +#### HTTP 认证? + +当前支持的身份验证认证方案是基本认证(Basic)和摘要验证(Digest)。 + +基本认证: + +``` +$ http -a username:password example.org +``` + +摘要验证: + +``` +$ http -A digest -a username:password example.org +``` + +提示输入密码: + +``` +$ http -a username example.org +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/httpie-curl-wget-alternative-http-client-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/best-4-command-line-download-managers-accelerators-for-linux/ +[2]: https://www.2daygeek.com/aria2-linux-command-line-download-utility-tool/ +[3]: https://www.2daygeek.com/axel-linux-command-line-download-accelerator/ +[4]: https://www.2daygeek.com/wget-linux-command-line-download-utility-tool/ +[5]: https://www.2daygeek.com/curl-linux-command-line-download-manager/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/published/201904/20190417 Managing RAID arrays with mdadm.md b/published/201904/20190417 Managing RAID arrays with mdadm.md new file mode 100644 index 0000000000..d1365aa03b --- /dev/null +++ b/published/201904/20190417 Managing RAID arrays with mdadm.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10785-1.html) +[#]: subject: (Managing RAID arrays with mdadm) +[#]: via: (https://fedoramagazine.org/managing-raid-arrays-with-mdadm/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +使用 mdadm 管理 RAID 阵列 +====== + +![][1] + +mdadm 是多磁盘和设备管理Multiple Disk and Device Administration 的缩写。它是一个命令行工具,可用于管理 Linux 上的软件 [RAID][2] 阵列。本文概述了使用它的基础知识。 + +以下 5 个命令是你使用 mdadm 的基础功能: + +1. **创建 RAID 阵列**:`mdadm --create /dev/md/test --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1` +2. **组合(并启动)RAID 阵列**:`mdadm --assemble /dev/md/test /dev/sda1 /dev/sdb1` +3. **停止 RAID 阵列**:`mdadm --stop /dev/md/test` +4. **删除 RAID 阵列**:`mdadm --zero-superblock /dev/sda1 /dev/sdb1` +5. **检查所有已组合的 RAID 阵列的状态**:`cat /proc/mdstat` + +### 功能说明 + +#### mdadm --create + +上面的创建命令除了 `-create` 参数自身和设备名之外,还包括了四个参数: + +1、`–homehost`: + +默认情况下,`mdadm` 将你的计算机名保存为 RAID 阵列的属性。如果你的计算机名与存储的名称不匹配,则阵列将不会自动组合。此功能在共享硬盘的服务器群集中很有用,因为如果多个服务器同时尝试访问同一驱动器,通常会发生文件系统损坏。名称 `any` 是保留字段,并禁用 `-homehost` 限制。 + +2、 `–metadata`: + +`-mdadm` 保留每个 RAID 设备的一小部分空间,以存储有关 RAID 阵列本身的信息。 `-metadata` 参数指定信息的格式和位置。`1.0` 表示使用版本 1 格式,并将元数据存储在设备的末尾。 + +3、`–level`: + +`-level` 参数指定数据应如何在底层设备之间分布。级别 `1` 表示每个设备应包含所有数据的完整副本。此级别也称为[磁盘镜像] [3]。 + +4、`–raid-devices`: + +`-raid-devices` 参数指定将用于创建 RAID 阵列的设备数。 + +通过将 `-level=1`(镜像)与 `-metadata=1.0` (将元数据存储在设备末尾)结合使用,可以创建一个 RAID1 阵列,如果不通过 mdadm 驱动访问,那么它的底层设备会正常显示。这在灾难恢复的情况下很有用,因为即使新系统不支持 mdadm 阵列,你也可以访问该设备。如果程序需要在 mdadm 可用之前以*只读*访问底层设备时也很有用。例如,计算机中的 [UEFI][4] 固件可能需要在启动 mdadm 之前从 [ESP][5] 读取引导加载程序。 + +#### mdadm --assemble + +如果成员设备丢失或损坏,上面的组合命令将会失败。要强制 RAID 阵列在其中一个成员丢失时进行组合并启动,请使用以下命令: + +``` +# mdadm --assemble --run /dev/md/test /dev/sda1 +``` + +### 其他重要说明 + +避免直接写入底层是 RAID1 的设备。这导致设备不同步,并且 mdadm 不会知道它们不同步。如果你访问了在其他地方被修改了设备的某个 RAID1 阵列,则可能导致文件系统损坏。如果你在其他地方修改 RAID1 设备并需要强制阵列重新同步,请从要覆盖的设备中删除 mdadm 元数据,然后将其重新添加到阵列,如下所示: + +``` +# mdadm --zero-superblock /dev/sdb1 +# mdadm --assemble --run /dev/md/test /dev/sda1 +# mdadm /dev/md/test --add /dev/sdb1 +``` + +以上用 sda1 的内容完全覆盖 sdb1 的内容。 + +要指定在计算机启动时自动激活的 RAID 阵列,请创建 `/etc/mdadm.conf` 配置。 + +有关最新和详细信息,请查看手册页: + +``` +$ man mdadm +$ man mdadm.conf +``` + +本系列的下一篇文章将展示如何将现有的单磁盘 Linux 系统变为镜像磁盘安装,这意味着即使其中一个硬盘突然停止工作,系统仍将继续运行! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ + +作者:[Gregory Bartholomew][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://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/mdadm-816x345.jpg +[2]: https://en.wikipedia.org/wiki/RAID +[3]: https://en.wikipedia.org/wiki/Disk_mirroring +[4]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[5]: https://en.wikipedia.org/wiki/EFI_system_partition diff --git a/published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md b/published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md new file mode 100644 index 0000000000..01999af416 --- /dev/null +++ b/published/201904/20190418 Most data center workers happy with their jobs -- despite the heavy demands.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10797-1.html) +[#]: subject: (Most data center workers happy with their jobs -- despite the heavy demands) +[#]: via: (https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +许多数据中心的工作者很满意他们的工作,将鼓励他们的孩子继续从事这份工作 +====== + +> 一份 Informa Engage 和 Data Center Knowledge 的报告调查发现,在数据中心工作的人很满意他们的工作,因此他们将会鼓励他们的孩子从事这份工作。 + +![Thinkstock][1] + +一份由 [Informa Engage 和 Data Center Knowledge][2] 主导的调查报告显示,数据中心的工作者总体上对他们的工作很满意。尽管对时间和大脑的要求很高,但是他们还是鼓励自己的孩子能从事这项工作。 + +总体满意度非常好,72% 的受访者普遍同意“我喜欢我目前的工作”这一说法,三分之一的受访者则表示非常同意。75% 的人同意声明,“如果我的孩子、侄女或侄子问,我将建议他们进入 IT 行业。” + +在数据中心工作的员工之中,有一种很重要的感觉,88% 的人觉得他们自己对于雇主的成功非常重要。 + +尽管存在一些挑战,其中最主要的是技能和认证的缺乏。调查的受访者认为缺乏技能是最受关注的领域。只有 56% 的人认为他们需要完成工作所需的培训,74% 的人表示他们已经在 IT 行业工作了十多年。 + +这个行业提供认证计划,每个主要的 IT 硬件供应商都有,但是 61% 的人表示在过去的 12 个月里他们并没有完成或者重新续订证书。有几个原因: + +三分之一(34%)说是由于他们工作的组织缺乏培训预算,而 24% 的人认为是缺乏时间,16% 的人表示管理者认为不需要培训,以及另外 16% 的人表示在他们的工作地点没有培训计划。 + +这并不让我感到惊讶,因为科技是世界上最开放的行业之一,在那里你可以找到培训和教育材料并自学。已经证实了[许多程序员是自学成才][4],包括行业巨头比尔·盖茨、史蒂夫·沃兹尼亚克、约翰·卡马克和杰克·多尔西。 + +### 数据中心工作者们的薪水 + +数据中心工作者不会抱怨酬劳。当然,大部分不会。50% 的人每年可以赚到 $100,000 甚至更多,然而 11% 的人赚的少于 $40,000。三分之二的受访者来自于美国,因此那些低端收入人士可能在国外。 + +有一个值得注意的差异。史蒂夫·布朗是伦敦数据中心人力资源的总经理,他说软件工程师获得的薪水比硬件工程师多。 + +布朗在这篇报道中说,“数据中心软件工程方面的工作可以与高收入的职业媲美,而在物理基础设施——机械/电气方面的工作——情况并非如此。它更像是中层管理。” + +### 数据中心的专业人士仍然主要是男性 + +最不令人惊讶的发现?10 个受访者中有 9 个是男性。该行业正在调整解决性别歧视问题,但是现在没什么改变。 + +这篇报告的结论有一点不太好,但是我认为是错的: + +> “随着数据中心基础设施完成云计算模式的过渡,软件进入到容器和微服务时代,数据中心剩下来的珍贵领导者——在 20 世纪获得技能的人——可能会发现没有任何他们了解的东西需要管理,也没有人需要他们领导。当危机最终来临时,我们可能会感到震惊,但是我们不能说我们没有受到警告。" + +我说过了很多次,[数据中心不会消失][6]。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389359/most-data-center-workers-happy-with-their-jobs-despite-the-heavy-demands.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.idgesg.net/images/article/2018/02/data_center_thinkstock_879720438-100749725-large.jpg +[2]: https://informa.tradepub.com/c/pubRD.mpl?sr=oc&_t=oc:&qf=w_dats04&ch=datacenterkids +[3]: https://www.networkworld.com/article/3276025/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://www.networkworld.com/article/3046178/survey-finds-most-coders-are-self-taught.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[6]: https://www.networkworld.com/article/3289509/two-studies-show-the-data-center-is-thriving-instead-of-dying.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md b/published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md new file mode 100644 index 0000000000..3f1647eccb --- /dev/null +++ b/published/201904/20190418 Ubuntu 19.04 ‘Disco Dingo- Has Arrived- Downloads Available Now.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10795-1.html) +[#]: subject: (Ubuntu 19.04 ‘Disco Dingo’ Has Arrived: Downloads Available Now!) +[#]: via: (https://itsfoss.com/ubuntu-19-04-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +下载安装 Ubuntu 19.04 “Disco Dingo” +====== + +Ubuntu 19.04 “Disco Dingo” 已经发布,可以下载了。虽然我们已经知道 [Ubuntu 19.04 中的新功能][1] —— 我将在下面提到一些重要的地方,还会给出官方的下载链接。 + +### Ubuntu 19.04:你需要知道什么 + +以下是你应该了解的有关 Ubuntu 19.04 Disco Dingo 发布的一些内容。 + +#### Ubuntu 19.04 不是 LTS 版本 + +与 Ubuntu 18.04 LTS 不同,它不会[支持 10 年][2]。相反,非 LTS 的 19.04 将支持 **9 个月,直到 2020 年 1 月。** + +因此,如果你有生产环境,我们可能不会立即建议你进行升级。例如,如果你有一台运行在 Ubuntu 18.04 LTS 上的服务器 —— 只是因为它是一个新的版本就将它升级到 19.04 可能不是一个好主意。 + +但是,对于希望在计算机上安装最新版本的用户,可以尝试一下。 + +![][3] + +#### Ubuntu 19.04 对 NVIDIA GPU 用户是个不错的更新 + +Martin Wimpress(来自 Canonical)在 Ubuntu MATE 19.04(Ubuntu 版本之一)的 [GitHub][4] 的最终发布说明中提到 Ubuntu 19.04 对 NVIDIA GPU 用户来说特别重要。 + +换句话说,在安装专有图形驱动时 —— 它现在会选择与你特定 GPU 型号兼容最佳的驱动程序。 + +#### Ubuntu 19.04 功能 + +- https://youtu.be/sbbPYdpdMb8 + +尽管我们已经讨论过 [Ubuntu 19.04][1] Disco Dingo 的[最佳功能][1],但值得一提的是,我对本次发布的主要变化:桌面更新 (GNOME 3.32) 和 Linux 内核 (5.0)感到兴奋。 + +#### 从 Ubuntu 18.10 升级到 19.04 + +显而易见,如果你安装了 Ubuntu 18.10,你应该升级它。18.10 将于 2019 年 7 月停止支持 —— 所以我们建议你将其升级到 19.04。 + +要做到这一点,你可以直接进入“软件和更新”设置,然后选择“更新”选项卡。 + +现在将选项从“通知我新的 Ubuntu 版本” 变成 “任何新版本都通知我”。 + +现在再次运行更新管理器时,你应该会看到 Ubuntu 19.04。 + +![][5] + +#### 从 Ubuntu 18.04 升级到 19.04 + +建议不要直接从 18.04 升级到 19.04,因为你需要先将操作系统更新到 18.10,然后再继续升级到 19.04。 + +相反,你只需下载 Ubuntu 19.04 的官方 ISO 映像,然后在你的系统上重新安装 Ubuntu。 + +### Ubuntu 19.04:所有版本都可下载 + +根据[发行说明][6],现在可以下载 Ubuntu 19.04。你可以在其官方发布下载页面上获取种子或 ISO 文件。 + +- [下载 Ubuntu 19.04][7] + +如果你需要不同的桌面环境或需要特定的东西,你应该查看 Ubuntu 的官方版本: + + * [Ubuntu MATE][8] + * [Kubuntu][9] + * [Lubuntu][10] + * [Ubuntu Budgie][11] + * [Ubuntu Studio][12] + * [Xubuntu][13] + +上面提到的一些 Ubuntu 版本还没有在页面提供 19.04。但你可以[仍然在 Ubuntu 的发行说明网页上找到 ISO][6]。就个人而言,我使用带 GNOME 桌面的 Ubuntu。你可以选择你喜欢的。 + +### 总结 + +你如何看待 Ubuntu 19.04 Disco Dingo?这些新功能是否足够令人兴奋?你试过了吗?请在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-19-04-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/ubuntu-19-04-release-features/ +[2]: https://itsfoss.com/ubuntu-18-04-ten-year-support/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/ubuntu-19-04-Disco-Dingo-default-wallpaper.jpg?resize=800%2C450&ssl=1 +[4]: https://github.com/ubuntu-mate/ubuntu-mate.org/blob/master/blog/20190418-ubuntu-mate-disco-final-release.md +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-19-04-upgrade-available.jpg?ssl=1 +[6]: https://wiki.ubuntu.com/DiscoDingo/ReleaseNotes +[7]: https://www.ubuntu.com/download/desktop +[8]: https://ubuntu-mate.org/download/ +[9]: https://kubuntu.org/getkubuntu/ +[10]: https://lubuntu.me/cosmic-released/ +[11]: https://ubuntubudgie.org/downloads +[12]: https://ubuntustudio.org/2019/04/ubuntu-studio-19-04-released/ +[13]: https://xubuntu.org/download/ diff --git a/published/201904/20190419 4 cool new projects to try in COPR for April 2019.md b/published/201904/20190419 4 cool new projects to try in COPR for April 2019.md new file mode 100644 index 0000000000..dee3920eb0 --- /dev/null +++ b/published/201904/20190419 4 cool new projects to try in COPR for April 2019.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10787-1.html) +[#]: subject: (4 cool new projects to try in COPR for April 2019) +[#]: via: (https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/) +[#]: author: (Dominik Turecek https://fedoramagazine.org/author/dturecek/) + +COPR 仓库中 4 个很酷的新软件(2019.4) +====== + +![][1] + +COPR 是个人软件仓库[集合][1],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准。或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 + +这是 COPR 中一组新的有趣项目。 + +### Joplin + +[Joplin][3] 是一个笔记和待办事项应用。笔记以 Markdown 格式编写,并通过使用标签和将它们分类到各种笔记本中进行组织。Joplin 可以从任何 Markdown 源导入笔记或从 Evernote 导出笔记。除了桌面应用之外,还有一个 Android 版本,通过使用 Nextcloud、Dropbox 或其他云服务同步笔记。最后,它还有 Chrome 和 Firefox 的浏览器扩展程序,用于保存网页和屏幕截图。 + +![][4] + +#### 安装说明 + +[COPR 仓库][5]目前为 Fedora 29 和 30 以及 EPEL 7 提供 Joplin。要安装 Joplin,请[带上 sudo][6] 使用这些命令: + +``` +sudo dnf copr enable taw/joplin +sudo dnf install joplin +``` + +### Fzy + +[Fzy][7] 是用于模糊字符串搜索的命令行程序。它从标准输入读取并根据最有可能的搜索结果进行排序,然后打印所选行。除了命令行,`fzy` 也可以在 vim 中使用。你可以在这个在线 [demo][8] 中尝试 `fzy`。 + +#### 安装说明 + +[COPR 仓库][9]目前为 Fedora 29、30 和 Rawhide 以及其他发行版提供了 `fzy`。要安装 `fzy`,请使用以下命令: + +``` +sudo dnf copr enable lehrenfried/fzy +sudo dnf install fzy +``` + +### Fondo + +Fondo 是一个浏览 [unsplash.com][10] 网站照片的程序。它有一个简单的界面,允许你一次查找某个主题或所有主题的图片。然后,你可以通过单击将找到的图片设置为壁纸,或者共享它。 + +![][11] + +#### 安装说明 + +[COPR 仓库][12]目前为 Fedora 29、30 和 Rawhide 提供 Fondo。要安装 Fondo,请使用以下命令: + +``` +sudo dnf copr enable atim/fondo +sudo dnf install fondo +``` + +### YACReader + +[YACReader][13] 是一款数字漫画阅读器,它支持许多漫画和图像格式,例如 cbz、cbr、pdf 等。YACReader 会跟踪阅读进度,并可以从 [Comic Vine][14] 下载漫画信息。它还有一个 YACReader 库,用于组织和浏览你的漫画集。 + +![][15] + +#### 安装说明 + +[COPR 仓库][16]目前为 Fedora 29、30 和 Rawhide 提供 YACReader。要安装 YACReader,请使用以下命令: + +``` +sudo dnf copr enable atim/yacreader +sudo dnf install yacreader +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-april-2019/ + +作者:[Dominik Turecek][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://fedoramagazine.org/author/dturecek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg +[2]: https://copr.fedorainfracloud.org/ +[3]: https://joplin.cozic.net/ +[4]: https://fedoramagazine.org/wp-content/uploads/2019/04/joplin.png +[5]: https://copr.fedorainfracloud.org/coprs/taw/joplin/ +[6]: https://fedoramagazine.org/howto-use-sudo/ +[7]: https://github.com/jhawthorn/fzy +[8]: https://jhawthorn.github.io/fzy-demo/ +[9]: https://copr.fedorainfracloud.org/coprs/lehrenfried/fzy/ +[10]: https://unsplash.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/04/fondo.png +[12]: https://copr.fedorainfracloud.org/coprs/atim/fondo/ +[13]: https://www.yacreader.com/ +[14]: https://comicvine.gamespot.com/ +[15]: https://fedoramagazine.org/wp-content/uploads/2019/04/yacreader.png +[16]: https://copr.fedorainfracloud.org/coprs/atim/yacreader/ diff --git a/published/201904/20190420 New Features Coming to Debian 10 Buster Release.md b/published/201904/20190420 New Features Coming to Debian 10 Buster Release.md new file mode 100644 index 0000000000..83e9c640bd --- /dev/null +++ b/published/201904/20190420 New Features Coming to Debian 10 Buster Release.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10790-1.html) +[#]: subject: (New Features Coming to Debian 10 Buster Release) +[#]: via: (https://itsfoss.com/new-features-coming-to-debian-10-buster-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +即将到来的 Debian 10 Buster 发布版的新特点 +======================================= + +Debian 10 Buster 即将发布。第一个发布候选版已经发布,我们预期可以在几周内见到待最终版。 + +如果你期待对这个新的主要发布版本,让我告诉你里面有什么。 + +### Debian 10 Buster 发布计划 + +[Debian 10 Buster][1] 的发布日期并没有确定。为什么这样呢?不像其他分发版,[Debian][2] 并不基于时间发布。相反地它主要关注于修复发布版重要 Bugrelease-critical bug。发布版重要 Bug 要么是严重的安全问题([CVE][3]),要么是一些其他阻止 Debian 发布的严重问题。 + +Debian 在它的软件归档中分为三个部分,叫做 Main、contrib 和 non-free。在这三者之中,Debian 开发者和发布管理者最关心的包组成了该分发版的基石。Main 是像石头一样稳定的。因此他们要确保那里没有主要的功能或者安全问题。他们同样给予了不同的优先级,例如 Essential、Required、Important、Standard、Optional 和 Extra。更多关于此方面的知识参考后续的 Debian 文章。 + +这是必要的,因为 Debian 在很多环境中被用作服务器,人们已经变得依赖 Debian。他们同样看重升级周期是否有破环,因此他们寻找人们来测试,来查看当升级的时候是否有破坏并通知 Debian 有这样的问题。 + +这种提交方式带来的稳定性[是我喜欢 Debian 的众多原因之一][4]。 + +### Debian 10 Buster 版本的新内容 + +这里是即将到来的 Debian 主要发布版的一些视觉上和内部的改变。 + +#### 新的主题和壁纸 + +Buster 的 Debian 主题被称为 [FuturePrototype][5] 并且看起来如下图: + +![Debian Buster FuturePrototype Theme][6] + +#### 1、GNOME 桌面 3.30 + +Debian Stretch 版中的 GNOME 桌面在 Buster 中从 1.3.22 升级到了 1.3.30。在 GNOME 桌面发布版中新包含的一些包是 gnome-todo、tracker 替代了 tracker-gui、gstreamer1.0-packagekit 的依赖,因此可以通过自动地安装编码解码器来做播放电影之类的事。对于所有包来说一个大的改变是从 libgtk2+ 到 libgtk3+。 + +#### 2、Linux 内核 4.19.0-4 + +Debian 使用 LTS 内核版本,因此你可以期待更好的硬件支持和长达 5 年的维护和支持周期。我们已经从内核 4.9.0.3 到 4.19.0-4。 + +``` +$ uname -r +4.19.0-4-amd64 +``` + +#### 3、OpenJDK 11.0 + +Debian 在很长时间里都是 OpenJDK 8.0。现在在 Debian Buster 里我们已经升级为 OpenJDK 11.0,并且会有一个团队维护新的版本。 + +#### 4、默认启用 AppArmor + +在 Debian Buster 中是默认启用 [AppArmor][7] 的。这是一个好事,谨慎是系统管理员必须采取的正确策略。这仅仅是第一步,并且可能需要修复很多对用户觉得有用的脚本。 + +#### 5、Nodejs 10.15.2 + +在很长一段时间里 Debian 在仓库中都只有 Nodejs 4.8。在这个周期里 Debian 已经移到 Nodejs 10.15.2。事实上,Debian Buster 有很多 javascript 库例如 yarnpkg (一个 nmp 的替代品)等等。 + +当然,你可以从该项目仓库[在 Debian 中安装最新的 Nodejs][8],但是从 Debian 仓库中看到更新的版本是很棒的。 + +#### 6、NFtables 替代了 iptables + +Debian Buster 提供了 nftables 来完整地替代了 iptables,因为它有更好、更简单的语法,更好的支持双栈 ipv4/v6 防火墙等等。 + +#### 7、支持更多的 ARM 64 和 ARMHF 的单板机。 + +Debian 已经支持一些常见的新的单板机,其中最新的包括 pine64_plus、ARM64 的 pinebook、Firefly-RK3288、ARMHF 64 的 u-boot-rockchip 以及 Odroid HC1/HC2 板、SolidRun Cubox-i 双核/四核(1.5som)和 SolidRun Cubox-i 双核/四核(1.5som+emmc)板、Cubietruckplus 等。同样支持 Rock 64、Banana Pi M2 Berry、Pine A64 LTS Board、Olimex A64 Teres-1 与 Rapberry Pi 1、Zero 和 Pi 3。对于 RISC-V 系统同样支持开箱即用。 + +#### 8、Python 2 已死,Python 3 长存 + +在 2020 年 1 月 1 日,Python 2 将被 python.org 废弃。在 Debian 将所有的软件包从 Python 2.7 移到 Python 3 以后,Python 2.7 将从软件仓库中移除。这可能发生在 Buster 发布版或者将来的某个发布版,这是肯定要来临的。因此 Python 开发者被鼓励移植他们的代码库来兼容 Python 3。在写本文的时候,在 Debian Buster 中同时支持 python2 和 pythone3。 + +#### 9、Mailman 3 + +在 Debian 中终于可以使用 Mailman3 了。同时 [Mailman][10] 已经被细分成为组件。要安装整个软件栈,可以安装 mailman3-full 来获取所有组件。 + +#### 10、任意已有的 Postgresql 数据库将需要重新索引 + +由于 glibc 本地数据的更新,放入文本索引中的信息排序的方式将会改变,因为重新索引是有益的,这样在将来就不会有数据破坏发生。 + +#### 11、默认 Bash 5.0 + +你可能已经了解了 [Bash 5.0 的新特点][11],在 Debian 中已经是该版本了。 + +#### 12、Debian 实现 /usr/merge + +我们已经分享过一个优秀的 freedesktop [读物][12],介绍了 `/usr/merge` 带来了什么。有一些事项需要注意。当 Debian 想要整个过渡时,可能由于未预见的情况,一些二进制文件可能并没有做这些改变。需要指出的一点是,`/var` 和 `/etc` 不会被触及,因此使用容器或者云技术的不需要考虑太多 :)。 + +#### 13、支持安全启动 + +在 Buster RC1 中,Debian 现在支持安全启动secure-boot。这意味着打开了安全启动设置的机器应该能够轻松安装 Debian。不再需要禁止或者处理安全启动的事 :) + +#### 14、Debian-Live 镜像的 Calameres Live-installer + +对于 Debian Buster 的 Live 版,Debian 引入了 [Calameres 安装器][13]来替代老的 Debian-installer。Debian-installer 比 Calameres 功能更多,但对于初学者,Calameres 相对于 Debian-installer 提供了另外一种全新的安装方式。安装过程的截图: + +![Calamares Partitioning Stage][14] + +如图所见,在 Calamares 下安装 Debian 相当简单,只要经历 5 个步骤你就能在你的机器上安装 Debian。 + +### 下载 Debian 10 Live 镜像 (只用于测试) + +现在还不要将它用于生产机器。可以在测试机上尝试或者一个虚拟机。 + +你可以从 Debian Live [目录][15]获取 Debian 64 位和 32 位的镜像。如果你想要 64 位的就进入 `64-bit` 目录,如果你想要 32 位的,就进入 `32-bit` 目录。 + +- [下载 Debian 10 Buster Live Images][15] + +如果你从已存在的稳定版升级并且出现了一些问题,查看它是否在预安装的[升级报告][16]中提及了,使用 [reportbug][17] 报告你看到的问题。如果 bug 没有被报告,那么请尽可能地报告和分享更多地信息。 + +### 总结 + +当上千个包被升级时,看起来不可能一一列出。我已经列出了一些你在 Debian Buster 可以找到的一些主要的改变。你怎么看呢? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/new-features-coming-to-debian-10-buster-release/ + +作者:[Shirish][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.debian.org/DebianBuster +[2]: https://www.debian.org/ +[3]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures +[4]: https://itsfoss.com/reasons-why-i-love-debian/ +[5]: https://wiki.debian.org/DebianArt/Themes/futurePrototype +[6]: https://itsfoss.com/wp-content/uploads/2019/04/debian-buster-theme-800x450.png +[7]: https://wiki.debian.org/AppArmor +[8]: https://itsfoss.com/install-nodejs-ubuntu/ +[9]: https://www.python.org/dev/peps/pep-0373/ +[10]: https://www.list.org/ +[11]: https://itsfoss.com/bash-5-release/ +[12]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/ +[13]: https://calamares.io/about/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/calamares-partitioning-wizard.jpg?fit=800%2C538&ssl=1 +[15]: https://cdimage.debian.org/cdimage/weekly-live-builds/ +[16]: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=upgrade-reports;dist=unstable +[17]: https://itsfoss.com/bug-report-debian/ diff --git a/published/20190416 Can schools be agile.md b/published/20190416 Can schools be agile.md new file mode 100644 index 0000000000..1e696ab2cd --- /dev/null +++ b/published/20190416 Can schools be agile.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11076-1.html) +[#]: subject: (Can schools be agile?) +[#]: via: (https://opensource.com/open-organization/19/4/education-culture-agile) +[#]: author: (Ben Owens https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins) + +学校可以变得敏捷吗? +====== +> 我们一定不会希望用商业的方式运作我们的学校 —— 但是更加注重持续改进的教育机构是可以让我们受益的。 + +![][1] + +我们都有过那种感觉一件事情“似曾相识”的经历。在 1980 年代末期我经常会有这种感觉,那时候我刚刚进入工业领域不久。当时正赶上一波组织变革的热潮,美国制造业在尝试各种各样不同的模型,让企业领导、经理人和像我这样的工程师重新思考我们应该如何处理质量、成本、创新以及股东价值这样的问题。我们似乎每一年(有时候更加频繁)都需要通过学习一本书来找到让我们更精简、更扁平、更灵活以及更加能满足顾客需求的“最佳方案”。 + +这里面的很多方法都带来了巨大的改进,我至今仍然赞同它们的核心原则。像 John Kotter、Peter Drucker、Edwards Demming 和 Peter Senge 这样的思想领袖提出的某些思想和策略,还有我们采用的像 Six Sigma 以及在“丰田模式”里可以找到的一些流程优化方法,对我们改进工作都起到了十分关键的作用。 + +但是其他人似乎只是在同样的思想上进行了润色和调整,然后重新包装了一下 —— 所以我才会有那种 *似曾相识* 的感觉。但是当我成为了一名教师之后,我遇到了一个 *没有* 给我那种似曾相识的感觉的地方:教育界。事实上我十分惊讶地发现,在我的这个新职业里,“持续不断的改进”并 *不像* 在我之前的职业里那样重要了(特别是对于像我这种授课老师职级的人来说)。 + +为什么教育机构很少努力营造一种不断改进的文化氛围呢?我能想到几个原因,在这里我列举两个。 + +### 不再做生产线上的元件 + +这种不断改进的文化氛围遇到的第一个阻碍是,教育界普遍不愿意从其它行业借鉴可以为自己所用的思想 —— 特别是来自商界的思想。第二个阻碍是,主导教育界的仍然是一种自上而下的、等级制度森严的领导模式。人们往往只能在小范围内讨论这种系统性的、持续的改进方案,比如包括校长、助理校长、学校监管人(LCTT 译注:美国地方政府下设的一种官职,每个学校监管人管理一定数量的学校,接受学校校长的汇报)等等在内的学校领导和区域领袖。但是一小群人的参与是远远不足以带来整个组织层面的文化改革的。 + +在进一步展开观点之前,我想强调一下,上面所做的概括一定是存在例外情况的(我自己就见到过很多),不过我觉得任何一个教育界的利益相关者都应该会同意以下两点基本假设: + + 1. 为学生提供高质量的、公平的教育和教学系统的工作所涉及到的任何人都应该将持续不断的改进作为思维方式里的重要部分; + 2. 如果学校领导在做决策的时候可以更多地参考那些离学生最近的工作者的意见,那么学生以及学生所在的社区都将更加受益; + +那么教育界人士为什么会倾向于忽视(或者公然地敌视)教育界之外的思想呢? + +比如我过去就曾经提议应该向别的行业借鉴一些思想和灵感来帮助我们更好地迎合学生的需求,并且果然遭到了批评。我经常得到的回应是:“你这是在把我们的学生当成生产线上的元件来对待呀!”但是我们的学生现在就是在被当作生产线上的元件对待,并且已经无以复加了。他们按照被年龄划分的群体考入大学,每天根据刺耳的铃声的指示去上一节又一节孤立的课程,并且由一些武断的、强调同一性而不是个性的考试来评判他们的成绩。 + +很多教育界人士可能不知道,生产线元件这种会让人想到流水线标准化作业的东西已经不是现代制造业里的重要组成部分了。得益于上面提到的不断改进的文化氛围,现代先进制造业已经可以做到在单个顾客产生需求的时候,以合理的价格有针对性地提供她所需要的商品。如果我们的学校也可以采用这种模式,教师们之间就更可能会进行协作,并且可以基于学生即时的需求和兴趣,不断完善每一个学生独特的成长和进步路线,而不受时间、课题或者其它传统规范的限制。 + +我并不是要呼吁大家像经营商业一样经营我们的学校。我所主张的是,用一种清晰而客观的态度去看待任何行业的任何思想,只要它们有可能帮助我们更好地迎合学生个体的需求。不过,如果想有效率地实现这个目标,我们需要仔细研究这个 100 多年来都停滞不前的领导结构。 + +### 把不断改进作为努力的目标 + +有一种说法认为教育和其它行业之间存在着巨大的差异,我虽然赞同这种说法,但同时也相信“重新思考组织和领导结构”这件事情对于任何一个希望对利益相关者负责(并且可以及时作出响应)的主体来说都是适用的。大多数其它行业都已经在重新审视它们传统的、封闭的、等级森严的结构,并且采用可以鼓励员工基于共有的优秀目标发挥自主性的组织结构 —— 这种组织结构对于不断改进来说十分关键。我们的学校和行政区是时候放开眼界了,而不应该拘泥于只听到来自内部的声音,因为它们的用意虽然是好的,但都没有脱离现有的范式。 + +对于任何希望开始或者加速这个转变过程的学校,我推荐一本很好的书:Jim Whitehurst 的《开放组织》(这不应该让你感到意外)。这本书不仅可以帮助我们理解教育者如何创造更加开放、覆盖面更广的领导领导结构 —— 在这样的结构下,互相尊重让人们可以基于实时数据作出更加灵活的决策 —— 并且它所使用的语言风格也和教育者们所习惯使用的奇怪的词汇库非常契合(这种词汇库简直是教育者们第二天性)。任何组织都可以借鉴开放组织的思维提供的实用主义方法让组织成员更加开放:分享想法和资源、拥抱以共同协作为核心的文化、通过快速制作原型来开发创新思维、基于价值(而不是提出者的职级)来评估一个想法,以及创造一种融入到组织 DNA 里的很强的社区观念。通过众包的方式,这样的开放组织不仅可以从组织内部,也能够从组织外部收集想法,创造一种可以让本地化的、以学生为中心的创新蓬勃发展的环境。 + +最重要的事情是:在快速变化的未来,我们在过去所做的事情不一定仍然适用了 —— 认清楚这一点对于创造一个不断改进的文化氛围是十分关键的。对于教育者来说,这意味着我们不能只是简单地依赖在针对工厂模型发展出来的解决方案和实践方式了。我们必须从其它行业(比如说非营利组织、军事、医疗以及商业 —— 没错,甚至是商业)里借鉴数不清的最佳方案,这样至少应该能让我们 *知道* 如何找到让学生受益最大的办法。从教育界传统的陈词滥调里超脱出来,才有机会拥有更广阔的视角。我们可以更好地顾全大局,用更客观地视角看待我们遇到的问题,同时也知道我们在什么方面已经做得很不错。 + +通过有意识地借鉴各路思想 —— 从一年级教师到纽约时报上最新的商业、管理、领导力畅销书 —— 我们可以更好地发掘和运用校内人才,以帮助我们克服阻碍了我们的学校和区域进步的制度里的惰性。 + +坚持不懈地追求不断改进这件事情,不应该只局限于那种努力在一个全球化的、创新的经济环境中争取竞争力的机构,或者是负责运营学校的少数几个人。当机构里的每一个人都能不断思考怎样才能让今天比昨天做得更好的时候,这就是一个拥有优秀的文化氛围的机构。这种非常有注重协作性和创新的文化氛围,正是我们希望在这些负责改变年轻人命运的机构身上看到的。 + +我非常期待,有朝一日我能在学校里感受到这种精神,然后微笑着对自己说:“这种感觉多么似曾相识啊。” + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/education-culture-agile + +作者:[Ben Owens][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/engineerteacher/users/ke4qqq/users/n8chz/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_network.png?itok=ySEHuAQ8 diff --git a/published/201905/20161106 Myths about -dev-urandom.md b/published/201905/20161106 Myths about -dev-urandom.md new file mode 100644 index 0000000000..76f07ebc3c --- /dev/null +++ b/published/201905/20161106 Myths about -dev-urandom.md @@ -0,0 +1,294 @@ +关于 /dev/urandom 的流言终结 +====== + +有很多关于 `/dev/urandom` 和 `/dev/random` 的流言在坊间不断流传。然而流言终究是流言。 + +> 本篇文章里针对的都是近来的 Linux 操作系统,其它类 Unix 操作系统不在讨论范围内。 + +**`/dev/urandom` 不安全。加密用途必须使用 `/dev/random`** + +*事实*:`/dev/urandom` 才是类 Unix 操作系统下推荐的加密种子。 + +**`/dev/urandom` 是伪随机数生成器pseudo random number generator(PRND),而 `/dev/random` 是“真”随机数生成器。** + +*事实*:它们两者本质上用的是同一种 CSPRNG (一种密码学伪随机数生成器)。它们之间细微的差别和“真”“不真”随机完全无关。(参见:“Linux 随机数生成器的构架”一节) + +**`/dev/random` 在任何情况下都是密码学应用更好地选择。即便 `/dev/urandom` 也同样安全,我们还是不应该用它。** + +*事实*:`/dev/random` 有个很恶心人的问题:它是阻塞的。(参见:“阻塞有什么问题?”一节)(LCTT 译注:意味着请求都得逐个执行,等待前一个请求完成) + +**但阻塞不是好事吗!`/dev/random` 只会给出电脑收集的信息熵足以支持的随机量。`/dev/urandom` 在用完了所有熵的情况下还会不断吐出不安全的随机数给你。** + +*事实*:这是误解。就算我们不去考虑应用层面后续对随机种子的用法,“用完信息熵池”这个概念本身就不存在。仅仅 256 位的熵就足以生成计算上安全的随机数很长、很长的一段时间了。(参见:“那熵池快空了的情况呢?”一节) + +问题的关键还在后头:`/dev/random` 怎么知道有系统会*多少*可用的信息熵?接着看! + +**但密码学家老是讨论重新选种子(re-seeding)。这难道不和上一条冲突吗?** + +*事实*:你说的也没错!某种程度上吧。确实,随机数生成器一直在使用系统信息熵的状态重新选种。但这么做(一部分)是因为别的原因。(参见:“重新选种”一节) + +这样说吧,我没有说引入新的信息熵是坏的。更多的熵肯定更好。我只是说在熵池低的时候阻塞是没必要的。 + +**好,就算你说的都对,但是 `/dev/(u)random` 的 man 页面和你说的也不一样啊!到底有没有专家同意你说的这堆啊?** + +*事实*:其实 man 页面和我说的不冲突。它看似好像在说 `/dev/urandom` 对密码学用途来说不安全,但如果你真的理解这堆密码学术语你就知道它说的并不是这个意思。(参见:“random 和 urandom 的 man 页面”一节) + +man 页面确实说在一些情况下推荐使用 `/dev/random` (我觉得也没问题,但绝对不是说必要的),但它也推荐在大多数“一般”的密码学应用下使用 `/dev/urandom` 。 + +虽然诉诸权威一般来说不是好事,但在密码学这么严肃的事情上,和专家统一意见是很有必要的。 + +所以说呢,还确实有一些*专家*和我的一件事一致的:`/dev/urandom` 就应该是类 UNIX 操作系统下密码学应用的首选。显然的,是他们的观点说服了我而不是反过来的。(参见:“正道”一节) + +------ + +难以相信吗?觉得我肯定错了?读下去看我能不能说服你。 + +我尝试不讲太高深的东西,但是有两点内容必须先提一下才能让我们接着论证观点。 + +首当其冲的,*什么是随机性*,或者更准确地:我们在探讨什么样的随机性?(参见:“真随机”一节) + +另外一点很重要的是,我*没有尝试以说教的态度*对你们写这段话。我写这篇文章是为了日后可以在讨论起的时候指给别人看。比 140 字长(LCTT 译注:推特长度)。这样我就不用一遍遍重复我的观点了。能把论点磨炼成一篇文章本身就很有助于将来的讨论。(参见:“你是在说我笨?!”一节) + +并且我非常乐意听到不一样的观点。但我只是认为单单地说 `/dev/urandom` 坏是不够的。你得能指出到底有什么问题,并且剖析它们。 + +### 你是在说我笨?! + +绝对没有! + +事实上我自己也相信了 “`/dev/urandom` 是不安全的” 好些年。这几乎不是我们的错,因为那么德高望重的人在 Usenet、论坛、推特上跟我们重复这个观点。甚至*连 man 手册*都似是而非地说着。我们当年怎么可能鄙视诸如“信息熵太低了”这种看上去就很让人信服的观点呢?(参见:“random 和 urandom 的 man 页面”一节) + +整个流言之所以如此广为流传不是因为人们太蠢,而是因为但凡有点关于信息熵和密码学概念的人都会觉得这个说法很有道理。直觉似乎都在告诉我们这流言讲的很有道理。很不幸直觉在密码学里通常不管用,这次也一样。 + +### 真随机 + +随机数是“真正随机”是什么意思? + +我不想搞的太复杂以至于变成哲学范畴的东西。这种讨论很容易走偏因为对于随机模型大家见仁见智,讨论很快变得毫无意义。 + +在我看来“真随机”的“试金石”是量子效应。一个光子穿过或不穿过一个半透镜。或者观察一个放射性粒子衰变。这类东西是现实世界最接近真随机的东西。当然,有些人也不相信这类过程是真随机的,或者这个世界根本不存在任何随机性。这个就百家争鸣了,我也不好多说什么了。 + +密码学家一般都会通过不去讨论什么是“真随机”来避免这种哲学辩论。他们更关心的是不可预测性unpredictability。只要没有*任何*方法能猜出下一个随机数就可以了。所以当你以密码学应用为前提讨论一个随机数好不好的时候,在我看来这才是最重要的。 + +无论如何,我不怎么关心“哲学上安全”的随机数,这也包括别人嘴里的“真”随机数。 + +### 两种安全,一种有用 + +但就让我们退一步说,你有了一个“真”随机变量。你下一步做什么呢? + +你把它们打印出来然后挂在墙上来展示量子宇宙的美与和谐?牛逼!我支持你。 + +但是等等,你说你要*用*它们?做密码学用途?额,那这就废了,因为这事情就有点复杂了。 + +事情是这样的,你的真随机、量子力学加护的随机数即将被用进不理想的现实世界算法里去。 + +因为我们使用的几乎所有的算法都并不是信息论安全性information-theoretic security 的。它们“只能”提供**计算意义上的安全**。我能想到为数不多的例外就只有 Shamir 密钥分享和一次性密码本One-time pad(OTP)算法。并且就算前者是名副其实的(如果你实际打算用的话),后者则毫无可行性可言。 + +但所有那些大名鼎鼎的密码学算法,AES、RSA、Diffie-Hellman、椭圆曲线,还有所有那些加密软件包,OpenSSL、GnuTLS、Keyczar、你的操作系统的加密 API,都仅仅是计算意义上安全的。 + +那区别是什么呢?信息论安全的算法肯定是安全的,绝对是,其它那些的算法都可能在理论上被拥有无限计算力的穷举破解。我们依然愉快地使用它们是因为全世界的计算机加起来都不可能在宇宙年龄的时间里破解,至少现在是这样。而这就是我们文章里说的“不安全”。 + +除非哪个聪明的家伙破解了算法本身 —— 在只需要更少量计算力、在今天可实现的计算力的情况下。这也是每个密码学家梦寐以求的圣杯:破解 AES 本身、破解 RSA 本身等等。 + +所以现在我们来到了更底层的东西:随机数生成器,你坚持要“真随机”而不是“伪随机”。但是没过一会儿你的真随机数就被喂进了你极为鄙视的伪随机算法里了! + +真相是,如果我们最先进的哈希算法被破解了,或者最先进的分组加密算法被破解了,你得到的这些“哲学上不安全”的随机数甚至无所谓了,因为反正你也没有安全的应用方法了。 + +所以把计算性上安全的随机数喂给你的仅仅是计算性上安全的算法就可以了,换而言之,用 `/dev/urandom`。 + +### Linux 随机数生成器的构架 + +#### 一种错误的看法 + +你对内核的随机数生成器的理解很可能是像这样的: + +![image: mythical structure of the kernel's random number generator][1] + +“真正的随机性”,尽管可能有点瑕疵,进入操作系统然后它的熵立刻被加入内部熵计数器。然后经过“矫偏”和“漂白”之后它进入内核的熵池,然后 `/dev/random` 和 `/dev/urandom` 从里面生成随机数。 + +“真”随机数生成器,`/dev/random`,直接从池里选出随机数,如果熵计数器表示能满足需要的数字大小,那就吐出数字并且减少熵计数。如果不够的话,它会阻塞程序直至有足够的熵进入系统。 + +这里很重要一环是 `/dev/random` 几乎只是仅经过必要的“漂白”后就直接把那些进入系统的随机性吐了出来,不经扭曲。 + +而对 `/dev/urandom` 来说,事情是一样的。除了当没有足够的熵的时候,它不会阻塞,而会从一直在运行的伪随机数生成器(当然,是密码学安全的,CSPRNG)里吐出“低质量”的随机数。这个 CSPRNG 只会用“真随机数”生成种子一次(或者好几次,这不重要),但你不能特别相信它。 + +在这种对随机数生成的理解下,很多人会觉得在 Linux 下尽量避免 `/dev/urandom` 看上去有那么点道理。 + +因为要么你有足够多的熵,你会相当于用了 `/dev/random`。要么没有,那你就会从几乎没有高熵输入的 CSPRNG 那里得到一个低质量的随机数。 + +看上去很邪恶是吧?很不幸的是这种看法是完全错误的。实际上,随机数生成器的构架更像是下面这样的。 + +#### 更好地简化 + +##### Linux 4.8 之前 + +![image: actual structure of the kernel's random number generator before Linux 4.8][2] + +你看到最大的区别了吗?CSPRNG 并不是和随机数生成器一起跑的,它在 `/dev/urandom` 需要输出但熵不够的时候进行填充。CSPRNG 是整个随机数生成过程的内部组件之一。从来就没有什么 `/dev/random` 直接从池里输出纯纯的随机性。每个随机源的输入都在 CSPRNG 里充分混合和散列过了,这一切都发生在实际变成一个随机数,被 `/dev/urandom` 或者 `/dev/random` 吐出去之前。 + +另外一个重要的区别是这里没有熵计数器的任何事情,只有预估。一个源给你的熵的量并不是什么很明确能直接得到的数字。你得预估它。注意,如果你太乐观地预估了它,那 `/dev/random` 最重要的特性——只给出熵允许的随机量——就荡然无存了。很不幸的,预估熵的量是很困难的。 + +> 这是个很粗糙的简化。实际上不仅有一个,而是三个熵池。一个主池,另一个给 `/dev/random`,还有一个给 `/dev/urandom`,后两者依靠从主池里获取熵。这三个池都有各自的熵计数器,但二级池(后两个)的计数器基本都在 0 附近,而“新鲜”的熵总在需要的时候从主池流过来。同时还有好多混合和回流进系统在同时进行。整个过程对于这篇文档来说都过于复杂了,我们跳过。 + +Linux 内核只使用事件的到达时间来预估熵的量。根据模型,它通过多项式插值来预估实际的到达时间有多“出乎意料”。这种多项式插值的方法到底是不是好的预估熵量的方法本身就是个问题。同时硬件情况会不会以某种特定的方式影响到达时间也是个问题。而所有硬件的取样率也是个问题,因为这基本上就直接决定了随机数到达时间的颗粒度。 + +说到最后,至少现在看来,内核的熵预估还是不错的。这也意味着它比较保守。有些人会具体地讨论它有多好,这都超出我的脑容量了。就算这样,如果你坚持不想在没有足够多的熵的情况下吐出随机数,那你看到这里可能还会有一丝紧张。我睡的就很香了,因为我不关心熵预估什么的。 + +最后要明确一下:`/dev/random` 和 `/dev/urandom` 都是被同一个 CSPRNG 饲喂的。只有它们在用完各自熵池(根据某种预估标准)的时候,它们的行为会不同:`/dev/random` 阻塞,`/dev/urandom` 不阻塞。 + +##### Linux 4.8 以后 + +![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] + +在 Linux 4.8 里,`/dev/random` 和 `/dev/urandom` 的等价性被放弃了。现在 `/dev/urandom` 的输出不来自于熵池,而是直接从 CSPRNG 来。 + +*我们很快会理解*为什么这不是一个安全问题。(参见:“CSPRNG 没问题”一节) + +### 阻塞有什么问题? + +你有没有需要等着 `/dev/random` 来吐随机数?比如在虚拟机里生成一个 PGP 密钥?或者访问一个在生成会话密钥的网站? + +这些都是问题。阻塞本质上会降低可用性。换而言之你的系统不干你让它干的事情。不用我说,这是不好的。要是它不干活你干嘛搭建它呢? + +> 我在工厂自动化里做过和安全相关的系统。猜猜看安全系统失效的主要原因是什么?操作问题。就这么简单。很多安全措施的流程让工人恼火了。比如时间太长,或者太不方便。你要知道人很会找捷径来“解决”问题。 + +但其实有个更深刻的问题:人们不喜欢被打断。它们会找一些绕过的方法,把一些诡异的东西接在一起仅仅因为这样能用。一般人根本不知道什么密码学什么乱七八糟的,至少正常的人是这样吧。 + +为什么不禁止调用 `random()`?为什么不随便在论坛上找个人告诉你用写奇异的 ioctl 来增加熵计数器呢?为什么不干脆就把 SSL 加密给关了算了呢? + +到头来如果东西太难用的话,你的用户就会被迫开始做一些降低系统安全性的事情——你甚至不知道它们会做些什么。 + +我们很容易会忽视可用性之类的重要性。毕竟安全第一对吧?所以比起牺牲安全,不可用、难用、不方便都是次要的? + +这种二元对立的想法是错的。阻塞不一定就安全了。正如我们看到的,`/dev/urandom` 直接从 CSPRNG 里给你一样好的随机数。用它不好吗! + +### CSPRNG 没问题 + +现在情况听上去很惨淡。如果连高质量的 `/dev/random` 都是从一个 CSPRNG 里来的,我们怎么敢在高安全性的需求上使用它呢? + +实际上,“看上去随机”是现存大多数密码学基础组件的基本要求。如果你观察一个密码学哈希的输出,它一定得和随机的字符串不可区分,密码学家才会认可这个算法。如果你生成一个分组加密,它的输出(在你不知道密钥的情况下)也必须和随机数据不可区分才行。 + +如果任何人能比暴力穷举要更有效地破解一个加密,比如它利用了某些 CSPRNG 伪随机的弱点,那这就又是老一套了:一切都废了,也别谈后面的了。分组加密、哈希,一切都是基于某个数学算法,比如 CSPRNG。所以别害怕,到头来都一样。 + +### 那熵池快空了的情况呢? + +毫无影响。 + +加密算法的根基建立在攻击者不能预测输出上,只要最一开始有足够的随机性(熵)就行了。“足够”的下限可以是 256 位,不需要更多了。 + +介于我们一直在很随意的使用“熵”这个概念,我用“位”来量化随机性希望读者不要太在意细节。像我们之前讨论的那样,内核的随机数生成器甚至没法精确地知道进入系统的熵的量。只有一个预估。而且这个预估的准确性到底怎么样也没人知道。 + +### 重新选种 + +但如果熵这么不重要,为什么还要有新的熵一直被收进随机数生成器里呢? + +> djb [提到][4] 太多的熵甚至可能会起到反效果。 + +首先,一般不会这样。如果你有很多随机性可以拿来用,用就对了! + +但随机数生成器时不时要重新选种还有别的原因: + +想象一下如果有个攻击者获取了你随机数生成器的所有内部状态。这是最坏的情况了,本质上你的一切都暴露给攻击者了。 + +你已经凉了,因为攻击者可以计算出所有未来会被输出的随机数了。 + +但是,如果不断有新的熵被混进系统,那内部状态会再一次变得随机起来。所以随机数生成器被设计成这样有些“自愈”能力。 + +但这是在给内部状态引入新的熵,这和阻塞输出没有任何关系。 + +### random 和 urandom 的 man 页面 + +这两个 man 页面在吓唬程序员方面很有建树: + +> 从 `/dev/urandom` 读取数据不会因为需要更多熵而阻塞。这样的结果是,如果熵池里没有足够多的熵,取决于驱动使用的算法,返回的数值在理论上有被密码学攻击的可能性。发动这样攻击的步骤并没有出现在任何公开文献当中,但这样的攻击从理论上讲是可能存在的。如果你的应用担心这类情况,你应该使用 `/dev/random`。 + +>> 实际上已经有 `/dev/random` 和 `/dev/urandom` 的 Linux 内核 man 页面的更新版本。不幸的是,随便一个网络搜索出现我在结果顶部的仍然是旧的、有缺陷的版本。此外,许多 Linux 发行版仍在发布旧的 man 页面。所以不幸的是,这一节需要在这篇文章中保留更长的时间。我很期待删除这一节! + +没有“公开的文献”描述,但是 NSA 的小卖部里肯定卖这种攻击手段是吧?如果你真的真的很担心(你应该很担心),那就用 `/dev/random` 然后所有问题都没了? + +然而事实是,可能某个什么情报局有这种攻击,或者某个什么邪恶黑客组织找到了方法。但如果我们就直接假设这种攻击一定存在也是不合理的。 + +而且就算你想给自己一个安心,我要给你泼个冷水:AES、SHA-3 或者其它什么常见的加密算法也没有“公开文献记述”的攻击手段。难道你也不用这几个加密算法了?这显然是可笑的。 + +我们在回到 man 页面说:“使用 `/dev/random`”。我们已经知道了,虽然 `/dev/urandom` 不阻塞,但是它的随机数和 `/dev/random` 都是从同一个 CSPRNG 里来的。 + +如果你真的需要信息论安全性的随机数(你不需要的,相信我),那才有可能成为唯一一个你需要等足够熵进入 CSPRNG 的理由。而且你也不能用 `/dev/random`。 + +man 页面有毒,就这样。但至少它还稍稍挽回了一下自己: + +> 如果你不确定该用 `/dev/random` 还是 `/dev/urandom` ,那你可能应该用后者。通常来说,除了需要长期使用的 GPG/SSL/SSH 密钥以外,你总该使用`/dev/urandom` 。 + +>> 该手册页的[当前更新版本](http://man7.org/linux/man-pages/man4/random.4.html)毫不含糊地说: + +>> `/dev/random` 接口被认为是遗留接口,并且 `/dev/urandom` 在所有用例中都是首选和足够的,除了在启动早期需要随机性的应用程序;对于这些应用程序,必须替代使用 `getrandom(2)`,因为它将阻塞,直到熵池初始化完成。 + +行。我觉得没必要,但如果你真的要用 `/dev/random` 来生成 “长期使用的密钥”,用就是了也没人拦着!你可能需要等几秒钟或者敲几下键盘来增加熵,但这没什么问题。 + +但求求你们,不要就因为“你想更安全点”就让连个邮件服务器要挂起半天。 + +### 正道 + +本篇文章里的观点显然在互联网上是“小众”的。但如果问一个真正的密码学家,你很难找到一个认同阻塞 `/dev/random` 的人。 + +比如我们看看 [Daniel Bernstein][5](即著名的 djb)的看法: + +> 我们密码学家对这种胡乱迷信行为表示不负责。你想想,写 `/dev/random` man 页面的人好像同时相信: +> +> * (1) 我们不知道如何用一个 256 位长的 `/dev/random` 的输出来生成一个无限长的随机密钥串流(这是我们需要 `/dev/urandom` 吐出来的),但与此同时 +> * (2) 我们却知道怎么用单个密钥来加密一条消息(这是 SSL,PGP 之类干的事情) +> +> 对密码学家来说这甚至都不好笑了 + +或者 [Thomas Pornin][6] 的看法,他也是我在 stackexchange 上见过最乐于助人的一位: + +> 简单来说,是的。展开说,答案还是一样。`/dev/urandom` 生成的数据可以说和真随机完全无法区分,至少在现有科技水平下。使用比 `/dev/urandom` “更好的“随机性毫无意义,除非你在使用极为罕见的“信息论安全”的加密算法。这肯定不是你的情况,不然你早就说了。 +> +> urandom 的 man 页面多多少少有些误导人,或者干脆可以说是错的——特别是当它说 `/dev/urandom` 会“用完熵”以及 “`/dev/random` 是更好的”那几句话; + +或者 [Thomas Ptacek][7] 的看法,他不设计密码算法或者密码学系统,但他是一家名声在外的安全咨询公司的创始人,这家公司负责很多渗透和破解烂密码学算法的测试: + +> 用 urandom。用 urandom。用 urandom。用 urandom。用 urandom。 + +### 没有完美 + +`/dev/urandom` 不是完美的,问题分两层: + +在 Linux 上,不像 FreeBSD,`/dev/urandom` 永远不阻塞。记得安全性取决于某个最一开始决定的随机性?种子? + +Linux 的 `/dev/urandom` 会很乐意给你吐点不怎么随机的随机数,甚至在内核有机会收集一丁点熵之前。什么时候有这种情况?当你系统刚刚启动的时候。 + +FreeBSD 的行为更正确点:`/dev/random` 和 `/dev/urandom` 是一样的,在系统启动的时候 `/dev/random` 会阻塞到有足够的熵为止,然后它们都再也不阻塞了。 + +> 与此同时 Linux 实行了一个新的系统调用syscall,最早由 OpenBSD 引入叫 `getentrypy(2)`,在 Linux 下这个叫 `getrandom(2)`。这个系统调用有着上述正确的行为:阻塞到有足够的熵为止,然后再也不阻塞了。当然,这是个系统调用,而不是一个字节设备(LCTT 译注:不在 `/dev/` 下),所以它在 shell 或者别的脚本语言里没那么容易获取。这个系统调用 自 Linux 3.17 起存在。 + +在 Linux 上其实这个问题不太大,因为 Linux 发行版会在启动的过程中保存一点随机数(这发生在已经有一些熵之后,因为启动程序不会在按下电源的一瞬间就开始运行)到一个种子文件中,以便系统下次启动的时候读取。所以每次启动的时候系统都会从上一次会话里带一点随机性过来。 + +显然这比不上在关机脚本里写入一些随机种子,因为这样的显然就有更多熵可以操作了。但这样做显而易见的好处就是它不用关心系统是不是正确关机了,比如可能你系统崩溃了。 + +而且这种做法在你真正第一次启动系统的时候也没法帮你随机,不过好在 Linux 系统安装程序一般会保存一个种子文件,所以基本上问题不大。 + +虚拟机是另外一层问题。因为用户喜欢克隆它们,或者恢复到某个之前的状态。这种情况下那个种子文件就帮不到你了。 + +但解决方案依然和用 `/dev/random` 没关系,而是你应该正确的给每个克隆或者恢复的镜像重新生成种子文件。 + +### 太长不看 + +别问,问就是用 `/dev/urandom` ! + +-------------------------------------------------------------------------------- + +via: https://www.2uo.de/myths-about-urandom/ + +作者:[Thomas Hühn][a] +译者:[Moelf](https://github.com/Moelf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2uo.de/ +[1]:https://www.2uo.de/_media/wiki:structure-no.png +[2]:https://www.2uo.de/_media/wiki:structure-yes.png +[3]:https://www.2uo.de/_media/wiki:structure-new.png +[4]:http://blog.cr.yp.to/20140205-entropy.html +[5]:http://www.mail-archive.com/cryptography@randombit.net/msg04763.html +[6]:http://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 +[7]:http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ diff --git a/published/201905/20171214 Build a game framework with Python using the module Pygame.md b/published/201905/20171214 Build a game framework with Python using the module Pygame.md new file mode 100644 index 0000000000..931a248a8c --- /dev/null +++ b/published/201905/20171214 Build a game framework with Python using the module Pygame.md @@ -0,0 +1,279 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10850-1.html) +[#]: subject: (Build a game framework with Python using the module Pygame) +[#]: via: (https://opensource.com/article/17/12/game-framework-python) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Python 和 Pygame 模块构建一个游戏框架 +====== + + > 这系列的第一篇通过创建一个简单的骰子游戏来探究 Python。现在是来从零制作你自己的游戏的时间。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) + +在我的[这系列的第一篇文章][1] 中, 我已经讲解如何使用 Python 创建一个简单的、基于文本的骰子游戏。这次,我将展示如何使用 Python 模块 Pygame 来创建一个图形化游戏。它将需要几篇文章才能来得到一个确实做成一些东西的游戏,但是到这系列的结尾,你将更好地理解如何查找和学习新的 Python 模块和如何从其基础上构建一个应用程序。 + +在开始前,你必须安装 [Pygame][2]。 + +### 安装新的 Python 模块 + +有几种方法来安装 Python 模块,但是最通用的两个是: + + * 从你的发行版的软件存储库 + * 使用 Python 的软件包管理器 `pip` + +两个方法都工作的很好,并且每一个都有它自己的一套优势。如果你是在 Linux 或 BSD 上开发,可以利用你的发行版的软件存储库来自动和及时地更新。 + +然而,使用 Python 的内置软件包管理器可以给予你控制更新模块时间的能力。而且,它不是特定于操作系统的,这意味着,即使当你不是在你常用的开发机器上时,你也可以使用它。`pip` 的其它的优势是允许本地安装模块,如果你没有正在使用的计算机的管理权限,这是有用的。 + +### 使用 pip + +如果 Python 和 Python3 都安装在你的系统上,你想使用的命令很可能是 `pip3`,它用来区分 Python 2.x 的 `pip` 的命令。如果你不确定,先尝试 `pip3`。 + +`pip` 命令有些像大多数 Linux 软件包管理器一样工作。你可以使用 `search` 搜索 Python 模块,然后使用 `install` 安装它们。如果你没有你正在使用的计算机的管理权限来安装软件,你可以使用 `--user` 选项来仅仅安装模块到你的家目录。 + +``` +$ pip3 search pygame +[...] +Pygame (1.9.3)                 - Python Game Development +sge-pygame (1.5)               - A 2-D game engine for Python +pygame_camera (0.1.1)          - A Camera lib for PyGame +pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. +[...] +$ pip3 install Pygame --user +``` + +Pygame 是一个 Python 模块,这意味着它仅仅是一套可以使用在你的 Python 程序中的库。换句话说,它不是一个像 [IDLE][3] 或 [Ninja-IDE][4] 一样可以让你启动的程序。 + +### Pygame 新手入门 + +一个电子游戏需要一个背景设定:故事发生的地点。在 Python 中,有两种不同的方法来创建你的故事背景: + + * 设置一种背景颜色 + * 设置一张背景图片 + +你的背景仅是一张图片或一种颜色。你的电子游戏人物不能与在背景中的东西相互作用,因此,不要在后面放置一些太重要的东西。它仅仅是设置装饰。 + +### 设置你的 Pygame 脚本 + +要开始一个新的 Pygame 工程,先在计算机上创建一个文件夹。游戏的全部文件被放在这个目录中。在你的工程文件夹内部保持所需要的所有的文件来运行游戏是极其重要的。 + +![](https://opensource.com/sites/default/files/u128651/project.jpg) + +一个 Python 脚本以文件类型、你的姓名,和你想使用的许可证开始。使用一个开放源码许可证,以便你的朋友可以改善你的游戏并与你一起分享他们的更改: + +``` +#!/usr/bin/env python3 +# by Seth Kenlon + +## GPLv3 +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +``` + +然后,你告诉 Python 你想使用的模块。一些模块是常见的 Python 库,当然,你想包括一个你刚刚安装的 Pygame 模块。 + +``` +import pygame  # 加载 pygame 关键字 +import sys     # 让 python 使用你的文件系统 +import os      # 帮助 python 识别你的操作系统 +``` + +由于你将用这个脚本文件做很多工作,在文件中分成段落是有帮助的,以便你知道在哪里放代码。你可以使用块注释来做这些,这些注释仅在看你的源文件代码时是可见的。在你的代码中创建三个块。 + +``` +''' +Objects +''' + +# 在这里放置 Python 类和函数 + +''' +Setup +''' + +# 在这里放置一次性的运行代码 + +''' +Main Loop +''' + +# 在这里放置游戏的循环代码指令 +``` + +接下来,为你的游戏设置窗口大小。注意,不是每一个人都有大计算机屏幕,所以,最好使用一个适合大多数人的计算机的屏幕大小。 + +这里有一个方法来切换全屏模式,很多现代电子游戏都会这样做,但是,由于你刚刚开始,简单起见仅设置一个大小即可。 + +``` +''' +Setup +''' +worldx = 960 +worldy = 720 +``` + +在脚本中使用 Pygame 引擎前,你需要一些基本的设置。你必须设置帧频,启动它的内部时钟,然后开始 (`init`)Pygame 。 + +``` +fps   = 40  # 帧频 +ani   = 4   # 动画循环 +clock = pygame.time.Clock() +pygame.init() +``` + +现在你可以设置你的背景。 + +### 设置背景 + +在你继续前,打开一个图形应用程序,为你的游戏世界创建一个背景。在你的工程目录中的 `images` 文件夹内部保存它为 `stage.png` 。 + +这里有一些你可以使用的自由图形应用程序。 + +* [Krita][5] 是一个专业级绘图素材模拟器,它可以被用于创建漂亮的图片。如果你对创建电子游戏艺术作品非常感兴趣,你甚至可以购买一系列的[游戏艺术作品教程][6]。 +* [Pinta][7] 是一个基本的,易于学习的绘图应用程序。 +* [Inkscape][8] 是一个矢量图形应用程序。使用它来绘制形状、线、样条曲线和贝塞尔曲线。 + +你的图像不必很复杂,你可以以后回去更改它。一旦有了它,在你文件的 Setup 部分添加这些代码: + +``` +world    = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) +backdropbox = world.get_rect() +``` + +如果你仅仅用一种颜色来填充你的游戏的背景,你需要做的就是: + +``` +world = pygame.display.set_mode([worldx,worldy]) +``` + +你也必须定义颜色以使用。在你的 Setup 部分,使用红、绿、蓝 (RGB) 的值来创建一些颜色的定义。 + +``` +''' +Setup +''' + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +``` + +至此,你理论上可以启动你的游戏了。问题是,它可能仅持续了一毫秒。 + +为证明这一点,保存你的文件为 `your-name_game.py`(用你真实的名称替换 `your-name`)。然后启动你的游戏。 + +如果你正在使用 IDLE,通过选择来自 “Run” 菜单的 “Run Module” 来运行你的游戏。 + +如果你正在使用 Ninja,在左侧按钮条中单击 “Run file” 按钮。 + +![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) + +你也可以直接从一个 Unix 终端或一个 Windows 命令提示符中运行一个 Python 脚本。 + +``` +$ python3 ./your-name_game.py +``` + +如果你正在使用 Windows,使用这命令: + +``` +py.exe your-name_game.py +``` + +启动它,不过不要期望很多,因为你的游戏现在仅仅持续几毫秒。你可以在下一部分中修复它。 + +### 循环 + +除非另有说明,一个 Python 脚本运行一次并仅一次。近来计算机的运行速度是非常快的,所以你的 Python 脚本运行时间会少于 1 秒钟。 + +为强制你的游戏来处于足够长的打开和活跃状态来让人看到它(更不要说玩它),使用一个 `while` 循环。为使你的游戏保存打开,你可以设置一个变量为一些值,然后告诉一个 `while` 循环只要变量保持未更改则一直保存循环。 + +这经常被称为一个“主循环”,你可以使用术语 `main` 作为你的变量。在你的 Setup 部分的任意位置添加代码: + +``` +main = True +``` + +在主循环期间,使用 Pygame 关键字来检查键盘上的按键是否已经被按下或释放。添加这些代码到你的主循环部分: + +``` +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +也是在你的循环中,刷新你世界的背景。 + +如果你使用一个图片作为背景: + +``` +world.blit(backdrop, backdropbox) +``` + +如果你使用一种颜色作为背景: + +``` +world.fill(BLUE) +``` + +最后,告诉 Pygame 来重新刷新屏幕上的所有内容,并推进游戏的内部时钟。 + +``` +    pygame.display.flip() +    clock.tick(fps) +``` + +保存你的文件,再次运行它来查看你曾经创建的最无趣的游戏。 + +退出游戏,在你的键盘上按 `q` 键。 + +在这系列的 [下一篇文章][9] 中,我将向你演示,如何加强你当前空空如也的游戏世界,所以,继续学习并创建一些将要使用的图形! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-framework-python + +作者:[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://linux.cn/article-9071-1.html +[2]: http://www.pygame.org/wiki/about +[3]: https://en.wikipedia.org/wiki/IDLE +[4]: http://ninja-ide.org/ +[5]: http://krita.org +[6]: https://gumroad.com/l/krita-game-art-tutorial-1 +[7]: https://pinta-project.com/pintaproject/pinta/releases +[8]: http://inkscape.org +[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player diff --git a/published/201905/20171215 How to add a player to your Python game.md b/published/201905/20171215 How to add a player to your Python game.md new file mode 100644 index 0000000000..b313a8219e --- /dev/null +++ b/published/201905/20171215 How to add a player to your Python game.md @@ -0,0 +1,163 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10858-1.html) +[#]: subject: (How to add a player to your Python game) +[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +如何在你的 Python 游戏中添加一个玩家 +====== +> 这是用 Python 从头开始构建游戏的系列文章的第三部分。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) + +在 [这个系列的第一篇文章][1] 中,我解释了如何使用 Python 创建一个简单的基于文本的骰子游戏。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。但是每个游戏都需要一名玩家,并且每个玩家都需要一个可操控的角色,这也就是我们接下来要在这个系列的第三部分中需要做的。 + +在 Pygame 中,玩家操控的图标或者化身被称作妖精sprite。如果你现在还没有任何可用于玩家妖精的图像,你可以使用 [Krita][3] 或 [Inkscape][4] 来自己创建一些图像。如果你对自己的艺术细胞缺乏自信,你也可以在 [OpenClipArt.org][5] 或 [OpenGameArt.org][6] 搜索一些现成的图像。如果你还未按照上一篇文章所说的单独创建一个 `images` 文件夹,那么你需要在你的 Python 项目目录中创建它。将你想要在游戏中使用的图片都放 `images` 文件夹中。 + +为了使你的游戏真正的刺激,你应该为你的英雄使用一张动态的妖精图片。这意味着你需要绘制更多的素材,并且它们要大不相同。最常见的动画就是走路循环,通过一系列的图像让你的妖精看起来像是在走路。走路循环最快捷粗糙的版本需要四张图像。 + +![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) + +注意:这篇文章中的代码示例同时兼容静止的和动态的玩家妖精。 + +将你的玩家妖精命名为 `hero.png`。如果你正在创建一个动态的妖精,则需要在名字后面加上一个数字,从 `hero1.png` 开始。 + +### 创建一个 Python 类 + +在 Python 中,当你在创建一个你想要显示在屏幕上的对象时,你需要创建一个类。 + +在你的 Python 脚本靠近顶端的位置,加入如下代码来创建一个玩家。在以下的代码示例中,前三行已经在你正在处理的 Python 脚本中: + +``` +import pygame +import sys +import os # 以下是新代码 + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +    img = pygame.image.load(os.path.join('images','hero.png')).convert() +    self.images.append(img) +    self.image = self.images[0] +    self.rect  = self.image.get_rect() +``` + +如果你的可操控角色拥有一个走路循环,在 `images` 文件夹中将对应图片保存为 `hero1.png` 到 `hero4.png` 的独立文件。 + +使用一个循环来告诉 Python 遍历每个文件。 + +``` +''' +对象 +''' + +class Player(pygame.sprite.Sprite): +    ''' +    生成一个玩家 +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.images = [] +        for i in range(1,5): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() +``` + +### 将玩家带入游戏世界 + +现在已经创建好了一个 Player 类,你需要使用它在你的游戏世界中生成一个玩家妖精。如果你不调用 Player 类,那它永远不会起作用,(游戏世界中)也就不会有玩家。你可以通过立马运行你的游戏来验证一下。游戏会像上一篇文章末尾看到的那样运行,并得到明确的结果:一个空荡荡的游戏世界。 + +为了将一个玩家妖精带到你的游戏世界,你必须通过调用 Player 类来生成一个妖精,并将它加入到 Pygame 的妖精组中。在如下的代码示例中,前三行是已经存在的代码,你需要在其后添加代码: + +``` +world       = pygame.display.set_mode([worldx,worldy]) +backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = screen.get_rect() + +# 以下是新代码 + +player = Player()   # 生成玩家 +player.rect.x = 0   # 移动 x 坐标 +player.rect.y = 0   # 移动 y 坐标 +player_list = pygame.sprite.Group() +player_list.add(player) +``` + +尝试启动你的游戏来看看发生了什么。高能预警:它不会像你预期的那样工作,当你启动你的项目,玩家妖精没有出现。事实上它生成了,只不过只出现了一毫秒。你要如何修复一个只出现了一毫秒的东西呢?你可能回想起上一篇文章中,你需要在主循环中添加一些东西。为了使玩家的存在时间超过一毫秒,你需要告诉 Python 在每次循环中都绘制一次。 + +将你的循环底部的语句更改如下: + +``` +    world.blit(backdrop, backdropbox) +    player_list.draw(screen) # 绘制玩家 +    pygame.display.flip() +    clock.tick(fps) +``` + +现在启动你的游戏,你的玩家出现了! + +### 设置 alpha 通道 + +根据你如何创建你的玩家妖精,在它周围可能会有一个色块。你所看到的是 alpha 通道应该占据的空间。它本来是不可见的“颜色”,但 Python 现在还不知道要使它不可见。那么你所看到的,是围绕在妖精周围的边界区(或现代游戏术语中的“命中区hit box”)内的空间。 + +![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) + +你可以通过设置一个 alpha 通道和 RGB 值来告诉 Python 使哪种颜色不可见。如果你不知道你使用 alpha 通道的图像的 RGB 值,你可以使用 Krita 或 Inkscape 打开它,并使用一种独特的颜色,比如 `#00ff00`(差不多是“绿屏绿”)来填充图像周围的空白区域。记下颜色对应的十六进制值(此处为 `#00ff00`,绿屏绿)并将其作为 alpha 通道用于你的 Python 脚本。 + +使用 alpha 通道需要在你的妖精生成相关代码中添加如下两行。类似第一行的代码已经存在于你的脚本中,你只需要添加另外两行: + +``` +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha()     # 优化 alpha +            img.set_colorkey(ALPHA) # 设置 alpha +``` + +除非你告诉它,否则 Python 不知道将哪种颜色作为 alpha 通道。在你代码的设置相关区域,添加一些颜色定义。将如下的变量定义添加于你的设置相关区域的任意位置: + +``` +ALPHA = (0, 255, 0) +``` + +在以上示例代码中,`0,255,0` 被我们使用,它在 RGB 中所代表的值与 `#00ff00` 在十六进制中所代表的值相同。你可以通过一个优秀的图像应用程序,如 [GIMP][7]、Krita 或 Inkscape,来获取所有这些颜色值。或者,你可以使用一个优秀的系统级颜色选择器,如 [KColorChooser][8],来检测颜色。 + +![](https://opensource.com/sites/default/files/u128651/kcolor.png) + +如果你的图像应用程序将你的妖精背景渲染成了其他的值,你可以按需调整 `ALPHA` 变量的值。不论你将 alpha 设为多少,最后它都将“不可见”。RGB 颜色值是非常严格的,因此如果你需要将 alpha 设为 000,但你又想将 000 用于你图像中的黑线,你只需要将图像中线的颜色设为 111。这样一来,(图像中的黑线)就足够接近黑色,但除了电脑以外没有人能看出区别。 + +运行你的游戏查看结果。 + +![](https://opensource.com/sites/default/files/u128651/alpha.jpg) + +在 [这个系列的第四篇文章][9] 中,我会向你们展示如何使你的妖精动起来。多么的激动人心啊! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-add-a-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[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://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html +[3]: http://krita.org +[4]: http://inkscape.org +[5]: http://openclipart.org +[6]: https://opengameart.org/ +[7]: http://gimp.org +[8]: https://github.com/KDE/kcolorchooser +[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite diff --git a/published/201905/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/published/201905/20180130 An introduction to the DomTerm terminal emulator for Linux.md new file mode 100644 index 0000000000..13652f26ef --- /dev/null +++ b/published/201905/20180130 An introduction to the DomTerm terminal emulator for Linux.md @@ -0,0 +1,130 @@ +DomTerm:一款为 Linux 打造的终端模拟器 +====== +> 了解一下 DomTerm,这是一款终端模拟器和复用器,带有 HTML 图形和其它不多见的功能。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) + +[DomTerm][1] 是一款现代化的终端模拟器,它使用浏览器引擎作为 “GUI 工具包”。这就支持了一些相关的特性,例如可嵌入图像和链接、HTML 富文本以及可折叠(显示/隐藏)命令。除此以外,它看起来感觉就像一个功能完整、独立的终端模拟器,有着出色 xterm 兼容性(包括鼠标处理和 24 位色)和恰当的 “装饰” (菜单)。另外它内置支持了会话管理和副窗口(如同 `tmux` 和 `GNU Screen` 中一样)、基本输入编辑(如在 `readline` 中)以及分页(如在 `less` 中)。 + +![](https://opensource.com/sites/default/files/u128651/domterm1.png) + +*图 1: DomTerminal 终端模拟器。* + +在以下部分我们将看一看这些特性。我们将假设你已经安装好了 `domterm` (如果你需要获取并构建 Dormterm 请跳到本文最后)。开始之前先让我们概览一下这项技术。 + +### 前端 vs. 后端 + +DomTerm 大部分是用 JavaScript 写的,它运行在一个浏览器引擎中。它可以是像例如 Chrome 或者 Firefox 一样的桌面浏览器(见图 3),也可以是一个内嵌的浏览器。使用一个通用的网页浏览器没有问题,但是用户体验却不够好(因为菜单是为通用的网页浏览而不是为了终端模拟器所打造),并且其安全模型也会妨碍使用。因此使用内嵌的浏览器更好一些。 + +目前以下这些是支持的: + + * qdomterm,使用了 Qt 工具包 和 QtWebEngine + * 一个内嵌的 [Electron][2](见图 1) + * atom-domterm 以 [Atom 文本编辑器][3](同样基于 Electron)包的形式运行 DomTerm,并和 Atom 面板系统集成在一起(见图 2) + * 一个为 JavaFX 的 WebEngine 包装器,这对 Java 编程十分有用(见图 4) + * 之前前端使用 [Firefox-XUL][4] 作为首选,但是 Mozilla 已经终止了 XUL + +![在 Atom 编辑器中的 DomTerm 终端面板][6] + +*图 2:在 Atom 编辑器中的 DomTerm 终端面板。* + +目前,Electron 前端可能是最佳选择,紧随其后的是 Qt 前端。如果你使用 Atom,atom-domterm 也工作得相当不错。 + +后端服务器是用 C 写的。它管理着伪终端(PTY)和会话。它同样也是一个为前端提供 Javascript 和其它文件的 HTTP 服务器。`domterm` 命令启动终端任务和执行其它请求。如果没有服务器在运行,domterm 就会自己来服务。后端与服务器之间的通讯通常是用 WebSockets(在服务器端是[libwebsockets][8])完成的。然而,JavaFX 的嵌入既不用 Websockets 也不用 DomTerm 服务器。相反 Java 应用直接通过 Java-Javascript 桥接进行通讯。 + +### 一个稳健的可兼容 xterm 的终端模拟器 + +DomTerm 看上去感觉像一个现代的终端模拟器。它处理鼠标事件、24 位色、Unicode、倍宽字符(CJK)以及输入方式。DomTerm 在 [vttest 测试套件][9] 上工作地十分出色。 + +其不同寻常的特性包括: + +**展示/隐藏按钮(“折叠”):** 小三角(如上图 2)是隐藏/展示相应输出的按钮。仅需在[提示符][11]中添加特定的[转义字符][10]就可以创建按钮。 + +**对于 readline 和类似输入编辑器的鼠标点击支持:** 如果你点击输入区域(黄色),DomTerm 会向应用发送正确的方向键按键序列。(可以通过提示符中的转义字符启用这一特性,你也可以通过 `Alt+点击` 强制使用。) + +**用 CSS 样式化终端:** 这通常是在 `~/.domterm/settings.ini` 里完成的,保存时会自动重载。例如在图 2 中,设置了终端专用的背景色。 + +### 一个更好的 REPL 控制台 + +一个经典的终端模拟器基于长方形的字符单元格工作的。这在 REPL(命令行)上没问题,但是并不理想。这里有些通常在终端模拟器中不常见的 REPL 很有用的 DomTerm 特性: + +**一个能“打印”图片、图形、数学公式或者一组可点击的链接的命令:** 应用可以发送包含几乎任何 HTML 的转义字符。(HTML 会被剔除部分,以移除 JavaScript 和其它危险特性。) + +图 3 显示了来自 [gnuplot][12] 会话的一个片段。Gnuplot(2.1 或者跟高版本)支持 DormTerm 作为终端类型。图形输出被转换成 [SVG 图片][13],然后被打印到终端。我的博客帖子[在 DormTerm 上的 Gnuplot 展示][14]在这方面提供了更多信息。 + +![](https://opensource.com/sites/default/files/dt-gnuplot.png) + +*图 3:Gnuplot 截图。* + +[Kawa][15] 语言有一个创建并转换[几何图像值][16]的库。如果你将这样的图片值打印到 DomTerm 终端,图片就会被转换成 SVG 形式并嵌入进输出中。 + +![](https://opensource.com/sites/default/files/dt-kawa1.png) + +*图 4:Kawa 中可计算的几何形状。* + +**富文本输出:** 有着 HTML 样式的帮助信息更加便于阅读,看上去也更漂亮。图片 1 的下面面板展示 `dormterm help` 的输出。(如果没在 DomTerm 下运行的话输出的是普通文本。)注意自带的分页器中的 `PAUSED` 消息。 + +**包括可点击链接的错误消息:** DomTerm 可以识别语法 `filename:line:column` 并将其转化成一个能在可定制文本编辑器中打开文件并定位到行的链接。(这适用于相对路径的文件名,如果你用 `PROMPT_COMMAND` 或类似的跟踪目录。) + +编译器可以侦测到它在 DomTerm 下运行,并直接用转义字符发出文件链接。这比依赖 DomTerm 的样式匹配要稳健得多,因为它可以处理空格和其他字符并且无需依赖目录追踪。在图 4 中,你可以看到来自 [Kawa Compiler][15] 的错误消息。悬停在文件位置上会使其出现下划线,`file:` URL 出现在 `atom-domterm` 消息栏(窗口底部)中。(当不用 atom-domterm 时,这样的消息会在一个浮层的框中显示,如图 1 中所看到的 `PAUSED` 消息所示。) + +点击链接时的动作是可以配置的。默认对于带有 `#position` 后缀的 `file:` 链接的动作是在文本编辑器中打开那个文件。 + +**结构化内部表示:**以下内容均以内部节点结构表示:命令、提示符、输入行、正常和错误输出、标签,如果“另存为 HTML”,则保留结构。HTML 文件与 XML 兼容,因此你可以使用 XML 工具搜索或转换输出。命令 `domterm view-saved` 会以一种启用命令折叠(显示/隐藏按钮处于活动状态)和重新调整窗口大小的方式打开保存的 HTML 文件。 + +**内建的 Lisp 样式优美打印:** 你可以在输出中包括优美打印指令(比如,grouping),这样断行会根据窗口大小调整而重新计算。查看我的文章 [DomTerm 中的动态优美打印][17]以更深入探讨。 + +**基本的内建行编辑**,带着历史记录(像 GNU readline 一样): 这使用浏览器自带的编辑器,因此它有着优秀的鼠标和选择处理机制。你可以在正常字符模式(大多数输入的字符被指接送向进程);或者行模式(通常的字符是直接插入的,而控制字符导致编辑操作,回车键会向进程发送被编辑行)之间转换。默认的是自动模式,根据 PTY 是在原始模式还是终端模式中,DomTerm 在字符模式与行模式间转换。 + +**自带的分页器**(类似简化版的 `less`):键盘快捷键控制滚动。在“页模式”中,输出在每个新的屏幕(或者单独的行,如果你想一行行地向前移)后暂停;页模式对于用户输入简单智能,因此(如果你想的话)你无需阻碍交互式程序就可以运行它。 + +### 多路复用和会话 + +**标签和平铺:** 你不仅可以创建多个终端标签,也可以平铺它们。你可以要么使用鼠标或键盘快捷键来创建或者切换面板和标签。它们可以用鼠标重新排列并调整大小。这是通过 [GoldenLayout][18] JavaScript 库实现的。图 1 展示了一个有着两个面板的窗口。上面的有两个标签,一个运行 [Midnight Commander][20];底下的面板以 HTML 形式展示了 `dormterm help` 输出。然而相反在 Atom 中我们使用其自带的可拖拽的面板和标签。你可以在图 2 中看到这个。 + +**分离或重接会话:** 与 `tmux` 和 GNU `screen` 类似,DomTerm 支持会话安排。你甚至可以给同样的会话接上多个窗口或面板。这支持多用户会话分享和远程链接。(为了安全,同一个服务器的所有会话都需要能够读取 Unix 域接口和一个包含随机密钥的本地文件。当我们有了良好、安全的远程链接,这个限制将会有所放松。) + +**domterm 命令** 类似与 `tmux` 和 GNU `screen`,它有多个选项可以用于控制或者打开单个或多个会话的服务器。主要的差别在于,如果它没在 DomTerm 下运行,`dormterm` 命令会创建一个新的顶层窗口,而不是在现有的终端中运行。 + +与 `tmux` 和 `git` 类似,`dormterm` 命令有许多子命令。一些子命令创建窗口或者会话。另一些(例如“打印”一张图片)仅在现有的 DormTerm 会话下起作用。 + +命令 `domterm browse` 打开一个窗口或者面板以浏览一个指定的 URL,例如浏览文档的时候。 + +### 获取并安装 DomTerm + +DomTerm 可以从其 [Github 仓库][21]获取。目前没有提前构建好的包,但是有[详细指导][22]。所有的前提条件在 Fedora 27 上都有,这使得其特别容易被搭建。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator + +作者:[Per Bothner][a] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/perbothner +[1]:http://domterm.org/ +[2]:https://electronjs.org/ +[3]:https://atom.io/ +[4]:https://en.wikipedia.org/wiki/XUL +[5]:/file/385346 +[6]:https://opensource.com/sites/default/files/images/dt-atom1.png (DomTerm terminal panes in Atom editor) +[7]:https://opensource.com/sites/default/files/images/dt-atom1.png +[8]:https://libwebsockets.org/ +[9]:http://invisible-island.net/vttest/ +[10]:http://domterm.org/Wire-byte-protocol.html +[11]:http://domterm.org/Shell-prompts.html +[12]:http://www.gnuplot.info/ +[13]:https://developer.mozilla.org/en-US/docs/Web/SVG +[14]:http://per.bothner.com/blog/2016/gnuplot-in-domterm/ +[15]:https://www.gnu.org/software/kawa/ +[16]:https://www.gnu.org/software/kawa/Composable-pictures.html +[17]:http://per.bothner.com/blog/2017/dynamic-prettyprinting/ +[18]:https://golden-layout.com/ +[19]:https://opensource.com/sites/default/files/u128651/domterm1.png +[20]:https://midnight-commander.org/ +[21]:https://github.com/PerBothner/DomTerm +[22]:http://domterm.org/Downloading-and-building.html + diff --git a/published/201905/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/published/201905/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md new file mode 100644 index 0000000000..3d8083d440 --- /dev/null +++ b/published/201905/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md @@ -0,0 +1,229 @@ +ddgr:一个从终端搜索 DuckDuckGo 的命令行工具 +====== + +在 Linux 中,Bash 技巧非常棒,它使 Linux 中的一切成为可能。 + +对于开发人员或系统管理员来说,它真的很管用,因为他们大部分时间都在使用终端。你知道他们为什么喜欢这种技巧吗? + +因为这些技巧可以提高他们的工作效率,也能使他们工作更快。 + +### 什么是 ddgr + +[ddgr][1] 是一个命令行实用程序,用于从终端搜索 DuckDuckGo。如果设置了 `BROWSER` 环境变量,ddgr 可以在几个基于文本的浏览器中开箱即用。 + +确保你的系统安装了任何一个基于文本的浏览器。你可能知道 [googler][2],它允许用户从 Linux 命令行进行 Google 搜索。 + +它在命令行用户中非常受欢迎,他们期望对隐私敏感的 DuckDuckGo 也有类似的实用程序,这就是 `ddgr` 出现的原因。 + +与 Web 界面不同,你可以指定每页要查看的搜索结果数。 + +**建议阅读:** + +- [Googler – 从 Linux 命令行搜索 Google][2] +- [Buku – Linux 中一个强大的命令行书签管理器][3] +- [SoCLI – 从终端搜索和浏览 StackOverflow 的简单方法][4] +- [RTV(Reddit 终端查看器)- 一个简单的 Reddit 终端查看器][5] + +### 什么是 DuckDuckGo + +DDG 即 DuckDuckGo。DuckDuckGo(DDG)是一个真正保护用户搜索和隐私的互联网搜索引擎。它没有过滤用户的个性化搜索结果,对于给定的搜索词,它会向所有用户显示相同的搜索结果。 + +大多数用户更喜欢谷歌搜索引擎,但是如果你真的担心隐私,那么你可以放心地使用 DuckDuckGo。 + +### ddgr 特性 + + * 快速且干净(没有广告、多余的 URL 或杂物参数),自定义颜色 + * 旨在以最小的空间提供最高的可读性 + * 指定每页显示的搜索结果数 + * 可以在 omniprompt 中导航结果,在浏览器中打开 URL + * 用于 Bash、Zsh 和 Fish 的搜索和选项补完脚本 + * 支持 DuckDuckGo Bang(带有自动补完) + * 直接在浏览器中打开第一个结果(如同 “I’m Feeling Ducky”) + * 不间断搜索:无需退出即可在 omniprompt 中触发新搜索 + * 关键字支持(例如:filetype:mime、site:somesite.com) + * 按时间、指定区域搜索,禁用安全搜索 + * 支持 HTTPS 代理,支持 Do Not Track,可选择禁用用户代理字符串 + * 支持自定义 URL 处理程序脚本或命令行实用程序 + * 全面的文档,man 页面有方便的使用示例 + * 最小的依赖关系 + +### 需要条件 + +`ddgr` 需要 Python 3.4 或更高版本。因此,确保你的系统应具有 Python 3.4 或更高版本。 + +``` +$ python3 --version +Python 3.6.3 +``` + +### 如何在 Linux 中安装 ddgr + +我们可以根据发行版使用以下命令轻松安装 `ddgr`。 + +对于 Fedora ,使用 [DNF 命令][6]来安装 `ddgr`。 + +``` +# dnf install ddgr +``` + +或者我们可以使用 [SNAP 命令][7]来安装 `ddgr`。 + +``` +# snap install ddgr +``` + +对于 LinuxMint/Ubuntu,使用 [APT-GET 命令][8] 或 [APT 命令][9]来安装 `ddgr`。 + +``` +$ sudo add-apt-repository ppa:twodopeshaggy/jarun +$ sudo apt-get update +$ sudo apt-get install ddgr +``` + +对于基于 Arch Linux 的系统,使用 [Yaourt 命令][10]或 [Packer 命令][11]从 AUR 仓库安装 `ddgr`。 + +``` +$ yaourt -S ddgr +或 +$ packer -S ddgr +``` + +对于 Debian,使用 [DPKG 命令][12] 安装 `ddgr`。 + +``` +# wget https://github.com/jarun/ddgr/releases/download/v1.2/ddgr_1.2-1_debian9.amd64.deb +# dpkg -i ddgr_1.2-1_debian9.amd64.deb +``` + +对于 CentOS 7,使用 [YUM 命令][13]来安装 `ddgr`。 + +``` +# yum install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.el7.3.centos.x86_64.rpm +``` + +对于 opensuse,使用 [zypper 命令][14]来安装 `ddgr`。 + +``` +# zypper install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.opensuse42.3.x86_64.rpm +``` + +### 如何启动 ddgr + +在终端上输入 `ddgr` 命令,不带任何选项来进行 DuckDuckGo 搜索。你将获得类似于下面的输出。 + +``` +$ ddgr +``` + +![][16] + +### 如何使用 ddgr 进行搜索 + +我们可以通过两种方式启动搜索。从 omniprompt 或者直接从终端开始。你可以搜索任何你想要的短语。 + +直接从终端: + +``` +$ ddgr 2daygeek +``` + +![][17] + +从 omniprompt: + +![][18] + +### Omniprompt 快捷方式 + +输入 `?` 以获得 omniprompt,它将显示关键字列表和进一步使用 `ddgr` 的快捷方式。 + +![][19] + +### 如何移动下一页、上一页和第一页 + +它允许用户移动下一页、上一页或第一页。 + + * `n`: 移动到下一组搜索结果 + * `p`: 移动到上一组搜索结果 + * `f`: 跳转到第一页 + +![][20] + +### 如何启动新搜索 + +`d` 选项允许用户从 omniprompt 发起新的搜索。例如,我搜索了 “2daygeek website”,现在我将搜索 “Magesh Maruthamuthu” 这个新短语。 + +从 omniprompt: + +``` +ddgr (? for help) d magesh maruthmuthu +``` + +![][21] + +### 在搜索结果中显示完整的 URL + +默认情况下,它仅显示文章标题,在搜索中添加 `x` 选项以在搜索结果中显示完整的文章网址。 + +``` +$ ddgr -n 5 -x 2daygeek +``` + +![][22] + +### 限制搜索结果 + +默认情况下,搜索结果每页显示 10 个结果。如果你想为方便起见限制页面结果,可以使用 `ddgr` 带有 `--num` 或 ` -n` 参数。 + +``` +$ ddgr -n 5 2daygeek +``` + +![][23] + +### 网站特定搜索 + +要搜索特定网站的特定页面,使用以下格式。这将从网站获取给定关键字的结果。例如,我们在 2daygeek 网站下搜索 “Package Manager”,查看结果。 + +``` +$ ddgr -n 5 --site 2daygeek "package manager" +``` + +![][24] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/ddgr-duckduckgo-search-from-the-command-line-in-linux/ + +作者:[Magesh Maruthamuthu][a] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://github.com/jarun/ddgr +[2]:https://www.2daygeek.com/googler-google-search-from-the-command-line-on-linux/ +[3]:https://www.2daygeek.com/buku-command-line-bookmark-manager-linux/ +[4]:https://www.2daygeek.com/socli-search-and-browse-stack-overflow-from-linux-terminal/ +[5]:https://www.2daygeek.com/rtv-reddit-terminal-viewer-a-simple-terminal-viewer-for-reddit/ +[6]:https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]:https://www.2daygeek.com/snap-command-examples/ +[8]:https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[9]:https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[10]:https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ +[11]:https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ +[12]:https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ +[13]:https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[14]:https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[15]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[16]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux1.png +[17]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-3.png +[18]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-2.png +[19]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-4.png +[20]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-5a.png +[21]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-6a.png +[22]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-7a.png +[23]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-8.png +[24]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-9a.png diff --git a/published/201905/20180429 The Easiest PDO Tutorial (Basics).md b/published/201905/20180429 The Easiest PDO Tutorial (Basics).md new file mode 100644 index 0000000000..cadc526b0f --- /dev/null +++ b/published/201905/20180429 The Easiest PDO Tutorial (Basics).md @@ -0,0 +1,155 @@ +PHP PDO 简单教程 +====== + +![](http://www.theitstuff.com/wp-content/uploads/2018/04/php-language.jpg) + +大约 80% 的 Web 应用程序由 PHP 提供支持。类似地,SQL 也是如此。PHP 5.5 版本之前,我们有用于访问 MySQL 数据库的 mysql_ 命令,但由于安全性不足,它们最终被弃用。 + +弃用这件事是发生在 2013 年的 PHP 5.5 上,我写这篇文章的时间是 2018 年,PHP 版本为 7.2。mysql_ 的弃用带来了访问数据库的两种主要方法:mysqli 和 PDO 库。 + +虽然 mysqli 库是官方指定的,但由于 mysqli 只能支持 mysql 数据库,而 PDO 可以支持 12 种不同类型的数据库驱动程序,因此 PDO 获得了更多的赞誉。此外,PDO 还有其它一些特性,使其成为大多数开发人员的更好选择。你可以在下表中看到一些特性比较: + +| | PDO | MySQLi +---|---|--- +| 数据库支持 | 12 种驱动 | 只有 MySQL +| 范例 | OOP | 过程 + OOP +| 预处理语句(客户端侧) | Yes | No +| 1命名参数 | Yes | No + +现在我想对于大多数开发人员来说,PDO 是首选的原因已经很清楚了。所以让我们深入研究它,并希望在本文中尽量涵盖关于 PDO 你需要的了解的。 + +### 连接 + +第一步是连接到数据库,由于 PDO 是完全面向对象的,所以我们将使用 PDO 类的实例。 + +我们要做的第一件事是定义主机、数据库名称、用户名、密码和数据库字符集。 + +``` +$host = 'localhost'; +$db = 'theitstuff'; +$user = 'root'; +$pass = 'root'; +$charset = 'utf8mb4'; +$dsn = "mysql:host=$host;dbname=$db;charset=$charset"; +$conn = new PDO($dsn, $user, $pass); +``` + +之后,正如你在上面的代码中看到的,我们创建了 DSN 变量,DSN 变量只是一个保存数据库信息的变量。对于一些在外部服务器上运行 MySQL 的人,你还可以通过提供一个 `port=$port_number` 来调整端口号。 + +最后,你可以创建一个 PDO 类的实例,我使用了 `$conn` 变量,并提供了 `$dsn`、`$user`、`$pass` 参数。如果你遵循这些步骤,你现在应该有一个名为 `$conn` 的对象,它是 PDO 连接类的一个实例。现在是时候进入数据库并运行一些查询。 + +### 一个简单的 SQL 查询 + +现在让我们运行一个简单的 SQL 查询。 + +``` +$tis = $conn->query('SELECT name, age FROM students'); +while ($row = $tis->fetch()) +{ + echo $row['name']."\t"; + echo $row['age']; + echo "
    "; +} +``` + +这是使用 PDO 运行查询的最简单形式。我们首先创建了一个名为 `tis`(TheITStuff 的缩写 )的变量,然后你可以看到我们使用了创建的 `$conn` 对象中的查询函数。 + +然后我们运行一个 `while` 循环并创建了一个 `$row` 变量来从 `$tis` 对象中获取内容,最后通过调用列名来显示每一行。 + +很简单,不是吗?现在让我们来看看预处理语句。 + +### 预处理语句 + +预处理语句是人们开始使用 PDO 的主要原因之一,因为它提供了可以阻止 SQL 注入的语句。 + +有两种基本方法可供使用,你可以使用位置参数或命名参数。 + +#### 位置参数 + +让我们看一个使用位置参数的查询示例。 + +``` +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)"); +$tis->bindValue(1,'mike'); +$tis->bindValue(2,22); +$tis->execute(); +``` + +在上面的例子中,我们放置了两个问号,然后使用 `bindValue()` 函数将值映射到查询中。这些值绑定到语句问号中的位置。 + +我还可以使用变量而不是直接提供值,通过使用 `bindParam()` 函数相同例子如下: + +``` +$name='Rishabh'; $age=20; +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)"); +$tis->bindParam(1,$name); +$tis->bindParam(2,$age); +$tis->execute(); +``` + +### 命名参数 + +命名参数也是预处理语句,它将值/变量映射到查询中的命名位置。由于没有位置绑定,因此在多次使用相同变量的查询中非常有效。 + +``` +$name='Rishabh'; $age=20; +$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)"); +$tis->bindParam(':name', $name); +$tis->bindParam(':age', $age); +$tis->execute(); +``` + +你可以注意到,唯一的变化是我使用 `:name` 和 `:age` 作为占位符,然后将变量映射到它们。冒号在参数之前使用,让 PDO 知道该位置是一个变量,这非常重要。 + +你也可以类似地使用 `bindValue()` 来使用命名参数直接映射值。 + +### 获取数据 + +PDO 在获取数据时非常丰富,它实际上提供了许多格式来从数据库中获取数据。 + +你可以使用 `PDO::FETCH_ASSOC` 来获取关联数组,`PDO::FETCH_NUM` 来获取数字数组,使用 `PDO::FETCH_OBJ` 来获取对象数组。 + +``` +$tis = $conn->prepare("SELECT * FROM STUDENTS"); +$tis->execute(); +$result = $tis->fetchAll(PDO::FETCH_ASSOC); +``` + +你可以看到我使用了 `fetchAll`,因为我想要所有匹配的记录。如果只需要一行,你可以简单地使用 `fetch`。 + +现在我们已经获取了数据,现在是时候循环它了,这非常简单。 + +``` +foreach ($result as $lnu){ + echo $lnu['name']; + echo $lnu['age']."
    "; +} +``` + +你可以看到,因为我请求了关联数组,所以我正在按名称访问各个成员。 + +虽然在定义希望如何传输递数据方面没有要求,但在定义 `$conn` 变量本身时,实际上可以将其设置为默认值。 + +你需要做的就是创建一个 `$options` 数组,你可以在其中放入所有默认配置,只需在 `$conn` 变量中传递数组即可。 + +``` +$options = [ + PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, +]; +$conn = new PDO($dsn, $user, $pass, $options); +``` + +这是一个非常简短和快速的 PDO 介绍,我们很快就会制作一个高级教程。如果你在理解本教程的任何部分时遇到任何困难,请在评论部分告诉我,我会在那你为你解答。 + +-------------------------------------------------------------------------------- + +via: http://www.theitstuff.com/easiest-pdo-tutorial-basics + +作者:[Rishabh Kandari][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.theitstuff.com/author/reevkandari diff --git a/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md b/published/201905/20180518 What-s a hero without a villain- How to add one to your Python game.md similarity index 83% rename from translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md rename to published/201905/20180518 What-s a hero without a villain- How to add one to your Python game.md index a4a2138136..c4bb5c84f0 100644 --- a/translated/tech/20180518 What-s a hero without a villain- How to add one to your Python game.md +++ b/published/201905/20180518 What-s a hero without a villain- How to add one to your Python game.md @@ -1,21 +1,22 @@ -没有恶棍,英雄又将如何?如何向你的 Python 游戏中添加一个敌人 +如何向你的 Python 游戏中添加一个敌人 ====== + +> 在本系列的第五部分,学习如何增加一个坏蛋与你的好人战斗。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/game-dogs-chess-play-lead.png?itok=NAuhav4Z) 在本系列的前几篇文章中(参见 [第一部分][1]、[第二部分][2]、[第三部分][3] 以及 [第四部分][4]),你已经学习了如何使用 Pygame 和 Python 在一个空白的视频游戏世界中生成一个可玩的角色。但没有恶棍,英雄又将如何? 如果你没有敌人,那将会是一个非常无聊的游戏。所以在此篇文章中,你将为你的游戏添加一个敌人并构建一个用于创建关卡的框架。 -在对玩家妖精实现全部功能仍有许多事情可做之前,跳向敌人似乎就很奇怪。但你已经学到了很多东西,创造恶棍与与创造玩家妖精非常相似。所以放轻松,使用你已经掌握的知识,看看能挑起怎样一些麻烦。 +在对玩家妖精实现全部功能之前,就来实现一个敌人似乎就很奇怪。但你已经学到了很多东西,创造恶棍与与创造玩家妖精非常相似。所以放轻松,使用你已经掌握的知识,看看能挑起怎样一些麻烦。 针对本次训练,你能够从 [Open Game Art][5] 下载一些预创建的素材。此处是我使用的一些素材: - -+ 印加花砖(译注:游戏中使用的花砖贴图) ++ 印加花砖(LCTT 译注:游戏中使用的花砖贴图) + 一些侵略者 + 妖精、角色、物体以及特效 - ### 创造敌方妖精 是的,不管你意识到与否,你其实已经知道如何去实现敌人。这个过程与创造一个玩家妖精非常相似: @@ -24,40 +25,27 @@ 2. 创建 `update` 方法使得敌人能够检测碰撞 3. 创建 `move` 方法使得敌人能够四处游荡 - - -从类入手。从概念上看,它与你的 Player 类大体相同。你设置一张或者一组图片,然后设置妖精的初始位置。 +从类入手。从概念上看,它与你的 `Player` 类大体相同。你设置一张或者一组图片,然后设置妖精的初始位置。 在继续下一步之前,确保你有一张你的敌人的图像,即使只是一张临时图像。将图像放在你的游戏项目的 `images` 目录(你放置你的玩家图像的相同目录)。 如果所有的活物都拥有动画,那么游戏看起来会好得多。为敌方妖精设置动画与为玩家妖精设置动画具有相同的方式。但现在,为了保持简单,我们使用一个没有动画的妖精。 在你代码 `objects` 节的顶部,使用以下代码创建一个叫做 `Enemy` 的类: + ``` class Enemy(pygame.sprite.Sprite): -     ''' - 生成一个敌人 -     ''' -     def __init__(self,x,y,img): -         pygame.sprite.Sprite.__init__(self) -         self.image = pygame.image.load(os.path.join('images',img)) -         self.image.convert_alpha() -         self.image.set_colorkey(ALPHA) -         self.rect = self.image.get_rect() -         self.rect.x = x -         self.rect.y = y - ``` 如果你想让你的敌人动起来,使用让你的玩家拥有动画的 [相同方式][4]。 @@ -67,25 +55,21 @@ class Enemy(pygame.sprite.Sprite): 你能够通过告诉类,妖精应使用哪张图像,应出现在世界上的什么地方,来生成不只一个敌人。这意味着,你能够使用相同的敌人类,在游戏世界的任意地方生成任意数量的敌方妖精。你需要做的仅仅是调用这个类,并告诉它应使用哪张图像,以及你期望生成点的 X 和 Y 坐标。 再次,这从原则上与生成一个玩家精灵相似。在你脚本的 `setup` 节添加如下代码: + ``` enemy   = Enemy(20,200,'yeti.png') # 生成敌人 - enemy_list = pygame.sprite.Group() # 创建敌人组 - enemy_list.add(enemy)              # 将敌人加入敌人组 - ``` -在示例代码中,X 坐标为 20,Y 坐标为 200。你可能需要根据你的敌方妖精的大小,来调整这些数字,但尽量生成在一个地方,使得你的玩家妖精能够到它。`Yeti.png` 是用于敌人的图像。 +在示例代码中,X 坐标为 20,Y 坐标为 200。你可能需要根据你的敌方妖精的大小,来调整这些数字,但尽量生成在一个范围内,使得你的玩家妖精能够碰到它。`Yeti.png` 是用于敌人的图像。 接下来,将敌人组的所有敌人绘制在屏幕上。现在,你只有一个敌人,如果你想要更多你可以稍后添加。一但你将一个敌人加入敌人组,它就会在主循环中被绘制在屏幕上。中间这一行是你需要添加的新行: + ```     player_list.draw(world) -     enemy_list.draw(world)  # 刷新敌人 -     pygame.display.flip() - ``` 启动你的游戏,你的敌人会出现在游戏世界中你选择的 X 和 Y 坐标处。 @@ -96,42 +80,31 @@ enemy_list.add(enemy)              # 将敌人加入敌人组 思考一下“关卡”是什么。你如何知道你是在游戏中的一个特定关卡中呢? -你可以把关卡想成一系列项目的集合。就像你刚刚创建的这个平台中,一个关卡,包含了平台、敌人放置、赃物等的一个特定排列。你可以创建一个类,用来在你的玩家附近创建关卡。最终,当你创建了超过一个关卡,你就可以在你的玩家达到特定目标时,使用这个类生成下一个关卡。 +你可以把关卡想成一系列项目的集合。就像你刚刚创建的这个平台中,一个关卡,包含了平台、敌人放置、战利品等的一个特定排列。你可以创建一个类,用来在你的玩家附近创建关卡。最终,当你创建了一个以上的关卡,你就可以在你的玩家达到特定目标时,使用这个类生成下一个关卡。 将你写的用于生成敌人及其群组的代码,移动到一个每次生成新关卡时都会被调用的新函数中。你需要做一些修改,使得每次你创建新关卡时,你都能够创建一些敌人。 + ``` class Level(): -     def bad(lvl,eloc): -         if lvl == 1: -             enemy = Enemy(eloc[0],eloc[1],'yeti.png') # 生成敌人 -             enemy_list = pygame.sprite.Group() # 生成敌人组 -             enemy_list.add(enemy)              # 将敌人加入敌人组 -         if lvl == 2: -             print("Level " + str(lvl) ) - -         return enemy_list - ``` `return` 语句确保了当你调用 `Level.bad` 方法时,你将会得到一个 `enemy_list` 变量包含了所有你定义的敌人。 因为你现在将创造敌人作为每个关卡的一部分,你的 `setup` 部分也需要做些更改。不同于创造一个敌人,取而代之的是你必须去定义敌人在那里生成,以及敌人属于哪个关卡。 + ``` eloc = [] - eloc = [200,20] - enemy_list = Level.bad( 1, eloc ) - ``` 再次运行游戏来确认你的关卡生成正确。与往常一样,你应该会看到你的玩家,并且能看到你在本章节中添加的敌人。 @@ -140,31 +113,27 @@ enemy_list = Level.bad( 1, eloc ) 一个敌人如果对玩家没有效果,那么它不太算得上是一个敌人。当玩家与敌人发生碰撞时,他们通常会对玩家造成伤害。 -因为你可能想要去跟踪玩家的生命值,因此碰撞检测发生在 Player 类,而不是 Enemy 类中。当然如果你想,你也可以跟踪敌人的生命值。它们之间的逻辑与代码大体相似,现在,我们只需要跟踪玩家的生命值。 +因为你可能想要去跟踪玩家的生命值,因此碰撞检测发生在 `Player` 类,而不是 `Enemy` 类中。当然如果你想,你也可以跟踪敌人的生命值。它们之间的逻辑与代码大体相似,现在,我们只需要跟踪玩家的生命值。 为了跟踪玩家的生命值,你必须为它确定一个变量。代码示例中的第一行是上下文提示,那么将第二行代码添加到你的 Player 类中: + ```         self.frame  = 0 -         self.health = 10 - ``` -在你 Player 类的 `update` 方法中,添加如下代码块: +在你 `Player` 类的 `update` 方法中,添加如下代码块: + ```         hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -         for enemy in hit_list: -             self.health -= 1 -             print(self.health) - ``` 这段代码使用 Pygame 的 `sprite.spritecollide` 方法,建立了一个碰撞检测器,称作 `enemy_hit`。每当它的父类妖精(生成检测器的玩家妖精)的碰撞区触碰到 `enemy_list` 中的任一妖精的碰撞区时,碰撞检测器都会发出一个信号。当这个信号被接收,`for` 循环就会被触发,同时扣除一点玩家生命值。 -一旦这段代码出现在你 Player 类的 `update` 方法,并且 `update` 方法在你的主循环中被调用,Pygame 会在每个时钟 tick 检测一次碰撞。 +一旦这段代码出现在你 `Player` 类的 `update` 方法,并且 `update` 方法在你的主循环中被调用,Pygame 会在每个时钟滴答中检测一次碰撞。 ### 移动敌人 @@ -176,60 +145,41 @@ enemy_list = Level.bad( 1, eloc ) 举个例子,你告诉你的敌方妖精向右移动 10 步,向左移动 10 步。但敌方妖精不会计数,因此你需要创建一个变量来跟踪你的敌人已经移动了多少步,并根据计数变量的值来向左或向右移动你的敌人。 -首先,在你的 Enemy 类中创建计数变量。添加以下代码示例中的最后一行代码: +首先,在你的 `Enemy` 类中创建计数变量。添加以下代码示例中的最后一行代码: + ```         self.rect = self.image.get_rect() -         self.rect.x = x -         self.rect.y = y -         self.counter = 0 # 计数变量 - ``` -然后,在你的 Enemy 类中创建一个 `move` 方法。使用 if-else 循环来创建一个所谓的死循环: +然后,在你的 `Enemy` 类中创建一个 `move` 方法。使用 if-else 循环来创建一个所谓的死循环: * 如果计数在 0 到 100 之间,向右移动; * 如果计数在 100 到 200 之间,向左移动; * 如果计数大于 200,则将计数重置为 0。 - - 死循环没有终点,因为循环判断条件永远为真,所以它将永远循环下去。在此情况下,计数器总是介于 0 到 100 或 100 到 200 之间,因此敌人会永远地从左向右再从右向左移动。 你用于敌人在每个方向上移动距离的具体值,取决于你的屏幕尺寸,更确切地说,取决于你的敌人移动的平台大小。从较小的值开始,依据习惯逐步提高数值。首先进行如下尝试: + ```     def move(self): -         ''' - 敌人移动 -         ''' -         distance = 80 -         speed = 8 - -         if self.counter >= 0 and self.counter <= distance: -             self.rect.x += speed -         elif self.counter >= distance and self.counter <= distance*2: -             self.rect.x -= speed -         else: -             self.counter = 0 - -         self.counter += 1 - ``` 你可以根据需要调整距离和速度。 @@ -237,13 +187,11 @@ enemy_list = Level.bad( 1, eloc ) 当你现在启动游戏,这段代码有效果吗? 当然不,你应该也知道原因。你必须在主循环中调用 `move` 方法。如下示例代码中的第一行是上下文提示,那么添加最后两行代码: + ```     enemy_list.draw(world) #refresh enemy -     for e in enemy_list: -         e.move() - ``` 启动你的游戏看看当你打击敌人时发生了什么。你可能需要调整妖精的生成地点,使得你的玩家和敌人能够碰撞。当他们发生碰撞时,查看 [IDLE][6] 或 [Ninja-IDE][7] 的控制台,你可以看到生命值正在被扣除。 @@ -261,15 +209,15 @@ via: https://opensource.com/article/18/5/pygame-enemy 作者:[Seth Kenlon][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth -[1]:https://opensource.com/article/17/10/python-101 -[2]:https://opensource.com/article/17/12/game-framework-python -[3]:https://opensource.com/article/17/12/game-python-add-a-player -[4]:https://opensource.com/article/17/12/game-python-moving-player +[1]:https://linux.cn/article-9071-1.html +[2]:https://linux.cn/article-10850-1.html +[3]:https://linux.cn/article-10858-1.html +[4]:https://linux.cn/article-10874-1.html [5]:https://opengameart.org [6]:https://docs.python.org/3/library/idle.html [7]:http://ninja-ide.org/ diff --git a/published/201905/20180605 How to use autofs to mount NFS shares.md b/published/201905/20180605 How to use autofs to mount NFS shares.md new file mode 100644 index 0000000000..15321b2e3d --- /dev/null +++ b/published/201905/20180605 How to use autofs to mount NFS shares.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10830-1.html) +[#]: subject: (How to use autofs to mount NFS shares) +[#]: via: (https://opensource.com/article/18/6/using-autofs-mount-nfs-shares) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +如何使用 autofs 挂载 NFS 共享 +====== + +> 给你的网络文件系统(NFS)配置一个基本的自动挂载功能。 + +![](https://img.linux.net.cn/data/attachment/album/201905/08/115328rva7kqw9wqh2qees.jpg) + +大多数 Linux 文件系统在引导时挂载,并在系统运行时保持挂载状态。对于已在 `fstab` 中配置的任何远程文件系统也是如此。但是,有时你可能希望仅按需挂载远程文件系统。例如,通过减少网络带宽使用来提高性能,或出于安全原因隐藏或混淆某些目录。[autofs][1] 软件包提供此功能。在本文中,我将介绍如何配置基本的自动挂载。 + +首先做点假设:假设有台 NFS 服务器 `tree.mydatacenter.net` 已经启动并运行。另外假设一个名为 `ourfiles` 的数据目录还有供 Carl 和 Sarah 使用的用户目录,它们都由服务器共享。 + +一些最佳实践可以使工作更好:服务器上的用户和任何客户端工作站上的帐号有相同的用户 ID。此外,你的工作站和服务器应有相同的域名。检查相关配置文件应该确认。 + +``` +alan@workstation1:~$ sudo getent passwd carl sarah +[sudo] password for alan: +carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash +sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash + +alan@workstation1:~$ sudo getent hosts +127.0.0.1 localhost +127.0.1.1 workstation1.mydatacenter.net workstation1 +10.10.1.5 tree.mydatacenter.net tree +``` + +如你所见,客户端工作站和 NFS 服务器都在 `hosts` 文件中配置。我假设这是一个基本的家庭甚至小型办公室网络,可能缺乏适合的内部域名服务(即 DNS)。 + +### 安装软件包 + +你只需要安装两个软件包:用于 NFS 客户端的 `nfs-common` 和提供自动挂载的 `autofs`。 + +``` +alan@workstation1:~$ sudo apt-get install nfs-common autofs +``` + +你可以验证 autofs 相关的文件是否已放在 `/etc` 目录中: + +``` +alan@workstation1:~$ cd /etc; ll auto* +-rw-r--r-- 1 root root 12596 Nov 19 2015 autofs.conf +-rw-r--r-- 1 root root 857 Mar 10 2017 auto.master +-rw-r--r-- 1 root root 708 Jul 6 2017 auto.misc +-rwxr-xr-x 1 root root 1039 Nov 19 2015 auto.net* +-rwxr-xr-x 1 root root 2191 Nov 19 2015 auto.smb* +alan@workstation1:/etc$ +``` + +### 配置 autofs + +现在你需要编辑其中几个文件并添加 `auto.home` 文件。首先,将以下两行添加到文件 `auto.master` 中: + +``` +/mnt/tree  /etc/auto.misc +/home/tree  /etc/auto.home +``` + +每行以挂载 NFS 共享的目录开头。继续创建这些目录: + +``` +alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree +``` + +接下来,将以下行添加到文件 `auto.misc`: + +``` +ourfiles        -fstype=nfs     tree:/share/ourfiles +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.misc` 的 `ourfiles` 共享。如上所示,这些文件将在 `/mnt/tree/ourfiles` 目录中。 + +第三步,使用以下行创建文件 `auto.home`: + +``` +*               -fstype=nfs     tree:/home/& +``` + +该行表示 autofs 将挂载 `auto.master` 文件中匹配 `auto.home` 的用户共享。在这种情况下,Carl 和 Sarah 的文件将分别在目录 `/home/tree/carl` 或 `/home/tree/sarah`中。星号 `*`(称为通配符)使每个用户的共享可以在登录时自动挂载。`&` 符号也可以作为表示服务器端用户目录的通配符。它们的主目录会相应地根据 `passwd` 文件映射。如果你更喜欢本地主目录,则无需执行此操作。相反,用户可以将其用作特定文件的简单远程存储。 + +最后,重启 `autofs` 守护进程,以便识别并加载这些配置的更改。 + +``` +alan@workstation1:/etc$ sudo service autofs restart +``` + +### 测试 autofs + +如果更改文件 `auto.master` 中的列出目录,并运行 `ls` 命令,那么不会立即看到任何内容。例如,切换到目录 `/mnt/tree`。首先,`ls` 的输出不会显示任何内容,但在运行 `cd ourfiles` 之后,将自动挂载 `ourfiles` 共享目录。 `cd` 命令也将被执行,你将进入新挂载的目录中。 + +``` +carl@workstation1:~$ cd /mnt/tree +carl@workstation1:/mnt/tree$ ls +carl@workstation1:/mnt/tree$ cd ourfiles +carl@workstation1:/mnt/tree/ourfiles$ +``` + +为了进一步确认正常工作,`mount` 命令会显示已挂载共享的细节。 + +``` +carl@workstation1:~$ mount + +tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) + +``` + +对于 Carl 和 Sarah,`/home/tree` 目录工作方式相同。 + +我发现在我的文件管理器中添加这些目录的书签很有用,可以用来快速访问。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares + +作者:[Alan Formy-Duval][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[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/alanfdoss +[1]:https://wiki.archlinux.org/index.php/autofs diff --git a/published/201905/20180611 3 open source alternatives to Adobe Lightroom.md b/published/201905/20180611 3 open source alternatives to Adobe Lightroom.md new file mode 100644 index 0000000000..4cebea72fa --- /dev/null +++ b/published/201905/20180611 3 open source alternatives to Adobe Lightroom.md @@ -0,0 +1,86 @@ +Adobe Lightroom 的三个开源替代品 +======= + +> 摄影师们:在没有 Lightroom 套件的情况下,可以看看这些 RAW 图像处理器。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/camera-photography-film.jpg?itok=oe2ixyu6) + +如今智能手机的摄像功能已经完备到多数人认为可以代替传统摄影了。虽然这在傻瓜相机的市场中是个事实,但是对于许多摄影爱好者和专业摄影师看来,一个高端单反相机所能带来的照片景深、清晰度以及真实质感是口袋中的智能手机无法与之相比的。 + +所有的这些功能在便利性上要付出一些很小的代价;就像传统的胶片相机中的反色负片,单反照相得到的 RAW 格式文件必须预先处理才能印刷或编辑;因此对于单反相机,照片的后期处理是无可替代的,并且 首选应用就是 Adobe Lightroom。但是由于 Adobe Lightroom 的昂贵价格、基于订阅的定价模式以及专有许可证都使更多人开始关注其开源替代品。 + +Lightroom 有两大主要功能:处理 RAW 格式的图片文件,以及数字资产管理系统(DAM) —— 通过标签、评星以及其他元数据信息来简单清晰地整理照片。 + +在这篇文章中,我们将介绍三个开源的图片处理软件:Darktable、LightZone 以及 RawTherapee。所有的软件都有 DAM 系统,但没有任何一个具有 Lightroom 基于机器学习的图像分类和标签功能。如果你想要知道更多关于开源的 DAM 系统的软件,可以看 Terry Hacock 的文章:“[开源项目的 DAM 管理][2]”,他分享了他在自己的 [Lunatics!][3] 电影项目研究过的开源多媒体软件。 + +### Darktable + +![Darktable][4] + +类似其他两个软件,Darktable 可以处理 RAW 格式的图像并将它们转换成可用的文件格式 —— JPEG、PNG、TIFF、PPM、PFM 和 EXR,它同时支持 Google 和 Facebook 的在线相册,上传至 Flikr,通过邮件附件发送以及创建在线相册。 + +它有 61 个图像处理模块,可以调整图像的对比度、色调、明暗、色彩、噪点;添加水印;切割以及旋转;等等。如同另外两个软件一样,不论你做出多少次修改,这些修改都是“无损的” —— 你的初始 RAW 图像文件始终会被保存。 + +Darktable 可以从 400 多种相机型号中直接导入照片,以及有 JPEG、CR2、DNG、OpenEXR 和 PFM 等格式的支持。图像在一个数据库中显示,因此你可以轻易地过滤并查询这些元数据,包括了文字标签、评星以及颜色标签。软件同时支持 21 种语言,支持 Linux、MacOS、BSD、Solaris 11/GNOME 以及 Windows(Windows 版本是最新发布的,Darktable 声明它比起其他版本可能还有一些不完备之处,有一些未实现的功能)。 + +Darktable 在开源许可证 [GPLv3][7] 下发布,你可以了解更多它的 [特性][8],查阅它的 [用户手册][9],或者直接去 Github 上看[源代码][10] 。 + +### LightZone + +![LightZone's tool stack][11] + +[LightZone][12] 和其他两个软件类似同样是无损的 RAW 格式图像处理工具:它是跨平台的,有 Windows、MacOS 和 Linux 版本,除 RAW 格式之外,它还支持 JPG 和 TIFF 格式的图像处理。接下来说说 LightZone 其他独特特性。 + +这个软件最初在 2005 年时,是以专有许可证发布的图像处理软件,后来在 BSD 证书下开源。此外,在你下载这个软件之前,你必须注册一个免费账号,以便 LightZone的 开发团队可以跟踪软件的下载数量以及建立相关社区。(许可很快,而且是自动的,因此这不是一个很大的使用障碍。) + +除此之外的一个特性是这个软件的图像处理通常是通过很多可组合的工具实现的,而不是叠加滤镜(就像大多数图像处理软件),这些工具组可以被重新编排以及移除,以及被保存并且复制用到另一些图像上。如果想要编辑图片的部分区域,你还可以通过矢量工具或者根据色彩和亮度来选择像素。 + +想要了解更多,见 LightZone 的[论坛][13] 或者查看 Github上的 [源代码][14]。 + +### RawTherapee + +![RawTherapee][15] + +[RawTherapee][16] 是另一个值得关注的开源([GPL][17])的 RAW 图像处理器。就像 Darktable 和 LightZone,它是跨平台的(支持 Windows、MacOS 和 Linux),一切修改都在无损条件下进行,因此不论你叠加多少滤镜做出多少改变,你都可以回到你最初的 RAW 文件。 + +RawTherapee 采用的是一个面板式的界面,包括一个历史记录面板来跟踪你做出的修改,以方便随时回到先前的图像;一个快照面板可以让你同时处理一张照片的不同版本;一个可滚动的工具面板可以方便准确地选择工具。这些工具包括了一系列的调整曝光、色彩、细节、图像变换以及去马赛克功能。 + +这个软件可以从多数相机直接导入 RAW 文件,并且支持超过 25 种语言,得到了广泛使用。批量处理以及 [SSE][18] 优化这类功能也进一步提高了图像处理的速度以及对 CPU 性能的利用。 + +RawTherapee 还提供了很多其他 [功能][19];可以查看它的 [官方文档][20] 以及 [源代码][21] 了解更多细节。 + +你是否在摄影中使用另外的开源 RAW 图像处理工具?有任何建议和推荐都可以在评论中分享。 + +------ + +via: https://opensource.com/alternatives/adobe-lightroom + +作者:[Opensource.com][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[scoutydren](https://github.com/scoutydren) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com +[1]: https://en.wikipedia.org/wiki/Raw_image_format +[2]: https://opensource.com/article/18/3/movie-open-source-software +[3]: http://lunatics.tv/ +[4]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_darkroom1.jpg?itok=0fjk37tC "Darktable" +[5]: http://www.darktable.org/ +[6]: https://www.darktable.org/about/faq/#faq-windows +[7]: https://github.com/darktable-org/darktable/blob/master/LICENSE +[8]: https://www.darktable.org/about/features/ +[9]: https://www.darktable.org/resources/ +[10]: https://github.com/darktable-org/darktable +[11]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ +[12]: http://www.lightzoneproject.org/ +[13]: http://www.lightzoneproject.org/Forum +[14]: https://github.com/ktgw0316/LightZone +[15]: https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_rawtherapee.jpg?itok=meiuLxPw "RawTherapee" +[16]: http://rawtherapee.com/ +[17]: https://github.com/Beep6581/RawTherapee/blob/dev/LICENSE.txt +[18]: https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions +[19]: http://rawpedia.rawtherapee.com/Features +[20]: http://rawpedia.rawtherapee.com/Main_Page +[21]: https://github.com/Beep6581/RawTherapee diff --git a/published/201905/20180725 Put platforms in a Python game with Pygame.md b/published/201905/20180725 Put platforms in a Python game with Pygame.md new file mode 100644 index 0000000000..d5f6a910d2 --- /dev/null +++ b/published/201905/20180725 Put platforms in a Python game with Pygame.md @@ -0,0 +1,593 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10902-1.html) +[#]: subject: (Put platforms in a Python game with Pygame) +[#]: via: (https://opensource.com/article/18/7/put-platforms-python-game) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +在 Pygame 游戏中放置平台 +====== + +> 在这个从零构建一个 Python 游戏系列的第六部分中,为你的角色创建一些平台来旅行。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header.png?itok=iq8HFoEJ) + +这是仍在进行中的关于使用 Pygame 模块来在 Python 3 中创建电脑游戏的系列文章的第六部分。先前的文章是: + ++ [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][24] ++ [使用 Python 和 Pygame 模块构建一个游戏框架][25] ++ [如何在你的 Python 游戏中添加一个玩家][26] ++ [用 Pygame 使你的游戏角色移动起来][27] ++ [如何向你的 Python 游戏中添加一个敌人][28] + +一个平台类游戏需要平台。 + +在 [Pygame][1] 中,平台本身也是个妖精,正像你那个可玩的妖精。这一点是重要的,因为有个是对象的平台,可以使你的玩家妖精更容易与之互动。 + +创建平台有两个主要步骤。首先,你必须给该对象编写代码,然后,你必须映射出你希望该对象出现的位置。 + +### 编码平台对象 + +要构建一个平台对象,你要创建一个名为 `Platform` 的类。它是一个妖精,正像你的 `Player` [妖精][2] 一样,带有很多相同的属性。 + +你的 `Platform` 类需要知道很多平台类型的信息,它应该出现在游戏世界的哪里、它应该包含的什么图片等等。这其中很多信息可能还尚不存在,这要看你为你的游戏计划了多少,但是没有关系。正如直到[移动你的游戏角色][3]那篇文章结束时,你都没有告诉你的玩家妖精移动速度有多快,你不必事先告诉 `Platform` 每一件事。 + +在这系列中你所写的脚本的开头附近,创建一个新的类。在这个代码示例中前三行是用于说明上下文,因此在注释的下面添加代码: + +``` +import pygame +import sys +import os +## 新代码如下: + +class Platform(pygame.sprite.Sprite): +# x location, y location, img width, img height, img file     +def __init__(self,xloc,yloc,imgw,imgh,img): +    pygame.sprite.Sprite.__init__(self) +    self.image = pygame.image.load(os.path.join('images',img)).convert() +    self.image.convert_alpha() +    self.image.set_colorkey(ALPHA) +    self.rect = self.image.get_rect() +    self.rect.y = yloc +    self.rect.x = xloc +``` + +当被调用时,这个类在某个 X 和 Y 位置上创建一个屏上对象,具有某种宽度和高度,并使用某种图像作为纹理。这与如何在屏上绘制出玩家或敌人非常类似。 + +### 平台的类型 + +下一步是绘制出你的平台需要出现的地方。 + +#### 瓷砖方式 + +实现平台类游戏世界有几种不同的方法。在最初的横向滚轴游戏中,例如,马里奥超级兄弟和刺猬索尼克,这个技巧是使用“瓷砖”方式,也就是说有几个代表地面和各种平台的块,并且这些块被重复使用来制作一个关卡。你只能有 8 或 12 种不同的块,你可以将它们排列在屏幕上来创建地面、浮动的平台,以及你游戏中需要的一切其它的事物。有人发现这是制作游戏最容易的方法了,因为你只需要制作(或下载)一小组关卡素材就能创建很多不同的关卡。然而,这里的代码需要一点数学知识。 + +![Supertux, a tile-based video game][5] + +*[SuperTux][6] ,一个基于瓷砖的电脑游戏。* + +#### 手工绘制方式 + +另一种方法是将每个素材作为一个整体图像。如果你喜欢为游戏世界创建素材,那你会在用图形应用程序构建游戏世界的每个部分上花费很多时间。这种方法不需要太多的数学知识,因为所有的平台都是整体的、完整的对象,你只需要告诉 [Python][7] 将它们放在屏幕上的什么位置。 + +每种方法都有优势和劣势,并且根据于你选择使用的方式,代码稍有不同。我将覆盖这两方面,所以你可以在你的工程中使用一种或另一种,甚至两者的混合。 + +### 关卡绘制 + +总的来说,绘制你的游戏世界是关卡设计和游戏编程中的一个重要的部分。这需要数学知识,但是没有什么太难的,而且 Python 擅长数学,它会有所帮助。 + +你也许发现先在纸张上设计是有用的。拿一张表格纸,并绘制一个方框来代表你的游戏窗体。在方框中绘制平台,并标记其每一个平台的 X 和 Y 坐标,以及它的宽度和高度。在方框中的实际位置没有必要是精确的,你只要保持数字合理即可。譬如,假设你的屏幕是 720 像素宽,那么你不能在一个屏幕上放 8 块 100 像素的平台。 + +当然,不是你游戏中的所有平台都必须容纳在一个屏幕大小的方框里,因为你的游戏将随着你的玩家行走而滚动。所以,可以继续绘制你的游戏世界到第一屏幕的右侧,直到关卡结束。 + +如果你更喜欢精确一点,你可以使用方格纸。当设计一个瓷砖类的游戏时,这是特别有用的,因为每个方格可以代表一个瓷砖。 + +![Example of a level map][9] + +*一个关卡地图示例。* + +#### 坐标系 + +你可能已经在学校中学习过[笛卡尔坐标系][10]。你学习的东西也适用于 Pygame,除了在 Pygame 中你的游戏世界的坐标系的原点 `0,0` 是放置在你的屏幕的左上角而不是在中间,是你在地理课上用过的坐标是在中间的。 + +![Example of coordinates in Pygame][12] + +*在 Pygame 中的坐标示例。* + +X 轴起始于最左边的 0,向右无限增加。Y 轴起始于屏幕顶部的 0,向下延伸。 + +#### 图片大小 + +如果你不知道你的玩家、敌人、平台是多大的,绘制出一个游戏世界是毫无意义的。你可以在图形程序中找到你的平台或瓷砖的尺寸。例如在 [Krita][13] 中,单击“图像”菜单,并选择“属性”。你可以在“属性”窗口的最顶部处找到它的尺寸。 + +另外,你也可以创建一个简单的 Python 脚本来告诉你的一个图像的尺寸。打开一个新的文本文件,并输入这些代码到其中: + +``` +#!/usr/bin/env python3 + +from PIL import Image +import os.path +import sys + +if len(sys.argv) > 1: +    print(sys.argv[1]) +else: +    sys.exit('Syntax: identify.py [filename]') + +pic = sys.argv[1] +dim = Image.open(pic) +X   = dim.size[0] +Y   = dim.size[1] + +print(X,Y) +``` + +保存该文本文件为 `identify.py`。 + +要使用这个脚本,你必须安装一些额外的 Python 模块,它们包含了这个脚本中新使用的关键字: + +``` +$ pip3 install Pillow --user +``` + +一旦安装好,在你游戏工程目录中运行这个脚本: + +``` +$ python3 ./identify.py images/ground.png +(1080, 97) +``` + +在这个示例中,地面平台的图形的大小是 1080 像素宽和 97 像素高。 + +### 平台块 + +如果你选择单独地绘制每个素材,你必须创建想要插入到你的游戏世界中的几个平台和其它元素,每个素材都放在它自己的文件中。换句话说,你应该让每个素材都有一个文件,像这样: + +![One image file per object][15] + +*每个对象一个图形文件。* + +你可以按照你希望的次数重复使用每个平台,只要确保每个文件仅包含一个平台。你不能使用一个文件包含全部素材,像这样: + +![Your level cannot be one image file][17] + +*你的关卡不能是一个图形文件。* + +当你完成时,你可能希望你的游戏看起来像这样,但是如果你在一个大文件中创建你的关卡,你就没有方法从背景中区分出一个平台,因此,要么把对象绘制在它们自己的文件中,要么从一个更大的文件中裁剪出它们,并保存为单独的副本。 + +**注意:** 如同你的其它素材,你可以使用 [GIMP][18]、Krita、[MyPaint][19],或 [Inkscape][20] 来创建你的游戏素材。 + +平台出现在每个关卡开始的屏幕上,因此你必须在你的 `Level` 类中添加一个 `platform` 函数。在这里特例是地面平台,它重要到应该拥有它自己的一个组。通过把地面看作一组特殊类型的平台,你可以选择它是否滚动,或它上面是否可以站立,而其它平台可以漂浮在它上面。这取决于你。 + +添加这两个函数到你的 `Level` 类: + +``` +def ground(lvl,x,y,w,h): +    ground_list = pygame.sprite.Group() +    if lvl == 1: +        ground = Platform(x,y,w,h,'block-ground.png') +        ground_list.add(ground) + +    if lvl == 2: +        print("Level " + str(lvl) ) + +    return ground_list + +def platform( lvl ): +    plat_list = pygame.sprite.Group() +    if lvl == 1: +        plat = Platform(200, worldy-97-128, 285,67,'block-big.png') +        plat_list.add(plat) +        plat = Platform(500, worldy-97-320, 197,54,'block-small.png') +        plat_list.add(plat) +    if lvl == 2: +        print("Level " + str(lvl) ) +        +    return plat_list +``` + +`ground` 函数需要一个 X 和 Y 位置,以便 Pygame 知道在哪里放置地面平台。它也需要知道平台的宽度和高度,这样 Pygame 知道地面延伸到每个方向有多远。该函数使用你的 `Platform` 类来生成一个屏上对象,然后将这个对象添加到 `ground_list` 组。 + +`platform` 函数本质上是相同的,除了其有更多的平台。在这个示例中,仅有两个平台,但是你可以想有多少就有多少。在进入一个平台后,在列出另一个前你必须添加它到 `plat_list` 中。如果你不添加平台到组中,那么它将不出现在你的游戏中。 + +> **提示:** 很难想象你的游戏世界的 0 是在顶部,因为在真实世界中发生的情况是相反的;当估计你有多高时,你不会从上往下测量你自己,而是从脚到头顶来测量。 +> +> 如果对你来说从“地面”上来构建你的游戏世界更容易,将 Y 轴值表示为负数可能有帮助。例如,你知道你的游戏世界的底部是 `worldy` 的值。因此 `worldy` 减去地面的高度(在这个示例中是 97)是你的玩家正常站立的位置。如果你的角色是 64 像素高,那么地面减去 128 正好是你的玩家的两倍高。事实上,一个放置在 128 像素处平台大约是相对于你的玩家的两层楼高度。一个平台在 -320 处比三层楼更高。等等。 + +正像你现在可能所知的,如果你不使用它们,你的类和函数是没有价值的。添加这些代码到你的设置部分(第一行只是上下文,所以添加最后两行): + +``` +enemy_list  = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,0,worldy-97,1080,97 ) +plat_list   = Level.platform( 1 ) +``` + +并把这些行加到你的主循环(再一次,第一行仅用于上下文): + +``` +enemy_list.draw(world)  # 刷新敌人 +ground_list.draw(world)  # 刷新地面 +plat_list.draw(world)  # 刷新平台 +``` + +### 瓷砖平台 + +瓷砖类游戏世界更容易制作,因为你只需要在前面绘制一些块,就能在游戏中一再使用它们创建每个平台。在像 [OpenGameArt.org][21] 这样的网站上甚至有一套瓷砖供你来使用。 + +`Platform` 类与在前面部分中的类是相同的。 + +`ground` 和 `platform` 在 `Level` 类中,然而,必须使用循环来计算使用多少块来创建每个平台。 + +如果你打算在你的游戏世界中有一个坚固的地面,这种地面是很简单的。你只需要从整个窗口的一边到另一边“克隆”你的地面瓷砖。例如,你可以创建一个 X 和 Y 值的列表来规定每个瓷砖应该放置的位置,然后使用一个循环来获取每个值并绘制每一个瓷砖。这仅是一个示例,所以不要添加这到你的代码: + +``` +# Do not add this to your code +gloc = [0,656,64,656,128,656,192,656,256,656,320,656,384,656] +``` + +不过,如果你仔细看,你可以看到所有的 Y 值是相同的,X 值以 64 的增量不断地增加 —— 这就是瓷砖的大小。这种重复是精确地,是计算机擅长的,因此你可以使用一点数学逻辑来让计算机为你做所有的计算: + +添加这些到你的脚本的设置部分: + +``` +gloc = [] +tx   = 64 +ty   = 64 + +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 + +ground_list = Level.ground( 1,gloc,tx,ty ) +``` + +现在,不管你的窗口的大小,Python 会通过瓷砖的宽度分割游戏世界的宽度,并创建一个数组列表列出每个 X 值。这里不计算 Y 值,因为在平的地面上这个从不会变化。 + +为了在一个函数中使用数组,使用一个 `while` 循环,查看每个条目并在适当的位置添加一个地面瓷砖: + +``` +def ground(lvl,gloc,tx,ty): +    ground_list = pygame.sprite.Group() +    i=0 +    if lvl == 1: +        while i < len(gloc): +            ground = Platform(gloc[i],worldy-ty,tx,ty,'tile-ground.png') +            ground_list.add(ground) +            i=i+1 + +    if lvl == 2: +        print("Level " + str(lvl) ) + +    return ground_list +``` + +除了 `while` 循环,这几乎与在上面一部分中提供的瓷砖类平台的 `ground` 函数的代码相同。 + +对于移动的平台,原理是相似的,但是这里有一些技巧可以使它简单。 + +你可以通过它的起始像素(它的 X 值)、距地面的高度(它的 Y 值)、绘制多少瓷砖来定义一个平台,而不是通过像素绘制每个平台。这样,你不必操心每个平台的宽度和高度。 + +这个技巧的逻辑有一点复杂,因此请仔细复制这些代码。有一个 `while` 循环嵌套在另一个 `while` 循环的内部,因为这个函数必须考虑每个数组项的三个值来成功地建造一个完整的平台。在这个示例中,这里仅有三个平台以 `ploc.append` 语句定义,但是你的游戏可能需要更多,因此你需要多少就定义多少。当然,有一些不会出现,因为它们远在屏幕外,但是一旦当你进行滚动时,它们将呈现在眼前。 + +``` +def platform(lvl,tx,ty): +    plat_list = pygame.sprite.Group() +    ploc = [] +    i=0 +    if lvl == 1: +        ploc.append((200,worldy-ty-128,3)) +        ploc.append((300,worldy-ty-256,3)) +        ploc.append((500,worldy-ty-128,4)) +        while i < len(ploc): +            j=0 +            while j <= ploc[i][2]: +                plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'tile.png') +                plat_list.add(plat) +                j=j+1 +            print('run' + str(i) + str(ploc[i])) +            i=i+1 +            +    if lvl == 2: +        print("Level " + str(lvl) ) + +    return plat_list +``` + +要让这些平台出现在你的游戏世界,它们必须出现在你的主循环中。如果你还没有这样做,添加这些行到你的主循环(再一次,第一行仅被用于上下文)中: + +``` +        enemy_list.draw(world)  # 刷新敌人 +        ground_list.draw(world) # 刷新地面 +        plat_list.draw(world)   # 刷新平台 +``` + +启动你的游戏,根据需要调整你的平台的放置位置。如果你看不见屏幕外产生的平台,不要担心;你不久后就可以修复它。 + +到目前为止,这是游戏的图片和代码: + +![Pygame game][23] + +*到目前为止,我们的 Pygame 平台。* + +``` +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved.  This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Platform(pygame.sprite.Sprite): +    # x location, y location, img width, img height, img file     +    def __init__(self,xloc,yloc,imgw,imgh,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)).convert() +        self.image.convert_alpha() +        self.rect = self.image.get_rect() +        self.rect.y = yloc +        self.rect.x = xloc + +class Player(pygame.sprite.Sprite): +    ''' +    Spawn a player +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 +        self.movey = 0 +        self.frame = 0 +        self.health = 10 +        self.score = 1 +        self.images = [] +        for i in range(1,9): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha() +            img.set_colorkey(ALPHA) +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() + +    def control(self,x,y): +        ''' +        control player movement +        ''' +        self.movex += x +        self.movey += y + +    def update(self): +        ''' +        Update sprite position +        ''' + +        self.rect.x = self.rect.x + self.movex +        self.rect.y = self.rect.y + self.movey + +        # moving left +        if self.movex < 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # moving right +        if self.movex > 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] + +        # collisions +        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) +        for enemy in enemy_hit_list: +            self.health -= 1 +            print(self.health) + +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.health -= 1 +            print(self.health) + + +class Enemy(pygame.sprite.Sprite): +    ''' +    Spawn an enemy +    ''' +    def __init__(self,x,y,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)) +        #self.image.convert_alpha() +        #self.image.set_colorkey(ALPHA) +        self.rect = self.image.get_rect() +        self.rect.x = x +        self.rect.y = y +        self.counter = 0 + +    def move(self): +        ''' +        enemy movement +        ''' +        distance = 80 +        speed = 8 + +        if self.counter >= 0 and self.counter <= distance: +            self.rect.x += speed +        elif self.counter >= distance and self.counter <= distance*2: +            self.rect.x -= speed +        else: +            self.counter = 0 + +        self.counter += 1 + +class Level(): +    def bad(lvl,eloc): +        if lvl == 1: +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy +            enemy_list = pygame.sprite.Group() # create enemy group +            enemy_list.add(enemy)              # add enemy to group + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return enemy_list + +    def loot(lvl,lloc): +        print(lvl) + +    def ground(lvl,gloc,tx,ty): +        ground_list = pygame.sprite.Group() +        i=0 +        if lvl == 1: +            while i < len(gloc): +                print("blockgen:" + str(i)) +                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') +                ground_list.add(ground) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return ground_list + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4  # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 # how fast to move + +eloc = [] +eloc = [200,20] +gloc = [] +#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] +tx = 64 #tile size +ty = 64 #tile size + +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 +    print("block: " + str(i)) + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) + +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False + +#    world.fill(BLACK) +    world.blit(backdrop, backdropbox) +    player.update() +    player_list.draw(world) #refresh player position +    enemy_list.draw(world)  # refresh enemies +    ground_list.draw(world)  # refresh enemies +    for e in enemy_list: +        e.move() +    pygame.display.flip() +    clock.tick(fps) +``` + +(LCTT 译注:到本文翻译完为止,该系列已经近一年没有继续更新了~) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/put-platforms-python-game + +作者:[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://www.pygame.org/news +[2]: https://opensource.com/article/17/12/game-python-add-a-player +[3]: https://opensource.com/article/17/12/game-python-moving-player +[4]: /file/403841 +[5]: https://opensource.com/sites/default/files/uploads/supertux.png (Supertux, a tile-based video game) +[6]: https://www.supertux.org/ +[7]: https://www.python.org/ +[8]: /file/403861 +[9]: https://opensource.com/sites/default/files/uploads/layout.png (Example of a level map) +[10]: https://en.wikipedia.org/wiki/Cartesian_coordinate_system +[11]: /file/403871 +[12]: https://opensource.com/sites/default/files/uploads/pygame_coordinates.png (Example of coordinates in Pygame) +[13]: https://krita.org/en/ +[14]: /file/403876 +[15]: https://opensource.com/sites/default/files/uploads/pygame_floating.png (One image file per object) +[16]: /file/403881 +[17]: https://opensource.com/sites/default/files/uploads/pygame_flattened.png (Your level cannot be one image file) +[18]: https://www.gimp.org/ +[19]: http://mypaint.org/about/ +[20]: https://inkscape.org/en/ +[21]: https://opengameart.org/content/simplified-platformer-pack +[22]: /file/403886 +[23]: https://opensource.com/sites/default/files/uploads/pygame_platforms.jpg (Pygame game) +[24]: https://linux.cn/article-9071-1.html +[25]: https://linux.cn/article-10850-1.html +[26]: https://linux.cn/article-10858-1.html +[27]: https://linux.cn/article-10874-1.html +[28]: https://linux.cn/article-10883-1.html + diff --git a/published/201905/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/published/201905/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md new file mode 100644 index 0000000000..2b38da68d0 --- /dev/null +++ b/published/201905/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -0,0 +1,596 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10848-1.html) +[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) +[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +TLP:一个可以延长 Linux 笔记本电池寿命的高级电源管理工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/201905/13/094413iu77i8w75t80tq7h.jpg) + +笔记本电池是针对 Windows 操作系统进行了高度优化的,当我在笔记本电脑中使用 Windows 操作系统时,我已经意识到这一点,但对于 Linux 来说却不一样。 + +多年来,Linux 在电池优化方面取得了很大进步,但我们仍然需要做一些必要的事情来改善 Linux 中笔记本电脑的电池寿命。 + +当我考虑延长电池寿命时,我没有多少选择,但我觉得 TLP 对我来说是一个更好的解决方案,所以我会继续使用它。 + +在本教程中,我们将详细讨论 TLP 以延长电池寿命。 + +我们之前在我们的网站上写过三篇关于 Linux [笔记本电池节电工具][1] 的文章:[PowerTOP][2] 和 [电池充电状态][3]。 + +### TLP + +[TLP][4] 是一款自由开源的高级电源管理工具,可在不进行任何配置更改的情况下延长电池寿命。 + +由于它的默认配置已针对电池寿命进行了优化,因此你可能只需要安装,然后就忘记它吧。 + +此外,它可以高度定制化,以满足你的特定要求。TLP 是一个具有自动后台任务的纯命令行工具。它不包含GUI。 + +TLP 适用于各种品牌的笔记本电脑。设置电池充电阈值仅适用于 IBM/Lenovo ThinkPad。 + +所有 TLP 设置都存储在 `/etc/default/tlp` 中。其默认配置提供了开箱即用的优化的节能设置。 + +以下 TLP 设置可用于自定义,如果需要,你可以相应地进行必要的更改。 + +### TLP 功能 + +* 内核笔记本电脑模式和脏缓冲区超时 +* 处理器频率调整,包括 “turbo boost”/“turbo core” +* 限制最大/最小的 P 状态以控制 CPU 的功耗 +* HWP 能源性能提示 +* 用于多核/超线程的功率感知进程调度程序 +* 处理器性能与节能策略(`x86_energy_perf_policy`) +* 硬盘高级电源管理级别(APM)和降速超时(按磁盘) +* AHCI 链路电源管理(ALPM)与设备黑名单 +* PCIe 活动状态电源管理(PCIe ASPM) +* PCI(e) 总线设备的运行时电源管理 +* Radeon 图形电源管理(KMS 和 DPM) +* Wifi 省电模式 +* 关闭驱动器托架中的光盘驱动器 +* 音频省电模式 +* I/O 调度程序(按磁盘) +* USB 自动暂停,支持设备黑名单/白名单(输入设备自动排除) +* 在系统启动和关闭时启用或禁用集成的 wifi、蓝牙或 wwan 设备 +* 在系统启动时恢复无线电设备状态(从之前的关机时的状态) +* 无线电设备向导:在网络连接/断开和停靠/取消停靠时切换无线电 +* 禁用 LAN 唤醒 +* 挂起/休眠后恢复集成的 WWAN 和蓝牙状态 +* 英特尔处理器的动态电源降低 —— 需要内核和 PHC-Patch 支持 +* 电池充电阈值 —— 仅限 ThinkPad +* 重新校准电池 —— 仅限 ThinkPad + +### 如何在 Linux 上安装 TLP + +TLP 包在大多数发行版官方存储库中都可用,因此,使用发行版的 [包管理器][5] 来安装它。 + +对于 Fedora 系统,使用 [DNF 命令][6] 安装 TLP。 + +``` +$ sudo dnf install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm +$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo dnf install smartmontools +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][7] 或 [APT 命令][8] 安装 TLP。 + +``` +$ sudo apt install tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ sudo apt-get install tp-smapi-dkms acpi-call-dkms +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo apt-get install smartmontools +``` + +当基于 Ubuntu 的系统的官方软件包过时时,请使用以下 PPA 存储库,该存储库提供最新版本。运行以下命令以使用 PPA 安装 TLP。 + +``` +$ sudo add-apt-repository ppa:linrunner/tlp +$ sudo apt-get update +$ sudo apt-get install tlp +``` + +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 安装 TLP。 + +``` +$ sudo pacman -S tlp tlp-rdw +``` + +ThinkPad 需要一些附加软件包。 + +``` +$ pacman -S tp_smapi acpi_call +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo pacman -S smartmontools +``` + +对于基于 Arch Linux 的系统,在启动时启用 TLP 和 TLP-Sleep 服务。 + +``` +$ sudo systemctl enable tlp.service +$ sudo systemctl enable tlp-sleep.service +``` + +对于基于 Arch Linux 的系统,你还应该屏蔽以下服务以避免冲突,并确保 TLP 的无线电设备切换选项的正确操作。 + +``` +$ sudo systemctl mask systemd-rfkill.service +$ sudo systemctl mask systemd-rfkill.socket +``` + +对于 RHEL/CentOS 系统,使用 [YUM 命令][10] 安装 TLP。 + +``` +$ sudo yum install tlp tlp-rdw +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo yum install smartmontools +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][11] 安装 TLP。 + +``` +$ sudo zypper install TLP +``` + +安装 smartmontool 以显示 tlp-stat 中 S.M.A.R.T. 数据。 + +``` +$ sudo zypper install smartmontools +``` + +成功安装 TLP 后,使用以下命令启动服务。 + +``` +$ systemctl start tlp.service +``` + +### 使用方法 + +#### 显示电池信息 + +``` +$ sudo tlp-stat -b +或 +$ sudo tlp-stat --battery +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] +/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] +/sys/class/power_supply/BAT0/power_now = 0 [mW] +/sys/class/power_supply/BAT0/status = Full + +Charge = 100.0 [%] +Capacity = 81.4 [%] +``` + +#### 显示磁盘信息 + +``` +$ sudo tlp-stat -d +或 +$ sudo tlp-stat --disk +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25775 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on +``` + +#### 显示 PCI 设备信息 + +``` +$ sudo tlp-stat -e +或 +$ sudo tlp-stat --pcie +``` + +``` +$ sudo tlp-stat -e +or +$ sudo tlp-stat --pcie + +--- TLP 1.1 -------------------------------------------- + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) + +...... +``` + +#### 显示图形卡信息 + +``` +$ sudo tlp-stat -g +或 +$ sudo tlp-stat --graphics +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) +``` + +#### 显示处理器信息 + +``` +$ sudo tlp-stat -p +或 +$ sudo tlp-stat --processor +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +...... + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. +``` + +#### 显示系统数据信息 + +``` +$ sudo tlp-stat -s +或 +$ sudo tlp-stat --system +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 596 sec(s) ago +Mode = battery +Power source = battery +``` + +#### 显示温度和风扇速度信息 + +``` +$ sudo tlp-stat -t +或 +$ sudo tlp-stat --temp +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Temperatures +CPU temp = 36 [°C] +Fan speed = (not available) +``` + +#### 显示 USB 设备数据信息 + +``` +$ sudo tlp-stat -u +或 +$ sudo tlp-stat --usb +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) + +...... +``` + +#### 显示警告信息 + +``` +$ sudo tlp-stat -w +或 +$ sudo tlp-stat --warn +``` + +``` +--- TLP 1.1 -------------------------------------------- + +No warnings detected. +``` + +#### 状态报告及配置和所有活动的设置 + +``` +$ sudo tlp-stat +``` + +``` +--- TLP 1.1 -------------------------------------------- + ++++ Configured Settings: /etc/default/tlp +TLP_ENABLE=1 +TLP_DEFAULT_MODE=AC +TLP_PERSISTENT_DEFAULT=0 +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 + +...... + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 684 sec(s) ago +Mode = battery +Power source = battery + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave + +...... + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. + ++++ Temperatures +CPU temp = 42 [°C] +Fan speed = (not available) + ++++ File System +/proc/sys/vm/laptop_mode = 2 +/proc/sys/vm/dirty_writeback_centisecs = 6000 +/proc/sys/vm/dirty_expire_centisecs = 6000 +/proc/sys/vm/dirty_ratio = 20 +/proc/sys/vm/dirty_background_ratio = 10 + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25777 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on + ++++ PCIe Active State Power Management +/sys/module/pcie_aspm/parameters/policy = powersave + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) + ++++ Wireless +bluetooth = on +wifi = on +wwan = none (no device) + +hci0(btusb) : bluetooth, not connected +wlp8s0(iwlwifi) : wifi, connected, power management = on + ++++ Audio +/sys/module/snd_hda_intel/parameters/power_save = 1 +/sys/module/snd_hda_intel/parameters/power_save_controller = Y + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) + +...... + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] +/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] +/sys/class/power_supply/BAT0/power_now = 12185 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 97.0 [%] +Capacity = 86.2 [%] +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ +[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ +[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ +[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html +[5]: https://www.2daygeek.com/category/package-management/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/published/201905/20181218 Using Pygame to move your game character around.md b/published/201905/20181218 Using Pygame to move your game character around.md new file mode 100644 index 0000000000..9605601ad7 --- /dev/null +++ b/published/201905/20181218 Using Pygame to move your game character around.md @@ -0,0 +1,354 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10874-1.html) +[#]: subject: (Using Pygame to move your game character around) +[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +用 Pygame 使你的游戏角色移动起来 +====== +> 在本系列的第四部分,学习如何编写移动游戏角色的控制代码。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) + +在这个系列的第一篇文章中,我解释了如何使用 Python 创建一个简单的[基于文本的骰子游戏][1]。在第二部分中,我向你们展示了如何从头开始构建游戏,即从 [创建游戏的环境][2] 开始。然后在第三部分,我们[创建了一个玩家妖精][3],并且使它在你的(而不是空的)游戏世界内生成。你可能已经注意到,如果你不能移动你的角色,那么游戏不是那么有趣。在本篇文章中,我们将使用 Pygame 来添加键盘控制,如此一来你就可以控制你的角色的移动。 + +在 Pygame 中有许多函数可以用来添加(除键盘外的)其他控制,但如果你正在敲击 Python 代码,那么你一定是有一个键盘的,这将成为我们接下来会使用的控制方式。一旦你理解了键盘控制,你可以自己去探索其他选项。 + +在本系列的第二篇文章中,你已经为退出游戏创建了一个按键,移动角色的(按键)原则也是相同的。但是,使你的角色移动起来要稍微复杂一点。 + +让我们从简单的部分入手:设置控制器按键。 + +### 为控制你的玩家妖精设置按键 + +在 IDLE、Ninja-IDE 或文本编辑器中打开你的 Python 游戏脚本。 + +因为游戏需要时刻“监听”键盘事件,所以你写的代码需要连续运行。你知道应该把需要在游戏周期中持续运行的代码放在哪里吗? + +如果你回答“放在主循环中”,那么你是正确的!记住除非代码在循环中,否则(大多数情况下)它只会运行仅一次。如果它被写在一个从未被使用的类或函数中,它可能根本不会运行。 + +要使 Python 监听传入的按键,将如下代码添加到主循环。目前的代码还不能产生任何的效果,所以使用 `print` 语句来表示成功的信号。这是一种常见的调试技术。 + +``` +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right') +            if event.key == pygame.K_UP or event.key == ord('w'): +             print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print('left stop') +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print('right stop') +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False     +``` + +一些人偏好使用键盘字母 `W`、`A`、`S` 和 `D` 来控制玩家角色,而另一些偏好使用方向键。因此确保你包含了两种选项。 + +注意:当你在编程时,同时考虑所有用户是非常重要的。如果你写代码只是为了自己运行,那么很可能你会成为你写的程序的唯一用户。更重要的是,如果你想找一个通过写代码赚钱的工作,你写的代码就应该让所有人都能运行。给你的用户选择权,比如提供使用方向键或 WASD 的选项,是一个优秀程序员的标志。 + +使用 Python 启动你的游戏,并在你按下“上下左右”方向键或 `A`、`D` 和 `W` 键的时候查看控制台窗口的输出。 + +``` +$ python ./your-name_game.py +  left +  left stop +  right +  right stop +  jump +``` + +这验证了 Pygame 可以正确地检测按键。现在是时候来完成使妖精移动的艰巨任务了。 + +### 编写玩家移动函数 + +为了使你的妖精移动起来,你必须为你的妖精创建一个属性代表移动。当你的妖精没有在移动时,这个变量被设为 `0`。 + +如果你正在为你的妖精设置动画,或者你决定在将来为它设置动画,你还必须跟踪帧来使走路循环保持在轨迹上。 + +在 `Player` 类中创建如下变量。开头两行作为上下文对照(如果你一直跟着做,你的代码中就已经有这两行),因此只需要添加最后三行: + +``` +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 # 沿 X 方向移动 +        self.movey = 0 # 沿 Y 方向移动 +        self.frame = 0 # 帧计数 +``` + +设置好了这些变量,是时候去为妖精移动编写代码了。 + +玩家妖精不需要时刻响应控制,有时它并没有在移动。控制妖精的代码,仅仅只是玩家妖精所有能做的事情中的一小部分。在 Python 中,当你想要使一个对象做某件事并独立于剩余其他代码时,你可以将你的新代码放入一个函数。Python 的函数以关键词 `def` 开头,(该关键词)代表了定义函数。 + +在你的 `Player` 类中创建如下函数,来为你的妖精在屏幕上的位置增加几个像素。现在先不要担心你增加几个像素,这将在后续的代码中确定。 + +``` +    def control(self,x,y): +        ''' +        控制玩家移动 +        ''' +        self.movex += x +        self.movey += y +``` + +为了在 Pygame 中移动妖精,你需要告诉 Python 在新的位置重绘妖精,以及这个新位置在哪里。 + +因为玩家妖精并不总是在移动,所以更新只需要是 Player 类中的一个函数。将此函数添加前面创建的 `control` 函数之后。 + +要使妖精看起来像是在行走(或者飞行,或是你的妖精应该做的任何事),你需要在按下适当的键时改变它在屏幕上的位置。要让它在屏幕上移动,你需要将它的位置(由 `self.rect.x` 和 `self.rect.y` 属性指定)重新定义为当前位置加上已应用的任意 `movex` 或 `movey`。(移动的像素数量将在后续进行设置。) + +``` +    def update(self): +        ''' +        更新妖精位置 +        ''' +        self.rect.x = self.rect.x + self.movex         +``` + +对 Y 方向做同样的处理: + +``` +        self.rect.y = self.rect.y + self.movey +``` + +对于动画,在妖精移动时推进动画帧,并使用相应的动画帧作为玩家的图像: + +``` +        # 向左移动 +        if self.movex < 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # 向右移动 +        if self.movex > 0: +            self.frame += 1 +            if self.frame > 3*ani: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] +``` + +通过设置一个变量来告诉代码为你的妖精位置增加多少像素,然后在触发你的玩家妖精的函数时使用这个变量。 + +首先,在你的设置部分创建这个变量。在如下代码中,开头两行是上下文对照,因此只需要在你的脚本中增加第三行代码: + +``` +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10  # 移动多少个像素 +``` + +现在你已经有了适当的函数和变量,使用你的按键来触发函数并将变量传递给你的妖精。 + +为此,将主循环中的 `print` 语句替换为玩家妖精的名字(`player`)、函数(`.control`)以及你希望玩家妖精在每个循环中沿 X 轴和 Y 轴移动的步数。 + +``` +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False +``` + +记住,`steps` 变量代表了当一个按键被按下时,你的妖精会移动多少个像素。如果当你按下 `D` 或右方向键时,你的妖精的位置增加了 10 个像素。那么当你停止按下这个键时,你必须(将 `step`)减 10(`-steps`)来使你的妖精的动量回到 0。 + +现在尝试你的游戏。注意:它不会像你预想的那样运行。 + +为什么你的妖精仍无法移动?因为主循环还没有调用 `update` 函数。 + +将如下代码加入到你的主循环中来告诉 Python 更新你的玩家妖精的位置。增加带注释的那行: + +``` +    player.update()  # 更新玩家位置 +    player_list.draw(world) +    pygame.display.flip() +    clock.tick(fps) +``` + +再次启动你的游戏来见证你的玩家妖精在你的命令下在屏幕上来回移动。现在还没有垂直方向的移动,因为这部分函数会被重力控制,不过这是另一篇文章中的课程了。 + +与此同时,如果你拥有一个摇杆,你可以尝试阅读 Pygame 中 [joystick][4] 模块相关的文档,看看你是否能通过这种方式让你的妖精移动起来。或者,看看你是否能通过[鼠标][5]与你的妖精互动。 + +最重要的是,玩的开心! + +### 本教程中用到的所有代码 + +为了方便查阅,以下是目前本系列文章用到的所有代码。 + +``` +#!/usr/bin/env python3 +# 绘制世界 +# 添加玩家和玩家控制 +# 添加玩家移动控制 + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Player(pygame.sprite.Sprite): + ''' + 生成玩家 + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.images = [] + for i in range(1,5): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() + + def control(self,x,y): + ''' + 控制玩家移动 + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + 更新妖精位置 + ''' + + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey + + # 向左移动 + if self.movex < 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[self.frame//ani] + + # 向右移动 + if self.movex > 0: + self.frame += 1 + if self.frame > 3*ani: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] + + +''' +设置 +''' +worldx = 960 +worldy = 720 + +fps = 40 # 帧刷新率 +ani = 4 # 动画循环 +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # 生成玩家 +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 # 移动速度 + +''' +主循环 +''' +while main == True: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False + + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') + + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False + +# world.fill(BLACK) + world.blit(backdrop, backdropbox) + player.update() + player_list.draw(world) # 更新玩家位置 + pygame.display.flip() + clock.tick(fps) +``` + +你已经学了很多,但还仍有许多可以做。在接下来的几篇文章中,你将实现添加敌方妖精、模拟重力等等。与此同时,练习 Python 吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/12/game-python-moving-player + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[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://linux.cn/article-9071-1.html +[2]: https://linux.cn/article-10850-1.html +[3]: https://linux.cn/article-10858-1.html +[4]: http://pygame.org/docs/ref/joystick.html +[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse diff --git a/published/201905/20190107 Aliases- To Protect and Serve.md b/published/201905/20190107 Aliases- To Protect and Serve.md new file mode 100644 index 0000000000..60299f61c5 --- /dev/null +++ b/published/201905/20190107 Aliases- To Protect and Serve.md @@ -0,0 +1,172 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10918-1.html) +[#]: subject: (Aliases: To Protect and Serve) +[#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +命令别名:保护和服务 +====== + +> Linux shell 允许你将命令彼此链接在一起,一次触发执行复杂的操作,并且可以对此创建别名作为快捷方式。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) + +让我们将继续我们的别名系列。到目前为止,你可能已经阅读了我们的[关于别名的第一篇文章][1],并且应该非常清楚它们是如何为你省去很多麻烦的最简单方法。例如,你已经看到它们帮助我们减少了输入,让我们看看别名派上用场的其他几个案例。 + +### 别名即快捷方式 + +Linux shell 最美妙的事情之一是可以使用数以万计的选项和把命令连接在一起执行真正复杂的操作。好吧,也许这种美丽是在旁观者的眼中的,但是我们觉得这个功能很实用。 + +不利的一面是,你经常需要记得难以记忆或难以打字出来的命令组合。比如说硬盘上的空间非常宝贵,而你想要做一些清洁工作。你的第一步可能是寻找隐藏在你的家目录里的东西。你可以用来判断的一个标准是查找不再使用的内容。`ls` 可以帮助你: + +``` +ls -lct +``` + +上面的命令显示了每个文件和目录的详细信息(`-l`),并显示了每一项上次访问的时间(`-c`),然后它按从最近访问到最少访问的顺序排序这个列表(`-t`)。 + +这难以记住吗?你可能不会每天都使用 `-c` 和 `-t` 选项,所以也许是吧。无论如何,定义一个别名,如: + +``` +alias lt='ls -lct' +``` + +会更容易一些。 + +然后,你也可能希望列表首先显示最旧的文件: + +``` +alias lo='lt -F | tac' +``` + +![aliases][3] + +*图 1:使用 lt 和 lo 别名。* + +这里有一些有趣的事情。首先,我们使用别名(`lt`)来创建另一个别名 —— 这是完全可以的。其次,我们将一个新参数传递给 `lt`(后者又通过 `lt` 别名的定义传递给了 `ls`)。 + +`-F` 选项会将特殊符号附加到项目的名称后,以便更好地区分常规文件(没有符号)和可执行文件(附加了 `*`)、目录文件(以 `/` 结尾),以及所有链接文件、符号链接文件(以 `@` 符号结尾)等等。`-F` 选项是当你回归到单色终端的日子里,没有其他方法可以轻松看到列表项之间的差异时用的。在这里使用它是因为当你将输出从 `lt` 传递到 `tac` 时,你会丢失 `ls` 的颜色。 + +第三件我们需要注意的事情是我们使用了管道。管道用于你将一个命令的输出传递给另外一个命令时。第二个命令可以使用这些输出作为它的输入。在包括 Bash 在内的许多 shell 里,你可以使用管道符(`|`) 来做传递。 + +在这里,你将来自 `lt -F` 的输出导给 `tac`。`tac` 这个命令有点玩笑的意思,你或许听说过 `cat` 命令,它名义上用于将文件彼此连接(con`cat`),而在实践中,它被用于将一个文件的内容打印到终端。`tac` 做的事情一样,但是它是以逆序将接收到的内容输出出来。明白了吗?`cat` 和 `tac`,技术人有时候也挺有趣的。 + +`cat` 和 `tac` 都能输出通过管道传递过来的内容,在这里,也就是一个按时间顺序排序的文件列表。 + +那么,在有些离题之后,最终我们得到的就是这个列表将当前目录中的文件和目录以新鲜度的逆序列出(即老的在前)。 + +最后你需要注意的是,当在当前目录或任何目录运行 `lt` 时: + +``` +# 这可以工作: +lt +# 这也可以: +lt /some/other/directory +``` + +……而 `lo` 只能在当前目录奏效: + +``` +# 这可工作: +lo +# 而这不行: +lo /some/other/directory +``` + +这是因为 Bash 会展开别名的组分。当你键入: + +``` +lt /some/other/directory +``` + +Bash 实际上运行的是: + +``` +ls -lct /some/other/directory +``` + +这是一个有效的 Bash 命令。 + +而当你键入: + +``` +lo /some/other/directory +``` + +Bash 试图运行: + +``` +ls -lct -F | tac /some/other/directory +``` + +这不是一个有效的命令,主要是因为 `/some/other/directory` 是个目录,而 `cat` 和 `tac` 不能用于目录。 + +### 更多的别名快捷方式 + + * `alias lll='ls -R'` 会打印出目录的内容,并深入到子目录里面打印子目录的内容,以及子目录的子目录,等等。这是一个查看一个目录下所有内容的方式。 + * `mkdir='mkdir -pv'` 可以让你一次性创建目录下的目录。按照 `mkdir` 的基本形式,要创建一个包含子目录的目录,你必须这样: + +``` +mkdir newdir +mkdir newdir/subdir +``` + +或这样: + +``` +mkdir -p newdir/subdir +``` + +而用这个别名你将只需要这样就行: + +``` +mkdir newdir/subdir +``` + +你的新 `mkdir` 也会告诉你创建子目录时都做了什么。 + +### 别名也是一种保护 + +别名的另一个好处是它可以作为防止你意外地删除或覆写已有的文件的保护措施。你可能听说过这个 Linux 新用户的传言,当他们以 root 身份运行: + +``` +rm -rf / +``` + +整个系统就爆了。而决定输入如下命令的用户: + +``` +rm -rf /some/directory/ * +``` + +就很好地干掉了他们的家目录的全部内容。这里不小心键入的目录和 `*` 之间的那个空格有时候很容易就会被忽视掉。 + +这两种情况我们都可以通过 `alias rm='rm -i'` 别名来避免。`-i` 选项会使 `rm` 询问用户是否真的要做这个操作,在你对你的文件系统做出不可弥补的损失之前给你第二次机会。 + +对于 `cp` 也是一样,它能够覆盖一个文件而不会给你任何提示。创建一个类似 `alias cp='cp -i'` 来保持安全吧。 + +### 下一次 + +我们越来越深入到了脚本领域,下一次,我们将沿着这个方向,看看如何在命令行组合命令以给你真正的乐趣,并可靠地解决系统管理员每天面临的问题。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve + +作者:[Paul Brown][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/bro66 +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10377-1.html +[2]: https://www.linux.com/files/images/fig01png-0 +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fig01_0.png?itok=crqTm_va (aliases) +[4]: https://www.linux.com/licenses/category/used-permission diff --git a/published/201905/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/published/201905/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md new file mode 100644 index 0000000000..5da1acbdd0 --- /dev/null +++ b/published/201905/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md @@ -0,0 +1,212 @@ +[#]: collector: (lujun9972) +[#]: translator: (bodhix) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10804-1.html) +[#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/restart-network-ubuntu) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +Linux 初学者:如何在 Ubuntu 中重启网络 +====== + +你[是否正在使用基于 Ubuntu 的系统,然后发现无法连接网络][1]?你一定会很惊讶,很多的问题都可以简单地通过重启服务解决。 + +在这篇文章中,我会介绍在 Ubuntu 或者其他 Linux 发行版中重启网络的几种方法,你可以根据自身需要选择对应的方法。这些方法基本分为两类: + +![Ubuntu Restart Network][2] + +### 通过命令行方式重启网络 + +如果你使用的 Ubuntu 服务器版,那么你已经在使用命令行终端了。如果你使用的是桌面版,那么你可以通过快捷键 `Ctrl+Alt+T` [Ubuntu 键盘快捷键][3] 打开命令行终端。 + +在 Ubuntu 中,有多个命令可以重启网络。这些命令,一部分或者说大部分,也适用于在 Debian 或者其他的 Linux 发行版中重启网络。 + +#### 1、network manager 服务 + +这是通过命令行方式重启网络最简单的方法。它相当于是通过图形化界面重启网络(重启 Network-Manager 服务)。 + +``` +sudo service network-manager restart +``` + +此时,网络图标会消失一会儿然后重新显示。 + +#### 2、systemd + +`service` 命令仅仅是这个方式的一个封装(同样的也是 init.d 系列脚本和 Upstart 相关命令的封装)。`systemctl` 命令的功能远多于 `service` 命令。通常我更喜欢使用这个命令。 + +``` +sudo systemctl restart NetworkManager.service +``` + +这时,网络图标又会消失一会儿。 如果你想了解 `systemctl` 的其他选项, 可以参考 man 帮助文档。 + +#### 3、nmcli + +这是 Linux 上可以管理网络的另一个工具。这是一个功能强大而且实用的工具。很多系统管理员都喜欢使用该工具,因为它非常容易使用。 + +这种方法有两个操作步骤:关闭网络,再开启网络。 + +``` +sudo nmcli networking off +``` + +这样就会关闭网络,网络图标会消失。接下来,再开启网络: + +``` +sudo nmcli networking on +``` + +你可以通过 man 帮助文档了解 nmcli 的更多用法。 + +#### 4、ifup & ifdown + +这两个命令直接操作网口,切换网口是否可以收发包的状态。这是 [Linux 中最应该了解的网络命令][4] 之一。 + +使用 `ifdown` 关闭所有网口,再使用 `ifup` 重新启用网口。 + +通常推荐的做法是将这两个命令一起使用。 + +``` +sudo ifdown -a && sudo ifup -a +``` + +注意:这种方法不会让网络图标从系统托盘中消失,另外,各种网络连接也会断。 + +#### 补充工具: nmtui + +这是系统管理员们常用的另外一种方法。它是在命令行终端中管理网络的文本菜单工具。 + +``` +nmtui +``` + +打开如下菜单: + +![nmtui Menu][5] + +注意:在 nmtui 中,可以通过 `up` 和 `down` 方向键选择选项。 + +选择 “Activate a connection”: + +![nmtui Menu Select "Activate a connection"][6] + +按下回车键,打开 “connections” 菜单。 + +![nmtui Connections Menu][7] + +接下来,选择前面带星号(*)的网络。在这个例子中,就是 MGEO72。 + +![Select your connection in the nmtui connections menu.][8] + +按下回车键。 这就将“停用”你的网络连接。 + +![nmtui Connections Menu with no active connection][9] + +选择你要连接的网络: + +![Select the connection you want in the nmtui connections menu.][10] + +按下回车键。这样就重新激活了所选择的网络连接。 + +![nmtui Connections Menu][11] + +按下 `Tab` 键两次,选择 “Back”: + +![Select "Back" in the nmtui connections menu.][12] + +按下回车键,回到 nmtui 的主菜单。 + +![nmtui Main Menu][13] + +选择 “Quit” : + +![nmtui Quit Main Menu][14] + +退出该界面,返回到命令行终端。 + +就这样,你已经成功重启网络了。 + +### 通过图形化界面重启网络 + +显然,这是 Ubuntu 桌面版用户重启网络最简单的方法。如果这个方法不生效,你可以尝试使用前文提到的命令行方式重启网络。 + +NM 小程序是 [NetworkManager][15] 的系统托盘程序标志。我们将使用它来重启网络。 + +首先,查看顶部状态栏。你会在系统托盘找到一个网络图标 (因为我使用 Wi-Fi,所以这里是一个 Wi-Fi 图标)。 + +接下来,点击该图标(也可以点击音量图标或电池图标)。打开菜单。选择 “Turn Off” 关闭网络。 + +![Restart network in Ubuntu][16] + +网络图标会在状态栏中消失,这表示你已经成功关闭网络了。 + +再次点击系统托盘重新打开菜单,选择 “Turn On”,重新开启网络。 + +![Restarting network in Ubuntu][17] + +恭喜!你现在已经重启你的网络了。 + +#### 其他提示:刷新可用网络列表 + +如果你已经连接上一个网络,但是你想连接到另外一个网络,你如何刷新 WiFi 列表,查找其他可用的网络呢?我来向你展示一下。 + +Ubuntu 没有可以直接 “刷新 WiFi 网络” 的选项,它有点隐蔽。 + +你需要再次打开配置菜单,然后点击 “Select Network” 。 + +![Refresh wifi network list in Ubuntu][18] + +选择对应的网络修改你的 WiFi 连接。 + +你无法马上看到可用的无线网络列表。打开网络列表之后,大概需要 5 秒才会显示其它可用的无线网络。 + +![Select another wifi network in Ubuntu][19] + +等待大概 5 秒钟,看到其他可用的网络。 + +现在,你就可以选择你想要连接的网络,点击连接。这样就完成了。 + +### 总结 + +重启网络连接是每个 Linux 用户在使用过程中必须经历的事情。 + +我们希望这些方法可以帮助你处理这样的问题! + +你是如何重启或管理你的网络的?我们是否还有遗漏的?请在下方留言。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/restart-network-ubuntu + +作者:[Sergiu][a] +选题:[lujun9972][b] +译者:[bodhix](https://github.com/bodhix) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/fix-no-wireless-network-ubuntu/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/ubuntu-restart-network.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/ubuntu-shortcuts/ +[4]: https://itsfoss.com/basic-linux-networking-commands/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu.png?fit=800%2C602&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu_select_option.png?fit=800%2C579&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_on.png?fit=800%2C585&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_select_connection_on.png?fit=800%2C576&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_off.png?fit=800%2C572&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_select_connection_off.png?fit=800%2C566&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_on-1.png?fit=800%2C585&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_back.png?fit=800%2C585&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu_select_option-1.png?fit=800%2C579&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_menu_quit.png?fit=800%2C580&ssl=1 +[15]: https://wiki.gnome.org/Projects/NetworkManager +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/restart-network-ubuntu-1.jpg?resize=800%2C400&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/restart-network-ubuntu-2.jpg?resize=800%2C400&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/select-wifi-network-ubuntu.jpg?resize=800%2C400&ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/select-wifi-network-ubuntu-1.jpg?resize=800%2C400&ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/ubuntu-restart-network.png?fit=800%2C450&ssl=1 diff --git a/published/201905/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/published/201905/20190308 Virtual filesystems in Linux- Why we need them and how they work.md new file mode 100644 index 0000000000..8ffd7c6ab0 --- /dev/null +++ b/published/201905/20190308 Virtual filesystems in Linux- Why we need them and how they work.md @@ -0,0 +1,210 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10884-1.html) +[#]: subject: (Virtual filesystems in Linux: Why we need them and how they work) +[#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) +[#]: author: (Alison Chariken ) + +详解 Linux 中的虚拟文件系统 +====== + +> 虚拟文件系统是一种神奇的抽象,它使得 “一切皆文件” 哲学在 Linux 中成为了可能。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) + +什么是文件系统?根据早期的 Linux 贡献者和作家 [Robert Love][1] 所说,“文件系统是一个遵循特定结构的数据的分层存储。” 不过,这种描述也同样适用于 VFAT(虚拟文件分配表Virtual File Allocation Table)、Git 和[Cassandra][2](一种 [NoSQL 数据库][3])。那么如何区别文件系统呢? + +### 文件系统基础概念 + +Linux 内核要求文件系统必须是实体,它还必须在持久对象上实现 `open()`、`read()` 和 `write()` 方法,并且这些实体需要有与之关联的名字。从 [面向对象编程][4] 的角度来看,内核将通用文件系统视为一个抽象接口,这三大函数是“虚拟”的,没有默认定义。因此,内核的默认文件系统实现被称为虚拟文件系统(VFS)。 + +![][5] + +*如果我们能够 `open()`、`read()` 和 `write()`,它就是一个文件,如这个主控台会话所示。* + +VFS 是著名的类 Unix 系统中 “一切皆文件” 概念的基础。让我们看一下它有多奇怪,上面的小小演示体现了字符设备 `/dev/console` 实际的工作。该图显示了一个在虚拟电传打字控制台(tty)上的交互式 Bash 会话。将一个字符串发送到虚拟控制台设备会使其显示在虚拟屏幕上。而 VFS 甚至还有其它更奇怪的属性。例如,它[可以在其中寻址][6]。 + +我们熟悉的文件系统如 ext4、NFS 和 /proc 都在名为 [file_operations] [7] 的 C 语言数据结构中提供了三大函数的定义。此外,个别的文件系统会以熟悉的面向对象的方式扩展和覆盖了 VFS 功能。正如 Robert Love 指出的那样,VFS 的抽象使 Linux 用户可以轻松地将文件复制到(或复制自)外部操作系统或抽象实体(如管道),而无需担心其内部数据格式。在用户空间这一侧,通过系统调用,进程可以使用文件系统方法之一 `read()` 从文件复制到内核的数据结构中,然后使用另一种文件系统的方法 `write()` 输出数据。 + +属于 VFS 基本类型的函数定义本身可以在内核源代码的 [fs/*.c 文件][8] 中找到,而 `fs/` 的子目录中包含了特定的文件系统。内核还包含了类似文件系统的实体,例如 cgroup、`/dev` 和 tmpfs,在引导过程的早期需要它们,因此定义在内核的 `init/` 子目录中。请注意,cgroup、`/dev` 和 tmpfs 不会调用 `file_operations` 的三大函数,而是直接读取和写入内存。 + +下图大致说明了用户空间如何访问通常挂载在 Linux 系统上的各种类型文件系统。像管道、dmesg 和 POSIX 时钟这样的结构在此图中未显示,它们也实现了 `struct file_operations`,而且其访问也要通过 VFS 层。 + +![How userspace accesses various types of filesystems][9] + +VFS 是个“垫片层”,位于系统调用和特定 `file_operations` 的实现(如 ext4 和 procfs)之间。然后,`file_operations` 函数可以与特定于设备的驱动程序或内存访问器进行通信。tmpfs、devtmpfs 和 cgroup 不使用 `file_operations` 而是直接访问内存。 + +VFS 的存在促进了代码重用,因为与文件系统相关的基本方法不需要由每种文件系统类型重新实现。代码重用是一种被广泛接受的软件工程最佳实践!唉,但是如果重用的代码[引入了严重的错误][10],那么继承常用方法的所有实现都会受到影响。 + +### /tmp:一个小提示 + +找出系统中存在的 VFS 的简单方法是键入 `mount | grep -v sd | grep -v :/`,在大多数计算机上,它将列出所有未驻留在磁盘上,同时也不是 NFS 的已挂载文件系统。其中一个列出的 VFS 挂载肯定是 `/tmp`,对吧? + +![Man with shocked expression][11] + +*谁都知道把 /tmp 放在物理存储设备上简直是疯了!图片:* + +为什么把 `/tmp` 留在存储设备上是不可取的?因为 `/tmp` 中的文件是临时的(!),并且存储设备比内存慢,所以创建了 tmpfs 这种文件系统。此外,比起内存,物理设备频繁写入更容易磨损。最后,`/tmp` 中的文件可能包含敏感信息,因此在每次重新启动时让它们消失是一项功能。 + +不幸的是,默认情况下,某些 Linux 发行版的安装脚本仍会在存储设备上创建 /tmp。如果你的系统出现这种情况,请不要绝望。按照一直优秀的 [Arch Wiki][12] 上的简单说明来解决问题就行,记住分配给 tmpfs 的内存就不能用于其他目的了。换句话说,包含了大文件的庞大的 tmpfs 可能会让系统耗尽内存并崩溃。 + +另一个提示:编辑 `/etc/fstab` 文件时,请务必以换行符结束,否则系统将无法启动。(猜猜我怎么知道。) + +### /proc 和 /sys + +除了 `/tmp` 之外,大多数 Linux 用户最熟悉的 VFS 是 `/proc` 和 `/sys`。(`/dev` 依赖于共享内存,而没有 `file_operations` 结构)。为什么有两种呢?让我们来看看更多细节。 + +procfs 为用户空间提供了内核及其控制的进程的瞬时状态的快照。在 `/proc` 中,内核发布有关其提供的设施的信息,如中断、虚拟内存和调度程序。此外,`/proc/sys` 是存放可以通过 [sysctl 命令][13]配置的设置的地方,可供用户空间访问。单个进程的状态和统计信息在 `/proc/` 目录中报告。 + +![Console][14] + +*/proc/meminfo 是一个空文件,但仍包含有价值的信息。* + +`/proc` 文件的行为说明了 VFS 可以与磁盘上的文件系统不同。一方面,`/proc/meminfo` 包含了可由命令 `free` 展现出来的信息。另一方面,它还是空的!怎么会这样?这种情况让人联想起康奈尔大学物理学家 N. David Mermin 在 1985 年写的一篇名为《[没有人看见月亮的情况吗?][15]现实和量子理论》。事实是当进程从 `/proc` 请求数据时内核再收集有关内存的统计信息,而且当没有人查看它时,`/proc` 中的文件实际上没有任何内容。正如 [Mermin 所说][16],“这是一个基本的量子学说,一般来说,测量不会揭示被测属性的预先存在的价值。”(关于月球的问题的答案留作练习。) + +![Full moon][17] + +*当没有进程访问它们时,/proc 中的文件为空。([来源][18])* + +procfs 的空文件是有道理的,因为那里可用的信息是动态的。sysfs 的情况则不同。让我们比较一下 `/proc` 与 `/sys` 中不为空的文件数量。 + +![](https://opensource.com/sites/default/files/uploads/virtualfilesystems_6-filesize.png) + +procfs 只有一个不为空的文件,即导出的内核配置,这是一个例外,因为每次启动只需要生成一次。另一方面,`/sys` 有许多更大一些的文件,其中大多数由一页内存组成。通常,sysfs 文件只包含一个数字或字符串,与通过读取 `/proc/meminfo` 等文件生成的信息表格形成鲜明对比。 + +sysfs 的目的是将内核称为 “kobject” 的可读写属性公开给用户空间。kobject 的唯一目的是引用计数:当删除对 kobject 的最后一个引用时,系统将回收与之关联的资源。然而,`/sys` 构成了内核著名的“[到用户空间的稳定 ABI][19]”,它的大部分内容[在任何情况下都没有人能“破坏”][20]。但这并不意味着 sysfs 中的文件是静态,这与易失性对象的引用计数相反。 + +内核的稳定 ABI 限制了 `/sys` 中可能出现的内容,而不是任何给定时刻实际存在的内容。列出 sysfs 中文件的权限可以了解如何设置或读取设备、模块、文件系统等的可配置、可调参数。逻辑上强调 procfs 也是内核稳定 ABI 的一部分的结论,尽管内核的[文档][19]没有明确说明。 + +![Console][21] + +*sysfs 中的文件确切地描述了实体的每个属性,并且可以是可读的、可写的,或两者兼而有之。文件中的“0”表示 SSD 不可移动的存储设备。* + +### 用 eBPF 和 bcc 工具一窥 VFS 内部 + +了解内核如何管理 sysfs 文件的最简单方法是观察它的运行情况,在 ARM64 或 x86_64 上观看的最简单方法是使用 eBPF。eBPF(扩展的伯克利数据包过滤器extended Berkeley Packet Filter)由[在内核中运行的虚拟机][22]组成,特权用户可以从命令行进行查询。内核源代码告诉读者内核可以做什么;而在一个启动的系统上运行 eBPF 工具会显示内核实际上做了什么。 + +令人高兴的是,通过 [bcc][23] 工具入门使用 eBPF 非常容易,这些工具在[主要 Linux 发行版的软件包][24] 中都有,并且已经由 Brendan Gregg [给出了充分的文档说明][25]。bcc 工具是带有小段嵌入式 C 语言片段的 Python 脚本,这意味着任何对这两种语言熟悉的人都可以轻松修改它们。据当前统计,[bcc/tools 中有 80 个 Python 脚本][26],使得系统管理员或开发人员很有可能能够找到与她/他的需求相关的已有脚本。 + +要了解 VFS 在正在运行中的系统上的工作情况,请尝试使用简单的 [vfscount][27] 或 [vfsstat][28] 脚本,这可以看到每秒都会发生数十次对 `vfs_open()` 及其相关的调用。 + +![Console - vfsstat.py][29] + +*vfsstat.py 是一个带有嵌入式 C 片段的 Python 脚本,它只是计数 VFS 函数调用。* + +作为一个不太重要的例子,让我们看一下在运行的系统上插入 USB 记忆棒时 sysfs 中会发生什么。 + +![Console when USB is inserted][30] + +*用 eBPF 观察插入 USB 记忆棒时 /sys 中会发生什么,简单的和复杂的例子。* + +在上面的第一个简单示例中,只要 `sysfs_create_files()` 命令运行,[trace.py][31] bcc 工具脚本就会打印出一条消息。我们看到 `sysfs_create_files()` 由一个 kworker 线程启动,以响应 USB 棒的插入事件,但是它创建了什么文件?第二个例子说明了 eBPF 的强大能力。这里,`trace.py` 正在打印内核回溯(`-K` 选项)以及 `sysfs_create_files()` 创建的文件的名称。单引号内的代码段是一些 C 源代码,包括一个易于识别的格式字符串,所提供的 Python 脚本[引入 LLVM 即时编译器(JIT)][32] 来在内核虚拟机内编译和执行它。必须在第二个命令中重现完整的 `sysfs_create_files()` 函数签名,以便格式字符串可以引用其中一个参数。在此 C 片段中出错会导致可识别的 C 编译器错误。例如,如果省略 `-I` 参数,则结果为“无法编译 BPF 文本”。熟悉 C 或 Python 的开发人员会发现 bcc 工具易于扩展和修改。 + +插入 USB 记忆棒后,内核回溯显示 PID 7711 是一个 kworker 线程,它在 sysfs 中创建了一个名为 `events` 的文件。使用 `sysfs_remove_files()` 进行相应的调用表明,删除 USB 记忆棒会导致删除该 `events` 文件,这与引用计数的想法保持一致。在 USB 棒插入期间(未显示)在 eBPF 中观察 `sysfs_create_link()` 表明创建了不少于 48 个符号链接。 + +无论如何,`events` 文件的目的是什么?使用 [cscope][33] 查找函数 [`__device_add_disk()`][34] 显示它调用 `disk_add_events()`,并且可以将 “media_change” 或 “eject_request” 写入到该文件。这里,内核的块层通知用户空间该 “磁盘” 的出现和消失。考虑一下这种检查 USB 棒的插入的工作原理的方法与试图仅从源头中找出该过程的速度有多快。 + +### 只读根文件系统使得嵌入式设备成为可能 + +确实,没有人通过拔出电源插头来关闭服务器或桌面系统。为什么?因为物理存储设备上挂载的文件系统可能有挂起的(未完成的)写入,并且记录其状态的数据结构可能与写入存储器的内容不同步。当发生这种情况时,系统所有者将不得不在下次启动时等待 [fsck 文件系统恢复工具][35] 运行完成,在最坏的情况下,实际上会丢失数据。 + +然而,狂热爱好者会听说许多物联网和嵌入式设备,如路由器、恒温器和汽车现在都运行着 Linux。许多这些设备几乎完全没有用户界面,并且没有办法干净地让它们“解除启动”。想一想启动电池耗尽的汽车,其中[运行 Linux 的主机设备][36] 的电源会不断加电断电。当引擎最终开始运行时,系统如何在没有长时间 fsck 的情况下启动呢?答案是嵌入式设备依赖于[只读根文件系统][37](简称 ro-rootfs)。 + +![Photograph of a console][38] + +*ro-rootfs 是嵌入式系统不经常需要 fsck 的原因。 来源:* + +ro-rootfs 提供了许多优点,虽然这些优点不如耐用性那么显然。一个是,如果 Linux 进程不可以写入,那么恶意软件也无法写入 `/usr` 或 `/lib`。另一个是,基本上不可变的文件系统对于远程设备的现场支持至关重要,因为支持人员拥有理论上与现场相同的本地系统。也许最重要(但也是最微妙)的优势是 ro-rootfs 迫使开发人员在项目的设计阶段就决定好哪些系统对象是不可变的。处理 ro-rootfs 可能经常是不方便甚至是痛苦的,[编程语言中的常量变量][39]经常就是这样,但带来的好处很容易偿还这种额外的开销。 + +对于嵌入式开发人员,创建只读根文件系统确实需要做一些额外的工作,而这正是 VFS 的用武之地。Linux 需要 `/var` 中的文件可写,此外,嵌入式系统运行的许多流行应用程序会尝试在 `$HOME` 中创建配置的点文件。放在家目录中的配置文件的一种解决方案通常是预生成它们并将它们构建到 rootfs 中。对于 `/var`,一种方法是将其挂载在单独的可写分区上,而 `/` 本身以只读方式挂载。使用绑定或叠加挂载是另一种流行的替代方案。 + +### 绑定和叠加挂载以及在容器中的使用 + +运行 [man mount][40] 是了解绑定挂载bind mount叠加挂载overlay mount的最好办法,这种方法使得嵌入式开发人员和系统管理员能够在一个路径位置创建文件系统,然后以另外一个路径将其提供给应用程序。对于嵌入式系统,这代表着可以将文件存储在 `/var` 中的不可写闪存设备上,但是在启动时将 tmpfs 中的路径叠加挂载或绑定挂载到 `/var` 路径上,这样应用程序就可以在那里随意写它们的内容了。下次加电时,`/var` 中的变化将会消失。叠加挂载为 tmpfs 和底层文件系统提供了联合,允许对 ro-rootfs 中的现有文件进行直接修改,而绑定挂载可以使新的空 tmpfs 目录在 ro-rootfs 路径中显示为可写。虽然叠加文件系统是一种适当的文件系统类型,而绑定挂载由 [VFS 命名空间工具][41] 实现的。 + +根据叠加挂载和绑定挂载的描述,没有人会对 [Linux 容器][42] 中大量使用它们感到惊讶。让我们通过运行 bcc 的 `mountsnoop` 工具监视当使用 [systemd-nspawn][43] 启动容器时会发生什么: + +![Console - system-nspawn invocation][44] + +*在 mountsnoop.py 运行的同时,system-nspawn 调用启动容器。* + +让我们看看发生了什么: + +![Console - Running mountsnoop][45] + +*在容器 “启动” 期间运行 `mountsnoop` 可以看到容器运行时很大程度上依赖于绑定挂载。(仅显示冗长输出的开头)* + +这里,`systemd-nspawn` 将主机的 procfs 和 sysfs 中的选定文件按其 rootfs 中的路径提供给容器。除了设置绑定挂载时的 `MS_BIND` 标志之外,`mount` 系统调用的一些其它标志用于确定主机命名空间和容器中的更改之间的关系。例如,绑定挂载可以将 `/proc` 和 `/sys` 中的更改传播到容器,也可以隐藏它们,具体取决于调用。 + +### 总结 + +理解 Linux 内部结构看似是一项不可能完成的任务,因为除了 Linux 用户空间应用程序和 glibc 这样的 C 库中的系统调用接口,内核本身也包含大量代码。取得进展的一种方法是阅读一个内核子系统的源代码,重点是理解面向用户空间的系统调用和头文件以及主要的内核内部接口,这里以 `file_operations` 表为例。`file_operations` 使得“一切都是文件”得以可以实际工作,因此掌握它们收获特别大。顶级 `fs/` 目录中的内核 C 源文件构成了虚拟文件系统的实现,虚拟文件​​系统是支持流行的文件系统和存储设备的广泛且相对简单的互操作性的垫片层。通过 Linux 命名空间进行绑定挂载和覆盖挂载是 VFS 魔术,它使容器和只读根文件系统成为可能。结合对源代码的研究,eBPF 内核工具及其 bcc 接口使得探测内核比以往任何时候都更简单。 + +非常感谢 [Akkana Peck][46] 和 [Michael Eager][47] 的评论和指正。 + +Alison Chaiken 也于 3 月 7 日至 10 日在加利福尼亚州帕萨迪纳举行的第 17 届南加州 Linux 博览会([SCaLE 17x][49])上演讲了[本主题][48]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/virtual-filesystems-linux + +作者:[Alison Chariken][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/chaiken +[b]: https://github.com/lujun9972 +[1]: https://www.pearson.com/us/higher-education/program/Love-Linux-Kernel-Development-3rd-Edition/PGM202532.html +[2]: http://cassandra.apache.org/ +[3]: https://en.wikipedia.org/wiki/NoSQL +[4]: http://lwn.net/Articles/444910/ +[5]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_1-console.png (Console) +[6]: https://lwn.net/Articles/22355/ +[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/fs.h +[8]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs +[9]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_2-shim-layer.png (How userspace accesses various types of filesystems) +[10]: https://lwn.net/Articles/774114/ +[11]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_3-crazy.jpg (Man with shocked expression) +[12]: https://wiki.archlinux.org/index.php/Tmpfs +[13]: http://man7.org/linux/man-pages/man8/sysctl.8.html +[14]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_4-proc-meminfo.png (Console) +[15]: http://www-f1.ijs.si/~ramsak/km1/mermin.moon.pdf +[16]: https://en.wikiquote.org/wiki/David_Mermin +[17]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_5-moon.jpg (Full moon) +[18]: https://commons.wikimedia.org/wiki/Moon#/media/File:Full_Moon_Luc_Viatour.jpg +[19]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable +[20]: https://lkml.org/lkml/2012/12/23/75 +[21]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_7-sysfs.png (Console) +[22]: https://events.linuxfoundation.org/sites/events/files/slides/bpf_collabsummit_2015feb20.pdf +[23]: https://github.com/iovisor/bcc +[24]: https://github.com/iovisor/bcc/blob/master/INSTALL.md +[25]: http://brendangregg.com/ebpf.html +[26]: https://github.com/iovisor/bcc/tree/master/tools +[27]: https://github.com/iovisor/bcc/blob/master/tools/vfscount_example.txt +[28]: https://github.com/iovisor/bcc/blob/master/tools/vfsstat.py +[29]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_8-vfsstat.png (Console - vfsstat.py) +[30]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_9-ebpf.png (Console when USB is inserted) +[31]: https://github.com/iovisor/bcc/blob/master/tools/trace_example.txt +[32]: https://events.static.linuxfound.org/sites/events/files/slides/bpf_collabsummit_2015feb20.pdf +[33]: http://northstar-www.dartmouth.edu/doc/solaris-forte/manuals/c/user_guide/cscope.html +[34]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/block/genhd.c#n665 +[35]: http://www.man7.org/linux/man-pages/man8/fsck.8.html +[36]: https://wiki.automotivelinux.org/_media/eg-rhsa/agl_referencehardwarespec_v0.1.0_20171018.pdf +[37]: https://elinux.org/images/1/1f/Read-only_rootfs.pdf +[38]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_10-code.jpg (Photograph of a console) +[39]: https://www.meetup.com/ACCU-Bay-Area/events/drpmvfytlbqb/ +[40]: http://man7.org/linux/man-pages/man8/mount.8.html +[41]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/sharedsubtree.txt +[42]: https://coreos.com/os/docs/latest/kernel-modules.html +[43]: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html +[44]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_11-system-nspawn.png (Console - system-nspawn invocation) +[45]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_12-mountsnoop.png (Console - Running mountsnoop) +[46]: http://shallowsky.com/ +[47]: http://eagercon.com/ +[48]: https://www.socallinuxexpo.org/scale/17x/presentations/virtual-filesystems-why-we-need-them-and-how-they-work +[49]: https://www.socallinuxexpo.org/ diff --git a/published/201905/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/published/201905/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md new file mode 100644 index 0000000000..0ea20b929a --- /dev/null +++ b/published/201905/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10914-1.html) +[#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) +[#]: author: (ostechnix https://www.ostechnix.com/author/editor/) + +区块链 2.0:房地产区块链(四) +====== + +![](https://www.ostechnix.com/wp-content/uploads/2019/03/Blockchain-In-Real-Estate-720x340.png) + +### 区块链 2.0:“更”智能的房地产 + +在本系列的[上一篇文章][1]中我们探讨了区块链的特征,这些区块链将使机构能够将**传统银行**和**融资系统**转换和交织在一起。这部分将探讨**房地产区块链**。房地产业正在走向革命。它是人类已知的交易最活跃、最重要的资产类别之一。然而,由于充满了监管障碍和欺诈、欺骗的无数可能性,它也是最难参与交易的之一。利用适当的共识算法的区块链的分布式分类账本功能被吹捧为这个行业的前进方向,而这个行业传统上被认为其面对变革是保守的。 + +就其无数的业务而言,房地产一直是一个非常保守的行业。这似乎也是理所当然的。2008 年金融危机或 20 世纪上半叶的大萧条等重大经济危机成功摧毁了该行业及其参与者。然而,与大多数具有经济价值的产品一样,房地产行业具有弹性,而这种弹性则源于其保守性。 + +全球房地产市场由价值 228 万亿 [^1] 美元的资产类别组成,出入不大。其他投资资产,如股票、债券和股票合计价值仅为 170 万亿美元。显然,在这样一个行业中实施的交易在很大程度上都是精心策划和执行的。很多时候,房地产也因许多欺诈事件而臭名昭著,并且随之而来的是毁灭性的损失。由于其运营非常保守,该行业也难以驾驭。它受到了法律的严格监管,创造了一个交织在一起的细微差别网络,这对于普通人来说太难以完全理解,使得大多数人无法进入和参与。如果你曾参与过这样的交易,那么你就会知道纸质文件的重要性和长期性。 + +从一个微不足道的开始,虽然是一个重要的例子,以显示当前的记录管理实践在房地产行业有多糟糕,考虑一下[产权保险业务][2] [^3]。产权保险用于对冲土地所有权和所有权记录不可接受且从而无法执行的可能性。诸如此类的保险产品也称为赔偿保险。在许多情况下,法律要求财产拥有产权保险,特别是在处理多年来多次易手的财产时。抵押贷款公司在支持房地产交易时也可能坚持同样的要求。事实上,这种产品自 19 世纪 50 年代就已存在,并且仅在美国每年至少有 1.5 万亿美元的商业价值这一事实证明了一开始的说法。在这种情况下,这些记录的维护方式必须进行改革,区块链提供了一个可持续解决方案。根据[美国土地产权协会][4],平均每个案例的欺诈平均约为 10 万美元,并且涉及交易的所有产权中有 25% 的文件存在问题。区块链允许设置一个不可变的永久数据库,该数据库将跟踪资产本身,记录已经进入的每个交易或投资。这样的分类帐本系统将使包括一次性购房者在内的房地产行业的每个人的生活更加轻松,并使诸如产权保险等金融产品基本上无关紧要。将诸如房地产之类的实物资产转换为这样的数字资产是非常规的,并且目前仅在理论上存在。然而,这种变化迫在眉睫,而不是迟到 [^5]。 + +区块链在房地产中影响最大的领域如上所述,在维护透明和安全的产权管理系统方面。基于区块链的财产记录可以包含有关财产、其所在地、所有权历史以及相关的公共记录的[信息][6]。这将允许房地产交易快速完成,并且无需第三方监控和监督。房地产评估和税收计算等任务成为有形的、客观的参数问题,而不是主观测量和猜测,因为可靠的历史数据是可公开验证的。[UBITQUITY][7] 就是这样一个平台,为企业客户提供定制的基于区块链的解决方案。该平台允许客户跟踪所有房产细节、付款记录、抵押记录,甚至允许运行智能合约,自动处理税收和租赁。 + +这为我们带来了房地产区块链的第二大机遇和用例。由于该行业受到众多第三方的高度监管,除了参与交易的交易对手外,尽职调查和财务评估可能非常耗时。这些流程主要通过离线渠道进行,文书工作需要在最终评估报告出来之前进行数天。对于公司房地产交易尤其如此,这构成了顾问所收取的总计费时间的大部分。如果交易由抵押背书,则这些过程的重复是不可避免的。一旦与所涉及的人员和机构的数字身份相结合,就可以完全避免当前的低效率,并且可以在几秒钟内完成交易。租户、投资者、相关机构、顾问等可以单独验证数据并达成一致的共识,从而验证永久性的财产记录 [^8]。这提高了验证流程的准确性。房地产巨头 RE/MAX 最近宣布与服务提供商 XYO Network Partners 合作,[建立墨西哥房上市地产国家数据库][9]。他们希望有朝一日能够创建世界上最大的(截至目前)去中心化房地产登记中心之一。 + +然而,区块链可以带来的另一个重要且可以说是非常民主的变化是投资房地产。与其他投资资产类别不同,即使是小型家庭投资者也可能参与其中,房地产通常需要大量的手工付款才能参与。诸如 ATLANT 和 BitOfProperty 之类的公司将房产的账面价值代币化,并将其转换为加密货币的等价物。这些代币随后在交易所出售,类似于股票和股票的交易方式。[房地产后续产生的任何现金流都会根据其在财产中的“份额”记入贷方或借记给代币所有者][4]。 + +然而,尽管如此,区块链技术仍处于房地产领域的早期采用阶段,目前的法规还没有明确定义它。诸如分布式应用程序、分布式匿名组织(DAO)、智能合约等概念在许多国家的法律领域是闻所未闻的。一旦所有利益相关者充分接受了区块链复杂性的良好教育,就会彻底改革现有的法规和指导方针,这是最务实的前进方式。 同样,这将是一个缓慢而渐进的变化,但是它是一个急需的变化。本系列的下一篇文章将介绍 “智能合约”,例如由 UBITQUITY 和 XYO 等公司实施的那些是如何在区块链中创建和执行的。 + +[^1]: HSBC, “Global Real Estate,” no. April, 2008 +[^3]: D. B. Burke, Law of title insurance. Aspen Law & Business, 2000. +[^5]: M. Swan, O’Reilly – Blockchain. Blueprint for a New Economy – 2015. +[^8]: Deloite, “Blockchain in commercial real estate The future is here ! Table of contents.” + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ + +作者:[ostechnix][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10689-1.html +[2]: https://www.forbes.com/sites/jordanlulich/2018/06/21/what-is-title-insurance-and-why-its-important/#1472022b12bb +[4]: https://www.cbinsights.com/research/blockchain-real-estate-disruption/#financing +[6]: https://www2.deloitte.com/us/en/pages/financial-services/articles/blockchain-in-commercial-real-estate.html +[7]: https://www.ubitquity.io/ +[9]: https://www.businesswire.com/news/home/20181012005068/en/XYO-Network-Partners-REMAX-M%C3%A9xico-Bring-Blockchain diff --git a/published/201905/20190327 Why DevOps is the most important tech strategy today.md b/published/201905/20190327 Why DevOps is the most important tech strategy today.md new file mode 100644 index 0000000000..d96ae31f13 --- /dev/null +++ b/published/201905/20190327 Why DevOps is the most important tech strategy today.md @@ -0,0 +1,123 @@ +[#]: collector: "lujun9972" +[#]: translator: "zgj1024" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10834-1.html" +[#]: subject: "Why DevOps is the most important tech strategy today" +[#]: via: "https://opensource.com/article/19/3/devops-most-important-tech-strategy" +[#]: author: "Kelly Albrecht https://opensource.com/users/ksalbrecht" + +为何 DevOps 是如今最重要的技术策略 +====== + +> 消除一些关于 DevOps 的疑惑。 + +![CICD with gears][1] + +很多人初学 [DevOps][2] 时,看到它其中一个结果就问这个是如何得来的。其实理解这部分 Devops 的怎样实现并不重要,重要的是——理解(使用) DevOps 策略的原因——这是做一个行业的领导者还是追随者的差别。 + +你可能会听过些 Devops 的难以置信的成果,例如生产环境非常有弹性,就算是有个“[癫狂的猴子][3]Chaos Monkey)跳来跳去将不知道哪个插头随便拔下,每天仍可以处理数千个发布。这是令人印象深刻的,但就其本身而言,这是一个 DevOps 的证据不足的案例,其本质上会被一个[反例][4]困扰:DevOps 环境有弹性是因为严重的故障还没有被观测到。 + +有很多关于 DevOps 的疑惑,并且许多人还在尝试弄清楚它的意义。下面是来自我 LinkedIn Feed 中的某个人的一个案例: + +> 最近我参加一些 #DevOps 的交流会,那里一些演讲人好像在倡导 #敏捷开发是 DevOps 的子集。不知为何,我的理解恰恰相反。 +> +> 能听一下你们的想法吗?你认为敏捷开发和 DevOps 之间是什么关系呢? +> +> 1. DevOps 是敏捷开发的子集 +> 2. 敏捷开发是 DevOps 的子集 +> 3. DevOps 是敏捷开发的扩展,从敏捷开发结束的地方开始 +> 4. DevOps 是敏捷开发的新版本 + +科技行业的专业人士在那篇 LinkedIn 的帖子上表达了各种各样的答案,你会怎样回复呢? + +### DevOps 源于精益和敏捷 + +如果我们从亨利福特的战略和丰田生产系统对福特车型的改进(的历史)开始, DevOps 就更有意义了。精益制造就诞生在那段历史中,人们对精益制作进行了良好的研究。James P. Womack 和 Daniel T. Jones 将精益思维([Lean Thinking][5])提炼为五个原则: + + 1. 指明客户所需的价值 + 2. 确定提供该价值的每个产品的价值流,并对当前提供该价值所需的所有浪费步骤提起挑战 + 3. 使产品通过剩余的增值步骤持续流动 + 4. 在可以连续流动的所有步骤之间引入拉力 + 5. 管理要尽善尽美,以便为客户服务所需的步骤数量和时间以及信息量持续下降 + +精益致力于持续消除浪费并增加客户的价值流动。这很容易识别并明白精益的核心原则:单一流。我们可以做一些游戏去了解为何同一时间移动单个比批量移动要快得多。其中的两个游戏是[硬币游戏][6]和[飞机游戏][7]。在硬币游戏中,如果一批 20 个硬币到顾客手中要用 2 分钟,顾客等 2 分钟后能拿到整批硬币。如果一次只移动一个硬币,顾客会在 5 秒内得到第一枚硬币,并会持续获得硬币,直到在大约 25 秒后第 20 个硬币到达。(LCTT 译注:有相关的视频的) + +这是巨大的不同,但是不是生活中的所有事都像硬币游戏那样简单并可预测的。这就是敏捷的出现的原因。我们当然看到了高效绩敏捷团队的精益原则,但这些团队需要的不仅仅是精益去做他们要做的事。 + +为了能够处理典型的软件开发任务的不可预见性和变化,敏捷开发的方法论会将重点放在意识、审议、决策和行动上,以便在不断变化的现实中调整。例如,敏捷框架(如 srcum)通过每日站立会议和冲刺评审会议等仪式提高意识。如果 scrum 团队意识到新的事实,框架允许并鼓励他们在必要时及时调整路线。 + +要使团队做出这些类型的决策,他们需要高度信任的环境中的自我组织能力。以这种方式工作的高效绩敏捷团队在不断调整的同时实现快速的价值流,消除错误方向上的浪费。 + +### 最佳批量大小 + +要了解 DevOps 在软件开发中的强大功能,这会帮助我们理解批处理大小的经济学。请考虑以下来自Donald Reinertsen 的[产品开发流程原则][8]的U曲线优化示例: + +![U-curve optimization illustration of optimal batch size][9] + +这可以类比杂货店购物来解释。假设你需要买一些鸡蛋,而你住的地方离商店只有 30 分钟的路程。买一个鸡蛋(图中最左边)意味着每次要花 30 分钟的路程,这就是你的*交易成本*。*持有成本*可能是鸡蛋变质和在你的冰箱中持续地占用空间。*总成本*是*交易成本*加上你的*持有成本*。这个 U 型曲线解释了为什么对大部分人来说,一次买一打鸡蛋是他们的*最佳批量大小*。如果你就住在商店的旁边,步行到那里不会花费你任何的时候,你可能每次只会买一小盒鸡蛋,以此来节省冰箱的空间并享受新鲜的鸡蛋。 + +这 U 型优化曲线可以说明为什么在成功的敏捷转换中生产力会显著提高。考虑敏捷转换对组织决策的影响。在传统的分级组织中,决策权是集中的。这会导致较少的人做更大的决策。敏捷方法论会有效地降低组织决策中的交易成本,方法是将决策分散到最被人熟知的认识和信息的位置:跨越高度信任,自组织的敏捷团队。 + +下面的动画演示了降低事务成本后,最佳批量大小是如何向左移动。在更频繁地做出更快的决策方面,你不能低估组织的价值。 + +![U-curve optimization illustration][10] + +### DevOps 适合哪些地方 + +自动化是 DevOps 最知名的事情之一。前面的插图非常详细地展示了自动化的价值。通过自动化,我们将交易成本降低到接近于零,实质上是可以免费进行测试和部署。这使我们可以利用越来越小的批量工作。较小批量的工作更容易理解、提交、测试、审查和知道何时能完成。这些较小的批量大小也包含较少的差异和风险,使其更易于部署,如果出现问题,可以进行故障排除和恢复。通过自动化与扎实的敏捷实践相结合,我们可以使我们的功能开发非常接近单件流程,从而快速、持续地为客户提供价值。 + +更传统地说,DevOps 被理解为一种打破开发团队和运营团队之间混乱局面的方法。在这个模型中,开发团队开发新的功能,而运营团队则保持系统的稳定和平稳运行。摩擦的发生是因为开发过程中的新功能将更改引入到系统中,从而增加了停机的风险,运营团队并不认为要对此负责,但无论如何都必须处理这一问题。DevOps 不仅仅尝试让人们一起工作,更重要的是尝试在复杂的环境中安全地进行更频繁的更改。 + +我们可以看看 [Ron Westrum][11] 在有关复杂组织中实现安全性的研究。在研究为什么有些组织比其他组织更安全时,他发现组织的文化可以预测其安全性。他确定了三种文化:病态的、官僚主义的和生产式的。他发现病态的可以预测其安全性较低,而生产式文化被预测为更安全(例如,在他的主要研究领域中,飞机坠毁或意外住院死亡的数量要少得多)。 + +![Three types of culture identified by Ron Westrum][12] + +高效的 DevOps 团队通过精益和敏捷的实践实现了一种生成性文化,这表明速度和安全性是互补的,或者说是同一个问题的两个方面。通过将决策和功能的最佳批量大小减少到非常小,DevOps 实现了更快的信息流和价值,同时消除了浪费并降低了风险。 + +与 Westrum 的研究一致,在提高安全性和可靠性的同时,变化也很容易发生。当一个敏捷的 DevOps 团队被信任做出自己的决定时,我们将获得 DevOps 目前最为人所知的工具和技术:自动化和持续交付。通过这种自动化,交易成本比以往任何时候都进一步降低,并且实现了近乎单一的精益流程,每天创造数千个决策和发布的潜力,正如我们在高效绩的 DevOps 组织中看到的那样 + +### 流动、反馈、学习 + +DevOps 并不止于此。我们主要讨论了 DevOps 实现了革命性的流程,但通过类似的努力可以进一步放大精益和敏捷实践,从而实现更快的反馈循环和更快的学习。在[DevOps手册][13] 中,作者除了详细解释快速流程外, DevOps 如何在整个价值流中实现遥测,从而获得快速且持续的反馈。此外,利用[精益求精的突破][14]和 scrum 的[回顾][15],高效的 DevOps 团队将不断推动学习和持续改进深入到他们的组织的基础,实现软件产品开发行业的精益制造革命。 + +### 从 DevOps 评估开始 + +利用 DevOps 的第一步是,经过大量研究或在 DevOps 顾问和教练的帮助下,对高效绩 DevOps 团队中始终存在的一系列维度进行评估。评估应确定需要改进的薄弱或不存在的团队规范。对评估的结果进行评估,以找到具有高成功机会的快速获胜焦点领域,从而产生高影响力的改进。快速获胜非常重要,能让团队获取解决更具挑战性领域所需的动力。团队应该产生可以快速尝试的想法,并开始关注 DevOps 转型。 + +一段时间后,团队应重新评估相同的维度,以衡量改进并确立新的高影响力重点领域,并再次采纳团队的新想法。一位好的教练将根据需要进行咨询、培训、指导和支持,直到团队拥有自己的持续改进方案,并通过不断地重新评估、试验和学习,在所有维度上实现近乎一致。 + +在本文的[第二部分][16]中,我们将查看 Drupal 社区中 DevOps 调查的结果,并了解最有可能找到快速获胜的位置。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/devops-most-important-tech-strategy + +作者:[Kelly Albrecht][a] +选题:[lujun9972][b] +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc "CICD with gears" +[2]: https://opensource.com/resources/devops +[3]: https://github.com/Netflix/chaosmonkey +[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative +[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[6]: https://youtu.be/5t6GhcvKB8o?t=54 +[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ +[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 +[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif "U-curve optimization illustration of optimal batch size" +[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif "U-curve optimization illustration" +[11]: https://en.wikipedia.org/wiki/Ron_Westrum +[12]: https://opensource.com/sites/default/files/uploads/information_flow.png "Three types of culture identified by Ron Westrum" +[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 +[14]: https://en.wikipedia.org/wiki/Kaizen +[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective +[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption +[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what +[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started +[19]: https://events.drupal.org/seattle2019 diff --git a/published/201905/20190329 How to manage your Linux environment.md b/published/201905/20190329 How to manage your Linux environment.md new file mode 100644 index 0000000000..0a226f79f7 --- /dev/null +++ b/published/201905/20190329 How to manage your Linux environment.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10916-1.html) +[#]: subject: (How to manage your Linux environment) +[#]: via: (https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何管理你的 Linux 环境变量 +====== + +> Linux 用户环境变量可以帮助你找到你需要的命令,无须了解系统如何配置的细节而完成大量工作。而这些设置来自哪里和如何被修改它们是另一个话题。 + +![IIP Photo Archive \(CC BY 2.0\)][1] + +在 Linux 系统上的用户账户配置以多种方法简化了系统的使用。你可以运行命令,而不需要知道它们的位置。你可以重新使用先前运行的命令,而不用发愁系统是如何追踪到它们的。你可以查看你的电子邮件,查看手册页,并容易地回到你的家目录,而不用管你在文件系统中身在何方。并且,当需要的时候,你可以调整你的账户设置,以便其更符合你喜欢的方式。 + +Linux 环境设置来自一系列的文件:一些是系统范围(意味着它们影响所有用户账户),一些是处于你的家目录中的配置文件里。系统范围的设置在你登录时生效,而本地设置在其后生效,所以,你在你账户中作出的更改将覆盖系统范围设置。对于 bash 用户,这些文件包含这些系统文件: + +``` +/etc/environment +/etc/bash.bashrc +/etc/profile +``` + +以及一些本地文件: + +``` +~/.bashrc +~/.profile # 如果有 ~/.bash_profile 或 ~/.bash_login 就不会读此文件 +~/.bash_profile +~/.bash_login +``` + +你可以修改本地存在的四个文件的任何一个,因为它们处于你的家目录,并且它们是属于你的。 + +### 查看你的 Linux 环境设置 + +为查看你的环境设置,使用 `env` 命令。你的输出将可能与这相似: + +``` +$ env +LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33; +01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32: +*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31: +*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31: +*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01; +31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31: +*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31: +*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31: +*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35: +*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35: +*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35: +*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35: +*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35: +*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35: +*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35: +*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36: +*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36: +*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.spf=00;36: +SSH_CONNECTION=192.168.0.21 34975 192.168.0.11 22 +LESSCLOSE=/usr/bin/lesspipe %s %s +LANG=en_US.UTF-8 +OLDPWD=/home/shs +XDG_SESSION_ID=2253 +USER=shs +PWD=/home/shs +HOME=/home/shs +SSH_CLIENT=192.168.0.21 34975 22 +XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop +SSH_TTY=/dev/pts/0 +MAIL=/var/mail/shs +TERM=xterm +SHELL=/bin/bash +SHLVL=1 +LOGNAME=shs +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +XDG_RUNTIME_DIR=/run/user/1000 +PATH=/home/shs/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin +LESSOPEN=| /usr/bin/lesspipe %s +_=/usr/bin/env +``` + +虽然你可能会看到大量的输出,上面显示的第一大部分用于在命令行上使用颜色标识各种文件类型。当你看到类似 `*.tar=01;31:` 这样的东西,这告诉你 `tar` 文件将以红色显示在文件列表中,然而 `*.jpg=01;35:` 告诉你 jpg 文件将以紫色显现出来。这些颜色旨在使它易于从一个文件列表中分辨出某些文件。你可以在《[在 Linux 命令行中自定义你的颜色][3]》处学习更多关于这些颜色的定义,和如何自定义它们。 + +当你更喜欢一种不加装饰的显示时,一种关闭颜色显示的简单方法是使用如下命令: + +``` +$ ls -l --color=never +``` + +这个命令可以简单地转换到一个别名: + +``` +$ alias ll2='ls -l --color=never' +``` + +你也可以使用 `echo` 命令来单独地显现某个设置。在这个命令中,我们显示在历史缓存区中将被记忆命令的数量: + +``` +$ echo $HISTSIZE +1000 +``` + +如果你已经移动到某个位置,你在文件系统中的最后位置会被记在这里: + +``` +PWD=/home/shs +OLDPWD=/tmp +``` + +### 作出更改 + +你可以使用一个像这样的命令更改环境设置,但是,如果你希望保持这个设置,在你的 `~/.bashrc` 文件中添加一行代码,例如 `HISTSIZE=1234`。 + +``` +$ export HISTSIZE=1234 +``` + +### “export” 一个变量的本意是什么 + +导出一个环境变量可使设置用于你的 shell 和可能的子 shell。默认情况下,用户定义的变量是本地的,并不被导出到新的进程,例如,子 shell 和脚本。`export` 命令使得环境变量可用在子进程中发挥功用。 + +### 添加和移除变量 + +你可以很容易地在命令行和子 shell 上创建新的变量,并使它们可用。然而,当你登出并再次回来时这些变量将消失,除非你也将它们添加到 `~/.bashrc` 或一个类似的文件中。 + +``` +$ export MSG="Hello, World!" +``` + +如果你需要,你可以使用 `unset` 命令来消除一个变量: + +``` +$ unset MSG +``` + +如果变量是局部定义的,你可以通过加载你的启动文件来简单地将其设置回来。例如: + +``` +$ echo $MSG +Hello, World! +$ unset $MSG +$ echo $MSG + +$ . ~/.bashrc +$ echo $MSG +Hello, World! +``` + +### 小结 + +用户账户是用一组恰当的启动文件设立的,创建了一个有用的用户环境,而个人用户和系统管理员都可以通过编辑他们的个人设置文件(对于用户)或很多来自设置起源的文件(对于系统管理员)来更改默认设置。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html + +作者:[Sandra Henry-Stocker][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.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/environment-rocks-leaves-100792229-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.networkworld.com/article/3269587/customizing-your-text-colors-on-the-linux-command-line.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/201905/20190401 What is 5G- How is it better than 4G.md b/published/201905/20190401 What is 5G- How is it better than 4G.md new file mode 100644 index 0000000000..a54eadbd7b --- /dev/null +++ b/published/201905/20190401 What is 5G- How is it better than 4G.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10812-1.html) +[#]: subject: (What is 5G? How is it better than 4G?) +[#]: via: (https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html#tk.rss_all) +[#]: author: (Josh Fruhlinger https://www.networkworld.com/author/Josh-Fruhlinger/) + +什么是 5G?它比 4G 好在哪里? +========================== + +> 5G 网络将使无线网络吞吐量提高 10 倍并且能够替代有线宽带。但是它们什么时候能够投入使用呢,为什么 5G 和物联网如此紧密地联系在一起呢? + +![Thinkstock][1] + +[5G 无线][2] 是一个概括的术语,用来描述一系列更快的无线互联网的标准和技术,理论上比 4G 快了 20 倍并且延迟降低了 120 倍,为物联网的发展和对新的高带宽应用的支持奠定了基础。 + +### 什么是 5G?科技还是流行词? + +这个技术在世界范围内完全发挥它的潜能还需要数年时间,但同时当今一些 5G 网络服务已经投入使用。5G 不仅是一个技术术语,也是一个营销术语,并不是市场上的所有 5G 服务是标准的。 + +- [来自世界移动大会:[5G 时代即将来到][3]] + +### 5G 与 4G 的速度对比 + +无线技术的每一代,最大的呼吁是增加速度。5G 网络潜在的峰值下载速度可以达到[20 Gbps,一般在 10 Gbps][4]。这不仅仅比当前 4G 网络更快,4G 目前峰值大约 1 Gbps,并且比更多家庭的有线网络连接更快。5G 提供的网络速度能够与光纤一较高下。 + +吞吐量不是 5G 仅有的速度提升;它还有的特点是极大降低了网络延迟。这是一个重要的区分:吞吐量用来测量花费多久来下载一个大文件,而延迟由网络瓶颈决定,延迟在往返的通讯中减慢了响应速度。 + +延迟很难量化,因为它因各种网络状态变化而变化,但是 5G 网络在理想情况下有能力使延迟率在 1 ms 内。总的来说,5G 延迟将比 4G 降低 60 到 120 倍。这会使很多应用变得可能,例如当前虚拟现实的延迟使它变得不实际。 + +### 5G 技术 + +5G 技术的基础有一系列标准定义,在过去的 10 年里一直在研究更好的部分。这些里面最重要的是 5G New Radio(5G NR),由 3GPP(一个为移动电话开发协议的标准化组织)组织标准化。5G NR 规定了很多 5G 设备操作的方式,[于 2018 年 7 月 完成终版][5]。 + +很多独特的技术同时出现来尽可能地提升 5G 的速度并降低延迟,下面是一些重要的。 + +### 毫米波 + +5G 网络大部分使用在 30 到 300 GHz 范围的频率。(正如名称一样,这些频率的波长在 1 到 10 毫米之间)这些高频范围能够[在每个时间单元比低频信号携带更多的信息][7],4G LTE 当前使用的就是通常频率在 1 GHz 以下的低频信号,或者 WiFi,最高 6 GHz。 + +毫米波技术传统上是昂贵并且难于部署的。科技进步已经克服了这些困难,这也是 5G 在如今成为了可能的原因。 + +### 小蜂窝 + +毫米波传输的一个缺点是当它们传输通过物理对象的时候比 4G 或 WiFi 信号更容易被干扰。 + +为了克服这些,5G 基础设施的模型将不同于 4G。替代了大的像景观一样移动天线桅杆,5G 网络将由[分布在城市中大概间距 250 米的更小的基站][8]提供支持,创建更小的服务区域。 + +这些 5G 基站的功率要求低于 4G,并且可以更容易地连接到建筑物和电线杆上。 + +### 大量的 MIMO + +尽管 5G 基站比 4G 的对应部分小多了,但它们却带了更多的天线。这些天线是[多输入多输出的(MIMO)][9],意味着在相同的数据信道能够同时处理多个双向会话。5G 网络能够处理比 4G 网络超过 20 倍的会话。 + +大量的 MIMO 保证了[基站容量限制下的极大提升][10],允许单个基站承载更多的设备会话。这就是 5G 可能推动物联网更广泛应用的原因。理论上,更多的连接到互联网的无线设备能够部署在相同的空间而不会使网络被压垮。 + +### 波束成形 + +确保所有的会话来回地到达正确的地方是比较棘手的,尤其是前面提到的毫米波信号的干涉问题。为了克服这些问题,5G 基站部署了更高级的波束技术,使用建设性和破坏性的无线电干扰来使信号有向而不是广播。这在一个特定的方向上有效地加强了信号强度和范围。 + +### 5G 可获得性 + +第一个 5G 商用网络 [2018 年 5 月在卡塔尔推出][12]。自那以后,5G 网络已经扩展到全世界,从阿根廷到越南。[Lifewire 有一个不错的,经常更新的列表][13]. + +牢记一点的是,尽管这样,目前不是所有的 5G 网络都履行了所有的技术承诺。一些早期的 5G 产品依赖于现有的 4G 基础设施,减少了可以获得的潜在速度;其它服务为了市场目的而标榜 5G 但是并不符合标准。仔细观察美国无线运营商的产品都会发现一些陷阱。 + +### 无线运营商和 5G + +技术上讲,5G 服务如今在美国已经可获得了。但声明中包含的注意事项因运营商而异,表明 5G 普及之前还有很长的路要走。 + +Verizon 可能是早期 5G 最大的推动者。它宣告到 2018 年 10 月 将有 4 个城市成为 [5G 家庭][14]的一部分,这是一项需要你的其他设备通过 WiFi 来连接特定的 5G 热点,由热点连接到网络的服务。 + +Verizon 计划四月在 [Minneapolis 和 Chicago 发布 5G 移动服务][15],该服务将在这一年内传播到其他城市。访问 5G 网络将需要消费者每月额外花费费用,加上购买能够实际访问 5G 的手机花费(稍后会详细介绍)。另外,Verizon 的部署被称作 [5G TF][16],实际上不符合 5G NR 的标准。 + +AT&T [声明在 2018 年 12 月将有美国的 12 个城市可以使用 5G][17],在 2019 年的末尾将增加 9 个城市,但最终在这些城市里,只有市中心商业区能够访问。为了访问 5G 网络,需要一个特定的 Netgear 热点来连接到 5G 服务,然后为手机和其他设备提供一个 Wi-Fi 信号。 + +与此同时,AT&T 也在推出 4G 网络的速度提升计划,被成为 5GE,即使这些提升和 5G 网络没有关系。([这会向后兼容][18]) + +Sprint 将在 2019 年 5 月之前在四个城市提供 5G 服务,在年末将有更多。但是 Sprint 的 5G 产品充分利用了 MIMO 单元,他们[没有使用毫米波信道][19],意味着 Sprint 的用户不会看到像其他运营商一样的速度提升。 + +T-Mobile 采用相似的模型,它[在 2019 年年底之前不会推出 5G 服务][20],因为他们没有手机能够连接到它。 + +一个可能阻止 5G 速度的迅速传播的障碍是需要铺开所有这些小蜂窝基站。它们小的尺寸和较低的功耗需求使它们技术上比 4G 技术更容易部署,但这不意味着它能够很简单的使政府和财产拥有者信服到处安装一堆基站。Verizon 实际上建立了[向本地民选官员请愿的网站][21]来加速 5G 基站的部署。 + +### 5G 手机:何时可获得?何时可以买? + +第一部声称为 5G 手机的是 Samsung Galaxy S10 5G,将在 2019 年夏末首发。你也可以从 Verizon 订阅一个“[Moto Mod][22]”,用来[转换 Moto Z3 手机为 5G 兼容设备][23]。 + +但是除非你不能忍受作为一个早期使用者的诱惑,你会希望再等待一下;一些关于运营商的奇怪和突显的问题意味着可能你的手机[不兼容你的运营商的整个 5G 网络][24]。 + +一个可能令你吃惊的落后者是苹果:分析者确信最早直到 2020 年以前 iPhone 不会与 5G 兼容。但这符合该公司的特点;苹果在 2012 年末也落后于三星发布兼容 4G 的手机。 + +不可否认,5G 洪流已经到来。5G 兼容的设备[在 2019 年统治了巴塞罗那世界移动大会][3],因此期待视野里有更多的选择。 + +### 为什么人们已经在讨论 6G 了? + +一些专家说缺点是[5G 不能够达到延迟和可靠性的目标][27]。这些完美主义者已经在探寻 6G,来试图解决这些缺点。 + +有一个[研究新的能够融入 6G 技术的小组][28],自称为“融合 TeraHertz 通信与传感中心”(ComSenTer)。根据说明,他们努力让每个设备的带宽达到 100Gbps。 + +除了增加可靠性,还突破了可靠性并增加速度,6G 同样试图允许上千的并发连接。如果成功的话,这个特点将帮助物联网设备联网,使在工业设置中部署上千个传感器。 + +即使仍在胚胎当中,6G 已经由于新发现的 [在基于 tera-hretz 的网络中潜在的中间人攻击][29]的紧迫性面临安全的考虑。好消息是有大量时间来解决这个问题。6G 网络直到 2030 之前才可能出现。 + +阅读更多关于 5G 网络: + + * [企业如何为 5G 网络做准备][30] + * [5G 与 4G:速度、延迟和应用支持的差异][31] + * [私人 5G 网络即将到来][32] + * [5G 和 6G 无线存在安全问题][33] + * [毫米波无线技术如何支持 5G 和物联网][34] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html + +作者:[Josh Fruhlinger][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Josh-Fruhlinger/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/5g-100718139-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://www.theverge.com/2018/6/15/17467734/5g-nr-standard-3gpp-standalone-finished +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3291323/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[8]: https://spectrum.ieee.org/video/telecom/wireless/5g-bytes-small-cells-explained +[9]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html +[10]: https://spectrum.ieee.org/tech-talk/telecom/wireless/5g-researchers-achieve-new-spectrum-efficiency-record +[11]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[12]: https://venturebeat.com/2018/05/14/worlds-first-commercial-5g-network-launches-in-qatar/ +[13]: https://www.lifewire.com/5g-availability-world-4156244 +[14]: https://www.digitaltrends.com/computing/verizon-5g-home-promises-up-to-gigabit-internet-speeds-for-50/ +[15]: https://lifehacker.com/heres-your-cheat-sheet-for-verizons-new-5g-data-plans-1833278817 +[16]: https://www.theverge.com/2018/10/2/17927712/verizon-5g-home-internet-real-speed-meaning +[17]: https://www.cnn.com/2018/12/18/tech/5g-mobile-att/index.html +[18]: https://www.networkworld.com/article/3339720/like-4g-before-it-5g-is-being-hyped.html?nsdr=true +[19]: https://www.digitaltrends.com/mobile/sprint-5g-rollout/ +[20]: https://www.cnet.com/news/t-mobile-delays-full-600-mhz-5g-launch-until-second-half/ +[21]: https://lets5g.com/ +[22]: https://www.verizonwireless.com/support/5g-moto-mod-faqs/?AID=11365093&SID=100098X1555750Xbc2e857934b22ebca1a0570d5ba93b7c&vendorid=CJM&PUBID=7105813&cjevent=2e2150cb478c11e98183013b0a1c0e0c +[23]: https://www.digitaltrends.com/cell-phone-reviews/moto-z3-review/ +[24]: https://www.businessinsider.com/samsung-galaxy-s10-5g-which-us-cities-have-5g-networks-2019-2 +[25]: https://www.cnet.com/news/why-apples-in-no-rush-to-sell-you-a-5g-iphone/ +[26]: https://mashable.com/2012/09/09/iphone-5-4g-lte/#hYyQUelYo8qq +[27]: https://www.networkworld.com/article/3305359/6g-will-achieve-terabits-per-second-speeds.html +[28]: https://www.networkworld.com/article/3285112/get-ready-for-upcoming-6g-wireless-too.html +[29]: https://www.networkworld.com/article/3315626/5g-and-6g-wireless-technologies-have-security-issues.html +[30]: https://%20https//www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[31]: https://%20https//www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[32]: https://%20https//www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[33]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[34]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[35]: https://www.facebook.com/NetworkWorld/ +[36]: https://www.linkedin.com/company/network-world + diff --git a/published/201905/20190405 Command line quick tips- Cutting content out of files.md b/published/201905/20190405 Command line quick tips- Cutting content out of files.md new file mode 100644 index 0000000000..a1b5ae3893 --- /dev/null +++ b/published/201905/20190405 Command line quick tips- Cutting content out of files.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10809-1.html) +[#]: subject: (Command line quick tips: Cutting content out of files) +[#]: via: (https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +命令行技巧:分割文件内容 +====== + +![][1] + +Fedora 发行版是一个功能齐全的操作系统,有出色的图形化桌面环境。用户可以很容易地通过单击动作来完成任何典型任务。所有这些美妙的易用性掩盖了其底层强大的命令行细节。本文是向你展示一些常见命令行实用程序的系列文章的一部分。让我们进入 shell 来看看 `cut`。 + +通常,当你在命令行中工作时,你处理的是文本文件。有时这些文件可能很长,虽然可以完整地阅读它们,但是可能会耗费大量时间,并且容易出错。在本文中,你将学习如何从文本文件中提取内容,并从中获取你所需的信息。 + +重要的是要意识到,在 Fedora 中有许多方法可以完成类似的命令行任务。例如,Fedora 仓库含有用于解析和处理文本的完整语言系统。此外,还有多个命令行实用程序可用于 shell 中任何可能的用途。本文只关注使用其中几个实用程序选项,从文件中提取一些信息并以可读的格式呈现。 + +### cut 使用 + +为了演示这个例子,在系统上使用一个标准的大文件,如 `/etc/passwd`。正如本系列的前一篇文章所示,你可以执行 `cat` 命令来查看整个文件: + +``` +$ cat /etc/passwd +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +... +``` + +此文件包含系统上所有所有账户的信息。它有一个特定的格式: + +``` +name:password:user-id:group-id:comment:home-directory:shell +``` + +假设你只想要系统上所有账户名的列表,如果你只能从每一行中删除 “name” 值。这就是 `cut` 命令派上用场的地方!它一次处理一行输入,并提取该行的特定部分。 + +`cut` 命令提供了以不同方式选择一行的部分的选项,在本示例中需要两个,`-d` 和 `-f`。`-d` 选项允许你声明用于分隔行中值的分隔符。在本例中,冒号(`:`)用于分隔值。`-f` 选项允许你选择要提取哪些字段值。因此,在本例中,输入的命令是: + +``` +$ cut -d: -f1 /etc/passwd +root +bin +daemon +adm +... +``` + +太棒了,成功了!但是你将输出打印到标准输出,在终端会话中意味着它需要占据屏幕。如果你需要稍后完成另一项任务所需的信息,这该怎么办?如果有办法将 `cut` 命令的输出保存到文本文件中,那就太好了。对于这样的任务,shell 有一个简单的内置功能,重定向功能(`>`)。 + +``` +$ cut -d: -f1 /etc/passwd > names.txt +``` + +这会将 `cut` 的输出放到一个名为 `names.txt` 的文件中,你可以使用 `cat` 来查看它的内容: + +``` +$ cat names.txt +root +bin +daemon +adm +... +``` + +使用两个命令和一个 shell 功能,可以很容易地使用 `cat` 从一个文件进行识别、提取和重定向一些信息,并将其保存到另一个文件以供以后使用。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/command-line-quick-tips-cutting-content-out-of-files/ + +作者:[Stephen Snow][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/commandline-cutting-816x345.jpg +[2]: https://unsplash.com/photos/tA5eSY_hay8?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/search/photos/command-line?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201905/20190408 Getting started with Python-s cryptography library.md b/published/201905/20190408 Getting started with Python-s cryptography library.md new file mode 100644 index 0000000000..bc6aeb05b7 --- /dev/null +++ b/published/201905/20190408 Getting started with Python-s cryptography library.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10833-1.html) +[#]: subject: (Getting started with Python's cryptography library) +[#]: via: (https://opensource.com/article/19/4/cryptography-python) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Python 的加密库入门 +====== + +> 加密你的数据并使其免受攻击者的攻击。 + +![lock on world map][1] + +密码学俱乐部的第一条规则是:永远不要自己*发明*密码系统。密码学俱乐部的第二条规则是:永远不要自己*实现*密码系统:在现实世界中,在*实现*以及设计密码系统阶段都找到过许多漏洞。 + +Python 中的一个有用的基本加密库就叫做 [cryptography][2]。它既是一个“安全”方面的基础库,也是一个“危险”层。“危险”层需要更加小心和相关的知识,并且使用它很容易出现安全漏洞。在这篇介绍性文章中,我们不会涵盖“危险”层中的任何内容! + +cryptography 库中最有用的高级安全功能是一种 Fernet 实现。Fernet 是一种遵循最佳实践的加密缓冲区的标准。它不适用于非常大的文件,如千兆字节以上的文件,因为它要求你一次加载要加密或解密的内容到内存缓冲区中。 + +Fernet 支持对称symmetric(即密钥secret key)加密方式*:加密和解密使用相同的密钥,因此必须保持安全。 + +生成密钥很简单: + +``` +>>> k = fernet.Fernet.generate_key() +>>> type(k) + +``` + +这些字节可以写入有适当权限的文件,最好是在安全的机器上。 + +有了密钥后,加密也很容易: + +``` +>>> frn = fernet.Fernet(k) +>>> encrypted = frn.encrypt(b"x marks the spot") +>>> encrypted[:10] +b'gAAAAABb1' +``` + +如果在你的机器上加密,你会看到略微不同的值。不仅因为(我希望)你生成了和我不同的密钥,而且因为 Fernet 将要加密的值与一些随机生成的缓冲区连接起来。这是我之前提到的“最佳实践”之一:它将阻止对手分辨哪些加密值是相同的,这有时是攻击的重要部分。 + +解密同样简单: + +``` +>>> frn = fernet.Fernet(k) +>>> frn.decrypt(encrypted) +b'x marks the spot' +``` + +请注意,这仅加密和解密*字节串*。为了加密和解密*文本串*,通常需要对它们使用 [UTF-8][3] 进行编码和解码。 + +20 世纪中期密码学最有趣的进展之一是公钥public key加密。它可以在发布加密密钥的同时而让*解密密钥*保持保密。例如,它可用于保存服务器使用的 API 密钥:服务器是唯一可以访问解密密钥的一方,但是任何人都可以保存公共加密密钥。 + +虽然 cryptography 没有任何支持公钥加密的*安全*功能,但 [PyNaCl][4] 库有。PyNaCl 封装并提供了一些很好的方法来使用 Daniel J. Bernstein 发明的 [NaCl][5] 加密系统。 + +NaCl 始终同时加密encrypt签名sign或者同时解密decrypt验证签名verify signature。这是一种防止基于可伸缩性malleability-based的攻击的方法,其中攻击者会修改加密值。 + +加密是使用公钥完成的,而签名是使用密钥完成的: + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> source = PrivateKey.generate() +>>> with open("target.pubkey", "rb") as fpin: +... target_public_key = PublicKey(fpin.read()) +>>> enc_box = Box(source, target_public_key) +>>> result = enc_box.encrypt(b"x marks the spot") +>>> result[:4] +b'\xe2\x1c0\xa4' +``` + +解密颠倒了角色:它需要私钥进行解密,需要公钥验证签名: + +``` +>>> from nacl.public import PrivateKey, PublicKey, Box +>>> with open("source.pubkey", "rb") as fpin: +... source_public_key = PublicKey(fpin.read()) +>>> with open("target.private_key", "rb") as fpin: +... target = PrivateKey(fpin.read()) +>>> dec_box = Box(target, source_public_key) +>>> dec_box.decrypt(result) +b'x marks the spot' +``` + +最后,[PocketProtector][6] 库构建在 PyNaCl 之上,包含完整的密钥管理方案。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/cryptography-python + +作者:[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/security-lock-cloud-safe.png?itok=yj2TFPzq (lock on world map) +[2]: https://cryptography.io/en/latest/ +[3]: https://en.wikipedia.org/wiki/UTF-8 +[4]: https://pynacl.readthedocs.io/en/stable/ +[5]: https://nacl.cr.yp.to/ +[6]: https://github.com/SimpleLegal/pocket_protector/blob/master/USER_GUIDE.md diff --git a/published/201905/20190408 How to quickly deploy, run Linux applications as unikernels.md b/published/201905/20190408 How to quickly deploy, run Linux applications as unikernels.md new file mode 100644 index 0000000000..87753f2a68 --- /dev/null +++ b/published/201905/20190408 How to quickly deploy, run Linux applications as unikernels.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10822-1.html) +[#]: subject: (How to quickly deploy, run Linux applications as unikernels) +[#]: via: (https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何快速部署并作为 unikernel 运行 Linux 应用 +====== + +unikernel 是一种用于在云基础架构上部署应用程序的更小、更快、更安全的方式。使用 NanoVMs OPS,任何人都可以将 Linux 应用程序作为 unikernel 运行而无需额外编码。 + +![Marcho Verch \(CC BY 2.0\)][1] + +随着 unikernel 的出现,构建和部署轻量级应用变得更容易、更可靠。虽然功能有限,但 unikernal 在速度和安全性方面有许多优势。 + +### 什么是 unikernel? + +unikernel 是一种非常特殊的单一地址空间single-address-space的机器镜像,类似于已经主导大批互联网的云应用,但它们相当小并且是单一用途的。它们很轻,只提供所需的资源。它们加载速度非常快,而且安全性更高 —— 攻击面非常有限。单个可执行文件中包含所需的所有驱动、I/O 例程和支持库。其最终生成的虚拟镜像可以无需其它部分就可以引导和运行。它们通常比容器快 10 到 20 倍。 + +潜在的攻击者无法进入 shell 并获得控制权,因为它没有 shell。他们无法获取系统的 `/etc/passwd`或 `/etc/shadow` 文件,因为这些文件不存在。创建一个 unikernel 就像应用将自己变成操作系统。使用 unikernel,应用和操作系统将成为一个单一的实体。你忽略了不需要的东西,从而消除了漏洞并大幅提高性能。 + +简而言之,unikernel: + +* 提供更高的安全性(例如,shell 破解代码无用武之地) +* 比标准云应用占用更小空间 +* 经过高度优化 +* 启动非常快 + +### unikernel 有什么缺点吗? + +unikernel 的唯一严重缺点是你必须构建它们。对于许多开发人员来说,这是一个巨大的进步。由于应用的底层特性,将应用简化为所需的内容然后生成紧凑、平稳运行的应用可能很复杂。在过去,你几乎必须是系统开发人员或底层程序员才能生成它们。 + +### 这是怎么改变的? + +最近(2019 年 3 月 24 日)[NanoVMs][3] 宣布了一个将任何 Linux 应用加载为 unikernel 的工具。使用 NanoVMs OPS,任何人都可以将 Linux 应用作为 unikernel 运行而无需额外编码。该应用还可以更快、更安全地运行,并且成本和开销更低。 + +### 什么是 NanoVMs OPS? + +NanoVMs 是给开发人员的 unikernel 工具。它能让你运行各种企业级软件,但仍然可以非常严格地控制它的运行。 + +使用 OPS 的其他好处包括: + +* 无需经验或知识,开发人员就可以构建 unikernel。 +* 该工具可在笔记本电脑上本地构建和运行 unikernel。 +* 无需创建帐户,只需下载并一个命令即可执行 OPS。 + +NanoVMs 的介绍可以在 [Youtube 上的 NanoVMs 视频][5] 上找到。你还可以查看该公司的 [LinkedIn 页面][6]并在[此处][7]阅读有关 NanoVMs 安全性的信息。 + +还有有关如何[入门][8]的一些信息。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387299/how-to-quickly-deploy-run-linux-applications-as-unikernels.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/corn-kernels-100792925-large.jpg +[3]: https://nanovms.com/ +[5]: https://www.youtube.com/watch?v=VHWDGhuxHPM +[6]: https://www.linkedin.com/company/nanovms/ +[7]: https://nanovms.com/security +[8]: https://nanovms.gitbook.io/ops/getting_started +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/published/201905/20190409 Anbox - Easy Way To Run Android Apps On Linux.md b/published/201905/20190409 Anbox - Easy Way To Run Android Apps On Linux.md new file mode 100644 index 0000000000..d4829d7344 --- /dev/null +++ b/published/201905/20190409 Anbox - Easy Way To Run Android Apps On Linux.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10843-1.html) +[#]: subject: (Anbox – Easy Way To Run Android Apps On Linux) +[#]: via: (https://www.2daygeek.com/anbox-best-android-emulator-for-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Anbox:在 Linux 上运行 Android 应用程序的简单方式 +====== + +Android 模拟器允许我们直接从 Linux 系统上运行我们最喜欢的 Android 应用程序或游戏。对于 Linux 来说,有很多的这样的 Android 模拟器,在过去我们介绍过几个此类应用程序。 + +你可以通过导航到下面的网址回顾它们。 + + * [如何在 Linux 上安装官方 Android 模拟器 (SDK)][1] + * [如何在 Linux 上安装 GenyMotion (Android 模拟器)][2] + +今天我们将讨论 Anbox Android 模拟器。 + +### Anbox 是什么? + +Anbox 是 “Android in a box” 的缩写。Anbox 是一个基于容器的方法,可以在普通的 GNU/Linux 系统上启动完整的 Android 系统。 + +它是现代化的新模拟器之一。 + +Anbox 可以让你在 Linux 系统上运行 Android,而没有虚拟化的迟钝,因为核心的 Android 操作系统已经使用 Linux 命名空间(LXE)放置到容器中了。 + +Android 容器不能直接访问到任何硬件,所有硬件的访问都是通过在主机上的守护进程进行的。 + +每个应用程序将在一个单独窗口打开,就像其它本地系统应用程序一样,并且它可以显示在启动器中。 + +### 如何在 Linux 中安装 Anbox ? + +Anbox 也可作为 snap 软件包安装,请确保你已经在你的系统上启用了 snap 支持。 + +Anbox 软件包最近被添加到 Ubuntu 18.10 (Cosmic) 和 Debian 10 (Buster) 软件仓库。如果你正在运行这些版本,那么你可以轻松地在官方发行版的软件包管理器的帮助下安装。否则可以用 snap 软件包安装。 + +为使 Anbox 工作,确保需要的内核模块已经安装在你的系统中。对于基于 Ubuntu 的用户,使用下面的 PPA 来安装它。 + +``` +$ sudo add-apt-repository ppa:morphis/anbox-support +$ sudo apt update +$ sudo apt install linux-headers-generic anbox-modules-dkms +``` + +在你安装 `anbox-modules-dkms` 软件包后,你必须手动重新加载内核模块,或需要系统重新启动。 + +``` +$ sudo modprobe ashmem_linux +$ sudo modprobe binder_linux +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 anbox。 + +``` +$ sudo apt install anbox +``` + +对于基于 Arch Linux 的系统,我们总是习惯从 AUR 储存库中获取软件包。所以,使用任一个的 [AUR 助手][5] 来安装它。我喜欢使用 [Yay 工具][6]。 + +``` +$ yuk -S anbox-git +``` + +否则,你可以通过导航到下面的文章来 [在 Linux 中安装和配置 snap][7]。如果你已经在你的系统上安装 snap,其它的步骤可以忽略。 + +``` +$ sudo snap install --devmode --beta anbox +``` + +### Anbox 的必要条件 + +默认情况下,Anbox 并没有带有 Google Play Store。因此,我们需要手动下载每个应用程序(APK),并使用 Android 调试桥(ADB)安装它。 + +ADB 工具在大多数的发行版的软件仓库是轻易可获得的,我们可以容易地安装它。 + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或 [APT 命令][4] 来安装 ADB。 + +``` +$ sudo apt install android-tools-adb +``` + +对于 Fedora 系统,使用 [DNF 命令][8] 来安装 ADB。 + +``` +$ sudo dnf install android-tools +``` + +对于基于 Arch Linux 的系统,使用 [Pacman 命令][9] 来安装 ADB。 + +``` +$ sudo pacman -S android-tools +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][10] 来安装 ADB。 + +``` +$ sudo zypper install android-tools +``` + +### 在哪里下载 Android 应用程序? + +既然我们不能使用 Play Store ,你就得从信得过的网站来下载 APK 软件包,像 [APKMirror][11] ,然后手动安装它。 + +### 如何启动 Anbox? + +Anbox 可以从 Dash 启动。这是默认的 Anbox 外貌。 + +![][13] + +### 如何把应用程序推到 Anbox ? + +像我先前所说,我们需要手动安装它。为测试目的,我们将安装 YouTube 和 Firefox 应用程序。 + +首先,你需要启动 ADB 服务。为做到这样,运行下面的命令。 + +``` +$ adb devices +``` + +我们已经下载 YouTube 和 Firefox 应用程序,现在我们将安装。 + +语法格式: + +``` +$ adb install Name-Of-Your-Application.apk +``` + +安装 YouTube 和 Firefox 应用程序: + +``` +$ adb install 'com.google.android.youtube_14.13.54-1413542800_minAPI19(x86_64)(nodpi)_apkmirror.com.apk' +Success + +$ adb install 'org.mozilla.focus_9.0-330191219_minAPI21(x86)(nodpi)_apkmirror.com.apk' +Success +``` + +我已经在我的 Anbox 中安装 YouTube 和 Firefox。查看下面的截图。 + +![][14] + +像我们在文章的开始所说,它将以新的标签页打开任何的应用程序。在这里,我们将打开 Firefox ,并访问 [2daygeek.com][15] 网站。 + +![][16] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/anbox-best-android-emulator-for-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/install-configure-sdk-android-emulator-on-linux/ +[2]: https://www.2daygeek.com/install-genymotion-android-emulator-on-ubuntu-debian-fedora-arch-linux/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/category/aur-helper/ +[6]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[7]: https://www.2daygeek.com/linux-snap-package-manager-ubuntu/ +[8]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[11]: https://www.apkmirror.com/ +[12]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[13]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-1.jpg +[14]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-2.jpg +[15]: https://www.2daygeek.com/ +[16]: https://www.2daygeek.com/wp-content/uploads/2019/04/anbox-best-android-emulator-for-linux-3.jpg diff --git a/published/201905/20190409 How To Install And Configure Chrony As NTP Client.md b/published/201905/20190409 How To Install And Configure Chrony As NTP Client.md new file mode 100644 index 0000000000..cf25d7af66 --- /dev/null +++ b/published/201905/20190409 How To Install And Configure Chrony As NTP Client.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10820-1.html) +[#]: subject: (How To Install And Configure Chrony As NTP Client?) +[#]: via: (https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何安装和配置 Chrony 作为 NTP 客户端? +====== + +NTP 服务器和 NTP 客户端可以让我们通过网络来同步时钟。之前,我们已经撰写了一篇关于 [NTP 服务器和 NTP 客户端的安装与配置][1] 的文章。 + +如果你想看这些内容,点击上述的 URL 访问。 + +### Chrony 客户端 + +Chrony 是 NTP 客户端的替代品。它能以更精确的时间和更快的速度同步时钟,并且它对于那些不是全天候在线的系统非常有用。 + +chronyd 更小、更节能,它占用更少的内存且仅当需要时它才唤醒 CPU。即使网络拥塞较长时间,它也能很好地运行。它支持 Linux 上的硬件时间戳,允许在本地网络进行极其准确的同步。 + +它提供下列两个服务。 + + * `chronyc`:Chrony 的命令行接口。 + * `chronyd`:Chrony 守护进程服务。 + +### 如何在 Linux 上安装和配置 Chrony? + +由于安装包在大多数发行版的官方仓库中可用,因此直接使用包管理器去安装它。 + +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 chrony。 + +``` +$ sudo dnf install chrony +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 chrony。 + +``` +$ sudo apt install chrony +``` + +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 chrony。 + +``` +$ sudo pacman -S chrony +``` + +对于 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 chrony。 + +``` +$ sudo yum install chrony +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 chrony。 + +``` +$ sudo zypper install chrony +``` + +在这篇文章中,我们将使用下列设置去测试。 + + * NTP 服务器:主机名:CentOS7.2daygeek.com,IP:192.168.1.5,OS:CentOS 7 + * Chrony 客户端:主机名:Ubuntu18.2daygeek.com,IP:192.168.1.3,OS:Ubuntu 18.04 + +服务器的安装请访问 [在 Linux 上安装和配置 NTP 服务器][1] 的 URL。 + +我已经在 CentOS7.2daygeek.com 这台主机上安装和配置了 NTP 服务器,因此,将其附加到所有的客户端机器上。此外,还包括其他所需信息。 + +`chrony.conf` 文件的位置根据你的发行版不同而不同。 + +对基于 RHEL 的系统,它位于 `/etc/chrony.conf`。 + +对基于 Debian 的系统,它位于 `/etc/chrony/chrony.conf`。 + +``` +# vi /etc/chrony/chrony.conf + +server CentOS7.2daygeek.com prefer iburst +keyfile /etc/chrony/chrony.keys +driftfile /var/lib/chrony/chrony.drift +logdir /var/log/chrony +maxupdateskew 100.0 +makestep 1 3 +cmdallow 192.168.1.0/24 +``` + +更新配置后需要重启 Chrony 服务。 + +对于 sysvinit 系统。基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 + +``` +# service chronyd restart +# chkconfig chronyd on +``` + +对于 systemctl 系统。 基于 RHEL 的系统需要去运行 `chronyd` 而不是 `chrony`。 + +``` +# systemctl restart chronyd +# systemctl enable chronyd +``` + +使用像 `tacking`、`sources` 和 `sourcestats` 这样的子命令去检查 chrony 的同步细节。 + +去检查 chrony 的追踪状态。 + +``` +# chronyc tracking +Reference ID : C0A80105 (CentOS7.2daygeek.com) +Stratum : 3 +Ref time (UTC) : Thu Mar 28 05:57:27 2019 +System time : 0.000002545 seconds slow of NTP time +Last offset : +0.001194361 seconds +RMS offset : 0.001194361 seconds +Frequency : 1.650 ppm fast +Residual freq : +184.101 ppm +Skew : 2.962 ppm +Root delay : 0.107966967 seconds +Root dispersion : 1.060455322 seconds +Update interval : 2.0 seconds +Leap status : Normal +``` + +运行 `sources` 命令去显示当前时间源的信息。 + +``` +# chronyc sources +210 Number of sources = 1 +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms +``` + +`sourcestats` 命令显示有关 chronyd 当前正在检查的每个源的漂移率和偏移估计过程的信息。 + +``` +# chronyc sourcestats +210 Number of sources = 1 +Name/IP Address NP NR Span Frequency Freq Skew Offset Std Dev +============================================================================== +CentOS7.2daygeek.com 5 3 71 -97.314 78.754 -469us 441us +``` + +当 chronyd 配置为 NTP 客户端或对等端时,你就能通过 `chronyc ntpdata` 命令向每一个 NTP 源发送/接收时间戳模式和交错模式的报告。 + +``` +# chronyc ntpdata + +Remote address : 192.168.1.5 (C0A80105) +Remote port : 123 +Local address : 192.168.1.3 (C0A80103) +Leap status : Normal +Version : 4 +Mode : Server +Stratum : 2 +Poll interval : 6 (64 seconds) +Precision : -23 (0.000000119 seconds) +Root delay : 0.108994 seconds +Root dispersion : 0.076523 seconds +Reference ID : 85F3EEF4 () +Reference time : Thu Mar 28 06:43:35 2019 +Offset : +0.000160221 seconds +Peer delay : 0.000664478 seconds +Peer dispersion : 0.000000178 seconds +Response time : 0.000243252 seconds +Jitter asymmetry: +0.00 +NTP tests : 111 111 1111 +Interleaved : No +Authenticated : No +TX timestamping : Kernel +RX timestamping : Kernel +Total TX : 46 +Total RX : 46 +Total valid RX : 46 +``` + +最后运行 `date` 命令。 + +``` +# date +Thu Mar 28 03:08:11 CDT 2019 +``` + +为了立即跟进系统时钟,绕过任何正在进行的缓步调整,请以 root 身份运行以下命令(以手动调整系统时钟)。 + +``` +# chronyc makestep +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10811-1.html +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/published/201905/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md b/published/201905/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md new file mode 100644 index 0000000000..4979e03dcb --- /dev/null +++ b/published/201905/20190409 How To Install And Configure NTP Server And NTP Client In Linux.md @@ -0,0 +1,252 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10811-1.html) +[#]: subject: (How To Install And Configure NTP Server And NTP Client In Linux?) +[#]: via: (https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上安装、配置 NTP 服务器和客户端? +====== + +你也许听说过这个词很多次或者你可能已经在使用它了。在这篇文章中我将会清晰的告诉你 NTP 服务器和客户端的安装。 + +之后我们将会了解 **[Chrony NTP 客户端的安装][1]**。 + +### 什么是 NTP 服务? + +NTP 意即网络时间协议Network Time Protocol。它是通过网络在计算机系统之间进行时钟同步的网络协议。换言之,它可以让那些通过 NTP 或者 Chrony 客户端连接到 NTP 服务器的系统保持时间上的一致(它能保持一个精确的时间)。 + +NTP 在公共互联网上通常能够保持时间延迟在几十毫秒以内的精度,并在理想条件下,它能在局域网下达到低于一毫秒的延迟精度。 + +它使用用户数据报协议(UDP)在端口 123 上发送和接受时间戳。它是个 C/S 架构的应用程序。 + +### NTP 客户端 + +NTP 客户端将其时钟与网络时间服务器同步。 + +### Chrony 客户端 + +Chrony 是 NTP 客户端的替代品。它能以更精确的时间更快的同步系统时钟,并且它对于那些不总是在线的系统很有用。 + +### 为什么我们需要 NTP 服务? + +为了使你组织中的所有服务器与基于时间的作业保持精确的时间同步。 + +为了说明这点,我将告诉你一个场景。比如说,我们有两个服务器(服务器 1 和服务器 2)。服务器 1 通常在 10:55 完成离线作业,然后服务器 2 在 11:00 需要基于服务器 1 完成的作业报告去运行其他作业。 + +如果两个服务器正在使用不同的时间(如果服务器 2 时间比服务器 1 提前,服务器 1 的时间就落后于服务器 2),然后我们就不能去执行这个作业。为了达到时间一致,我们应该安装 NTP。 + +希望上述能清除你对于 NTP 的疑惑。 + +在这篇文章中,我们将使用下列设置去测试。 + + * **NTP 服务器:** 主机名:CentOS7.2daygeek.com,IP:192.168.1.8,OS:CentOS 7 + * **NTP 客户端:** 主机名:Ubuntu18.2daygeek.com,IP:192.168.1.5,OS:Ubuntu 18.04 + +### NTP 服务器端:如何在 Linux 上安装 NTP? + +因为它是 C/S 架构,所以 NTP 服务器端和客户端的安装包没有什么不同。在发行版的官方仓库中都有 NTP 安装包,因此可以使用发行版的包管理器安装它。 + +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 + +``` +$ sudo dnf install ntp +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 + +``` +$ sudo apt install ntp +``` + +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 + +``` +$ sudo pacman -S ntp +``` + +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 + +``` +$ sudo yum install ntp +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 + +``` +$ sudo zypper install ntp +``` + +### 如何在 Linux 上配置 NTP 服务器? + +安装 NTP 软件包后,请确保在服务器端的 `/etc/ntp.conf` 文件中取消以下配置的注释。 + +默认情况下,NTP 服务器配置依赖于 `X.distribution_name.pool.ntp.org`。 如果有必要,可以使用默认配置,也可以访问站点,根据你所在的位置(特定国家/地区)进行更改。 + +比如说如果你在印度,然后你的 NTP 服务器将是 `0.in.pool.ntp.org`,并且这个地址适用于大多数国家。 + +``` +# vi /etc/ntp.conf + +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server 0.asia.pool.ntp.org +server 1.asia.pool.ntp.org +server 2.asia.pool.ntp.org +server 3.asia.pool.ntp.org +restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +我们仅允许 `192.168.1.0/24` 子网的客户端访问这个 NTP 服务器。 + +由于默认情况下基于 RHEL7 的发行版的防火墙是打开的,因此要允许 ntp 服务通过。 + +``` +# firewall-cmd --add-service=ntp --permanent +# firewall-cmd --reload +``` + +更新配置后要重启服务: + +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 + +``` +# service ntpd restart +# chkconfig ntpd on +``` + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 + +``` +# systemctl restart ntpd +# systemctl enable ntpd +``` + +### NTP 客户端:如何在 Linux 上安装 NTP 客户端? + +正如我在这篇文章中前面所说的。NTP 服务器端和客户端的安装包没有什么不同。因此在客户端上也安装同样的软件包。 + +对于 Fedora 系统,使用 [DNF 命令][2] 去安装 ntp。 + +``` +$ sudo dnf install ntp +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET 命令][3] 或者 [APT 命令][4] 去安装 ntp。 + +``` +$ sudo apt install ntp +``` + +对基于 Arch Linux 的系统,使用 [Pacman 命令][5] 去安装 ntp。 + +``` +$ sudo pacman -S ntp +``` + +对 RHEL/CentOS 系统,使用 [YUM 命令][6] 去安装 ntp。 + +``` +$ sudo yum install ntp +``` + +对于 openSUSE Leap 系统,使用 [Zypper 命令][7] 去安装 ntp。 + +``` +$ sudo zypper install ntp +``` + +我已经在 CentOS7.2daygeek.com` 这台主机上安装和配置了 NTP 服务器,因此将其附加到所有的客户端机器上。 + +``` +# vi /etc/ntp.conf +``` + +``` +restrict default kod nomodify notrap nopeer noquery +restrict -6 default kod nomodify notrap nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 +server CentOS7.2daygeek.com prefer iburst +driftfile /var/lib/ntp/drift +keys /etc/ntp/keys +``` + +更新配置后重启服务: + +对于 sysvinit 系统。基于 Debian 的系统需要去运行 `ntp` 而不是 `ntpd`。 + +``` +# service ntpd restart +# chkconfig ntpd on +``` + +对于 systemctl 系统。基于 Debian 的需要去运行 `ntp` 和 `ntpd`。 + +``` +# systemctl restart ntpd +# systemctl enable ntpd +``` + +重新启动 NTP 服务后等待几分钟以便从 NTP 服务器获取同步的时间。 + +在 Linux 上运行下列命令去验证 NTP 服务的同步状态。 + +``` +# ntpq –p +或 +# ntpq -pn + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +运行下列命令去得到 ntpd 的当前状态。 + +``` +# ntpstat +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +最后运行 `date` 命令。 + +``` +# date +Tue Mar 26 23:17:05 CDT 2019 +``` + +如果你观察到 NTP 中输出的时间偏移很大。运行下列命令从 NTP 服务器手动同步时钟。当你执行下列命令的时候,确保你的 NTP 客户端应该为未活动状态。(LCTT 译注:当时间偏差很大时,客户端的自动校正需要花费很长时间才能逐步追上,因此应该手动运行以更新) + +``` +# ntpdate –uv CentOS7.2daygeek.com +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-configure-ntp-server-ntp-client-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/configure-ntp-client-using-chrony-in-linux/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/published/201905/20190411 Installing Ubuntu MATE on a Raspberry Pi.md b/published/201905/20190411 Installing Ubuntu MATE on a Raspberry Pi.md new file mode 100644 index 0000000000..2712782f24 --- /dev/null +++ b/published/201905/20190411 Installing Ubuntu MATE on a Raspberry Pi.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10817-1.html) +[#]: subject: (Installing Ubuntu MATE on a Raspberry Pi) +[#]: via: (https://itsfoss.com/ubuntu-mate-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +在树莓派上安装 Ubuntu MATE +================================= + +> 简介: 这篇快速指南告诉你如何在树莓派设备上安装 Ubuntu MATE。 + +[树莓派][1] 是目前最流行的单板机并且是创客首选的板子。[Raspbian][2] 是基于 Debian 的树莓派官方操作系统。它是轻量级的,内置了教育工具和能在大部分场景下完成工作的工具。 + +[安装 Raspbian][3] 安装同样简单,但是与 [Debian][4] 随同带来的问题是慢的升级周期和旧的软件包。 + +在树莓派上运行 Ubuntu 可以给你带来一个更丰富的体验和最新的软件。当在你的树莓派上运行 Ubuntu 时我们有几个选择。 + + 1. [Ubuntu MATE][5] :Ubuntu MATE 是仅有的原生支持树莓派且包含一个完整的桌面环境的发行版。 + 2. [Ubuntu Server 18.04][6] + 手动安装一个桌面环境。 + 3. 使用 [Ubuntu Pi Flavor Maker][7] 社区构建的镜像,这些镜像只支持树莓派 2B 和 3B 的变种,并且**不能**更新到最新的 LTS 发布版。 + +第一个选择安装是最简单和快速的,而第二个选择给了你自由选择安装桌面环境的机会。我推荐选择前两个中的任一个。 + +这里是一些磁盘镜像下载链接。在这篇文章里我只会提及 Ubuntu MATE 的安装。 + +### 在树莓派上安装 Ubuntu MATE + +去 Ubuntu MATE 的下载页面获取推荐的镜像。 + +![][8] + +试验性的 ARM64 版本只应在你需要在树莓派服务器上运行像 MongoDB 这样的 64 位应用时使用。 + +- [下载为树莓派准备的 Ubuntu MATE][9] + +#### 第 1 步:设置 SD 卡 + +镜像文件一旦下载完成后需要解压。你可以简单的右击来提取它。 + +也可以使用下面命令做同样的事。 + +``` +xz -d ubuntu-mate***.img.xz +``` + +如果你在 Windows 上你可以使用 [7-zip][10] 替代。 + +安装 [Balena Etcher][11],我们将使用这个工具将镜像写入 SD 卡。确保你的 SD 卡有至少 8 GB 的容量。 + +启动 Etcher,选择镜像文件和 SD 卡。 + +![][12] + +一旦进度完成 SD 卡就准备好了。 + +#### 第 2 步:设置树莓派 + +你可能已经知道你需要一些外设才能使用树莓派,例如鼠标、键盘、HDMI 线等等。你同样可以[不用键盘和鼠标安装树莓派][13],但是这篇指南不是那样。 + + * 插入一个鼠标和一个键盘。 + * 连接 HDMI 线缆。 + * 插入 SD 卡 到 SD 卡槽。 + +插入电源线给它供电。确保你有一个好的电源供应(5V、3A 至少)。一个不好的电源供应可能降低性能。 + +#### Ubuntu MATE 安装 + +一旦你给树莓派供电,你将遇到非常熟悉的 Ubuntu 安装过程。在这里的安装过程相当直接。 + +![选择你的键盘布局][14] + +![选择你的时区][15] + +选择你的 WiFi 网络并且在网络连接中输入密码。 + +![添加用户名和密码][16] + +在设置了键盘布局、时区和用户凭证后,在几分钟后你将被带到登录界面。瞧!你快要完成了。 + +![][17] + +一旦登录,第一件事你应该做的是[更新 Ubuntu][18]。你应该使用下列命令。 + +``` +sudo apt update +sudo apt upgrade +``` + +你同样可以使用软件更新器。 + +![][19] + +一旦更新完成安装你就可以开始了。你可以根据你的需要继续安装树莓派平台为 GPIO 和其他 I/O 准备的特定软件包。 + +是什么让你考虑在 Raspberry 上安装 Ubuntu,你对 Raspbian 的体验如何呢?请在下方评论来让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-mate-raspberry-pi/ + +作者:[Chinmay][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://www.raspberrypi.org/downloads/ +[3]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[4]: https://www.debian.org/ +[5]: https://ubuntu-mate.org/ +[6]: https://wiki.ubuntu.com/ARM/RaspberryPi#Recovering_a_system_using_the_generic_kernel +[7]: https://ubuntu-pi-flavour-maker.org/download/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ubuntu-mate-raspberry-pi-download.jpg?ssl=1 +[9]: https://ubuntu-mate.org/download/ +[10]: https://www.7-zip.org/download.html +[11]: https://www.balena.io/etcher/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Screenshot-from-2019-04-08-01-36-16.png?ssl=1 +[13]: https://linuxhandbook.com/raspberry-pi-headless-setup/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Keyboard-layout-ubuntu.jpg?fit=800%2C467&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/select-time-zone-ubuntu.jpg?fit=800%2C468&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Credentials-ubuntu.jpg?fit=800%2C469&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Desktop-ubuntu.jpg?fit=800%2C600&ssl=1 +[18]: https://itsfoss.com/update-ubuntu/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/update-software.png?ssl=1 + + diff --git a/published/201905/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md b/published/201905/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md new file mode 100644 index 0000000000..742fca39da --- /dev/null +++ b/published/201905/20190415 12 Single Board Computers- Alternative to Raspberry Pi.md @@ -0,0 +1,317 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10823-1.html) +[#]: subject: (12 Single Board Computers: Alternative to Raspberry Pi) +[#]: via: (https://itsfoss.com/raspberry-pi-alternatives/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +12 个可替代树莓派的单板机 +================================ + +> 正在寻找树莓派的替代品?这里有一些单板机可以满足你的 DIY 渴求。 + +树莓派是当前最流行的单板机。你可以在你的 DIY 项目中使用它,或者用它作为一个成本效益高的系统来学习编代码,或者为了你的便利,利用一个[流媒体软件][1]运行在上面作为流媒体设备。 + +你可以使用树莓派做很多事,但它不是各种极客的最终解决方案。一些人可能在寻找更便宜的开发板,一些可能在寻找更强大的。 + +无论是哪种情况,我们都有很多原因需要树莓派的替代品。因此,在这片文章里,我们将讨论最好的 12 个我们认为能够替代树莓派的单板机。 + +![][2] + +### 满足你 DIY 渴望的树莓派替代品 + +这个列表没有特定的顺序排名。链接的一部分是赞助链接。请阅读我们的[赞助政策][3]。 + +#### 1、Onion Omega2+ + +![][4] + +只要 $13,Omega2+ 是这里你可以找到的最便宜的 IoT 单板机设备。它运行 LEDE(Linux 嵌入式开发环境)Linux 系统 —— 这是一个基于 [OpenWRT][5] 的发行版。 + +由于运行一个自定义 Linux 系统,它的组成元件、花费和灵活性使它完美适合几乎所有类型的 IoT 应用。 + +你可以在[亚马逊商城的 Onion Omega 套件][6]或者从他们的网站下单,可能会收取额外的邮费。 + +**关键参数:** + + * MT7688 SoC + * 2.4 GHz IEEE 802.11 b/g/n WiFi + * 128 MB DDR2 RAM + * 32 MB on-board flash storage + * MicroSD Slot + * USB 2.0 + * 12 GPIO Pins + +[查看官网][7] + +#### 2、NVIDIA Jetson Nano Developer Kit + +这是来自 NVIDIA 的只要 **$99** 的非常独特和有趣的树莓派替代品。是的,它不是每个人都能充分利用的设备 —— 只为特定的一组极客或者开发者而生。 + +NVIDIA 使用下面的用例解释它: + +> NVIDIA® Jetson Nano™ Developer Kit 是一个小的、强大的计算机,可以让你并行运行多个神经网络的应用像图像分类、对象侦察、图像分段、语音处理。全部在一个易于使用的、运行功率只有 5 瓦特的平台上。 +> +> nvidia + +因此,基本上,如果你正在研究 AI 或者深度学习,你可以充分利用开发设备。如果你很好奇,该设备的产品计算模块将在 2019 年 7 月到来。 + +**关键参数:** + + * CPU: Quad-core ARM A57 @ 1.43 GHz + * GPU: 128-core Maxwell + * RAM: 4 GB 64-bit LPDDR4 25.6 GB/s + * Display: HDMI 2.0 + * 4 x USB 3.0 and eDP 1.4 + +[查看官网][9] + +#### 3、ASUS Tinker Board S + +![][10] + +ASUS Tinker Board S 不是大多数人可负担得起的树莓派的替换设备 (**$82**,[亚马逊商城][11]),但是它是一个强大的替代品。它的特点是它有你通常可以发现与标准树莓派 3 一样的 40 针脚的连接器,但是提供了强大的处理器和 GPU。同样的,Tinker Board S 的大小恰巧和标准的树莓派3 一样大。 + +这个板子的主要亮点是 16 GB [eMMC][12] (用外行术语说,它的板上有一个类似 SSD 的存储单元使它工作时运行的更快。) 的存在。 + +**关键参数:** + + * Rockchip Quad-Core RK3288 processor + * 2 GB DDR3 RAM + * Integrated Graphics Processor + * ARM® Mali™-T764 GPU + * 16 GB eMMC + * MicroSD Card Slot + * 802.11 b/g/n, Bluetooth V4.0 + EDR + * USB 2.0 + * 28 GPIO pins + * HDMI Interface + +[查看网站][13] + +#### 4、ClockworkPi + +![][14] + +如果你正在想方设法组装一个模块化的复古的游戏控制台,Clockwork Pi 可能就是你需要的,它通常是 [GameShell Kit][15] 的一部分。然而,你可以 使用 $49 单独购买板子。 + +它紧凑的大小、WiFi 连接性和 micro HDMI 端口的存在使它成为许多方面的选择。 + +**关键参数:** + + * Allwinner R16-J Quad-core Cortex-A7 CPU @1.2GHz + * Mali-400 MP2 GPU + * RAM: 1GB DDR3 + * WiFi & Bluetooth v4.0 + * Micro HDMI output + * MicroSD Card Slot + +[查看官网][16] + +#### 5、Arduino Mega 2560 + +![][17] + +如果你正在研究机器人项目或者你想要一个 3D 打印机 —— Arduino Mega 2560 将是树莓派的便利的替代品。不像树莓派,它是基于微控制器而不是微处理器的。 + +在他们的[官网][18],你需要花费 $38.50,或者在[在亚马逊商城是 $33][19]。 + +**关键参数:** + + * Microcontroller: ATmega2560 + * Clock Speed: 16 MHz + * Digital I/O Pins: 54 + * Analog Input Pins: 16 + * Flash Memory: 256 KB of which 8 KB used by bootloader + +[查看官网][18] + +#### 6、Rock64 Media Board + +![][20] + +用与你可能想要的树莓派 3 B+ 相同的价格,你将在 Rock64 Media Board 上获得更快的处理器和双倍的内存。除此之外,如果你想要 1 GB RAM 版的,它提供了一个比树莓派更便宜的替代品,花费更少,只要 $10 。 + +不像树莓派,它没有无线连接支持,但是 USB 3.0 和 HDMI 2.0 的存在使它与众不同,如果它对你很重要的话。 + +**关键参数:** + + * Rockchip RK3328 Quad-Core ARM Cortex A53 64-Bit Processor + * Supports up to 4GB 1600MHz LPDDR3 RAM + * eMMC module socket + * MicroSD Card slot + * USB 3.0 + * HDMI 2.0 + +[查看官网][21] + +#### 7、Odroid-XU4 + +![][22] + +Odroid-XU4 是一个完美的树莓派的替代品,如果你有能够稍微提高预算的空间($80-$100 甚至更低,取决于存储的容量)。 + +它确实是一个强大的替代品并且体积更小。支持 eMMC 和 USB 3.0 使它工作起来更快。 + +**关键参数:** + + * Samsung Exynos 5422 Octa ARM Cortex™-A15 Quad 2Ghz and Cortex™-A7 Quad 1.3GHz CPUs + * 2Gbyte LPDDR3 RAM + * GPU: Mali-T628 MP6 + * USB 3.0 + * HDMI 1.4a + * eMMC 5.0 module socket + * MicroSD Card Slot + +[查看官网][23] + +#### 8、PocketBeagle + +![][24] + +它是一个难以置信的小的单板机 —— 几乎和树莓派Zero 相似。然而它的价格相当于完整大小的树莓派 3。主要的亮点是你可以用它作为一个 USB 便携式信息终端,并且进入 Linux 命令行工作。 + +**关键参数:** + + * Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 + * RAM: 512 MB DDR3 + * 72 expansion pin headers + * microUSB + * USB 2.0 + +[查看官网][25] + +#### 9、Le Potato + +![][26] + +由 [Libre Computer][27] 出品的 Le Potato,其型号是 AML-S905X-CC。它需要花费你 [$45][28]。 + +如果你花费的比树莓派更多的钱,你就能得到双倍内存和 HDMI 2.0 接口,这可能是一个完美的选择。尽管,你还是不能找到嵌入的无线连接。 + +**关键参数:** + + * Amlogic S905X SoC + * 2GB DDR3 SDRAM + * USB 2.0 + * HDMI 2.0 + * microUSB + * MicroSD Card Slot + * eMMC Interface + +[查看官网][29] + +#### 10、Banana Pi M64 + +![][30] + +它自带了 8G 的 eMMC —— 这是替代树莓派的主要亮点。因此,它需要花费 $60。 + +HDMI 接口的存在使它胜任 4K。除此之外,Banana Pi 提供了更多种类的开源单板机作为树莓派的替代。 + +**关键参数:** + + * 1.2 Ghz Quad-Core ARM Cortex A53 64-Bit Processor-R18 + * 2GB DDR3 SDRAM + * 8 GB eMMC + * WiFi & Bluetooth + * USB 2.0 + * HDMI + +[查看官网][31] + +#### 11、Orange Pi Zero + +![][32] + +Orange Pi Zero 相对于树莓派来说难以置信的便宜。你可以在 Aliexpress 或者亚马逊上以最多 $10 就能够获得。如果[稍微多花点,你能够获得 512 MB RAM][33]。 + +如果这还不够,你可以花费大概 $25 获得更好的配置,比如 Orange Pi 3。 + +**关键参数:** + + * H2 Quad-core Cortex-A7 + * Mali400MP2 GPU + * RAM: Up to 512 MB + * TF Card support + * WiFi + * USB 2.0 + +[查看官网][34] + +#### 12、VIM 2 SBC by Khadas + +![][35] + +由 Khadas 出品的 VIM 2 是最新的单板机,因此你能够在板上得到蓝牙 5.0 支持。它的价格范围[从 $99 的基础款到上限 $140][36]。 + +基础款包含 2 GB RAM、16 GB eMMC 和蓝牙 4.1。然而,Pro/Max 版包含蓝牙 5.0,更多的内存,更多的 eMMC 存储。 + +**关键参数:** + + * Amlogic S912 1.5GHz 64-bit Octa-Core CPU + * T820MP3 GPU + * Up to 3 GB DDR4 RAM + * Up to 64 GB eMMC + * Bluetooth 5.0 (Pro/Max) + * Bluetooth 4.1 (Basic) + * HDMI 2.0a + * WiFi + +### 总结 + +我们知道有很多不同种类的单板机电脑。一些比树莓派更好 —— 它的一些小规格的版本有更便宜的价格。同样的,像 Jetson Nano 这样的单板机已经被裁剪用于特定用途。因此,取决于你需要什么 —— 你应该检查一下单板机的配置。 + +如果你知道比上述提到的更好的东西,请随意在下方评论来让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-alternatives/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-media-server/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-alternatives.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/affiliate-policy/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/omega-2-plus-e1555306748755-800x444.jpg?resize=800%2C444&ssl=1 +[5]: https://openwrt.org/ +[6]: https://amzn.to/2Xj8pkn +[7]: https://onion.io/store/omega2p/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Jetson-Nano-e1555306350976-800x590.jpg?resize=800%2C590&ssl=1 +[9]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/asus-tinker-board-s-e1555304945760-800x450.jpg?resize=800%2C450&ssl=1 +[11]: https://amzn.to/2XfkOFT +[12]: https://en.wikipedia.org/wiki/MultiMediaCard +[13]: https://www.asus.com/in/Single-Board-Computer/Tinker-Board-S/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/clockwork-pi-e1555305016242-800x506.jpg?resize=800%2C506&ssl=1 +[15]: https://itsfoss.com/gameshell-console/ +[16]: https://www.clockworkpi.com/product-page/cpi-v3-1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/arduino-mega-2560-e1555305257633.jpg?ssl=1 +[18]: https://store.arduino.cc/usa/mega-2560-r3 +[19]: https://amzn.to/2KCi041 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/ROCK64_board-e1555306092845-800x440.jpg?resize=800%2C440&ssl=1 +[21]: https://www.pine64.org/?product=rock64-media-board-computer +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/odroid-xu4.jpg?fit=800%2C354&ssl=1 +[23]: https://www.hardkernel.com/shop/odroid-xu4-special-price/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/PocketBeagle.jpg?fit=800%2C450&ssl=1 +[25]: https://beagleboard.org/p/products/pocketbeagle +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/aml-libre.-e1555306237972-800x514.jpg?resize=800%2C514&ssl=1 +[27]: https://libre.computer/ +[28]: https://amzn.to/2DpG3xl +[29]: https://libre.computer/products/boards/aml-s905x-cc/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/banana-pi-m6.jpg?fit=800%2C389&ssl=1 +[31]: http://www.banana-pi.org/m64.html +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/orange-pi-zero.jpg?fit=800%2C693&ssl=1 +[33]: https://amzn.to/2IlI81g +[34]: http://www.orangepi.org/orangepizero/index.html +[35]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/khadas-vim-2-e1555306505640-800x563.jpg?resize=800%2C563&ssl=1 +[36]: https://amzn.to/2UDvrFE diff --git a/published/201905/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md b/published/201905/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md new file mode 100644 index 0000000000..46c2ce0052 --- /dev/null +++ b/published/201905/20190415 How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux.md @@ -0,0 +1,283 @@ +[#]: collector: (lujun9972) +[#]: translator: (bodhix) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10844-1.html) +[#]: subject: (How To Enable (UP) And Disable (DOWN) A Network Interface Port (NIC) In Linux?) +[#]: via: (https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux 中如何启用和禁用网卡? +====== + +你可能会根据你的需要执行以下命令。我会在这里列举一些你会用到这些命令的例子。 + +当你添加一个网卡或者从一个物理网卡创建出一个虚拟网卡的时候,你可能需要使用这些命令将新网卡启用起来。另外,如果你对网卡做了某些修改或者网卡本身没有启用,那么你也需要使用以下的某个命令将网卡启用起来。 + +启用、禁用网卡有很多种方法。在这篇文章里,我们会介绍我们使用过的最好的 5 种方法。 + +启用禁用网卡可以使用以下 5 个方法来完成: + +* `ifconfig` 命令:用于配置网卡。它可以提供网卡的很多信息。 +* `ifdown/up` 命令:`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 +* `ip` 命令:用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令所不具有的强大的特性。 +* `nmcli` 命令:是一个控制 NetworkManager 并报告网络状态的命令行工具。 +* `nmtui` 命令:是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 + +以下显示的是我的 Linux 系统中可用网卡的信息。 + +``` +# ip a +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86049sec preferred_lft 86049sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +3: enp0s8: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:30:5d:52 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s8 + valid_lft 86049sec preferred_lft 86049sec + inet6 fe80::32b7:8727:bdf2:2f3/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 1、如何使用 ifconfig 命令启用禁用网卡? + +`ifconfig` 命令用于配置网卡。 + +在系统启动过程中如果需要启用网卡,调用的命令就是 `ifconfig`。`ifconfig` 可以提供很多网卡的信息。不管我们想修改网卡的什么配置,都可以使用该命令。 + +`ifconfig` 的常用语法: + +``` +# ifconfig [NIC_NAME] Down/Up +``` + +执行以下命令禁用 `enp0s3` 网卡。注意,这里你需要输入你自己的网卡名字。 + +``` +# ifconfig enp0s3 down +``` + +从以下输出结果可以看到网卡已经被禁用了。 + +``` +# ip a | grep -A 1 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff +``` + +执行以下命令启用 `enp0s3` 网卡。 + +``` +# ifconfig enp0s3 up +``` + +从以下输出结果可以看到网卡已经启用了。 + +``` +# ip a | grep -A 5 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86294sec preferred_lft 86294sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 2、如何使用 ifdown/up 命令启用禁用网卡? + +`ifdown` 命令用于禁用网卡,`ifup` 命令用于启用网卡。 + +注意:这两个命令不支持以 `enpXXX` 命名的新的网络设备。 + +`ifdown`/`ifup` 的常用语法: + +``` +# ifdown [NIC_NAME] +# ifup [NIC_NAME] +``` + +执行以下命令禁用 `eth1` 网卡。 + +``` +# ifdown eth1 +``` + +从以下输出结果可以看到网卡已经被禁用了。 + +``` +# ip a | grep -A 3 "eth1:" +3: eth1: mtu 1500 qdisc pfifo_fast state DOWN qlen 1000 + link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff +``` + +执行以下命令启用 `eth1` 网卡。 + +``` +# ifup eth1 +``` + +从以下输出结果可以看到网卡已经启用了。 + +``` +# ip a | grep -A 5 "eth1:" +3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 08:00:27:d5:a0:18 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.7/24 brd 192.168.1.255 scope global eth1 + inet6 fe80::a00:27ff:fed5:a018/64 scope link tentative dadfailed + valid_lft forever preferred_lft forever +``` + +`ifup` 和 `ifdown` 不支持以 `enpXXX` 命名的网卡。当执行该命令时得到的结果如下: + +``` +# ifdown enp0s8 +Unknown interface enp0s8 +``` + +### 3、如何使用 ip 命令启用禁用网卡? + +`ip` 命令用于管理网卡,用于替代老旧的、不推荐使用的 `ifconfig` 命令。 + +它和 `ifconfig` 命令很相似,但是提供了很多 `ifconfig` 命令不具有的强大的特性。 + +`ip` 的常用语法: + +``` +# ip link set Down/Up +``` + +执行以下命令禁用 `enp0s3` 网卡。 + +``` +# ip link set enp0s3 down +``` + +从以下输出结果可以看到网卡已经被禁用了。 + +``` +# ip a | grep -A 1 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff +``` + +执行以下命令启用 `enp0s3` 网卡。 + +``` +# ip link set enp0s3 up +``` + +从以下输出结果可以看到网卡已经启用了。 + +``` +# ip a | grep -A 5 "enp0s3:" +2: enp0s3: mtu 1500 qdisc fq_codel state UP group default qlen 1000 + link/ether 08:00:27:c2:e4:e8 brd ff:ff:ff:ff:ff:ff + inet 192.168.1.4/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 + valid_lft 86294sec preferred_lft 86294sec + inet6 fe80::3899:270f:ae38:b433/64 scope link noprefixroute + valid_lft forever preferred_lft forever +``` + +### 4、如何使用 nmcli 命令启用禁用网卡? + +`nmcli` 是一个控制 NetworkManager 并报告网络状态的命令行工具。 + +`nmcli` 可以用做 nm-applet 或者其他图形化客户端的替代品。它可以用于展示、创建、修改、删除、启用和停用网络连接。除此之后,它还可以用来管理和展示网络设备状态。 + +`nmcli` 命令大部分情况下都是使用“配置名称”工作而不是“设备名称”。所以,执行以下命令,获取网卡对应的配置名称。(LCTT 译注:在使用 `nmtui` 或者 `nmcli` 管理网络连接的时候,可以为网络连接配置一个名称,就是这里提到的配置名称Profile name`) + +``` +# nmcli con show +NAME UUID TYPE DEVICE +Wired connection 1 3d5afa0a-419a-3d1a-93e6-889ce9c6a18c ethernet enp0s3 +Wired connection 2 a22154b7-4cc4-3756-9d8d-da5a4318e146 ethernet enp0s8 +``` + +`nmcli` 的常用语法: + +``` +# nmcli con Down/Up +``` + +执行以下命令禁用 `enp0s3` 网卡。在禁用网卡的时候,你需要使用配置名称而不是设备名称。 + +``` +# nmcli con down 'Wired connection 1' +Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6) +``` + +从以下输出结果可以看到网卡已经禁用了。 + +``` +# nmcli dev status +DEVICE TYPE STATE CONNECTION +enp0s8 ethernet connected Wired connection 2 +enp0s3 ethernet disconnected -- +lo loopback unmanaged -- +``` + +执行以下命令启用 `enp0s3` 网卡。同样的,这里你需要使用配置名称而不是设备名称。 + +``` +# nmcli con up 'Wired connection 1' +Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7) +``` + +从以下输出结果可以看到网卡已经启用了。 + +``` +# nmcli dev status +DEVICE TYPE STATE CONNECTION +enp0s8 ethernet connected Wired connection 2 +enp0s3 ethernet connected Wired connection 1 +lo loopback unmanaged -- +``` + +### 5、如何使用 nmtui 命令启用禁用网卡? + +`nmtui` 是一个与 NetworkManager 交互的、基于 curses 图形库的终端 UI 应用。 + +在启用 `nmtui` 的时候,如果第一个参数没有特别指定,它会引导用户选择对应的操作去执行。 + +执行以下命令打开 `mntui` 界面。选择 “Active a connection” 然后点击 “OK”。 + +``` +# nmtui +``` + +![][2] + +选择你要禁用的网卡,然后点击 “Deactivate” 按钮,就可以将网卡禁用。 + +![][3] + +如果要启用网卡,使用上述同样的步骤即可。 + +![][4] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[bodhix](https://github.com/bodhix) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-1.png +[3]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-2.png +[4]: https://www.2daygeek.com/wp-content/uploads/2019/04/enable-disable-up-down-nic-network-interface-port-linux-nmtui-3.png diff --git a/published/201905/20190415 Inter-process communication in Linux- Shared storage.md b/published/201905/20190415 Inter-process communication in Linux- Shared storage.md new file mode 100644 index 0000000000..de56a36982 --- /dev/null +++ b/published/201905/20190415 Inter-process communication in Linux- Shared storage.md @@ -0,0 +1,439 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10826-1.html) +[#]: subject: (Inter-process communication in Linux: Shared storage) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-storage) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:共享存储 +====== + +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + +![Filing papers and documents][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第一篇文章。这个系列将使用 C 语言代码示例来阐明以下 IPC 机制: + + * 共享文件 + * 共享内存(使用信号量) + * 管道(命名的或非命名的管道) + * 消息队列 + * 套接字 + * 信号 + +在聚焦上面提到的共享文件和共享内存这两个机制之前,这篇文章将带你回顾一些核心的概念。 + +### 核心概念 + +*进程*是运行着的程序,每个进程都有着它自己的地址空间,这些空间由进程被允许访问的内存地址组成。进程有一个或多个执行*线程*,而线程是一系列执行指令的集合:*单线程*进程就只有一个线程,而*多线程*的进程则有多个线程。一个进程中的线程共享各种资源,特别是地址空间。另外,一个进程中的线程可以直接通过共享内存来进行通信,尽管某些现代语言(例如 Go)鼓励一种更有序的方式,例如使用线程安全的通道。当然对于不同的进程,默认情况下,它们**不**能共享内存。 + +有多种方法启动之后要进行通信的进程,下面所举的例子中主要使用了下面的两种方法: + + * 一个终端被用来启动一个进程,另外一个不同的终端被用来启动另一个。 + * 在一个进程(父进程)中调用系统函数 `fork`,以此生发另一个进程(子进程)。 + +第一个例子采用了上面使用终端的方法。这些[代码示例][3]的 ZIP 压缩包可以从我的网站下载到。 + +### 共享文件 + +程序员对文件访问应该都已经很熟识了,包括许多坑(不存在的文件、文件权限损坏等等),这些问题困扰着程序对文件的使用。尽管如此,共享文件可能是最为基础的 IPC 机制了。考虑一下下面这样一个相对简单的例子,其中一个进程(生产者 `producer`)创建和写入一个文件,然后另一个进程(消费者 `consumer `)从这个相同的文件中进行读取: + +``` + writes +-----------+ reads +producer-------->| disk file |<-------consumer + +-----------+ +``` + +在使用这个 IPC 机制时最明显的挑战是*竞争条件*可能会发生:生产者和消费者可能恰好在同一时间访问该文件,从而使得输出结果不确定。为了避免竞争条件的发生,该文件在处于*读*或*写*状态时必须以某种方式处于被锁状态,从而阻止在*写*操作执行时和其他操作的冲突。在标准系统库中与锁相关的 API 可以被总结如下: + + * 生产者应该在写入文件时获得一个文件的排斥锁。一个*排斥*锁最多被一个进程所拥有。这样就可以排除掉竞争条件的发生,因为在锁被释放之前没有其他的进程可以访问这个文件。 + * 消费者应该在从文件中读取内容时得到至少一个共享锁。多个*读取者*可以同时保有一个*共享*锁,但是没有*写入者*可以获取到文件内容,甚至在当只有一个*读取者*保有一个共享锁时。 + +共享锁可以提升效率。假如一个进程只是读入一个文件的内容,而不去改变它的内容,就没有什么原因阻止其他进程来做同样的事。但如果需要写入内容,则很显然需要文件有排斥锁。 + +标准的 I/O 库中包含一个名为 `fcntl` 的实用函数,它可以被用来检查或者操作一个文件上的排斥锁和共享锁。该函数通过一个*文件描述符*(一个在进程中的非负整数值)来标记一个文件(在不同的进程中不同的文件描述符可能标记同一个物理文件)。对于文件的锁定, Linux 提供了名为 `flock` 的库函数,它是 `fcntl` 的一个精简包装。第一个例子中使用 `fcntl` 函数来暴露这些 API 细节。 + +#### 示例 1. 生产者程序 + +```c +#include +#include +#include +#include +#include + +#define FileName "data.dat" +#define DataString "Now is the winter of our discontent\nMade glorious summer by this sun of York\n" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive versus shared) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDWR | O_CREAT, 0666)) < 0) /* -1 signals an error */ + report_and_exit("open failed..."); + + if (fcntl(fd, F_SETLK, &lock) < 0) /** F_SETLK doesn't block, F_SETLKW does **/ + report_and_exit("fcntl failed to get lock..."); + else { + write(fd, DataString, strlen(DataString)); /* populate data file */ + fprintf(stderr, "Process %d has written to data file...\n", lock.l_pid); + } + + /* Now release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); /* close the file: would unlock if needed */ + return 0; /* terminating the process would unlock as well */ +} +``` + +上面生产者程序的主要步骤可以总结如下: + + * 这个程序首先声明了一个类型为 `struct flock` 的变量,它代表一个锁,并对它的 5 个域做了初始化。第一个初始化 + + ```c +lock.l_type = F_WRLCK; /* exclusive lock */ +``` + 使得这个锁为排斥锁(read-write)而不是一个共享锁(read-only)。假如生产者获得了这个锁,则其他的进程将不能够对文件做读或者写操作,直到生产者释放了这个锁,或者显式地调用 `fcntl`,又或者隐式地关闭这个文件。(当进程终止时,所有被它打开的文件都会被自动关闭,从而释放了锁) + * 上面的程序接着初始化其他的域。主要的效果是*整个*文件都将被锁上。但是,有关锁的 API 允许特别指定的字节被上锁。例如,假如文件包含多个文本记录,则单个记录(或者甚至一个记录的一部分)可以被锁,而其余部分不被锁。 + * 第一次调用 `fcntl` + + ```c +if (fcntl(fd, F_SETLK, &lock) < 0) +``` + 尝试排斥性地将文件锁住,并检查调用是否成功。一般来说, `fcntl` 函数返回 `-1` (因此小于 0)意味着失败。第二个参数 `F_SETLK` 意味着 `fcntl` 的调用*不是*堵塞的;函数立即做返回,要么获得锁,要么显示失败了。假如替换地使用 `F_SETLKW`(末尾的 `W` 代指*等待*),那么对 `fcntl` 的调用将是阻塞的,直到有可能获得锁的时候。在调用 `fcntl` 函数时,它的第一个参数 `fd` 指的是文件描述符,第二个参数指定了将要采取的动作(在这个例子中,`F_SETLK` 指代设置锁),第三个参数为锁结构的地址(在本例中,指的是 `&lock`)。 + * 假如生产者获得了锁,这个程序将向文件写入两个文本记录。 + * 在向文件写入内容后,生产者改变锁结构中的 `l_type` 域为 `unlock` 值: + + ```c +lock.l_type = F_UNLCK; +``` + 并调用 `fcntl` 来执行解锁操作。最后程序关闭了文件并退出。 + +#### 示例 2. 消费者程序 + +```c +#include +#include +#include +#include + +#define FileName "data.dat" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); /* EXIT_FAILURE */ +} + +int main() { + struct flock lock; + lock.l_type = F_WRLCK; /* read/write (exclusive) lock */ + lock.l_whence = SEEK_SET; /* base for seek offsets */ + lock.l_start = 0; /* 1st byte in file */ + lock.l_len = 0; /* 0 here means 'until EOF' */ + lock.l_pid = getpid(); /* process id */ + + int fd; /* file descriptor to identify a file within a process */ + if ((fd = open(FileName, O_RDONLY)) < 0) /* -1 signals an error */ + report_and_exit("open to read failed..."); + + /* If the file is write-locked, we can't continue. */ + fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ + if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); + + lock.l_type = F_RDLCK; /* prevents any writing during the reading */ + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("can't get a read-only lock..."); + + /* Read the bytes (they happen to be ASCII codes) one at a time. */ + int c; /* buffer for read bytes */ + while (read(fd, &c, 1) > 0) /* 0 signals EOF */ + write(STDOUT_FILENO, &c, 1); /* write one byte to the standard output */ + + /* Release the lock explicitly. */ + lock.l_type = F_UNLCK; + if (fcntl(fd, F_SETLK, &lock) < 0) + report_and_exit("explicit unlocking failed..."); + + close(fd); + return 0; +} +``` + +相比于锁的 API,消费者程序会相对复杂一点儿。特别的,消费者程序首先检查文件是否被排斥性的被锁,然后才尝试去获得一个共享锁。相关的代码为: + +``` +lock.l_type = F_WRLCK; +... +fcntl(fd, F_GETLK, &lock); /* sets lock.l_type to F_UNLCK if no write lock */ +if (lock.l_type != F_UNLCK) + report_and_exit("file is still write locked..."); +``` + +在 `fcntl` 调用中的 `F_GETLK` 操作指定检查一个锁,在本例中,上面代码的声明中给了一个 `F_WRLCK` 的排斥锁。假如特指的锁不存在,那么 `fcntl` 调用将会自动地改变锁类型域为 `F_UNLCK` 以此来显示当前的状态。假如文件是排斥性地被锁,那么消费者将会终止。(一个更健壮的程序版本或许应该让消费者*睡*会儿,然后再尝试几次。) + +假如当前文件没有被锁,那么消费者将尝试获取一个共享(read-only)锁(`F_RDLCK`)。为了缩短程序,`fcntl` 中的 `F_GETLK` 调用可以丢弃,因为假如其他进程已经保有一个读写锁,`F_RDLCK` 的调用就可能会失败。重新调用一个只读锁能够阻止其他进程向文件进行写的操作,但可以允许其他进程对文件进行读取。简而言之,共享锁可以被多个进程所保有。在获取了一个共享锁后,消费者程序将立即从文件中读取字节数据,然后在标准输出中打印这些字节的内容,接着释放锁,关闭文件并终止。 + +下面的 `%` 为命令行提示符,下面展示的是从相同终端开启这两个程序的输出: + +``` +% ./producer +Process 29255 has written to data file... + +% ./consumer +Now is the winter of our discontent +Made glorious summer by this sun of York +``` + +在本次的代码示例中,通过 IPC 传输的数据是文本:它们来自莎士比亚的戏剧《理查三世》中的两行台词。然而,共享文件的内容还可以是纷繁复杂的,任意的字节数据(例如一个电影)都可以,这使得文件共享变成了一个非常灵活的 IPC 机制。但它的缺点是文件获取速度较慢,因为文件的获取涉及到读或者写。同往常一样,编程总是伴随着折中。下面的例子将通过共享内存来做 IPC,而不是通过共享文件,在性能上相应的有极大的提升。 + +### 共享内存 + +对于共享内存,Linux 系统提供了两类不同的 API:传统的 System V API 和更新一点的 POSIX API。在单个应用中,这些 API 不能混用。但是,POSIX 方式的一个坏处是它的特性仍在发展中,并且依赖于安装的内核版本,这非常影响代码的可移植性。例如,默认情况下,POSIX API 用*内存映射文件*来实现共享内存:对于一个共享的内存段,系统为相应的内容维护一个*备份文件*。在 POSIX 规范下共享内存可以被配置为不需要备份文件,但这可能会影响可移植性。我的例子中使用的是带有备份文件的 POSIX API,这既结合了内存获取的速度优势,又获得了文件存储的持久性。 + +下面的共享内存例子中包含两个程序,分别名为 `memwriter` 和 `memreader`,并使用*信号量*来调整它们对共享内存的获取。在任何时候当共享内存进入一个*写入者*场景时,无论是多进程还是多线程,都有遇到基于内存的竞争条件的风险,所以,需要引入信号量来协调(同步)对共享内存的获取。 + +`memwriter` 程序应当在它自己所处的终端首先启动,然后 `memreader` 程序才可以在它自己所处的终端启动(在接着的十几秒内)。`memreader` 的输出如下: + +``` +This is the way the world ends... +``` + +在每个源程序的最上方注释部分都解释了在编译它们时需要添加的链接参数。 + +首先让我们复习一下信号量是如何作为一个同步机制工作的。一般的信号量也被叫做一个*计数信号量*,因为带有一个可以增加的值(通常初始化为 0)。考虑一家租用自行车的商店,在它的库存中有 100 辆自行车,还有一个供职员用于租赁的程序。每当一辆自行车被租出去,信号量就增加 1;当一辆自行车被还回来,信号量就减 1。在信号量的值为 100 之前都还可以进行租赁业务,但如果等于 100 时,就必须停止业务,直到至少有一辆自行车被还回来,从而信号量减为 99。 + +*二元信号量*是一个特例,它只有两个值:0 和 1。在这种情况下,信号量的表现为*互斥量*(一个互斥的构造)。下面的共享内存示例将把信号量用作互斥量。当信号量的值为 0 时,只有 `memwriter` 可以获取共享内存,在写操作完成后,这个进程将增加信号量的值,从而允许 `memreader` 来读取共享内存。 + +#### 示例 3. memwriter 进程的源程序 + +```c +/** Compilation: gcc -o memwriter memwriter.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); +} + +int main() { + int fd = shm_open(BackingFile, /* name from smem.h */ + O_RDWR | O_CREAT, /* read/write, create if needed */ + AccessPerms); /* access permissions (0644) */ + if (fd < 0) report_and_exit("Can't open shared mem segment..."); + + ftruncate(fd, ByteSize); /* get the bytes */ + + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't get segment..."); + + fprintf(stderr, "shared mem address: %p [0..%d]\n", memptr, ByteSize - 1); + fprintf(stderr, "backing file: /dev/shm%s\n", BackingFile ); + + /* semaphore code to lock the shared mem */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + strcpy(memptr, MemContents); /* copy some ASCII bytes to the segment */ + + /* increment the semaphore so that memreader can read */ + if (sem_post(semptr) < 0) report_and_exit("sem_post"); + + sleep(12); /* give reader a chance */ + + /* clean up */ + munmap(memptr, ByteSize); /* unmap the storage */ + close(fd); + sem_close(semptr); + shm_unlink(BackingFile); /* unlink from the backing file */ + return 0; +} +``` + +下面是 `memwriter` 和 `memreader` 程序如何通过共享内存来通信的一个总结: + + * 上面展示的 `memwriter` 程序调用 `shm_open` 函数来得到作为系统协调共享内存的备份文件的文件描述符。此时,并没有内存被分配。接下来调用的是令人误解的名为 `ftruncate` 的函数 + + ```c +ftruncate(fd, ByteSize); /* get the bytes */ +``` + 它将分配 `ByteSize` 字节的内存,在该情况下,一般为大小适中的 512 字节。`memwriter` 和 `memreader` 程序都只从共享内存中获取数据,而不是从备份文件。系统将负责共享内存和备份文件之间数据的同步。 + * 接着 `memwriter` 调用 `mmap` 函数: + + ```c +caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ +``` + 来获得共享内存的指针。(`memreader` 也做一次类似的调用。) 指针类型 `caddr_t` 以 `c` 开头,它代表 `calloc`,而这是动态初始化分配的内存为 0 的一个系统函数。`memwriter` 通过库函数 `strcpy`(字符串复制)来获取后续*写*操作的 `memptr`。 + * 到现在为止,`memwriter` 已经准备好进行写操作了,但首先它要创建一个信号量来确保共享内存的排斥性。假如 `memwriter` 正在执行写操作而同时 `memreader` 在执行读操作,则有可能出现竞争条件。假如调用 `sem_open` 成功了: + + ```c +sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ +``` + 那么,接着写操作便可以执行。上面的 `SemaphoreName`(任意一个唯一的非空名称)用来在 `memwriter` 和 `memreader` 识别信号量。初始值 0 将会传递给信号量的创建者,在这个例子中指的是 `memwriter` 赋予它执行*写*操作的权利。 + * 在写操作完成后,`memwriter* 通过调用 `sem_post` 函数将信号量的值增加到 1: + + ```c +if (sem_post(semptr) < 0) .. +``` + 增加信号了将释放互斥锁,使得 `memreader` 可以执行它的*读*操作。为了更好地测量,`memwriter` 也将从它自己的地址空间中取消映射, + + ```c +munmap(memptr, ByteSize); /* unmap the storage * +``` + 这将使得 `memwriter` 不能进一步地访问共享内存。 + +#### 示例 4. memreader 进程的源代码 + +```c +/** Compilation: gcc -o memreader memreader.c -lrt -lpthread **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "shmem.h" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); +} + +int main() { + int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* empty to begin */ + if (fd < 0) report_and_exit("Can't get file descriptor..."); + + /* get a pointer to memory */ + caddr_t memptr = mmap(NULL, /* let system pick where to put segment */ + ByteSize, /* how many bytes */ + PROT_READ | PROT_WRITE, /* access protections */ + MAP_SHARED, /* mapping visible to other processes */ + fd, /* file descriptor */ + 0); /* offset: start at 1st byte */ + if ((caddr_t) -1 == memptr) report_and_exit("Can't access segment..."); + + /* create a semaphore for mutual exclusion */ + sem_t* semptr = sem_open(SemaphoreName, /* name */ + O_CREAT, /* create the semaphore */ + AccessPerms, /* protection perms */ + 0); /* initial value */ + if (semptr == (void*) -1) report_and_exit("sem_open"); + + /* use semaphore as a mutex (lock) by waiting for writer to increment it */ + if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ + int i; + for (i = 0; i < strlen(MemContents); i++) + write(STDOUT_FILENO, memptr + i, 1); /* one byte at a time */ + sem_post(semptr); + } + + /* cleanup */ + munmap(memptr, ByteSize); + close(fd); + sem_close(semptr); + unlink(BackingFile); + return 0; +} +``` + +`memwriter` 和 `memreader` 程序中,共享内存的主要着重点都在 `shm_open` 和 `mmap` 函数上:在成功时,第一个调用返回一个备份文件的文件描述符,而第二个调用则使用这个文件描述符从共享内存段中获取一个指针。它们对 `shm_open` 的调用都很相似,除了 `memwriter` 程序创建共享内存,而 `memreader 只获取这个已经创建的内存: + +```c +int fd = shm_open(BackingFile, O_RDWR | O_CREAT, AccessPerms); /* memwriter */ +int fd = shm_open(BackingFile, O_RDWR, AccessPerms); /* memreader */ +``` + +有了文件描述符,接着对 `mmap` 的调用就是类似的了: + +```c +caddr_t memptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); +``` + +`mmap` 的第一个参数为 `NULL`,这意味着让系统自己决定在虚拟内存地址的哪个地方分配内存,当然也可以指定一个地址(但很有技巧性)。`MAP_SHARED` 标志着被分配的内存在进程中是共享的,最后一个参数(在这个例子中为 0 ) 意味着共享内存的偏移量应该为第一个字节。`size` 参数特别指定了将要分配的字节数目(在这个例子中是 512);另外的保护参数(`AccessPerms`)暗示着共享内存是可读可写的。 + +当 `memwriter` 程序执行成功后,系统将创建并维护备份文件,在我的系统中,该文件为 `/dev/shm/shMemEx`,其中的 `shMemEx` 是我为共享存储命名的(在头文件 `shmem.h` 中给定)。在当前版本的 `memwriter` 和 `memreader` 程序中,下面的语句 + +```c +shm_unlink(BackingFile); /* removes backing file */ +``` + +将会移除备份文件。假如没有 `unlink` 这个语句,则备份文件在程序终止后仍然持久地保存着。 + +`memreader` 和 `memwriter` 一样,在调用 `sem_open` 函数时,通过信号量的名字来获取信号量。但 `memreader` 随后将进入等待状态,直到 `memwriter` 将初始值为 0 的信号量的值增加。 + +```c +if (!sem_wait(semptr)) { /* wait until semaphore != 0 */ +``` + +一旦等待结束,`memreader` 将从共享内存中读取 ASCII 数据,然后做些清理工作并终止。 + +共享内存 API 包括显式地同步共享内存段和备份文件。在这次的示例中,这些操作都被省略了,以免文章显得杂乱,好让我们专注于内存共享和信号量的代码。 + +即便在信号量代码被移除的情况下,`memwriter` 和 `memreader` 程序很大几率也能够正常执行而不会引入竞争条件:`memwriter` 创建了共享内存段,然后立即向它写入;`memreader` 不能访问共享内存,直到共享内存段被创建好。然而,当一个*写操作*处于混合状态时,最佳实践需要共享内存被同步。信号量 API 足够重要,值得在代码示例中着重强调。 + +### 总结 + +上面共享文件和共享内存的例子展示了进程是怎样通过*共享存储*来进行通信的,前者通过文件而后者通过内存块。这两种方法的 API 相对来说都很直接。这两种方法有什么共同的缺点吗?现代的应用经常需要处理流数据,而且是非常大规模的数据流。共享文件或者共享内存的方法都不能很好地处理大规模的流数据。按照类型使用管道会更加合适一些。所以这个系列的第二部分将会介绍管道和消息队列,同样的,我们将使用 C 语言写的代码示例来辅助讲解。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-storage + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: http://condor.depaul.edu/mkalin +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html diff --git a/published/201905/20190415 Kubernetes on Fedora IoT with k3s.md b/published/201905/20190415 Kubernetes on Fedora IoT with k3s.md new file mode 100644 index 0000000000..a8293d4d3b --- /dev/null +++ b/published/201905/20190415 Kubernetes on Fedora IoT with k3s.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: (StdioA) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10908-1.html) +[#]: subject: (Kubernetes on Fedora IoT with k3s) +[#]: via: (https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/) +[#]: author: (Lennart Jern https://fedoramagazine.org/author/lennartj/) + +使用 k3s 在 Fedora IoT 上运行 K8S +====== + +![](https://img.linux.net.cn/data/attachment/album/201905/28/094048yrzlik9oek5rbs5s.jpg) + +Fedora IoT 是一个即将发布的、面向物联网的 Fedora 版本。去年 Fedora Magazine 的《[如何使用 Fedora IoT 点亮 LED 灯][2]》一文第一次介绍了它。从那以后,它与 Fedora Silverblue 一起不断改进,以提供针对面向容器的工作流的不可变基础操作系统。 + +Kubernetes 是一个颇受欢迎的容器编排系统。它可能最常用在那些能够处理巨大负载的强劲硬件上。不过,它也能在像树莓派 3 这样轻量级的设备上运行。让我们继续阅读,来了解如何运行它。 + +### 为什么用 Kubernetes? + +虽然 Kubernetes 在云计算领域风靡一时,但让它在小型单板机上运行可能并不是常见的。不过,我们有非常明确的理由来做这件事。首先,这是一个不需要昂贵硬件就可以学习并熟悉 Kubernetes 的好方法;其次,由于它的流行性,市面上有[大量应用][3]进行了预先打包,以用于在 Kubernetes 集群中运行。更不用说,当你遇到问题时,会有大规模的社区用户为你提供帮助。 + +最后但同样重要的是,即使是在家庭实验室这样的小规模环境中,容器编排也确实能够使事情变得更加简单。虽然在学习曲线方面,这一点并不明显,但这些技能在你将来与任何集群打交道的时候都会有帮助。不管你面对的是一个单节点树莓派集群,还是一个大规模的机器学习场,它们的操作方式都是类似的。 + +#### K3s - 轻量级的 Kubernetes + +一个“正常”安装的 Kubernetes(如果有这么一说的话)对于物联网来说有点沉重。K8s 的推荐内存配置,是每台机器 2GB!不过,我们也有一些替代品,其中一个新人是 [k3s][4] —— 一个轻量级的 Kubernetes 发行版。 + +K3s 非常特殊,因为它将 etcd 替换成了 SQLite 以满足键值存储需求。还有一点,在于整个 k3s 将使用一个二进制文件分发,而不是每个组件一个。这减少了内存占用并简化了安装过程。基于上述原因,我们只需要 512MB 内存即可运行 k3s,极度适合小型单板电脑! + +### 你需要的东西 + +1. Fedora IoT 运行在虚拟机或实体设备中运行的。在[这里][5]可以看到优秀的入门指南。一台机器就足够了,不过两台可以用来测试向集群添加更多节点。 +2. [配置防火墙][6],允许 6443 和 8372 端口的通信。或者,你也可以简单地运行 `systemctl stop firewalld` 来为这次实验关闭防火墙。 + +### 安装 k3s + +安装 k3s 非常简单。直接运行安装脚本: + +``` +curl -sfL https://get.k3s.io | sh - +``` + +它会下载、安装并启动 k3s。安装完成后,运行以下命令来从服务器获取节点列表: + +``` +kubectl get nodes +``` + +需要注意的是,有几个选项可以通过环境变量传递给安装脚本。这些选项可以在[文档][7]中找到。当然,你也完全可以直接下载二进制文件来手动安装 k3s。 + +对于实验和学习来说,这样已经很棒了,不过单节点的集群也不能算一个集群。幸运的是,添加另一个节点并不比设置第一个节点要难。只需要向安装脚本传递两个环境变量,它就可以找到第一个节点,而不用运行 k3s 的服务器部分。 + +``` +curl -sfL https://get.k3s.io | K3S_URL=https://example-url:6443 \ + K3S_TOKEN=XXX sh - +``` + +上面的 `example-url` 应被替换为第一个节点的 IP 地址,或一个完全限定域名。在该节点中,(用 XXX 表示的)令牌可以在 `/var/lib/rancher/k3s/server/node-token` 文件中找到。 + +### 部署一些容器 + +现在我们有了一个 Kubernetes 集群,我们可以真正做些什么呢?让我们从部署一个简单的 Web 服务器开始吧。 + +``` +kubectl create deployment my-server --image nginx +``` + +这会从名为 `nginx` 的容器镜像中创建出一个名叫 `my-server` 的 [部署][8](默认使用 docker hub 注册中心,以及 `latest` 标签)。 + +``` +kubectl get pods +``` + +为了访问到 pod 中运行的 nginx 服务器,首先通过一个 [服务][9] 来暴露该部署。以下命令将创建一个与该部署同名的服务。 + +``` +kubectl expose deployment my-server --port 80 +``` + +服务将作为一种负载均衡器和 Pod 的 DNS 记录来工作。比如,当运行第二个 Pod 时,我们只需指定 `my-server`(服务名称)就可以通过 `curl` 访问 nginx 服务器。有关如何操作,可以看下面的实例。 + +``` +# 启动一个 pod,在里面以交互方式运行 bash +kubectl run debug --generator=run-pod/v1 --image=fedora -it -- bash +# 等待 bash 提示符出现 +curl my-server +# 你可以看到“Welcome to nginx!”的输出页面 +``` + +### Ingress 控制器及外部 IP + +默认状态下,一个服务只能获得一个 ClusterIP(只能从集群内部访问),但你也可以通过把它的类型设置为 [LoadBalancer][10] 为该服务申请一个外部 IP。不过,并非所有应用都需要自己的 IP 地址。相反,通常可以通过基于 Host 请求头部或请求路径进行路由,从而使多个服务共享一个 IP 地址。你可以在 Kubernetes 使用 [Ingress][11] 完成此操作,而这也是我们要做的。Ingress 也提供了额外的功能,比如无需配置应用即可对流量进行 TLS 加密。 + +Kubernetes 需要 Ingress 控制器来使 Ingress 资源工作,k3s 包含 [Traefik][12] 正是出于此目的。它还包含了一个简单的服务负载均衡器,可以为集群中的服务提供外部 IP。这篇[文档][13]描述了这种服务: + +> k3s 包含一个使用可用主机端口的基础服务负载均衡器。比如,如果你尝试创建一个监听 80 端口的负载均衡器,它会尝试在集群中寻找一个 80 端口空闲的节点。如果没有可用端口,那么负载均衡器将保持在 Pending 状态。 +> +> k3s README + +Ingress 控制器已经通过这个负载均衡器暴露在外。你可以使用以下命令找到它正在使用的 IP 地址。 + +``` +$ kubectl get svc --all-namespaces +NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE + default kubernetes ClusterIP 10.43.0.1 443/TCP 33d + default my-server ClusterIP 10.43.174.38 80/TCP 30m + kube-system kube-dns ClusterIP 10.43.0.10 53/UDP,53/TCP,9153/TCP 33d + kube-system traefik LoadBalancer 10.43.145.104 10.0.0.8 80:31596/TCP,443:31539/TCP 33d +``` + +找到名为 `traefik` 的服务。在上面的例子中,我们感兴趣的 IP 是 10.0.0.8。 + +### 路由传入的请求 + +让我们创建一个 Ingress,使它通过基于 Host 头部的路由规则将请求路由至我们的服务器。这个例子中我们使用 [xip.io][14] 来避免必要的 DNS 记录配置工作。它的工作原理是将 IP 地址作为子域包含,以使用 `10.0.0.8.xip.io` 的任何子域来达到 IP `10.0.0.8`。换句话说,`my-server.10.0.0.8.xip.io` 被用于访问集群中的 Ingress 控制器。你现在就可以尝试(使用你自己的 IP,而不是 10.0.0.8)。如果没有 Ingress,你应该会访问到“默认后端”,只是一个写着“404 page not found”的页面。 + +我们可以使用以下 Ingress 让 Ingress 控制器将请求路由到我们的 Web 服务器的服务。 + +``` +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: my-server +spec: + rules: + - host: my-server.10.0.0.8.xip.io + http: + paths: + - path: / + backend: + serviceName: my-server + servicePort: 80 +``` + +将以上片段保存到 `my-ingress.yaml` 文件中,然后运行以下命令将其加入集群: + +``` +kubectl apply -f my-ingress.yaml +``` + +你现在应该能够在你选择的完全限定域名中访问到 nginx 的默认欢迎页面了。在我的例子中,它是 `my-server.10.0.0.8.xip.io`。Ingress 控制器会通过 Ingress 中包含的信息来路由请求。对 `my-server.10.0.0.8.xip.io` 的请求将被路由到 Ingress 中定义为 `backend` 的服务和端口(在本例中为 `my-server` 和 `80`)。 + +### 那么,物联网呢? + +想象如下场景:你的家或农场周围有很多的设备。它是一个具有各种硬件功能、传感器和执行器的物联网设备的异构集合。也许某些设备拥有摄像头、天气或光线传感器。其它设备可能会被连接起来,用来控制通风、灯光、百叶窗或闪烁的 LED。 + +这种情况下,你想从所有传感器中收集数据,在最终使用它来制定决策和控制执行器之前,也可能会对其进行处理和分析。除此之外,你可能还想配置一个仪表盘来可视化那些正在发生的事情。那么 Kubernetes 如何帮助我们来管理这样的事情呢?我们怎么保证 Pod 在合适的设备上运行? + +简单的答案就是“标签”。你可以根据功能来标记节点,如下所示: + +``` +kubectl label nodes = +# 举例 +kubectl label nodes node2 camera=available +``` + +一旦它们被打上标签,我们就可以轻松地使用 [nodeSelector][15] 为你的工作负载选择合适的节点。拼图的最后一块:如果你想在*所有*合适的节点上运行 Pod,那应该使用 [DaemonSet][16] 而不是部署。换句话说,应为每个使用唯一传感器的数据收集应用程序创建一个 DaemonSet,并使用 nodeSelector 确保它们仅在具有适当硬件的节点上运行。 + +服务发现功能允许 Pod 通过服务名称来寻找彼此,这项功能使得这类分布式系统的管理工作变得易如反掌。你不需要为应用配置 IP 地址或自定义端口,也不需要知道它们。相反,它们可以通过集群中的命名服务轻松找到彼此。 + +#### 充分利用空闲资源 + +随着集群的启动并运行,收集数据并控制灯光和气候,可能使你觉得你已经把它完成了。不过,集群中还有大量的计算资源可以用于其它项目。这才是 Kubernetes 真正出彩的地方。 + +你不必担心这些资源的确切位置,或者去计算是否有足够的内存来容纳额外的应用程序。这正是编排系统所解决的问题!你可以轻松地在集群中部署更多的应用,让 Kubernetes 来找出适合运行它们的位置(或是否适合运行它们)。 + +为什么不运行一个你自己的 [NextCloud][17] 实例呢?或者运行 [gitea][18]?你还可以为你所有的物联网容器设置一套 CI/CD 流水线。毕竟,如果你可以在集群中进行本地构建,为什么还要在主计算机上构建并交叉编译它们呢? + +这里的要点是,Kubernetes 可以更容易地利用那些你可能浪费掉的“隐藏”资源。Kubernetes 根据可用资源和容错处理规则来调度 Pod,因此你也无需手动完成这些工作。但是,为了帮助 Kubernetes 做出合理的决定,你绝对应该为你的工作负载添加[资源请求][19]配置。 + +### 总结 + +尽管 Kuberenetes 或一般的容器编排平台通常不会与物联网相关联,但在管理分布式系统时,使用一个编排系统肯定是有意义的。你不仅可以使用统一的方式来处理多样化和异构的设备,还可以简化它们的通信方式。此外,Kubernetes 还可以更好地对闲置资源加以利用。 + +容器技术使构建“随处运行”应用的想法成为可能。现在,Kubernetes 可以更轻松地来负责“随处”的部分。作为构建一切的不可变基础,我们使用 Fedora IoT。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/kubernetes-on-fedora-iot-with-k3s/ + +作者:[Lennart Jern][a] +选题:[lujun9972][b] +译者:[StdioA](https://github.com/StdioA) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lennartj/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/k3s-1-816x345.png +[2]: https://linux.cn/article-10380-1.html +[3]: https://hub.helm.sh/ +[4]: https://k3s.io +[5]: https://docs.fedoraproject.org/en-US/iot/getting-started/ +[6]: https://github.com/rancher/k3s#open-ports--network-security +[7]: https://github.com/rancher/k3s#systemd +[8]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[9]: https://kubernetes.io/docs/concepts/services-networking/service/ +[10]: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer +[11]: https://kubernetes.io/docs/concepts/services-networking/ingress/ +[12]: https://traefik.io/ +[13]: https://github.com/rancher/k3s/blob/master/README.md#service-load-balancer +[14]: http://xip.io/ +[15]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +[16]: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/ +[17]: https://nextcloud.com/ +[18]: https://gitea.io/en-us/ +[19]: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ diff --git a/published/201905/20190416 Building a DNS-as-a-service with OpenStack Designate.md b/published/201905/20190416 Building a DNS-as-a-service with OpenStack Designate.md new file mode 100644 index 0000000000..162097e5a9 --- /dev/null +++ b/published/201905/20190416 Building a DNS-as-a-service with OpenStack Designate.md @@ -0,0 +1,347 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10840-1.html) +[#]: subject: (Building a DNS-as-a-service with OpenStack Designate) +[#]: via: (https://opensource.com/article/19/4/getting-started-openstack-designate) +[#]: author: (Amjad Yaseen https://opensource.com/users/ayaseen) + +用 OpenStack Designate 构建一个 DNS 即服务(DNSaaS) +====== + +> 学习如何安装和配置 Designate,这是一个 OpenStack 的多租户 DNS 即服务(DNSaaS)。 + +![Command line prompt](https://img.linux.net.cn/data/attachment/album/201905/11/110822rjub9wtwtwtmccet.jpg) + +[Designate][2] 是一个多租户的 DNS 即服务,它包括一个用于域名和记录管理的 REST API 和集成了 [Neutron][3] 的框架,并支持 Bind9。 + +DNSaaS 可以提供: + + * 一个管理区域和记录的干净利落的 REST API + * 自动生成记录(集成 OpenStack) + * 支持多个授权名字服务器 + * 可以托管多个项目/组织 + +![Designate's architecture][4] + +这篇文章解释了如何在 CentOS 和 RHEL 上手动安装和配置 Designate 的最新版本,但是同样的配置也可以用在其它发行版上。 + +### 在 OpenStack 上安装 Designate + +在我的 [GitHub 仓库][5]里,我已经放了 Ansible 的 bind 和 Designate 角色的示范设置。 + +这个设置假定 bing 服务是安装 OpenStack 控制器节点之外(即使你可以在本地安装 bind)。 + +1、在 OpenStack 控制节点上安装 Designate 和 bind 软件包: + +``` +# yum install openstack-designate-* bind bind-utils -y +``` + +2、创建 Designate 数据库和用户: + +``` +MariaDB [(none)]> CREATE DATABASE designate CHARACTER SET utf8 COLLATE utf8_general_ci; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO \ +'designate'@'localhost' IDENTIFIED BY 'rhlab123'; + +MariaDB [(none)]> GRANT ALL PRIVILEGES ON designate.* TO 'designate'@'%' \ +IDENTIFIED BY 'rhlab123'; +``` + +注意:bind 包必须安装在控制节点之外才能使远程名字服务控制Remote Name Daemon Control(RNDC)功能正常。 + +### 配置 bind(DNS 服务器) + +1、生成 RNDC 文件: + +``` +rndc-confgen -a -k designate -c /etc/rndc.key -r /dev/urandom + +cat < etcrndc.conf +include "/etc/rndc.key"; +options { + default-key "designate"; + default-server {{ DNS_SERVER_IP }}; + default-port 953; +}; +EOF +``` + +2、将下列配置添加到 `named.conf`: + +``` +include "/etc/rndc.key"; +controls { + inet {{ DNS_SERVER_IP }} allow { localhost;{{ CONTROLLER_SERVER_IP }}; } keys { "designate"; }; +}; +``` + +在 `option` 节中,添加: + +``` +options { + ... + allow-new-zones yes; + request-ixfr no; + listen-on port 53 { any; }; + recursion no; + allow-query { 127.0.0.1; {{ CONTROLLER_SERVER_IP }}; }; +}; +``` + +添加正确的权限: + +``` +chown named:named /etc/rndc.key +chown named:named /etc/rndc.conf +chmod 600 /etc/rndc.key +chown -v root:named /etc/named.conf +chmod g+w /var/named + +# systemctl restart named +# setsebool named_write_master_zones 1 +``` + +3、把 `rndc.key` 和 `rndc.conf` 推入 OpenStack 控制节点: + +``` +# scp -r /etc/rndc* {{ CONTROLLER_SERVER_IP }}:/etc/ +``` + +### 创建 OpenStack Designate 服务和端点 + +输入: + +``` +# openstack user create --domain default --password-prompt designate +# openstack role add --project services --user designate admin +# openstack service create --name designate --description "DNS" dns + +# openstack endpoint create --region RegionOne dns public http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns internal http://{{ CONTROLLER_SERVER_IP }}:9001/ +# openstack endpoint create --region RegionOne dns admin http://{{ CONTROLLER_SERVER_IP }}:9001/ +``` + +### 配置 Designate 服务 + +1、编辑 `/etc/designate/designate.conf`: + +在 `[service:api]` 节配置 `auth_strategy`: + +``` +[service:api] +listen = 0.0.0.0:9001 +auth_strategy = keystone +api_base_uri = http://{{ CONTROLLER_SERVER_IP }}:9001/ +enable_api_v2 = True +enabled_extensions_v2 = quotas, reports +``` + +在 `[keystone_authtoken]` 节配置下列选项: + +``` +[keystone_authtoken] +auth_type = password +username = designate +password = rhlab123 +project_name = service +project_domain_name = Default +user_domain_name = Default +www_authenticate_uri = http://{{ CONTROLLER_SERVER_IP }}:5000/ +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000/ +``` + +在 `[service:worker]` 节,启用 worker 模型: + +``` +enabled = True +notify = True +``` + +在 `[storage:sqlalchemy]` 节,配置数据库访问: + +``` +[storage:sqlalchemy] +connection = mysql+pymysql://designate:rhlab123@{{ CONTROLLER_SERVER_IP }}/designate +``` + +填充 Designate 数据库: + +``` +# su -s /bin/sh -c "designate-manage database sync" designate +``` + +2、 创建 Designate 的 `pools.yaml` 文件(包含 target 和 bind 细节): + +编辑 `/etc/designate/pools.yaml`: + +``` +- name: default + # The name is immutable. There will be no option to change the name after + # creation and the only way will to change it will be to delete it + # (and all zones associated with it) and recreate it. + description: Default Pool + + attributes: {} + + # List out the NS records for zones hosted within this pool + # This should be a record that is created outside of designate, that + # points to the public IP of the controller node. + ns_records: + - hostname: {{Controller_FQDN}}. # Thisis mDNS + priority: 1 + + # List out the nameservers for this pool. These are the actual BIND servers. + # We use these to verify changes have propagated to all nameservers. + nameservers: + - host: {{ DNS_SERVER_IP }} + port: 53 + + # List out the targets for this pool. For BIND there will be one + # entry for each BIND server, as we have to run rndc command on each server + targets: + - type: bind9 + description: BIND9 Server 1 + + # List out the designate-mdns servers from which BIND servers should + # request zone transfers (AXFRs) from. + # This should be the IP of the controller node. + # If you have multiple controllers you can add multiple masters + # by running designate-mdns on them, and adding them here. + masters: + - host: {{ CONTROLLER_SERVER_IP }} + port: 5354 + + # BIND Configuration options + options: + host: {{ DNS_SERVER_IP }} + port: 53 + rndc_host: {{ DNS_SERVER_IP }} + rndc_port: 953 + rndc_key_file: /etc/rndc.key + rndc_config_file: /etc/rndc.conf +``` + +填充 Designate 池: + +``` +su -s /bin/sh -c "designate-manage pool update" designate +``` + +3、启动 Designate 中心和 API 服务: + +``` +systemctl enable --now designate-central designate-api +``` + +4、验证 Designate 服务运行: + +``` +# openstack dns service list + ++--------------+--------+-------+--------------+ +| service_name | status | stats | capabilities | ++--------------+--------+-------+--------------+ +| central | UP | - | - | +| api | UP | - | - | +| mdns | UP | - | - | +| worker | UP | - | - | +| producer | UP | - | - | ++--------------+--------+-------+--------------+ +``` + +### 用外部 DNS 配置 OpenStack Neutron + +1、为 Designate 服务配置 iptables: + +``` +# iptables -I INPUT -p tcp -m multiport --dports 9001 -m comment --comment "designate incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 5354 -m comment --comment "Designate mdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 53 -m comment --comment "bind incoming" -j ACCEPT + +# iptables -I INPUT -p udp -m multiport --dports 53 -m comment --comment "bind/powerdns incoming" -j ACCEPT + +# iptables -I INPUT -p tcp -m multiport --dports 953 -m comment --comment "rndc incoming - bind only" -j ACCEPT + +# service iptables save; service iptables restart +# setsebool named_write_master_zones 1 +``` + +2、 编辑 `/etc/neutron/neutron.conf` 的 `[default]` 节: + +``` +external_dns_driver = designate +``` + +3、 在 `/etc/neutron/neutron.conf` 中添加 `[designate]` 节: + +``` +[designate] +url = http://{{ CONTROLLER_SERVER_IP }}:9001/v2 ## This end point of designate +auth_type = password +auth_url = http://{{ CONTROLLER_SERVER_IP }}:5000 +username = designate +password = rhlab123 +project_name = services +project_domain_name = Default +user_domain_name = Default +allow_reverse_dns_lookup = True +ipv4_ptr_zone_prefix_size = 24 +ipv6_ptr_zone_prefix_size = 116 +``` + +4、编辑 `neutron.conf` 的 `dns_domain`: + +``` +dns_domain = rhlab.dev. +``` + +重启: + +``` +# systemctl restart neutron-* +``` + +5、在 `/etc/neutron/plugins/ml2/ml2_conf.ini` 中的组成层 2(ML2)中添加 `dns`: + +``` +extension_drivers=port_security,qos,dns +``` + +6、在 Designate 中添加区域: + +``` +# openstack zone create –email=admin@rhlab.dev rhlab.dev. +``` + +在 `rhlab.dev` 区域中添加记录: + +``` +# openstack recordset create --record '192.168.1.230' --type A rhlab.dev. Test +``` + +Designate 现在就安装和配置好了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/getting-started-openstack-designate + +作者:[Amjad Yaseen][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/ayaseen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://docs.openstack.org/designate/latest/ +[3]: /article/19/3/openstack-neutron +[4]: https://opensource.com/sites/default/files/uploads/openstack_designate_architecture.png (Designate's architecture) +[5]: https://github.com/ayaseen/designate diff --git a/published/201905/20190416 Detecting malaria with deep learning.md b/published/201905/20190416 Detecting malaria with deep learning.md new file mode 100644 index 0000000000..a1ce049292 --- /dev/null +++ b/published/201905/20190416 Detecting malaria with deep learning.md @@ -0,0 +1,780 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10891-1.html) +[#]: subject: (Detecting malaria with deep learning) +[#]: via: (https://opensource.com/article/19/4/detecting-malaria-deep-learning) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) + +使用深度学习检测疟疾 +================== + +> 人工智能结合开源硬件工具能够提升严重传染病疟疾的诊断。 + +![][1] + +人工智能(AI)和开源工具、技术和框架是促进社会进步的强有力的结合。“健康就是财富”可能有点陈词滥调,但它却是非常准确的!在本篇文章,我们将测试 AI 是如何与低成本、有效、精确的开源深度学习方法结合起来一起用来检测致死的传染病疟疾。 + +我既不是一个医生,也不是一个医疗保健研究者,我也绝不像他们那样合格,我只是对将 AI 应用到医疗保健研究感兴趣。在这片文章中我的想法是展示 AI 和开源解决方案如何帮助疟疾检测和减少人工劳动的方法。 + +![Python and TensorFlow][2] + +*Python 和 TensorFlow: 一个构建开源深度学习方法的很棒的结合* + +感谢 Python 的强大和像 TensorFlow 这样的深度学习框架,我们能够构建健壮的、大规模的、有效的深度学习方法。因为这些工具是自由和开源的,我们能够构建非常经济且易于被任何人采纳和使用的解决方案。让我们开始吧! + +### 项目动机 + +疟疾是由*疟原虫*造成的致死的、有传染性的、蚊子传播的疾病,主要通过受感染的雌性按蚊叮咬传播。共有五种寄生虫能够引起疟疾,但是大多数病例是这两种类型造成的:恶性疟原虫和间日疟原虫。 + +![疟疾热图][3] + +这个地图显示了疟疾在全球传播分布形势,尤其在热带地区,但疾病的性质和致命性是该项目的主要动机。 + +如果一只受感染雌性蚊子叮咬了你,蚊子携带的寄生虫进入你的血液,并且开始破坏携带氧气的红细胞(RBC)。通常,疟疾的最初症状类似于流感病毒,在蚊子叮咬后,他们通常在几天或几周内发作。然而,这些致死的寄生虫可以在你的身体里生存长达一年并且不会造成任何症状,延迟治疗可能造成并发症甚至死亡。因此,早期的检查能够挽救生命。 + +世界健康组织(WHO)的[疟疾实情][4]表明,世界近乎一半的人口面临疟疾的风险,有超过 2 亿的疟疾病例,每年由于疟疾造成的死亡将近 40 万。这是使疟疾检测和诊断快速、简单和有效的一个动机。 + +### 检测疟疾的方法 + +有几种方法能够用来检测和诊断疟疾。该文中的项目就是基于 Rajaraman, et al. 的论文:“[预先训练的卷积神经网络作为特征提取器,用于改善薄血涂片图像中的疟疾寄生虫检测][5]”介绍的一些方法,包含聚合酶链反应(PCR)和快速诊断测试(RDT)。这两种测试通常用于无法提供高质量显微镜服务的地方。 + +标准的疟疾诊断通常是基于血液涂片工作流程的,根据 Carlos Ariza 的文章“[Malaria Hero:一个更快诊断疟原虫的网络应用][6]”,我从中了解到 Adrian Rosebrock 的“[使用 Keras 的深度学习和医学图像分析][7]”。我感激这些优秀的资源的作者,让我在疟原虫预防、诊断和治疗方面有了更多的想法。 + +![疟原虫检测的血涂片工作流程][8] + +*一个疟原虫检测的血涂片工作流程* + +根据 WHO 方案,诊断通常包括对放大 100 倍的血涂片的集中检测。受过训练的人们手工计算在 5000 个细胞中有多少红细胞中包含疟原虫。正如上述解释中引用的 Rajaraman, et al. 的论文: + +> 厚血涂片有助于检测寄生虫的存在,而薄血涂片有助于识别引起感染的寄生虫种类(疾病控制和预防中心, 2012)。诊断准确性在很大程度上取决于诊断人的专业知识,并且可能受到观察者间差异和疾病流行/资源受限区域大规模诊断所造成的不利影响(Mitiku, Mengistu 和 Gelaw, 2003)。可替代的技术是使用聚合酶链反应(PCR)和快速诊断测试(RDT);然而,PCR 分析受限于它的性能(Hommelsheim, et al., 2014),RDT 在疾病流行的地区成本效益低(Hawkes, Katsuva 和 Masumbuko, 2009)。 + +因此,疟疾检测可能受益于使用机器学习的自动化。 + +### 疟疾检测的深度学习 + +人工诊断血涂片是一个繁重的手工过程,需要专业知识来分类和计数被寄生虫感染的和未感染的细胞。这个过程可能不能很好的规模化,尤其在那些专业人士不足的地区。在利用最先进的图像处理和分析技术提取人工选取特征和构建基于机器学习的分类模型方面取得了一些进展。然而,这些模型不能大规模推广,因为没有更多的数据用来训练,并且人工选取特征需要花费很长时间。 + +深度学习模型,或者更具体地讲,卷积神经网络(CNN),已经被证明在各种计算机视觉任务中非常有效。(如果你想更多的了解关于 CNN 的背景知识,我推荐你阅读[视觉识别的 CS2331n 卷积神经网络][9]。)简单地讲,CNN 模型的关键层包含卷积和池化层,正如下图所示。 + +![A typical CNN architecture][10] + +*一个典型的 CNN 架构* + +卷积层从数据中学习空间层级模式,它是平移不变的,因此它们能够学习图像的不同方面。例如,第一个卷积层将学习小的和局部图案,例如边缘和角落,第二个卷积层将基于第一层的特征学习更大的图案,等等。这允许 CNN 自动化提取特征并且学习对于新数据点通用的有效的特征。池化层有助于下采样和减少尺寸。 + +因此,CNN 有助于自动化和规模化的特征工程。同样,在模型末尾加上密集层允许我们执行像图像分类这样的任务。使用像 CNN 这样的深度学习模型自动的疟疾检测可能非常有效、便宜和具有规模性,尤其是迁移学习和预训练模型效果非常好,甚至在少量数据的约束下。 + +Rajaraman, et al. 的论文在一个数据集上利用六个预训练模型在检测疟疾对比无感染样本获取到令人吃惊的 95.9% 的准确率。我们的重点是从头开始尝试一些简单的 CNN 模型和用一个预训练的训练模型使用迁移学习来查看我们能够从相同的数据集中得到什么。我们将使用开源工具和框架,包括 Python 和 TensorFlow,来构建我们的模型。 + +### 数据集 + +我们分析的数据来自 Lister Hill 国家生物医学交流中心(LHNCBC)的研究人员,该中心是国家医学图书馆(NLM)的一部分,他们细心收集和标记了公开可用的健康和受感染的血涂片图像的[数据集][11]。这些研究者已经开发了一个运行在 Android 智能手机的[疟疾检测手机应用][12],连接到一个传统的光学显微镜。它们使用吉姆萨染液将 150 个受恶性疟原虫感染的和 50 个健康病人的薄血涂片染色,这些薄血涂片是在孟加拉的吉大港医学院附属医院收集和照相的。使用智能手机的内置相机获取每个显微镜视窗内的图像。这些图片由在泰国曼谷的马希多-牛津热带医学研究所的一个专家使用幻灯片阅读器标记的。 + +让我们简要地查看一下数据集的结构。首先,我将安装一些基础的依赖(基于使用的操作系统)。 + +![Installing dependencies][13] + +我使用的是云上的带有一个 GPU 的基于 Debian 的操作系统,这样我能更快的运行我的模型。为了查看目录结构,我们必须使用 `sudo apt install tree` 安装 `tree` 及其依赖(如果我们没有安装的话)。 + +![Installing the tree dependency][14] + +我们有两个文件夹包含血细胞的图像,包括受感染的和健康的。我们通过输入可以获取关于图像总数更多的细节: + +``` +import os +import glob + +base_dir = os.path.join('./cell_images') +infected_dir = os.path.join(base_dir,'Parasitized') +healthy_dir = os.path.join(base_dir,'Uninfected') + +infected_files = glob.glob(infected_dir+'/*.png') +healthy_files = glob.glob(healthy_dir+'/*.png') +len(infected_files), len(healthy_files) + +# Output +(13779, 13779) +``` + +看起来我们有一个平衡的数据集,包含 13,779 张疟疾的和 13,779 张非疟疾的(健康的)血细胞图像。让我们根据这些构建数据帧,我们将用这些数据帧来构建我们的数据集。 + + +``` +import numpy as np +import pandas as pd + +np.random.seed(42) + +files_df = pd.DataFrame({ + 'filename': infected_files + healthy_files, + 'label': ['malaria'] * len(infected_files) + ['healthy'] * len(healthy_files) +}).sample(frac=1, random_state=42).reset_index(drop=True) + +files_df.head() +``` + +![Datasets][15] + +### 构建和了解图像数据集 + +为了构建深度学习模型,我们需要训练数据,但是我们还需要使用不可见的数据测试模型的性能。相应的,我们将使用 60:10:30 的比例来划分用于训练、验证和测试的数据集。我们将在训练期间应用训练和验证数据集,并用测试数据集来检查模型的性能。 + + +``` +from sklearn.model_selection import train_test_split +from collections import Counter + +train_files, test_files, train_labels, test_labels = train_test_split(files_df['filename'].values, + files_df['label'].values, + test_size=0.3, random_state=42) +train_files, val_files, train_labels, val_labels = train_test_split(train_files, + train_labels, + test_size=0.1, random_state=42) + +print(train_files.shape, val_files.shape, test_files.shape) +print('Train:', Counter(train_labels), '\nVal:', Counter(val_labels), '\nTest:', Counter(test_labels)) + +# Output +(17361,) (1929,) (8268,) +Train: Counter({'healthy': 8734, 'malaria': 8627}) +Val: Counter({'healthy': 970, 'malaria': 959}) +Test: Counter({'malaria': 4193, 'healthy': 4075}) +``` + +这些图片尺寸并不相同,因为血涂片和细胞图像是基于人、测试方法、图片方向不同而不同的。让我们总结我们的训练数据集的统计信息来决定最佳的图像尺寸(牢记,我们根本不会碰测试数据集)。 + +``` +import cv2 +from concurrent import futures +import threading + +def get_img_shape_parallel(idx, img, total_imgs): + if idx % 5000 == 0 or idx == (total_imgs - 1): + print('{}: working on img num: {}'.format(threading.current_thread().name, + idx)) + return cv2.imread(img).shape + +ex = futures.ThreadPoolExecutor(max_workers=None) +data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +print('Starting Img shape computation:') +train_img_dims_map = ex.map(get_img_shape_parallel, + [record[0] for record in data_inp], + [record[1] for record in data_inp], + [record[2] for record in data_inp]) +train_img_dims = list(train_img_dims_map) +print('Min Dimensions:', np.min(train_img_dims, axis=0)) +print('Avg Dimensions:', np.mean(train_img_dims, axis=0)) +print('Median Dimensions:', np.median(train_img_dims, axis=0)) +print('Max Dimensions:', np.max(train_img_dims, axis=0)) + + +# Output +Starting Img shape computation: +ThreadPoolExecutor-0_0: working on img num: 0 +ThreadPoolExecutor-0_17: working on img num: 5000 +ThreadPoolExecutor-0_15: working on img num: 10000 +ThreadPoolExecutor-0_1: working on img num: 15000 +ThreadPoolExecutor-0_7: working on img num: 17360 +Min Dimensions: [46 46 3] +Avg Dimensions: [132.77311215 132.45757733 3.] +Median Dimensions: [130. 130. 3.] +Max Dimensions: [385 394 3] +``` + +我们应用并行处理来加速图像读取,并且基于汇总统计结果,我们将每幅图片的尺寸重新调整到 125x125 像素。让我们载入我们所有的图像并重新调整它们为这些固定尺寸。 + +``` +IMG_DIMS = (125, 125) + +def get_img_data_parallel(idx, img, total_imgs): + if idx % 5000 == 0 or idx == (total_imgs - 1): + print('{}: working on img num: {}'.format(threading.current_thread().name, + idx)) + img = cv2.imread(img) + img = cv2.resize(img, dsize=IMG_DIMS, + interpolation=cv2.INTER_CUBIC) + img = np.array(img, dtype=np.float32) + return img + +ex = futures.ThreadPoolExecutor(max_workers=None) +train_data_inp = [(idx, img, len(train_files)) for idx, img in enumerate(train_files)] +val_data_inp = [(idx, img, len(val_files)) for idx, img in enumerate(val_files)] +test_data_inp = [(idx, img, len(test_files)) for idx, img in enumerate(test_files)] + +print('Loading Train Images:') +train_data_map = ex.map(get_img_data_parallel, + [record[0] for record in train_data_inp], + [record[1] for record in train_data_inp], + [record[2] for record in train_data_inp]) +train_data = np.array(list(train_data_map)) + +print('\nLoading Validation Images:') +val_data_map = ex.map(get_img_data_parallel, + [record[0] for record in val_data_inp], + [record[1] for record in val_data_inp], + [record[2] for record in val_data_inp]) +val_data = np.array(list(val_data_map)) + +print('\nLoading Test Images:') +test_data_map = ex.map(get_img_data_parallel, + [record[0] for record in test_data_inp], + [record[1] for record in test_data_inp], + [record[2] for record in test_data_inp]) +test_data = np.array(list(test_data_map)) + +train_data.shape, val_data.shape, test_data.shape + + +# Output +Loading Train Images: +ThreadPoolExecutor-1_0: working on img num: 0 +ThreadPoolExecutor-1_12: working on img num: 5000 +ThreadPoolExecutor-1_6: working on img num: 10000 +ThreadPoolExecutor-1_10: working on img num: 15000 +ThreadPoolExecutor-1_3: working on img num: 17360 + +Loading Validation Images: +ThreadPoolExecutor-1_13: working on img num: 0 +ThreadPoolExecutor-1_18: working on img num: 1928 + +Loading Test Images: +ThreadPoolExecutor-1_5: working on img num: 0 +ThreadPoolExecutor-1_19: working on img num: 5000 +ThreadPoolExecutor-1_8: working on img num: 8267 +((17361, 125, 125, 3), (1929, 125, 125, 3), (8268, 125, 125, 3)) +``` + +我们再次应用并行处理来加速有关图像载入和重新调整大小的计算。最终,我们获得了所需尺寸的图片张量,正如前面的输出所示。我们现在查看一些血细胞图像样本,以对我们的数据有个印象。 + +``` +import matplotlib.pyplot as plt +%matplotlib inline + +plt.figure(1 , figsize = (8 , 8)) +n = 0 +for i in range(16): + n += 1 + r = np.random.randint(0 , train_data.shape[0] , 1) + plt.subplot(4 , 4 , n) + plt.subplots_adjust(hspace = 0.5 , wspace = 0.5) + plt.imshow(train_data[r[0]]/255.) + plt.title('{}'.format(train_labels[r[0]])) + plt.xticks([]) , plt.yticks([]) +``` + +![Malaria cell samples][16] + +基于这些样本图像,我们看到一些疟疾和健康细胞图像的细微不同。我们将使我们的深度学习模型试图在模型训练中学习这些模式。 + +开始我们的模型训练前,我们必须建立一些基础的配置设置。 + +``` +BATCH_SIZE = 64 +NUM_CLASSES = 2 +EPOCHS = 25 +INPUT_SHAPE = (125, 125, 3) + +train_imgs_scaled = train_data / 255. +val_imgs_scaled = val_data / 255. + +# encode text category labels +from sklearn.preprocessing import LabelEncoder + +le = LabelEncoder() +le.fit(train_labels) +train_labels_enc = le.transform(train_labels) +val_labels_enc = le.transform(val_labels) + +print(train_labels[:6], train_labels_enc[:6]) + + +# Output +['malaria' 'malaria' 'malaria' 'healthy' 'healthy' 'malaria'] [1 1 1 0 0 1] +``` + +我们修复我们的图像尺寸、批量大小,和纪元,并编码我们的分类的类标签。TensorFlow 2.0 于 2019 年三月发布,这个练习是尝试它的完美理由。 + +``` +import tensorflow as tf + +# Load the TensorBoard notebook extension (optional) +%load_ext tensorboard.notebook + +tf.random.set_seed(42) +tf.__version__ + +# Output +'2.0.0-alpha0' +``` + +### 深度学习训练 + +在模型训练阶段,我们将构建三个深度训练模型,使用我们的训练集训练,使用验证数据比较它们的性能。然后,我们保存这些模型并在之后的模型评估阶段使用它们。 + +#### 模型 1:从头开始的 CNN + +我们的第一个疟疾检测模型将从头开始构建和训练一个基础的 CNN。首先,让我们定义我们的模型架构, + +``` +inp = tf.keras.layers.Input(shape=INPUT_SHAPE) + +conv1 = tf.keras.layers.Conv2D(32, kernel_size=(3, 3), + activation='relu', padding='same')(inp) +pool1 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv1) +conv2 = tf.keras.layers.Conv2D(64, kernel_size=(3, 3), + activation='relu', padding='same')(pool1) +pool2 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv2) +conv3 = tf.keras.layers.Conv2D(128, kernel_size=(3, 3), + activation='relu', padding='same')(pool2) +pool3 = tf.keras.layers.MaxPooling2D(pool_size=(2, 2))(conv3) + +flat = tf.keras.layers.Flatten()(pool3) + +hidden1 = tf.keras.layers.Dense(512, activation='relu')(flat) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=inp, outputs=out) +model.compile(optimizer='adam', + loss='binary_crossentropy', + metrics=['accuracy']) +model.summary() + + +# Output +Model: "model" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_1 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +conv2d (Conv2D) (None, 125, 125, 32) 896 +_________________________________________________________________ +max_pooling2d (MaxPooling2D) (None, 62, 62, 32) 0 +_________________________________________________________________ +conv2d_1 (Conv2D) (None, 62, 62, 64) 18496 +_________________________________________________________________ +... +... +_________________________________________________________________ +dense_1 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_1 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_2 (Dense) (None, 1) 513 +================================================================= +Total params: 15,102,529 +Trainable params: 15,102,529 +Non-trainable params: 0 +_________________________________________________________________ +``` + +基于这些代码的架构,我们的 CNN 模型有三个卷积和一个池化层,其后是两个致密层,以及用于正则化的失活。让我们训练我们的模型。 + + +``` +import datetime + +logdir = os.path.join('/home/dipanzan_sarkar/projects/tensorboard_logs', + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")) +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, + patience=2, min_lr=0.000001) +callbacks = [reduce_lr, tensorboard_callback] + +history = model.fit(x=train_imgs_scaled, y=train_labels_enc, + batch_size=BATCH_SIZE, + epochs=EPOCHS, + validation_data=(val_imgs_scaled, val_labels_enc), + callbacks=callbacks, + verbose=1) + + +# Output +Train on 17361 samples, validate on 1929 samples +Epoch 1/25 +17361/17361 [====] - 32s 2ms/sample - loss: 0.4373 - accuracy: 0.7814 - val_loss: 0.1834 - val_accuracy: 0.9393 +Epoch 2/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.1725 - accuracy: 0.9434 - val_loss: 0.1567 - val_accuracy: 0.9513 +... +... +Epoch 24/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0036 - accuracy: 0.9993 - val_loss: 0.3693 - val_accuracy: 0.9565 +Epoch 25/25 +17361/17361 [====] - 30s 2ms/sample - loss: 0.0034 - accuracy: 0.9994 - val_loss: 0.3699 - val_accuracy: 0.9559 +``` + +我们获得了 95.6% 的验证精确率,这很好,尽管我们的模型看起来有些过拟合(通过查看我们的训练精确度,是 99.9%)。通过绘制训练和验证的精度和损失曲线,我们可以清楚地看到这一点。 + + +``` +f, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4)) +t = f.suptitle('Basic CNN Performance', fontsize=12) +f.subplots_adjust(top=0.85, wspace=0.3) + +max_epoch = len(history.history['accuracy'])+1 +epoch_list = list(range(1,max_epoch)) +ax1.plot(epoch_list, history.history['accuracy'], label='Train Accuracy') +ax1.plot(epoch_list, history.history['val_accuracy'], label='Validation Accuracy') +ax1.set_xticks(np.arange(1, max_epoch, 5)) +ax1.set_ylabel('Accuracy Value') +ax1.set_xlabel('Epoch') +ax1.set_title('Accuracy') +l1 = ax1.legend(loc="best") + +ax2.plot(epoch_list, history.history['loss'], label='Train Loss') +ax2.plot(epoch_list, history.history['val_loss'], label='Validation Loss') +ax2.set_xticks(np.arange(1, max_epoch, 5)) +ax2.set_ylabel('Loss Value') +ax2.set_xlabel('Epoch') +ax2.set_title('Loss') +l2 = ax2.legend(loc="best") +``` + +![Learning curves for basic CNN][17] + +*基础 CNN 学习曲线* + +我们可以看在在第五个纪元,情况并没有改善很多。让我们保存这个模型用于将来的评估。 + +``` +model.save('basic_cnn.h5') +``` + +#### 深度迁移学习 + +就像人类有与生俱来在不同任务间传输知识的能力一样,迁移学习允许我们利用从以前任务学到的知识用到新的相关的任务,即使在机器学习或深度学习的情况下也是如此。如果想深入探究迁移学习,你应该看我的文章“[一个易于理解与现实应用一起学习深度学习中的迁移学习的指导实践][18]”和我的书《[Python 迁移学习实践][19]》。 + +![深度迁移学习的想法][20] + +在这篇实践中我们想要探索的想法是: + +> 在我们的问题背景下,我们能够利用一个预训练深度学习模型(在大数据集上训练的,像 ImageNet)通过应用和迁移知识来解决疟疾检测的问题吗? + +我们将应用两个最流行的深度迁移学习策略。 + + * 预训练模型作为特征提取器 + * 微调的预训练模型 + +我们将使用预训练的 VGG-19 深度训练模型(由剑桥大学的视觉几何组(VGG)开发)进行我们的实验。像 VGG-19 这样的预训练模型是在一个大的数据集([Imagenet][21])上使用了很多不同的图像分类训练的。因此,这个模型应该已经学习到了健壮的特征层级结构,相对于你的 CNN 模型学到的特征,是空间不变的、转动不变的、平移不变的。因此,这个模型,已经从百万幅图片中学习到了一个好的特征显示,对于像疟疾检测这样的计算机视觉问题,可以作为一个好的合适新图像的特征提取器。在我们的问题中发挥迁移学习的能力之前,让我们先讨论 VGG-19 模型。 + +##### 理解 VGG-19 模型 + +VGG-19 模型是一个构建在 ImageNet 数据库之上的 19 层(卷积和全连接的)的深度学习网络,ImageNet 数据库为了图像识别和分类的目的而开发。该模型是由 Karen Simonyan 和 Andrew Zisserman 构建的,在他们的论文“[大规模图像识别的非常深的卷积网络][22]”中进行了描述。VGG-19 的架构模型是: + +![VGG-19 模型架构][23] + +你可以看到我们总共有 16 个使用 3x3 卷积过滤器的卷积层,与最大的池化层来下采样,和由 4096 个单元组成的两个全连接的隐藏层,每个隐藏层之后跟随一个由 1000 个单元组成的致密层,每个单元代表 ImageNet 数据库中的一个分类。我们不需要最后三层,因为我们将使用我们自己的全连接致密层来预测疟疾。我们更关心前五个块,因此我们可以利用 VGG 模型作为一个有效的特征提取器。 + +我们将使用模型之一作为一个简单的特征提取器,通过冻结五个卷积块的方式来确保它们的位权在每个纪元后不会更新。对于最后一个模型,我们会对 VGG 模型进行微调,我们会解冻最后两个块(第 4 和第 5)因此当我们训练我们的模型时,它们的位权在每个时期(每批数据)被更新。 + +#### 模型 2:预训练的模型作为一个特征提取器 + +为了构建这个模型,我们将利用 TensorFlow 载入 VGG-19 模型并冻结卷积块,因此我们能够将它们用作特征提取器。我们在末尾插入我们自己的致密层来执行分类任务。 + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', + input_shape=INPUT_SHAPE) +vgg.trainable = False +# Freeze the layers +for layer in vgg.layers: + layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-4), + loss='binary_crossentropy', + metrics=['accuracy']) +model.summary() + + +# Output +Model: "model_1" +_________________________________________________________________ +Layer (type) Output Shape Param # +================================================================= +input_2 (InputLayer) [(None, 125, 125, 3)] 0 +_________________________________________________________________ +block1_conv1 (Conv2D) (None, 125, 125, 64) 1792 +_________________________________________________________________ +block1_conv2 (Conv2D) (None, 125, 125, 64) 36928 +_________________________________________________________________ +... +... +_________________________________________________________________ +block5_pool (MaxPooling2D) (None, 3, 3, 512) 0 +_________________________________________________________________ +flatten_1 (Flatten) (None, 4608) 0 +_________________________________________________________________ +dense_3 (Dense) (None, 512) 2359808 +_________________________________________________________________ +dropout_2 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_4 (Dense) (None, 512) 262656 +_________________________________________________________________ +dropout_3 (Dropout) (None, 512) 0 +_________________________________________________________________ +dense_5 (Dense) (None, 1) 513 +================================================================= +Total params: 22,647,361 +Trainable params: 2,622,977 +Non-trainable params: 20,024,384 +_________________________________________________________________ +``` + +从整个输出可以明显看出,在我们的模型中我们有了很多层,我们将只利用 VGG-19 模型的冻结层作为特征提取器。你可以使用下列代码来验证我们的模型有多少层是实际可训练的,以及我们的网络中总共存在多少层。 + +``` +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", + sum([1 for l in model.layers if l.trainable])) + +# Output +Total Layers: 28 +Total trainable layers: 6 +``` + +我们将使用和我们之前的模型相似的配置和回调来训练我们的模型。参考[我的 GitHub 仓库][24]以获取训练模型的完整代码。我们观察下列图表,以显示模型精确度和损失曲线。 + +![Learning curves for frozen pre-trained CNN][25] + +*冻结的预训练的 CNN 的学习曲线* + +这表明我们的模型没有像我们的基础 CNN 模型那样过拟合,但是性能有点不如我们的基础的 CNN 模型。让我们保存这个模型,以备将来的评估。 + +``` +model.save('vgg_frozen.h5') +``` + +#### 模型 3:使用图像增强来微调预训练的模型 + +在我们的最后一个模型中,我们将在预定义好的 VGG-19 模型的最后两个块中微调层的位权。我们同样引入了图像增强的概念。图像增强背后的想法和其名字一样。我们从训练数据集中载入现有图像,并且应用转换操作,例如旋转、裁剪、转换、放大缩小等等,来产生新的、改变过的版本。由于这些随机转换,我们每次获取到的图像不一样。我们将应用 tf.keras 中的一个名为 ImageDataGenerator 的优秀工具来帮助构建图像增强器。 + +``` +train_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255, + zoom_range=0.05, + rotation_range=25, + width_shift_range=0.05, + height_shift_range=0.05, + shear_range=0.05, horizontal_flip=True, + fill_mode='nearest') + +val_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255) + +# build image augmentation generators +train_generator = train_datagen.flow(train_data, train_labels_enc, batch_size=BATCH_SIZE, shuffle=True) +val_generator = val_datagen.flow(val_data, val_labels_enc, batch_size=BATCH_SIZE, shuffle=False) +``` + +我们不会对我们的验证数据集应用任何转换(除非是调整大小,因为这是必须的),因为我们将使用它评估每个纪元的模型性能。对于在传输学习环境中的图像增强的详细解释,请随时查看我上面引用的[文章][18]。让我们从一批图像增强转换中查看一些样本结果。 + +``` +img_id = 0 +sample_generator = train_datagen.flow(train_data[img_id:img_id+1], train_labels[img_id:img_id+1], + batch_size=1) +sample = [next(sample_generator) for i in range(0,5)] +fig, ax = plt.subplots(1,5, figsize=(16, 6)) +print('Labels:', [item[1][0] for item in sample]) +l = [ax[i].imshow(sample[i][0][0]) for i in range(0,5)] +``` + +![Sample augmented images][26] + +你可以清晰的看到与之前的输出的我们图像的轻微变化。我们现在构建我们的学习模型,确保 VGG-19 模型的最后两块是可以训练的。 + +``` +vgg = tf.keras.applications.vgg19.VGG19(include_top=False, weights='imagenet', + input_shape=INPUT_SHAPE) +# Freeze the layers +vgg.trainable = True + +set_trainable = False +for layer in vgg.layers: + if layer.name in ['block5_conv1', 'block4_conv1']: + set_trainable = True + if set_trainable: + layer.trainable = True + else: + layer.trainable = False + +base_vgg = vgg +base_out = base_vgg.output +pool_out = tf.keras.layers.Flatten()(base_out) +hidden1 = tf.keras.layers.Dense(512, activation='relu')(pool_out) +drop1 = tf.keras.layers.Dropout(rate=0.3)(hidden1) +hidden2 = tf.keras.layers.Dense(512, activation='relu')(drop1) +drop2 = tf.keras.layers.Dropout(rate=0.3)(hidden2) + +out = tf.keras.layers.Dense(1, activation='sigmoid')(drop2) + +model = tf.keras.Model(inputs=base_vgg.input, outputs=out) +model.compile(optimizer=tf.keras.optimizers.RMSprop(lr=1e-5), + loss='binary_crossentropy', + metrics=['accuracy']) + +print("Total Layers:", len(model.layers)) +print("Total trainable layers:", sum([1 for l in model.layers if l.trainable])) + + +# Output +Total Layers: 28 +Total trainable layers: 16 +``` + +在我们的模型中我们降低了学习率,因为我们不想在微调的时候对预训练的层做大的位权更新。模型的训练过程可能有轻微的不同,因为我们使用了数据生成器,因此我们将应用 `fit_generator(...)` 函数。 + +``` +tensorboard_callback = tf.keras.callbacks.TensorBoard(logdir, histogram_freq=1) +reduce_lr = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.5, + patience=2, min_lr=0.000001) + +callbacks = [reduce_lr, tensorboard_callback] +train_steps_per_epoch = train_generator.n // train_generator.batch_size +val_steps_per_epoch = val_generator.n // val_generator.batch_size +history = model.fit_generator(train_generator, steps_per_epoch=train_steps_per_epoch, epochs=EPOCHS, + validation_data=val_generator, validation_steps=val_steps_per_epoch, + verbose=1) + + +# Output +Epoch 1/25 +271/271 [====] - 133s 489ms/step - loss: 0.2267 - accuracy: 0.9117 - val_loss: 0.1414 - val_accuracy: 0.9531 +Epoch 2/25 +271/271 [====] - 129s 475ms/step - loss: 0.1399 - accuracy: 0.9552 - val_loss: 0.1292 - val_accuracy: 0.9589 +... +... +Epoch 24/25 +271/271 [====] - 128s 473ms/step - loss: 0.0815 - accuracy: 0.9727 - val_loss: 0.1466 - val_accuracy: 0.9682 +Epoch 25/25 +271/271 [====] - 128s 473ms/step - loss: 0.0792 - accuracy: 0.9729 - val_loss: 0.1127 - val_accuracy: 0.9641 +``` + +这看起来是我们的最好的模型。它给了我们近乎 96.5% 的验证精确率,基于训练精度,它看起来不像我们的第一个模型那样过拟合。这可以通过下列的学习曲线验证。 + +![Learning curves for fine-tuned pre-trained CNN][27] + +*微调过的预训练 CNN 的学习曲线* + +让我们保存这个模型,因此我们能够在测试集上使用。 + + +``` +model.save('vgg_finetuned.h5') +``` + +这就完成了我们的模型训练阶段。现在我们准备好了在测试集上测试我们模型的性能。 + +### 深度学习模型性能评估 + +我们将通过在我们的测试集上做预测来评估我们在训练阶段构建的三个模型,因为仅仅验证是不够的!我们同样构建了一个检测工具模块叫做 `model_evaluation_utils`,我们可以使用相关分类指标用来评估使用我们深度学习模型的性能。第一步是扩展我们的数据集。 + +``` +test_imgs_scaled = test_data / 255. +test_imgs_scaled.shape, test_labels.shape + +# Output +((8268, 125, 125, 3), (8268,)) +``` + +下一步包括载入我们保存的深度学习模型,在测试集上预测。 + +``` +# Load Saved Deep Learning Models +basic_cnn = tf.keras.models.load_model('./basic_cnn.h5') +vgg_frz = tf.keras.models.load_model('./vgg_frozen.h5') +vgg_ft = tf.keras.models.load_model('./vgg_finetuned.h5') + +# Make Predictions on Test Data +basic_cnn_preds = basic_cnn.predict(test_imgs_scaled, batch_size=512) +vgg_frz_preds = vgg_frz.predict(test_imgs_scaled, batch_size=512) +vgg_ft_preds = vgg_ft.predict(test_imgs_scaled, batch_size=512) + +basic_cnn_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in basic_cnn_preds.ravel()]) +vgg_frz_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in vgg_frz_preds.ravel()]) +vgg_ft_pred_labels = le.inverse_transform([1 if pred > 0.5 else 0 + for pred in vgg_ft_preds.ravel()]) +``` + +下一步是应用我们的 `model_evaluation_utils` 模块根据相应分类指标来检查每个模块的性能。 + +``` +import model_evaluation_utils as meu +import pandas as pd + +basic_cnn_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=basic_cnn_pred_labels) +vgg_frz_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_frz_pred_labels) +vgg_ft_metrics = meu.get_metrics(true_labels=test_labels, predicted_labels=vgg_ft_pred_labels) + +pd.DataFrame([basic_cnn_metrics, vgg_frz_metrics, vgg_ft_metrics], + index=['Basic CNN', 'VGG-19 Frozen', 'VGG-19 Fine-tuned']) +``` + +![Model accuracy][28] + +看起来我们的第三个模型在我们的测试集上执行的最好,给出了一个模型精确性为 96% 的 F1 得分,这非常好,与我们之前提到的研究论文和文章中的更复杂的模型相当。 + +### 总结 + +疟疾检测不是一个简单的过程,全球的合格人员的不足在病例诊断和治疗当中是一个严重的问题。我们研究了一个关于疟疾的有趣的真实世界的医学影像案例。利用 AI 的、易于构建的、开源的技术在检测疟疾方面可以为我们提供最先进的精确性,因此使 AI 具有社会效益。 + +我鼓励你查看这篇文章中提到的文章和研究论文,没有它们,我就不能形成概念并写出来。如果你对运行和采纳这些技术感兴趣,本篇文章所有的代码都可以在[我的 GitHub 仓库][24]获得。记得从[官方网站][11]下载数据。 + +让我们希望在健康医疗方面更多的采纳开源的 AI 能力,使它在世界范围内变得更便宜、更易用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/detecting-malaria-deep-learning + +作者:[Dipanjan (DJ) Sarkar][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/djsarkar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcedoctor.png?itok=fk79NwpC +[2]: https://opensource.com/sites/default/files/uploads/malaria1_python-tensorflow.png (Python and TensorFlow) +[3]: https://opensource.com/sites/default/files/uploads/malaria2_malaria-heat-map.png (Malaria heat map) +[4]: https://www.who.int/features/factfiles/malaria/en/ +[5]: https://peerj.com/articles/4568/ +[6]: https://blog.insightdatascience.com/https-blog-insightdatascience-com-malaria-hero-a47d3d5fc4bb +[7]: https://www.pyimagesearch.com/2018/12/03/deep-learning-and-medical-image-analysis-with-keras/ +[8]: https://opensource.com/sites/default/files/uploads/malaria3_blood-smear.png (Blood smear workflow for Malaria detection) +[9]: http://cs231n.github.io/convolutional-networks/ +[10]: https://opensource.com/sites/default/files/uploads/malaria4_cnn-architecture.png (A typical CNN architecture) +[11]: https://ceb.nlm.nih.gov/repositories/malaria-datasets/ +[12]: https://www.ncbi.nlm.nih.gov/pubmed/29360430 +[13]: https://opensource.com/sites/default/files/uploads/malaria5_dependencies.png (Installing dependencies) +[14]: https://opensource.com/sites/default/files/uploads/malaria6_tree-dependency.png (Installing the tree dependency) +[15]: https://opensource.com/sites/default/files/uploads/malaria7_dataset.png (Datasets) +[16]: https://opensource.com/sites/default/files/uploads/malaria8_cell-samples.png (Malaria cell samples) +[17]: https://opensource.com/sites/default/files/uploads/malaria9_learningcurves.png (Learning curves for basic CNN) +[18]: https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a +[19]: https://github.com/dipanjanS/hands-on-transfer-learning-with-python +[20]: https://opensource.com/sites/default/files/uploads/malaria10_transferideas.png (Ideas for deep transfer learning) +[21]: http://image-net.org/index +[22]: https://arxiv.org/pdf/1409.1556.pdf +[23]: https://opensource.com/sites/default/files/uploads/malaria11_vgg-19-model-architecture.png (VGG-19 Model Architecture) +[24]: https://nbviewer.jupyter.org/github/dipanjanS/data_science_for_all/tree/master/os_malaria_detection/ +[25]: https://opensource.com/sites/default/files/uploads/malaria12_learningcurves.png (Learning curves for frozen pre-trained CNN) +[26]: https://opensource.com/sites/default/files/uploads/malaria13_sampleimages.png (Sample augmented images) +[27]: https://opensource.com/sites/default/files/uploads/malaria14_learningcurves.png (Learning curves for fine-tuned pre-trained CNN) +[28]: https://opensource.com/sites/default/files/uploads/malaria15_modelaccuracy.png (Model accuracy) diff --git a/published/201905/20190416 Inter-process communication in Linux- Using pipes and message queues.md b/published/201905/20190416 Inter-process communication in Linux- Using pipes and message queues.md new file mode 100644 index 0000000000..714f451e2e --- /dev/null +++ b/published/201905/20190416 Inter-process communication in Linux- Using pipes and message queues.md @@ -0,0 +1,578 @@ +[#]: collector: (lujun9972) +[#]: translator: (FSSlc) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10845-1.html) +[#]: subject: (Inter-process communication in Linux: Using pipes and message queues) +[#]: via: (https://opensource.com/article/19/4/interprocess-communication-linux-channels) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Linux 下的进程间通信:使用管道和消息队列 +====== + +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + +![Chat bubbles][1] + +本篇是 Linux 下[进程间通信][2](IPC)系列的第二篇文章。[第一篇文章][3] 聚焦于通过共享文件和共享内存段这样的共享存储来进行 IPC。这篇文件的重点将转向管道,它是连接需要通信的进程之间的通道。管道拥有一个*写端*用于写入字节数据,还有一个*读端*用于按照先入先出的顺序读入这些字节数据。而这些字节数据可能代表任何东西:数字、员工记录、数字电影等等。 + +管道有两种类型,命名管道和无名管道,都可以交互式的在命令行或程序中使用它们;相关的例子在下面展示。这篇文章也将介绍内存队列,尽管它们有些过时了,但它们不应该受这样的待遇。 + +在本系列的第一篇文章中的示例代码承认了在 IPC 中可能受到竞争条件(不管是基于文件的还是基于内存的)的威胁。自然地我们也会考虑基于管道的 IPC 的安全并发问题,这个也将在本文中提及。针对管道和内存队列的例子将会使用 POSIX 推荐使用的 API,POSIX 的一个核心目标就是线程安全。 + +请查看一些 [mq_open 函数的 man 页][4],这个函数属于内存队列的 API。这个 man 页中有关 [特性][5] 的章节带有一个小表格: + +接口 | 特性 | 值 +---|---|--- +`mq_open()` | 线程安全 | MT-Safe + +上面的 MT-Safe(MT 指的是多线程multi-threaded)意味着 `mq_open` 函数是线程安全的,进而暗示是进程安全的:一个进程的执行和它的一个线程执行的过程类似,假如竞争条件不会发生在处于*相同*进程的线程中,那么这样的条件也不会发生在处于不同进程的线程中。MT-Safe 特性保证了调用 `mq_open` 时不会出现竞争条件。一般来说,基于通道的 IPC 是并发安全的,尽管在下面例子中会出现一个有关警告的注意事项。 + +### 无名管道 + +首先让我们通过一个特意构造的命令行例子来展示无名管道是如何工作的。在所有的现代系统中,符号 `|` 在命令行中都代表一个无名管道。假设我们的命令行提示符为 `%`,接下来考虑下面的命令: + +```shell +## 写入方在 | 左边,读取方在右边 +% sleep 5 | echo "Hello, world!" +``` + +`sleep` 和 `echo` 程序以不同的进程执行,无名管道允许它们进行通信。但是上面的例子被特意设计为没有通信发生。问候语 “Hello, world!” 出现在屏幕中,然后过了 5 秒后,命令行返回,暗示 `sleep` 和 `echo` 进程都已经结束了。这期间发生了什么呢? + +在命令行中的竖线 `|` 的语法中,左边的进程(`sleep`)是写入方,右边的进程(`echo`)为读取方。默认情况下,读取方将会阻塞,直到从通道中能够读取到字节数据,而写入方在写完它的字节数据后,将发送 流已终止end-of-stream的标志。(即便写入方过早终止了,一个流已终止的标志还是会发给读取方。)无名管道将保持到写入方和读取方都停止的那个时刻。 + +在上面的例子中,`sleep` 进程并没有向通道写入任何的字节数据,但在 5 秒后就终止了,这时将向通道发送一个流已终止的标志。与此同时,`echo` 进程立即向标准输出(屏幕)写入问候语,因为这个进程并不从通道中读入任何字节,所以它并没有等待。一旦 `sleep` 和 `echo` 进程都终止了,不会再用作通信的无名管道将会消失然后返回命令行提示符。 + +下面这个更加实用的示例将使用两个无名管道。我们假定文件 `test.dat` 的内容如下: + +``` +this +is +the +way +the +world +ends +``` + +下面的命令: + +``` +% cat test.dat | sort | uniq +``` + +会将 `cat`(连接concatenate的缩写)进程的输出通过管道传给 `sort` 进程以生成排序后的输出,然后将排序后的输出通过管道传给 `uniq` 进程以消除重复的记录(在本例中,会将两次出现的 “the” 缩减为一个): + +``` +ends +is +the +this +way +world +``` + +下面展示的情景展示的是一个带有两个进程的程序通过一个无名管道通信来进行通信。 + +#### 示例 1. 两个进程通过一个无名管道来进行通信 + +```c +#include /* wait */ +#include +#include /* exit functions */ +#include /* read, write, pipe, _exit */ +#include + +#define ReadEnd 0 +#define WriteEnd 1 + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); /** failure **/ +} + +int main() { + int pipeFDs[2]; /* two file descriptors */ + char buf; /* 1-byte buffer */ + const char* msg = "Nature's first green is gold\n"; /* bytes to write */ + + if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); + pid_t cpid = fork(); /* fork a child process */ + if (cpid < 0) report_and_exit("fork"); /* check for failure */ + + if (0 == cpid) { /*** child ***/ /* child process */ + close(pipeFDs[WriteEnd]); /* child reads, doesn't write */ + + while (read(pipeFDs[ReadEnd], &buf, 1) > 0) /* read until end of byte stream */ + write(STDOUT_FILENO, &buf, sizeof(buf)); /* echo to the standard output */ + + close(pipeFDs[ReadEnd]); /* close the ReadEnd: all done */ + _exit(0); /* exit and notify parent at once */ + } + else { /*** parent ***/ + close(pipeFDs[ReadEnd]); /* parent writes, doesn't read */ + + write(pipeFDs[WriteEnd], msg, strlen(msg)); /* write the bytes to the pipe */ + close(pipeFDs[WriteEnd]); /* done writing: generate eof */ + + wait(NULL); /* wait for child to exit */ + exit(0); /* exit normally */ + } + return 0; +} +``` + +上面名为 `pipeUN` 的程序使用系统函数 `fork` 来创建一个进程。尽管这个程序只有一个单一的源文件,在它正确执行的情况下将会发生多进程的情况。 + +> 下面的内容是对库函数 `fork` 如何工作的一个简要回顾: + +> * `fork` 函数由*父*进程调用,在失败时返回 `-1` 给父进程。在 `pipeUN` 这个例子中,相应的调用是: + +> ```c +pid_t cpid = fork(); /* called in parent */ +``` + +> 函数调用后的返回值也被保存下来了。在这个例子中,保存在整数类型 `pid_t` 的变量 `cpid` 中。(每个进程有它自己的*进程 ID*,这是一个非负的整数,用来标记进程)。复刻一个新的进程可能会因为多种原因而失败,包括*进程表*满了的原因,这个结构由系统维持,以此来追踪进程状态。明确地说,僵尸进程假如没有被处理掉,将可能引起进程表被填满的错误。 +> * 假如 `fork` 调用成功,则它将创建一个新的子进程,向父进程返回一个值,向子进程返回另外的一个值。在调用 `fork` 后父进程和子进程都将执行相同的代码。(子进程继承了到此为止父进程中声明的所有变量的拷贝),特别地,一次成功的 `fork` 调用将返回如下的东西: +> * 向子进程返回 `0` +> * 向父进程返回子进程的进程 ID +> * 在一次成功的 `fork` 调用后,一个 `if`/`else` 或等价的结构将会被用来隔离针对父进程和子进程的代码。在这个例子中,相应的声明为: + +> ```c +if (0 == cpid) { /*** child ***/ +... +} +else { /*** parent ***/ +... +} +``` + +假如成功地复刻出了一个子进程,`pipeUN` 程序将像下面这样去执行。在一个整数的数列里: + +```c +int pipeFDs[2]; /* two file descriptors */ +``` + +来保存两个文件描述符,一个用来向管道中写入,另一个从管道中写入。(数组元素 `pipeFDs[0]` 是读端的文件描述符,元素 `pipeFDs[1]` 是写端的文件描述符。)在调用 `fork` 之前,对系统 `pipe` 函数的成功调用,将立刻使得这个数组获得两个文件描述符: + +```c +if (pipe(pipeFDs) < 0) report_and_exit("pipeFD"); +``` + +父进程和子进程现在都有了文件描述符的副本。但*分离关注点*模式意味着每个进程恰好只需要一个描述符。在这个例子中,父进程负责写入,而子进程负责读取,尽管这样的角色分配可以反过来。在 `if` 子句中的第一个语句将用于关闭管道的读端: + +```c +close(pipeFDs[WriteEnd]); /* called in child code */ +``` + +在父进程中的 `else` 子句将会关闭管道的读端: + +```c +close(pipeFDs[ReadEnd]); /* called in parent code */ +``` + +然后父进程将向无名管道中写入某些字节数据(ASCII 代码),子进程读取这些数据,然后向标准输出中回放它们。 + +在这个程序中还需要澄清的一点是在父进程代码中的 `wait` 函数。一旦被创建后,子进程很大程度上独立于它的父进程,正如简短的 `pipeUN` 程序所展示的那样。子进程可以执行任意的代码,而它们可能与父进程完全没有关系。但是,假如当子进程终止时,系统将会通过一个信号来通知父进程。 + +要是父进程在子进程之前终止又该如何呢?在这种情形下,除非采取了预防措施,子进程将会变成在进程表中的一个*僵尸*进程。预防措施有两大类型:第一种是让父进程去通知系统,告诉系统它对子进程的终止没有任何兴趣: + +```c +signal(SIGCHLD, SIG_IGN); /* in parent: ignore notification */ +``` + +第二种方法是在子进程终止时,让父进程执行一个 `wait`。这样就确保了父进程可以独立于子进程而存在。在 `pipeUN` 程序中使用了第二种方法,其中父进程的代码使用的是下面的调用: + +```c +wait(NULL); /* called in parent */ +``` + +这个对 `wait` 的调用意味着*一直等待直到任意一个子进程的终止发生*,因此在 `pipeUN` 程序中,只有一个子进程。(其中的 `NULL` 参数可以被替换为一个保存有子程序退出状态的整数变量的地址。)对于更细粒度的控制,还可以使用更灵活的 `waitpid` 函数,例如特别指定多个子进程中的某一个。 + +`pipeUN` 将会采取另一个预防措施。当父进程结束了等待,父进程将会调用常规的 `exit` 函数去退出。对应的,子进程将会调用 `_exit` 变种来退出,这类变种将快速跟踪终止相关的通知。在效果上,子进程会告诉系统立刻去通知父进程它的这个子进程已经终止了。 + +假如两个进程向相同的无名管道中写入内容,字节数据会交错吗?例如,假如进程 P1 向管道写入内容: + +``` +foo bar +``` + +同时进程 P2 并发地写入: + +``` +baz baz +``` + +到相同的管道,最后的结果似乎是管道中的内容将会是任意错乱的,例如像这样: + +``` +baz foo baz bar +``` + +只要没有写入超过 `PIPE_BUF` 字节,POSIX 标准就能确保写入不会交错。在 Linux 系统中, `PIPE_BUF` 的大小是 4096 字节。对于管道我更喜欢只有一个写入方和一个读取方,从而绕过这个问题。 + +### 命名管道 + +无名管道没有备份文件:系统将维持一个内存缓存来将字节数据从写方传给读方。一旦写方和读方终止,这个缓存将会被回收,进而无名管道消失。相反的,命名管道有备份文件和一个不同的 API。 + +下面让我们通过另一个命令行示例来了解命名管道的要点。下面是具体的步骤: + +* 开启两个终端。这两个终端的工作目录应该相同。 +* 在其中一个终端中,键入下面的两个命令(命令行提示符仍然是 `%`,我的注释以 `##` 打头。): + + ```shell +% mkfifo tester ## 创建一个备份文件,名为 tester +% cat tester ## 将管道的内容输出到 stdout +``` + + 在最开始,没有任何东西会出现在终端中,因为到现在为止没有在命名管道中写入任何东西。 +* 在第二个终端中输入下面的命令: + + ```shell +% cat > tester ## redirect keyboard input to the pipe +hello, world! ## then hit Return key +bye, bye ## ditto + ## terminate session with a Control-C +``` + + 无论在这个终端中输入什么,它都会在另一个终端中显示出来。一旦键入 `Ctrl+C`,就会回到正常的命令行提示符,因为管道已经被关闭了。 +* 通过移除实现命名管道的文件来进行清理: + + ```shell +% unlink tester +``` + +正如 `mkfifo` 程序的名字所暗示的那样,命名管道也被叫做 FIFO,因为第一个进入的字节,就会第一个出,其他的类似。有一个名为 `mkfifo` 的库函数,用它可以在程序中创建一个命名管道,它将在下一个示例中被用到,该示例由两个进程组成:一个向命名管道写入,而另一个从该管道读取。 + +#### 示例 2. fifoWriter 程序 + +```c +#include +#include +#include +#include +#include +#include +#include + +#define MaxLoops 12000 /* outer loop */ +#define ChunkSize 16 /* how many written at a time */ +#define IntsPerChunk 4 /* four 4-byte ints per chunk */ +#define MaxZs 250 /* max microseconds to sleep */ + +int main() { + const char* pipeName = "./fifoChannel"; + mkfifo(pipeName, 0666); /* read/write for user/group/others */ + int fd = open(pipeName, O_CREAT | O_WRONLY); /* open as write-only */ + if (fd < 0) return -1; /* can't go on */ + + int i; + for (i = 0; i < MaxLoops; i++) { /* write MaxWrites times */ + int j; + for (j = 0; j < ChunkSize; j++) { /* each time, write ChunkSize bytes */ + int k; + int chunk[IntsPerChunk]; + for (k = 0; k < IntsPerChunk; k++) + chunk[k] = rand(); + write(fd, chunk, sizeof(chunk)); + } + usleep((rand() % MaxZs) + 1); /* pause a bit for realism */ + } + + close(fd); /* close pipe: generates an end-of-stream marker */ + unlink(pipeName); /* unlink from the implementing file */ + printf("%i ints sent to the pipe.\n", MaxLoops * ChunkSize * IntsPerChunk); + + return 0; +} +``` + +上面的 `fifoWriter` 程序可以被总结为如下: + +* 首先程序创建了一个命名管道用来写入数据: + + ```c +mkfifo(pipeName, 0666); /* read/write perms for user/group/others */ +int fd = open(pipeName, O_CREAT | O_WRONLY); +``` + + 其中的 `pipeName` 是备份文件的名字,传递给 `mkfifo` 作为它的第一个参数。接着命名管道通过我们熟悉的 `open` 函数调用被打开,而这个函数将会返回一个文件描述符。 +* 在实现层面上,`fifoWriter` 不会一次性将所有的数据都写入,而是写入一个块,然后休息随机数目的微秒时间,接着再循环往复。总的来说,有 768000 个 4 字节整数值被写入到命名管道中。 +* 在关闭命名管道后,`fifoWriter` 也将使用 `unlink` 取消对该文件的连接。 + + ```c +close(fd); /* close pipe: generates end-of-stream marker */ +unlink(pipeName); /* unlink from the implementing file */ +``` + + 一旦连接到管道的每个进程都执行了 `unlink` 操作后,系统将回收这些备份文件。在这个例子中,只有两个这样的进程 `fifoWriter` 和 `fifoReader`,它们都做了 `unlink` 操作。 + +这个两个程序应该在不同终端的相同工作目录中执行。但是 `fifoWriter` 应该在 `fifoReader` 之前被启动,因为需要 `fifoWriter` 去创建管道。然后 `fifoReader` 才能够获取到刚被创建的命名管道。 + +#### 示例 3. fifoReader 程序 + +```c +#include +#include +#include +#include +#include + +unsigned is_prime(unsigned n) { /* not pretty, but efficient */ + if (n <= 3) return n > 1; + if (0 == (n % 2) || 0 == (n % 3)) return 0; + + unsigned i; + for (i = 5; (i * i) <= n; i += 6) + if (0 == (n % i) || 0 == (n % (i + 2))) return 0; + + return 1; /* found a prime! */ +} + +int main() { + const char* file = "./fifoChannel"; + int fd = open(file, O_RDONLY); + if (fd < 0) return -1; /* no point in continuing */ + unsigned count = 0, total = 0, primes_count = 0; + + while (1) { + int next; + int i; + + ssize_t count = read(fd, &next, sizeof(int)); + if (0 == count) break; /* end of stream */ + else if (count == sizeof(int)) { /* read a 4-byte int value */ + total++; + if (is_prime(next)) primes_count++; + } + } + + close(fd); /* close pipe from read end */ + unlink(file); /* unlink from the underlying file */ + printf("Received ints: %u, primes: %u\n", total, primes_count); + + return 0; +} +``` + +上面的 `fifoReader` 的内容可以总结为如下: + +* 因为 `fifoWriter` 已经创建了命名管道,所以 `fifoReader` 只需要利用标准的 `open` 调用来通过备份文件来获取到管道中的内容: + + ```c +const char* file = "./fifoChannel"; +int fd = open(file, O_RDONLY); +``` + + 这个文件的是以只读打开的。 +* 然后这个程序进入一个潜在的无限循环,在每次循环时,尝试读取 4 字节的块。`read` 调用: + + ```c +ssize_t count = read(fd, &next, sizeof(int)); +``` + + 返回 0 来暗示该流的结束。在这种情况下,`fifoReader` 跳出循环,关闭命名管道,并在终止前 `unlink` 备份文件。 +* 在读入 4 字节整数后,`fifoReader` 检查这个数是否为质数。这个操作代表了一个生产级别的读取器可能在接收到的字节数据上执行的逻辑操作。在示例运行中,在接收到的 768000 个整数中有 37682 个质数。 + +重复运行示例, `fifoReader` 将成功地读取 `fifoWriter` 写入的所有字节。这不是很让人惊讶的。这两个进程在相同的机器上执行,从而可以不用考虑网络相关的问题。命名管道是一个可信且高效的 IPC 机制,因而被广泛使用。 + +下面是这两个程序的输出,它们在不同的终端中启动,但处于相同的工作目录: + +```shell +% ./fifoWriter +768000 ints sent to the pipe. +### +% ./fifoReader +Received ints: 768000, primes: 37682 +``` + +### 消息队列 + +管道有着严格的先入先出行为:第一个被写入的字节将会第一个被读,第二个写入的字节将第二个被读,以此类推。消息队列可以做出相同的表现,但它又足够灵活,可以使得字节块可以不以先入先出的次序来接收。 + +正如它的名字所提示的那样,消息队列是一系列的消息,每个消息包含两部分: + +* 荷载,一个字节序列(在 C 中是 char) +* 类型,以一个正整数值的形式给定,类型用来分类消息,为了更灵活的回收 + +看一下下面对一个消息队列的描述,每个消息由一个整数类型标记: + +``` + +-+ +-+ +-+ +-+ +sender--->|3|--->|2|--->|2|--->|1|--->receiver + +-+ +-+ +-+ +-+ +``` + +在上面展示的 4 个消息中,标记为 1 的是开头,即最接近接收端,然后另个标记为 2 的消息,最后接着一个标记为 3 的消息。假如按照严格的 FIFO 行为执行,消息将会以 1-2-2-3 这样的次序被接收。但是消息队列允许其他收取次序。例如,消息可以被接收方以 3-2-1-2 的次序接收。 + +`mqueue` 示例包含两个程序,`sender` 将向消息队列中写入数据,而 `receiver` 将从这个队列中读取数据。这两个程序都包含的头文件 `queue.h` 如下所示: + +#### 示例 4. 头文件 queue.h + +```c +#define ProjectId 123 +#define PathName "queue.h" /* any existing, accessible file would do */ +#define MsgLen 4 +#define MsgCount 6 + +typedef struct { + long type; /* must be of type long */ + char payload[MsgLen + 1]; /* bytes in the message */ +} queuedMessage; +``` + +上面的头文件定义了一个名为 `queuedMessage` 的结构类型,它带有 `payload`(字节数组)和 `type`(整数)这两个域。该文件也定义了一些符号常数(使用 `#define` 语句),前两个常数被用来生成一个 `key`,而这个 `key` 反过来被用来获取一个消息队列的 ID。`ProjectId` 可以是任何正整数值,而 `PathName` 必须是一个存在的、可访问的文件,在这个示例中,指的是文件 `queue.h`。在 `sender` 和 `receiver` 中,它们都有的设定语句为: + +```c +key_t key = ftok(PathName, ProjectId); /* generate key */ +int qid = msgget(key, 0666 | IPC_CREAT); /* use key to get queue id */ +``` + +ID `qid` 在效果上是消息队列文件描述符的对应物。 + +#### 示例 5. sender 程序 + +```c +#include +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key = ftok(PathName, ProjectId); + if (key < 0) report_and_exit("couldn't get key..."); + + int qid = msgget(key, 0666 | IPC_CREAT); + if (qid < 0) report_and_exit("couldn't get queue id..."); + + char* payloads[] = {"msg1", "msg2", "msg3", "msg4", "msg5", "msg6"}; + int types[] = {1, 1, 2, 2, 3, 3}; /* each must be > 0 */ + int i; + for (i = 0; i < MsgCount; i++) { + /* build the message */ + queuedMessage msg; + msg.type = types[i]; + strcpy(msg.payload, payloads[i]); + + /* send the message */ + msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); /* don't block */ + printf("%s sent as type %i\n", msg.payload, (int) msg.type); + } + return 0; +} +``` + +上面的 `sender` 程序将发送出 6 个消息,每两个为一个类型:前两个是类型 1,接着的连个是类型 2,最后的两个为类型 3。发送的语句: + +```c +msgsnd(qid, &msg, sizeof(msg), IPC_NOWAIT); +``` + +被配置为非阻塞的(`IPC_NOWAIT` 标志),是因为这里的消息体量上都很小。唯一的危险在于一个完整的序列将可能导致发送失败,而这个例子不会。下面的 `receiver` 程序也将使用 `IPC_NOWAIT` 标志来接收消息。 + +#### 示例 6. receiver 程序 + +```c +#include +#include +#include +#include +#include "queue.h" + +void report_and_exit(const char* msg) { + perror(msg); + exit(-1); /* EXIT_FAILURE */ +} + +int main() { + key_t key= ftok(PathName, ProjectId); /* key to identify the queue */ + if (key < 0) report_and_exit("key not gotten..."); + + int qid = msgget(key, 0666 | IPC_CREAT); /* access if created already */ + if (qid < 0) report_and_exit("no access to queue..."); + + int types[] = {3, 1, 2, 1, 3, 2}; /* different than in sender */ + int i; + for (i = 0; i < MsgCount; i++) { + queuedMessage msg; /* defined in queue.h */ + if (msgrcv(qid, &msg, sizeof(msg), types[i], MSG_NOERROR | IPC_NOWAIT) < 0) + puts("msgrcv trouble..."); + printf("%s received as type %i\n", msg.payload, (int) msg.type); + } + + /** remove the queue **/ + if (msgctl(qid, IPC_RMID, NULL) < 0) /* NULL = 'no flags' */ + report_and_exit("trouble removing queue..."); + + return 0; +} +``` + +这个 `receiver` 程序不会创建消息队列,尽管 API 尽管建议那样。在 `receiver` 中,对 + +```c +int qid = msgget(key, 0666 | IPC_CREAT); +``` + +的调用可能因为带有 `IPC_CREAT` 标志而具有误导性,但是这个标志的真实意义是*如果需要就创建,否则直接获取*。`sender` 程序调用 `msgsnd` 来发送消息,而 `receiver` 调用 `msgrcv` 来接收它们。在这个例子中,`sender` 以 1-1-2-2-3-3 的次序发送消息,但 `receiver` 接收它们的次序为 3-1-2-1-3-2,这显示消息队列没有被严格的 FIFO 行为所拘泥: + +```shell +% ./sender +msg1 sent as type 1 +msg2 sent as type 1 +msg3 sent as type 2 +msg4 sent as type 2 +msg5 sent as type 3 +msg6 sent as type 3 + +% ./receiver +msg5 received as type 3 +msg1 received as type 1 +msg3 received as type 2 +msg2 received as type 1 +msg6 received as type 3 +msg4 received as type 2 +``` + +上面的输出显示 `sender` 和 `receiver` 可以在同一个终端中启动。输出也显示消息队列是持久的,即便 `sender` 进程在完成创建队列、向队列写数据、然后退出的整个过程后,该队列仍然存在。只有在 `receiver` 进程显式地调用 `msgctl` 来移除该队列,这个队列才会消失: + +```c +if (msgctl(qid, IPC_RMID, NULL) < 0) /* remove queue */ +``` + +### 总结 + +管道和消息队列的 API 在根本上来说都是单向的:一个进程写,然后另一个进程读。当然还存在双向命名管道的实现,但我认为这个 IPC 机制在它最为简单的时候反而是最佳的。正如前面提到的那样,消息队列已经不大受欢迎了,尽管没有找到什么特别好的原因来解释这个现象;而队列仍然是 IPC 工具箱中的一个工具。这个快速的 IPC 工具箱之旅将以第 3 部分(通过套接字和信号来示例 IPC)来终结。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-channels + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://en.wikipedia.org/wiki/Inter-process_communication +[3]: https://linux.cn/article-10826-1.html +[4]: http://man7.org/linux/man-pages/man2/mq_open.2.html +[5]: http://man7.org/linux/man-pages/man2/mq_open.2.html#ATTRIBUTES +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/rand.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/strcpy.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html diff --git a/published/201905/20190419 Building scalable social media sentiment analysis services in Python.md b/published/201905/20190419 Building scalable social media sentiment analysis services in Python.md new file mode 100644 index 0000000000..dd2dadd739 --- /dev/null +++ b/published/201905/20190419 Building scalable social media sentiment analysis services in Python.md @@ -0,0 +1,303 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10867-1.html) +[#]: subject: (Building scalable social media sentiment analysis services in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 构建可扩展的社交媒体情感分析服务 +====== + +> 学习如何使用 spaCy、vaderSentiment、Flask 和 Python 来为你的作品添加情感分析能力。 + +![Tall building with windows](https://img.linux.net.cn/data/attachment/album/201905/17/235241zr0cs4czu4psmrl6.jpg) + +本系列的[第一部分][2]提供了情感分析工作原理的一些背景知识,现在让我们研究如何将这些功能添加到你的设计中。 + +### 探索 Python 库 spaCy 和 vaderSentiment + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 用于安装 Python 包的 `pip` 命令 + * (可选)一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +在开始编写代码之前,你需要安装 [spaCy][4] 和 [vaderSentiment][5] 包来设置 Python 环境,同时下载一个语言模型来帮助你分析。幸运的是,大部分操作都容易在命令行中完成。 + +在 shell 中,输入以下命令来安装 spaCy 和 vaderSentiment 包: + +``` +pip install spacy vaderSentiment +``` + +命令安装完成后,安装 spaCy 可用于文本分析的语言模型。以下命令将使用 spaCy 模块下载并安装英语[模型][6]: + +``` +python -m spacy download en_core_web_sm +``` + +安装了这些库和模型之后,就可以开始编码了。 + +#### 一个简单的文本分析 + +使用 [Python 解释器交互模式][7] 编写一些代码来分析单个文本片段。首先启动 Python 环境: + +``` +$ python +Python 3.6.8 (default, Jan 31 2019, 09:38:34) +[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> +``` + +*(你的 Python 解释器版本打印可能与此不同。)* + +1、导入所需模块: + +``` +>>> import spacy +>>> from vaderSentiment import vaderSentiment +``` + +2、从 spaCy 加载英语语言模型: + +``` +>>> english = spacy.load("en_core_web_sm") +``` + +3、处理一段文本。本例展示了一个非常简单的句子,我们希望它能给我们带来些许积极的情感: + +``` +>>> result = english("I like to eat applesauce with sugar and cinnamon.") +``` + +4、从处理后的结果中收集句子。SpaCy 已识别并处理短语中的实体,这一步为每个句子生成情感(即时在本例中只有一个句子): + +``` +>>> sentences = [str(s) for s in result.sents] +``` + +5、使用 vaderSentiments 创建一个分析器: + +``` +>>> analyzer = vaderSentiment.SentimentIntensityAnalyzer() +``` + +6、对句子进行情感分析: + +``` +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +``` + +`sentiment` 变量现在包含例句的极性分数。打印出这个值,看看它是如何分析这个句子的。 + +``` +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.737, 'pos': 0.263, 'compound': 0.3612}] +``` + +这个结构是什么意思? + +表面上,这是一个只有一个字典对象的数组。如果有多个句子,那么每个句子都会对应一个字典对象。字典中有四个键对应不同类型的情感。`neg` 键表示负面情感,因为在本例中没有报告任何负面情感,`0.0` 值证明了这一点。`neu` 键表示中性情感,它的得分相当高,为 `0.737`(最高为 `1.0`)。`pos` 键代表积极情感,得分适中,为 `0.263`。最后,`cmpound` 键代表文本的总体得分,它可以从负数到正数,`0.3612` 表示积极方面的情感多一点。 + +要查看这些值可能如何变化,你可以使用已输入的代码做一个小实验。以下代码块显示了如何对类似句子的情感评分的评估。 + +``` +>>> result = english("I love applesauce!") +>>> sentences = [str(s) for s in result.sents] +>>> sentiment = [analyzer.polarity_scores(str(s)) for s in sentences] +>>> print(sentiment) +[{'neg': 0.0, 'neu': 0.182, 'pos': 0.818, 'compound': 0.6696}] +``` + +你可以看到,通过将例句改为非常积极的句子,`sentiment` 的值发生了巨大变化。 + +### 建立一个情感分析服务 + +现在你已经为情感分析组装了基本的代码块,让我们将这些东西转化为一个简单的服务。 + +在这个演示中,你将使用 Python [Flask 包][9] 创建一个 [RESTful][8] HTTP 服务器。此服务将接受英文文本数据并返回情感分析结果。请注意,此示例服务是用于学习所涉及的技术,而不是用于投入生产的东西。 + +#### 前提条件 + + * 一个终端 shell + * shell 中的 Python 语言二进制文件(3.4+ 版本) + * 安装 Python 包的 `pip` 命令 + * `curl` 命令 + * 一个文本编辑器 + * (可选) 一个 [Python 虚拟环境][3]使你的工作与系统隔离开来 + +#### 配置环境 + +这个环境几乎与上一节中的环境相同,唯一的区别是在 Python 环境中添加了 Flask 包。 + +1、安装所需依赖项: + +``` +pip install spacy vaderSentiment flask +``` + +2、安装 spaCy 的英语语言模型: + +``` +python -m spacy download en_core_web_sm +``` + +#### 创建应用程序文件 + +打开编辑器,创建一个名为 `app.py` 的文件。添加以下内容 *(不用担心,我们将解释每一行)*: + + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader + +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") + +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments + +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +虽然这个源文件不是很大,但它非常密集。让我们来看看这个应用程序的各个部分,并解释它们在做什么。 + +``` +import flask +import spacy +import vaderSentiment.vaderSentiment as vader +``` + +前三行引入了执行语言分析和 HTTP 框架所需的包。 + +``` +app = flask.Flask(__name__) +analyzer = vader.SentimentIntensityAnalyzer() +english = spacy.load("en_core_web_sm") +``` + +接下来的三行代码创建了一些全局变量。第一个变量 `app`,它是 Flask 用于创建 HTTP 路由的主要入口点。第二个变量 `analyzer` 与上一个示例中使用的类型相同,它将用于生成情感分数。最后一个变量 `english` 也与上一个示例中使用的类型相同,它将用于注释和标记初始文本输入。 + +你可能想知道为什么全局声明这些变量。对于 `app` 变量,这是许多 Flask 应用程序的标准过程。但是,对于 `analyzer` 和 `english` 变量,将它们设置为全局变量的决定是基于与所涉及的类关联的加载时间。虽然加载时间可能看起来很短,但是当它在 HTTP 服务器的上下文中运行时,这些延迟会对性能产生负面影响。 + +``` +def get_sentiments(text): + result = english(text) + sentences = [str(sent) for sent in result.sents] + sentiments = [analyzer.polarity_scores(str(s)) for s in sentences] + return sentiments +``` + +这部分是服务的核心 —— 一个用于从一串文本生成情感值的函数。你可以看到此函数中的操作对应于你之前在 Python 解释器中运行的命令。这里它们被封装在一个函数定义中,`text` 源作为文本变量传入,最后 `sentiments` 变量返回给调用者。 + +``` +@app.route("/", methods=["POST", "GET"]) +def index(): + if flask.request.method == "GET": + return "To access this service send a POST request to this URL with" \ + " the text you want analyzed in the body." + body = flask.request.data.decode("utf-8") + sentiments = get_sentiments(body) + return flask.json.dumps(sentiments) +``` + +源文件的最后一个函数包含了指导 Flask 如何为服务配置 HTTP 服务器的逻辑。它从一行开始,该行将 HTTP 路由 `/` 与请求方法 `POST` 和 `GET` 相关联。 + +在函数定义行之后,`if` 子句将检测请求方法是否为 `GET`。如果用户向服务发送此请求,那么下面的行将返回一条指示如何访问服务器的文本消息。这主要是为了方便最终用户。 + +下一行使用 `flask.request` 对象来获取请求的主体,该主体应包含要处理的文本字符串。`decode` 函数将字节数组转换为可用的格式化字符串。经过解码的文本消息被传递给 `get_sentiments` 函数以生成情感分数。最后,分数通过 HTTP 框架返回给用户。 + +你现在应该保存文件,如果尚未保存,那么返回 shell。 + +#### 运行情感服务 + +一切就绪后,使用 Flask 的内置调试服务器运行服务非常简单。要启动该服务,请从与源文件相同的目录中输入以下命令: + +``` +FLASK_APP=app.py flask run +``` + +现在,你将在 shell 中看到来自服务器的一些输出,并且服务器将处于运行状态。要测试服务器是否正在运行,你需要打开第二个 shell 并使用 `curl` 命令。 + +首先,输入以下命令检查是否打印了指令信息: + +``` +curl http://localhost:5000 +``` + +你应该看到说明消息: + +``` +To access this service send a POST request to this URI with the text you want analyzed in the body. +``` + +接下来,运行以下命令发送测试消息,查看情感分析: + +``` +curl http://localhost:5000 --header "Content-Type: application/json" --data "I love applesauce!" +``` + +你从服务器获得的响应应类似于以下内容: + +``` +[{"compound": 0.6696, "neg": 0.0, "neu": 0.182, "pos": 0.818}] +``` + +恭喜!你现在已经实现了一个 RESTful HTTP 情感分析服务。你可以在 [GitHub 上找到此服务的参考实现和本文中的所有代码][10]。 + +### 继续探索 + +现在你已经了解了自然语言处理和情感分析背后的原理和机制,下面是进一步发现探索该主题的一些方法。 + +#### 在 OpenShift 上创建流式情感分析器 + +虽然创建本地应用程序来研究情绪分析很方便,但是接下来需要能够部署应用程序以实现更广泛的用途。按照[Radnaalytics.io][11] 提供的指导和代码进行操作,你将学习如何创建一个情感分析仪,可以容器化并部署到 Kubernetes 平台。你还将了解如何将 Apache Kafka 用作事件驱动消息传递的框架,以及如何将 Apache Spark 用作情绪分析的分布式计算平台。 + +#### 使用 Twitter API 发现实时数据 + +虽然 [Radanalytics.io][12] 实验室可以生成合成推文流,但你可以不受限于合成数据。事实上,拥有 Twitter 账户的任何人都可以使用 [Tweepy Python][13] 包访问 Twitter 流媒体 API 对推文进行情感分析。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-scalable + +作者:[Michael McCune][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://linux.cn/article-10852-1.html +[3]: https://virtualenv.pypa.io/en/stable/ +[4]: https://pypi.org/project/spacy/ +[5]: https://pypi.org/project/vaderSentiment/ +[6]: https://spacy.io/models +[7]: https://docs.python.org/3.6/tutorial/interpreter.html +[8]: https://en.wikipedia.org/wiki/Representational_state_transfer +[9]: http://flask.pocoo.org/ +[10]: https://github.com/elmiko/social-moments-service +[11]: https://github.com/radanalyticsio/streaming-lab +[12]: http://Radanalytics.io +[13]: https://github.com/tweepy/tweepy diff --git a/published/201905/20190419 Getting started with social media sentiment analysis in Python.md b/published/201905/20190419 Getting started with social media sentiment analysis in Python.md new file mode 100644 index 0000000000..b9abec9325 --- /dev/null +++ b/published/201905/20190419 Getting started with social media sentiment analysis in Python.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10852-1.html) +[#]: subject: (Getting started with social media sentiment analysis in Python) +[#]: via: (https://opensource.com/article/19/4/social-media-sentiment-analysis-python) +[#]: author: (Michael McCune https://opensource.com/users/elmiko/users/jschlessman) + +使用 Python 进行社交媒体情感分析入门 +====== + +> 学习自然语言处理的基础知识并探索两个有用的 Python 包。 + +![](https://img.linux.net.cn/data/attachment/album/201905/14/002943t6udxhhcq1zoxu15.jpg) + +自然语言处理(NLP)是机器学习的一种,它解决了口语或书面语言和计算机辅助分析这些语言之间的相关性。日常生活中我们经历了无数的 NLP 创新,从写作帮助和建议到实时语音翻译,还有口译。 + +本文研究了 NLP 的一个特定领域:情感分析。重点是确定输入语言的积极、消极或中性性质。本部分将解释 NLP 和情感分析的背景,并探讨两个开源的 Python 包。[第 2 部分][2]将演示如何开始构建自己的可扩展情感分析服务。 + +在学习情感分析时,对 NLP 有一个大体了解是有帮助的。本文不会深入研究数学本质。相反,我们的目标是阐明 NLP 中的关键概念,这些概念对于将这些方法实际结合到你的解决方案中至关重要。 + +### 自然语言和文本数据 + +合理的起点是从定义开始:“什么是自然语言?”它是我们人类相互交流的方式,沟通的主要方式是口语和文字。我们可以更进一步,只关注文本交流。毕竟,生活在 Siri、Alexa 等无处不在的时代,我们知道语音是一组与文本无关的计算。 + +### 数据前景和挑战 + +我们只考虑使用文本数据,我们可以对语言和文本做什么呢?首先是语言,特别是英语,除了规则还有很多例外,含义的多样性和语境差异,这些都可能使人类口译员感到困惑,更不用说计算机翻译了。在小学,我们学习文章和标点符号,通过讲母语,我们获得了寻找直觉上表示唯一意义的词的能力。比如,出现诸如 “a”、“the” 和 “or” 之类的文章,它们在 NLP 中被称为*停止词*,因为传统上 NLP 算法是在一个序列中找到这些词时意味着搜索停止。 + +由于我们的目标是自动将文本分类为情感类,因此我们需要一种以计算方式处理文本数据的方法。因此,我们必须考虑如何向机器表示文本数据。众所周知,利用和解释语言的规则很复杂,输入文本的大小和结构可能会有很大差异。我们需要将文本数据转换为数字数据,这是机器和数学的首选方式。这种转变属于*特征提取*的范畴。 + +在提取输入文本数据的数字表示形式后,一个改进可能是:给定一个文本输入体,为上面列出的文章确定一组向量统计数据,并根据这些数据对文档进行分类。例如,过多的副词可能会使撰稿人感到愤怒,或者过度使用停止词可能有助于识别带有内容填充的学期论文。诚然,这可能与我们情感分析的目标没有太大关系。 + +### 词袋 + +当你评估一个文本陈述是积极还是消极的时候,你使用哪些上下文来评估它的极性?(例如,文本中是否具有积极的、消极的或中性的情感)一种方式是隐含形容词:被称为 “disgusting”(恶心) 的东西被认为是消极的,但如果同样的东西被称为 “beautiful”(漂亮),你会认为它是积极的。从定义上讲,俗语给人一种熟悉感,通常是积极的,而脏话可能是敌意的表现。文本数据也可以包括表情符号,它带有固定的情感。 + +理解单个单词的极性影响为文本的[词袋][3]bag-of-words(BoW)模型提供了基础。它分析一组单词或词汇表,并提取关于这些单词在输入文本中是否存在的度量。词汇表是通过处理已知极性的文本形成称为*标记的训练数据*。从这组标记数据中提取特征,然后分析特征之间的关系,并将标记与数据关联起来。 + +“词袋”这个名称说明了它的用途:即不考虑空间位置或上下文的的单个词。词汇表通常是由训练集中出现的所有单词构建的,训练后往往会被修剪。如果在训练之前没有清理停止词,那么停止词会因为其高频率和低语境而被移除。很少使用的单词也可以删除,因为缺乏为一般输入实例提供的信息。 + +但是,重要的是要注意,你可以(并且应该)进一步考虑单词在单个训练数据实例之外的情形,这称为[词频][4]term frequency(TF)。你还应该考虑输入数据在所有训练实例中的单词计数,通常,出现在所有文档中的低频词更重要,这被称为[逆文本频率指数][5]inverse document frequency(IDF)。这些指标一定会在本主题系列的其他文章和软件包中提及,因此了解它们会有所帮助。 + +词袋在许多文档分类应用程序中很有用。然而,在情感分析中,当缺乏情境意识的问题被利用时,事情就可以解决。考虑以下句子: + + * 我们不喜欢这场战争。 + * 我讨厌下雨天,好事是今天是晴天。 + * 这不是生死攸关的问题。 + +这些短语的情感对于人类口译员来说是有难度的,而且通过严格关注单个词汇的实例,对于机器翻译来说也是困难的。 + +在 NLP 中也可以使用称为 “n-grams” 的单词分组。一个二元组考虑两个相邻单词组成的组而不是(或除了)单个词袋。这应该可以缓解诸如上述“不喜欢”之类的情况,但由于缺乏语境意思,它仍然是个问题。此外,在上面的第二句中,下半句的情感语境可以被理解为否定前半部分。因此,这种方法中也会丢失上下文线索的空间局部性。从实用角度来看,使问题复杂化的是从给定输入文本中提取的特征的稀疏性。对于一个完整的大型词汇表,每个单词都有一个计数,可以将其视为一个整数向量。大多数文档的向量中都有大量的零计数向量,这给操作增加了不必要的空间和时间复杂度。虽然已经提出了许多用于降低这种复杂性的简便方法,但它仍然是一个问题。 + +### 词嵌入 + +词嵌入Word embedding是一种分布式表示,它允许具有相似含义的单词具有相似的表示。这是基于使用实值向量来与它们周围相关联。重点在于使用单词的方式,而不仅仅是它们的存在与否。此外,词嵌入的一个巨大实用优势是它们关注于密集向量。通过摆脱具有相应数量的零值向量元素的单词计数模型,词嵌入在时间和存储方面提供了一个更有效的计算范例。 + +以下是两个优秀的词嵌入方法。 + +#### Word2vec + +第一个是 [Word2vec][6],它是由 Google 开发的。随着你对 NLP 和情绪分析研究的深入,你可能会看到这种嵌入方法。它要么使用一个连续的词袋continuous bag of words(CBOW),要么使用一个连续 skip-gram 模型。在 CBOW 中,一个单词的上下文是在训练中根据围绕它的单词来学习的。连续 skip-gram 学习倾向于围绕给定的单词学习单词。虽然这可能超出了你需要解决的问题,但是如果你曾经面对必须生成自己的词嵌入情况,那么 Word2vec 的作者就提倡使用 CBOW 方法来提高速度并评估频繁的单词,而 skip-gram 方法更适合嵌入稀有单词更重要的嵌入。 + +#### GloVe + +第二个是[用于词表示的全局向量][7]Global Vectors for Word Representation(GloVe),它是斯坦福大学开发的。它是 Word2vec 方法的扩展,试图通过将经典的全局文本统计特征提取获得的信息与 Word2vec 确定的本地上下文信息相结合。实际上,在一些应用程序中,GloVe 性能优于 Word2vec,而在另一些应用程序中则不如 Word2vec。最终,用于词嵌入的目标数据集将决定哪种方法最优。因此,最好了解它们的存在性和高级机制,因为你很可能会遇到它们。 + +#### 创建和使用词嵌入 + +最后,知道如何获得词嵌入是有用的。在第 2 部分中,你将看到我们通过利用社区中其他人的实质性工作,站到了巨人的肩膀上。这是获取词嵌入的一种方法:即使用现有的经过训练和验证的模型。实际上,有无数的模型适用于英语和其他语言,一定会有一种模型可以满足你的应用程序,让你开箱即用! + +如果没有的话,就开发工作而言,另一个极端是培训你自己的独立模型,而不考虑你的应用程序。实质上,你将获得大量标记的训练数据,并可能使用上述方法之一来训练模型。即使这样,你仍然只是在理解你输入文本数据。然后,你需要为你应用程序开发一个特定的模型(例如,分析软件版本控制消息中的情感价值),这反过来又需要自己的时间和精力。 + +你还可以对针对你的应用程序的数据训练一个词嵌入,虽然这可以减少时间和精力,但这个词嵌入将是特定于应用程序的,这将会降低它的可重用性。 + +### 可用的工具选项 + +考虑到所需的大量时间和计算能力,你可能想知道如何才能找到解决问题的方法。的确,开发可靠模型的复杂性可能令人望而生畏。但是,有一个好消息:已经有许多经过验证的模型、工具和软件库可以为我们提供所需的大部分内容。我们将重点关注 [Python][8],因为它为这些应用程序提供了大量方便的工具。 + +#### SpaCy + +[SpaCy][9] 提供了许多用于解析输入文本数据和提取特征的语言模型。它经过了高度优化,并被誉为同类中最快的库。最棒的是,它是开源的!SpaCy 会执行标识化、词性分类和依赖项注释。它包含了用于执行此功能的词嵌入模型,还有用于为超过 46 种语言的其他特征提取操作。在本系列的第二篇文章中,你将看到它如何用于文本分析和特征提取。 + +#### vaderSentiment + +[vaderSentiment][10] 包提供了积极、消极和中性情绪的衡量标准。正如 [原论文][11] 的标题(《VADER:一个基于规则的社交媒体文本情感分析模型》)所示,这些模型是专门为社交媒体文本数据开发和调整的。VADER 接受了一组完整的人类标记过的数据的训练,包括常见的表情符号、UTF-8 编码的表情符号以及口语术语和缩写(例如 meh、lol、sux)。 + +对于给定的输入文本数据,vaderSentiment 返回一个极性分数百分比的三元组。它还提供了一个单个的评分标准,称为 *vaderSentiment 复合指标*。这是一个在 `[-1, 1]` 范围内的实值,其中对于分值大于 `0.05` 的情绪被认为是积极的,对于分值小于 `-0.05` 的被认为是消极的,否则为中性。 + +在[第 2 部分][2]中,你将学习如何使用这些工具为你的设计添加情感分析功能。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/social-media-sentiment-analysis-python + +作者:[Michael McCune][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko/users/jschlessman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://opensource.com/article/19/4/social-media-sentiment-analysis-python-part-2 +[3]: https://en.wikipedia.org/wiki/Bag-of-words_model +[4]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Term_frequency +[5]: https://en.wikipedia.org/wiki/Tf%E2%80%93idf#Inverse_document_frequency +[6]: https://en.wikipedia.org/wiki/Word2vec +[7]: https://en.wikipedia.org/wiki/GloVe_(machine_learning) +[8]: https://www.python.org/ +[9]: https://pypi.org/project/spacy/ +[10]: https://pypi.org/project/vaderSentiment/ +[11]: http://comp.social.gatech.edu/papers/icwsm14.vader.hutto.pdf diff --git a/published/201905/20190419 This is how System76 does open hardware.md b/published/201905/20190419 This is how System76 does open hardware.md new file mode 100644 index 0000000000..27887b1486 --- /dev/null +++ b/published/201905/20190419 This is how System76 does open hardware.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10808-1.html) +[#]: subject: (This is how System76 does open hardware) +[#]: via: (https://opensource.com/article/19/4/system76-hardware) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +System76 是如何打造开源硬件的 +================================ + +> 是什么让新的 Thelio 台式机系列与众不同。 + +![在计算机上显示度量和数据][1] + +大多数人对他们电脑的硬件一无所知。作为一个长期的 Linux 用户,当我想让我的无线网卡、视频卡、显示器和其他硬件与我选择的发行版共同运行时,也一样遇到了挫折。商业品牌的硬件通常使判断这些问题变得很困难:为什么以太网驱动、无线驱动或者鼠标驱动和我们预期的不太一样?随着 Linux 发行版变得成熟,这可能不再是问题,但是我们仍能发现触控板和其它外部设备的怪异行为,尤其是当我们对底层的硬件知道的不多时。 + +像 [System76][2] 这样的公司致力于解决这些问题,以提升 Linux 用户体验。System76 生产了一系列的 Linux 笔记本、台式机和服务器,甚至提供了它自己的 Linux 发行版 [Pop! OS][3] 作为客户的一个选择。最近我有幸参观了 System76 在 Devnver 的工厂并揭开它的新台式机产品线 [Thelio][5] [的神秘面纱][5]。 + +### 关于 Thelio + +System76 宣称 Thelio 的开源硬件子板(被命名为木星之后的第 5 个卫星的名字 Thelio Io)是它在市场上独特的特点之一。Thelio Io 取得了开源硬件协会的认证 [OSHWA #us000145][6],并且有 4 个用于存储的 SATA 端口和一个控制风扇和用于电源按钮控制的嵌入式控制器。Thelio IO SAS 取得了 [OSHWA #us000146][7] 认证,并且有 4 个用于存储的 U.2 端口,没有嵌入式控制器。在展示时,System76 显示了这些组件如何调整风扇通过底盘来优化部件的性能。 + +该控制器还管理电源键,和围绕该电源键的 LED 光环,当被按下时它以 100% 的亮度发光。这提供了触觉和视觉上的确认:该主机已经启动电源了。当电脑在使用中,该按钮被设置为 35% 的亮度,当在睡眠模式,它的亮度在 2.35% 和 25% 之间跳动。当计算机关闭后,LED 保持朦胧的亮度,因此能够在黑暗的房间里找到电源控制。 + +Thelio 的嵌入式控制器是一个低功耗的 [ATmega32U4][8] 微控制器,并且控制器的设置可以使用 Arduino Micro 进行原型设计。Thelio Io 主板变化的多少取决于你购买哪种 Thelio 型号。 + +Thelio 可能是我见过的设计的最好的电脑机箱和系统。如果你曾经亲身体验过在一个常规的 PC 的内部进行操作的话,你可能会同意我的观点。我已经做了很多次了,因此我能以自己过往的糟糕经历来证明这点。 + +### 为什么做开源硬件? + +该主板是在 [KiCAD][9] 设计的,你可以在 [GitHub][10] 上按 GPL 许可证访问 Thelio 所有的设计文件。因此,为什么一个与其他 PC 制造商竞争的公司会设计一个独特的接口并公开授权呢?可能是该公司认识到开源设计及根据你的需要调整和分享一个 I/O 主板设计的能力的价值,即便你是市场上的竞争者。 + +![在 Thelio 启动时 Don Watkins 与 System76 的 CEO Carl Richell 谈话][11] + +*在 [Thelio 发布会][12] Don Watkins 与 System76 的 CEO Carl Richell 谈话。* + +我问 System76 的设计者和 CEO [Carl Richell][13],该公司是否担心过公开许可它的硬件设计意味着有人可以采取它的独特设计并用它来将 System76 驱逐出市场。他说: + +> 开源硬件对我们所有人都有益。这是我们未来提升技术的方式,并且使得每个人获取技术更容易。我们欢迎任何想要提高 Thelio 设计的人来这么做。开源该硬件不仅可以帮助我们更快的改进我们的电脑,并且能够使我们的消费者 100% 信任他们的设备。我们的目标是尽可能地移除专利功能,同时仍然能够为消费者提供一个有竞争力的 Linux 主机。 +> +> 我们已经与 Linux 社区一起合作了 13 年之久,来为我们的笔记本、台式机、服务器创造一个完美顺滑的体验。我们长期专注于为 Linux 社区提供服务,提供给我们的客户高水准的服务,我们的个性使 System76 变得独特。 + +我还问 Carl 为什么开源硬件对 System76 和 PC 市场是有意义的。他回复道: + +> System76 创立之初的想法是技术应该对每个人是开放和可获取的。我们还没有到达 100% 开源创造一个电脑的程度,但是有了开源硬件,我们迈出了接近目标的必不可少的一大步。 +> +> 我们生活在技术变成工具的时代。计算机在各级教育和很多行业当中是人们的工具。由于每个人特定的需要,每个人对于如何提升电脑和软件作为他们的主要工具有他们自己的想法。开源我们的计算机可以让这些想法成为现实,从而反过来促进技术成为一个更强大的工具。在一个开源环境中,我们持续迭代来生产更好的 PC。这有点酷。 + +我们总结了我们讨论的关于 System76 技术路线的对话,包含了开源硬件 mini PC,甚至是笔记本。在 System76 品牌下的已售出的 mini PC 和笔记本是由其他供应商制造的,并不是基于开源硬件的(尽管它们用的是 Linux 软件,是开源的)。 + +设计和支持开放式硬件是 PC 产业中的变革者,也正是它造就了 System76 的新 Thelio 台式机电脑产品线的不同。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/system76-hardware + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [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/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://system76.com/ +[3]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[4]: /article/18/11/system76-thelio-desktop-computer +[5]: https://system76.com/desktops +[6]: https://certification.oshwa.org/us000145.html +[7]: https://certification.oshwa.org/us000146.html +[8]: https://www.microchip.com/wwwproducts/ATmega32u4 +[9]: http://kicad-pcb.org/ +[10]: https://github.com/system76/thelio-io +[11]: https://opensource.com/sites/default/files/uploads/don_system76_ceo.jpg (Don Watkins speaks with System76 CEO Carl Richell at the Thelio launch event.) +[12]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-FKWFxFv +[13]: https://www.linkedin.com/in/carl-richell-9435781 + + diff --git a/published/201905/20190422 2 new apps for music tweakers on Fedora Workstation.md b/published/201905/20190422 2 new apps for music tweakers on Fedora Workstation.md new file mode 100644 index 0000000000..00ccf16a53 --- /dev/null +++ b/published/201905/20190422 2 new apps for music tweakers on Fedora Workstation.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10841-1.html) +[#]: subject: (2 new apps for music tweakers on Fedora Workstation) +[#]: via: (https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/) +[#]: author: (Justin W. Flory https://fedoramagazine.org/author/jflory7/) + +2 个给使用 Fedora 工作站的音乐爱好者的新应用 +====== + +![][1] + +Linux 操作系统非常适合进行独特的自定义和调整,以使你的计算机更好地为你工作。例如,[i3 窗口管理器][2] 就让用户认识到了构成现代 Linux 桌面的各种组件和部分。 + +Fedora 上有两个音乐爱好者会感兴趣的新软件包:mpris-scrobbler 和 playerctl。mpris-scrobbler 可以在 Last.fm 和/或 ListenBrainz 等音乐跟踪服务上[跟踪你的音乐收听历史][3]。 playerctl 是一个命令行的[音乐播放器的控制器][4]。 + +### mpris-scrobbler:记录你的音乐收听趋势 + +mpris-scrobbler 是一个命令行应用程序,用于将音乐的播放历史记录提交给 [Last.fm][5]、[Libre.fm][6] 或 [ListenBrainz][7] 等服务。它监听 [MPRIS D-Bus 接口][8] 以检测正在播放的内容。它可以连接几个不同的音乐客户端,如 spotify 客户端、[vlc][9]、audacious、bmp、[cmus][10] 等。 + +![Last.fm last week in music report. Generated from user-submitted listening history.][11] + +#### 安装和配置 mpris-scrobbler + +mpris-scrobbler 在 Fedora 28 或更高版本以及 EPEL 7 存储库中可用。在终端中运行以下命令进行安装: + +``` +sudo dnf install mpris-scrobbler +``` + +安装完成后,使用 `systemctl` 启动并启用该服务。以下命令启动 mpris-scrobbler 并始终在系统重启后启动它: + +``` +systemctl --user enable --now mpris-scrobbler.service +``` + +#### 提交播放信息给 ListenBrainz + +这里将介绍如何将 mpris-scrobbler 与 ListenBrainz 帐户相关联。要使用 Last.fm 或 Libre.fm,请参阅其[上游文档][12]。 + +要将播放信息提交到 ListenBrainz 服务器,你需要有一个 ListenBrainz API 令牌。如果你有帐户,请从[个人资料设置页面][13]中获取该令牌。如果有了令牌,请运行此命令以使用 ListenBrainz API 令牌进行身份验证: + +``` +$ mpris-scrobbler-signon token listenbrainz +Token for listenbrainz.org: +``` + +最后,通过在 Fedora 上用你的音乐客户端播放一首歌来测试它。你播放的歌曲会出现在 ListenBrainz 个人资料页中。 + +![Basic statistics and play history from a user profile on ListenBrainz. The current track is playing on a Fedora Workstation laptop with mpris-scrobbler.][14] + +### playerctl 可以控制音乐回放 + +`playerctl` 是一个命令行工具,它可以控制任何实现了 MPRIS D-Bus 接口的音乐播放器。你可以轻松地将其绑定到键盘快捷键或媒体热键上。以下是如何在命令行中安装、使用它,以及为 i3 窗口管理器创建键绑定的方法。 + +#### 安装和使用 playerctl + +`playerctl` 在 Fedora 28 或更高版本中可用。在终端运行如下命令以安装: + +``` +sudo dnf install playerctl +``` + +现在已安装好,你可以立即使用它。在 Fedora 上打开你的音乐播放器。接下来,尝试用以下命令来控制终端的播放。 + +播放或暂停当前播放的曲目: + +``` +playerctl play-pause +``` + +如果你想跳过下一首曲目: + +``` +playerctl next +``` + +列出所有正在运行的播放器: + +``` +playerctl -l +``` + +仅使用 spotify 客户端播放或暂停当前播放的内容: + +``` +playerctl -p spotify play-pause +``` + +#### 在 i3wm 中创建 playerctl 键绑定 + +你是否使用窗口管理器,比如 [i3 窗口管理器][2]?尝试使用 `playerctl` 进行键绑定。你可以将不同的命令绑定到不同的快捷键,例如键盘上的播放/暂停按钮。参照下面的 [i3wm 配置摘录][15] 看看如何做: + +``` +# Media player controls +bindsym XF86AudioPlay exec "playerctl play-pause" +bindsym XF86AudioNext exec "playerctl next" +bindsym XF86AudioPrev exec "playerctl previous" +``` + +### 体验一下音乐播放器 + +想了解关于在 Fedora 上定制音乐聆听体验的更多信息吗?Fedora Magazine 为你提供服务。看看 Fedora 上这[五个很酷的音乐播放器][16]。 + +也可以通过使用 MusicBrainz Picard 对音乐库进行排序和组织,[为你的混乱的音乐库带来秩序][17]。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/2-new-apps-for-music-tweakers-on-fedora-workstation/ + +作者:[Justin W. Flory][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jflory7/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/2-music-tweak-apps-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://github.com/mariusor/mpris-scrobbler +[4]: https://github.com/acrisci/playerctl +[5]: https://www.last.fm/ +[6]: https://libre.fm/ +[7]: https://listenbrainz.org/ +[8]: https://specifications.freedesktop.org/mpris-spec/latest/ +[9]: https://www.videolan.org/vlc/ +[10]: https://cmus.github.io/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/02/Screenshot_2019-04-13-jflory7%E2%80%99s-week-in-music2-1024x500.png +[12]: https://github.com/mariusor/mpris-scrobbler#authenticate-to-the-service +[13]: https://listenbrainz.org/profile/ +[14]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot_2019-04-13-User-jflory-ListenBrainz.png +[15]: https://github.com/jwflory/swiss-army/blob/ba6ac0c71855e33e3caa1ee1fe51c05d2df0529d/roles/apps/i3wm/files/config#L207-L210 +[16]: https://fedoramagazine.org/5-cool-music-player-apps/ +[17]: https://fedoramagazine.org/picard-brings-order-music-library/ +[18]: https://unsplash.com/photos/Qrspubmx6kE?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[19]: https://unsplash.com/search/photos/music?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201905/20190422 8 environment-friendly open software projects you should know.md b/published/201905/20190422 8 environment-friendly open software projects you should know.md new file mode 100644 index 0000000000..5233688a65 --- /dev/null +++ b/published/201905/20190422 8 environment-friendly open software projects you should know.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10814-1.html) +[#]: subject: (8 environment-friendly open software projects you should know) +[#]: via: (https://opensource.com/article/19/4/environment-projects) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger) + +8 个你应该了解的环保开源项目 +====== + +> 通过给这些致力于提升环境的项目做贡献来庆祝地球日。 + +![][1] + +在过去的几年里,我一直在帮助 [Greenpeace][2] 建立其第一个完全开源的软件项目,Planet 4. [Planet 4][3] 是一个全球参与平台,Greenpeace 的支持者和活动家可以互动并参与组织。它的目标是让人们代表我们的星球采取行动。我们希望邀请参与并利用人力来应对气候变化和塑料污染等全球性问题。开发者、设计师、作者、贡献者和其他通过开源支持环保主义的人都非常欢迎[参与进来][4]! + +Planet 4 远非唯一关注环境的开源项目。对于地球日,我会分享其他七个关注我们星球的开源项目。 + +[Eco Hacker Farm][5] 致力于支持可持续社区。它建议并支持将黑客空间/黑客基地和永续农业生活结合在一起的项目。该组织还有在线项目。访问其 [wiki][6] 或 [Twitter][7] 了解有关 Eco Hacker Farm 正在做的更多信息。 + +[Public Lab][8] 是一个开放社区和非营利组织,它致力于将科学掌握在公民手中。它于 2010 年在 BP 石油灾难后形成,Public Lab 与开源合作,协助环境勘探和调查。它是一个多元化的社区,有很多方法可以做[贡献][9]。 + +不久前,Opensource.com 的社区管理者 Don Watkins 撰写了一篇 [Open Climate Workbench][10] 的文章,该项目来自 Apache 基金会。 [OCW][11] 提供了进行气候建模和评估的软件,可用于各种应用。 + +[Open Source Ecology][12] 是一个旨在改善经济运作方式的项目。该项目着眼于环境再生和社会公正,它旨在重新界定我们的一些肮脏的生产和分配技术,以创造一个更可持续的文明。 + +促进开源和大数据工具之间的合作,以实现海洋、大气、土地和气候的研究,“ [Pangeo][13] 是第一个推广开放、可重复和可扩展科学的社区。”大数据可以改变世界! + +[Leaflet][14] 是一个著名的开源 JavaScript 库。它可以做各种各样的事情,包括环保项目,如 [Arctic Web Map][15],它能让科学家准确地可视化和分析北极地区,这是气候研究的关键能力。 + +当然,没有我在 Mozilla 的朋友就没有这个列表(这不是个完整的列表!)。[Mozilla Science Lab][16] 社区就像所有 Mozilla 项目一样,非常开放,它致力于将开源原则带给科学界。它的项目和社区使科学家能够进行我们世界所需的各种研究,以解决一些最普遍的环境问题。 + +### 如何贡献 + +在这个地球日,做为期六个月的承诺,将一些时间贡献给一个有助于应对气候变化的开源项目,或以其他方式鼓励人们保护地球母亲。肯定还有许多关注环境的开源项目,所以请在评论中留言! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/environment-projects + +作者:[Laura Hilliger][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/laurahilliger +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE +[2]: http://www.greenpeace.org +[3]: http://medium.com/planet4 +[4]: https://planet4.greenpeace.org/community/#partners-open-sourcers +[5]: https://wiki.ecohackerfarm.org/start +[6]: https://wiki.ecohackerfarm.org/ +[7]: https://twitter.com/EcoHackerFarm +[8]: https://publiclab.org/ +[9]: https://publiclab.org/contribute +[10]: https://opensource.com/article/17/1/apache-open-climate-workbench +[11]: https://climate.apache.org/ +[12]: https://wiki.opensourceecology.org/wiki/Project_needs +[13]: http://pangeo.io/ +[14]: https://leafletjs.com/ +[15]: https://webmap.arcticconnect.ca/#ac_3573/2/20.8/-65.5 +[16]: https://science.mozilla.org/ diff --git a/published/201905/20190422 Tracking the weather with Python and Prometheus.md b/published/201905/20190422 Tracking the weather with Python and Prometheus.md new file mode 100644 index 0000000000..82ed567a80 --- /dev/null +++ b/published/201905/20190422 Tracking the weather with Python and Prometheus.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10807-1.html) +[#]: subject: (Tracking the weather with Python and Prometheus) +[#]: via: (https://opensource.com/article/19/4/weather-python-prometheus) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 Python 和 Prometheus 跟踪天气 +====== + +> 创建自定义 Prometheus 集成以跟踪最大的云端提供商:地球母亲。 + +![Tree clouds][1] + +开源监控系统 [Prometheus][2] 集成了跟踪多种类型的时间序列数据,但如果没有集成你想要的数据,那么很容易构建一个。一个经常使用的例子使用云端提供商的自定义集成,它使用提供商的 API 抓取特定的指标。但是,在这个例子中,我们将与最大云端提供商集成:地球。 + +幸运的是,美国政府已经测量了天气并为集成提供了一个简单的 API。获取红帽总部下一个小时的天气预报很简单。 + +``` +import requests +HOURLY_RED_HAT = "" +def get_temperature(): + result = requests.get(HOURLY_RED_HAT) + return result.json()["properties"]["periods"][0]["temperature"] +``` + +现在我们已经完成了与地球的集成,现在是确保 Prometheus 能够理解我们想要内容的时候了。我们可以使用 [Prometheus Python 库][3]中的 gauge 创建一个注册项:红帽总部的温度。 + + +``` +from prometheus_client import CollectorRegistry, Gauge +def prometheus_temperature(num): + registry = CollectorRegistry() + g = Gauge("red_hat_temp", "Temperature at Red Hat HQ", registry=registry) + g.set(num) + return registry +``` + +最后,我们需要以某种方式将它连接到 Prometheus。这有点依赖 Prometheus 的网络拓扑:是 Prometheus 与我们的服务通信更容易,还是反向更容易。 + +第一种是通常建议的情况,如果可能的话,我们需要构建一个公开注册入口的 Web 服务器,并配置 Prometheus 收刮(scrape)它。 + +我们可以使用 [Pyramid][4] 构建一个简单的 Web 服务器。 + +``` +from pyramid.config import Configurator +from pyramid.response import Response +from prometheus_client import generate_latest, CONTENT_TYPE_LATEST +def metrics_web(request): + registry = prometheus_temperature(get_temperature()) + return Response(generate_latest(registry), + content_type=CONTENT_TYPE_LATEST) +config = Configurator() +config.add_route('metrics', '/metrics') +config.add_view(metrics_web, route_name='metrics') +app = config.make_wsgi_app() +``` + +这可以使用任何 Web 网关接口(WSGI)服务器运行。例如,假设我们将代码放在 `earth.py` 中,我们可以使用 `python -m twisted web --wsgi earth.app` 来运行它。 + +或者,如果我们的代码连接到 Prometheus 更容易,我们可以定期将其推送到 Prometheus 的[推送网关][5]。 + +``` +import time +from prometheus_client import push_to_gateway +def push_temperature(url): + while True: + registry = prometheus_temperature(get_temperature()) + push_to_gateway(url, "temperature collector", registry) + time.sleep(60*60) +``` + +这里的 URL 是推送网关的 URL。它通常以 `:9091` 结尾。 + +祝你构建自定义 Prometheus 集成成功,以便跟踪一切! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/weather-python-prometheus + +作者:[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/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://prometheus.io/ +[3]: https://github.com/prometheus/client_python +[4]: https://trypyramid.com/ +[5]: https://github.com/prometheus/pushgateway diff --git a/published/201905/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md b/published/201905/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md new file mode 100644 index 0000000000..7f0f184e52 --- /dev/null +++ b/published/201905/20190423 Four Methods To Check The Default Gateway Or Router IP Address In Linux.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10800-1.html) +[#]: subject: (Four Methods To Check The Default Gateway Or Router IP Address In Linux?) +[#]: via: (https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +4 种在 Linux 中检查默认网关或者路由器 IP 地址的方法 +============================================== + +你应该意识到你的默认网关是你的路由器的 IP 地址。一般这是在安装过程中由操作系统自动检测的,如果没有,你可能需要改变它。如果你的系统不能 ping 自身,那么很可能是一个网关问题,你必须修复它。在网络中,当你有多个网络适配器或路由器时,这种情况可能会发生。 + +网关是一个扮演着入口点角色的路由器,可以从一个网络传递网络数据到另一个网络。 + +下面是一些可能帮助你收集到与该话题相似的一些信息。 + +* [在 Linux 命令行检查你的公网 IP 地址的 9 种方法][1] +* [如何在 Linux 启用和禁用网卡?][2] + +这可以通过下面的四个命令完成。 + +* `route` 命令:被用来显示和操作 IP 路由表。 +* `ip` 命令:类似于 `ifconfig`,常用于设置静态 IP 地址、路由 & 默认网关,等等。 +* `netstat` 命令:是一个命令行工具,用来显示网络连接相关的信息(包括入站和出站的),例如路由表、伪装连接、多播成员和网络接口。 +* `routel` 命令:被用来以好看的输出格式列出路由。 + +### 1)在 Linux 中如何使用 route 命令检查默认的网关或者路由 IP 地址? + +`route` 命令被用来显示和操作 IP 路由表。 + +它主要用于通过一个已经配置的接口给特定的主机或者网络设置静态的路由。 + +当使用 `add` 或者 `del` 选项时,`route` 修改路由表。没有这些选项,`route` 显示路由表的当前内容。 + +``` +# route +或 +# route -n + +Kernel IP routing table +Destination Gateway Genmask Flags Metric Ref Use Iface +default www.routerlogin 0.0.0.0 UG 600 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp8s0 +``` + +### 2)如何在 Linux 中使用 ip 命令检查默认网关或者路由 IP 地址? + +[IP 命令][3] 类似于 `ifconfig`,常用于配置静态 IP 地址、路由 & 默认网关,等等。 + +`ifconfig` 命令因为多年没有维护而被遗弃了,即使它仍然在大多数 Linux 发行版上可获得。 + +`ifconfig` 命令已经被 `ip` 命令替代了,`ip` 命令是非常强大的,只要一个命令就能执行几个网络管理任务。 + +`ip` 命令工具附带在 iproute2 包中。在主要的 Linux 发行版中都默认预装了 iproute2 。 + +如果没有,你可以在你的终端中在包管理器的帮助下通过指定 iproute2 来安装它。 + +``` +# ip r +或 +# ip route +或 +# ip route show + +default via 192.168.1.1 dev wlp8s0 proto dhcp metric 600 +192.168.1.0/24 dev wlp8s0 proto kernel scope link src 192.168.1.6 metric 600 +``` + +### 3)如何在 Linux 中使用 netstat 命令检查默认网关或者路由 IP 地址? + +`netstat` 代表 Network Statistics,是一个用来显示网络连接相关的信息(包括入站和出站)的命令行工具,例如路由表、伪装连接,多播成员和网络接口。 + +它列出所有的 tcp、udp 套接字连接和 unix 套接字连接。 + +它在网络中被用来诊断网络问题并判断网络中的流量总量来作为性能测量指标。 + +``` +# netstat -r + +Kernel IP routing table +Destination Gateway Genmask Flags MSS Window irtt Iface +default www.routerlogin 0.0.0.0 UG 0 0 0 wlp8s0 +192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp8s0 +``` + +### 4)如何在 Linux 中使用 routel 命令检查默认网关或者路由 IP 地址? + +它用来以好看的输出格式列出路由信息。这些程序是一系列你可以用来替代 iproute2 的帮助脚本(`routel` 和 `routef`)。 + +`routel` 脚本以一种被认为更容易解释并且等价于 `route` 输出列表的格式来输出路由信息。 + +如果 `routef` 脚本不加任何参数,将仅仅简单的将路由表清空。小心!这意味着删除所有的路由,让你的网络不再可用。 + +``` +# routel + target gateway source proto scope dev tbl + default 192.168.1.1 dhcp wlp8s0 + 192.168.1.0/ 24 192.168.1.6 kernel link wlp8s0 + 127.0.0.0 broadcast 127.0.0.1 kernel link lo local + 127.0.0.0/ 8 local 127.0.0.1 kernel host lo local + 127.0.0.1 local 127.0.0.1 kernel host lo local +127.255.255.255 broadcast 127.0.0.1 kernel link lo local + 192.168.1.0 broadcast 192.168.1.6 kernel link wlp8s0 local + 192.168.1.6 local 192.168.1.6 kernel host wlp8s0 local + 192.168.1.255 broadcast 192.168.1.6 kernel link wlp8s0 local + ::1 kernel lo + fe80::/ 64 kernel wlp8s0 + ::1 local kernel lo local +fe80::ad00:2f7e:d882:5add local kernel wlp8s0 local + ff00::/ 8 wlp8s0 local +``` + +如果你只想打印默认的网关那么使用下面的格式。 + + +``` +# routel | grep default + default 192.168.1.1 dhcp wlp8s0 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-find-default-gateway-or-router-ip-address-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-find-server-public-ip-address-linux/ +[2]: https://www.2daygeek.com/enable-disable-up-down-nic-network-interface-port-linux-using-ifconfig-ifdown-ifup-ip-nmcli-nmtui/ +[3]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/ diff --git a/published/201905/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md b/published/201905/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md new file mode 100644 index 0000000000..66b202a011 --- /dev/null +++ b/published/201905/20190423 How To Monitor Disk I-O Activity Using iotop And iostat Commands In Linux.md @@ -0,0 +1,325 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10815-1.html) +[#]: subject: (How To Monitor Disk I/O Activity Using iotop And iostat Commands In Linux?) +[#]: via: (https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +在 Linux 中如何使用 iotop 和 iostat 监控磁盘 I/O 活动? +====================================== + +你知道在 Linux 中我们使用什么工具检修和监控实时的磁盘活动吗?如果 [Linux 系统性能][1]变慢,我们会用 [top 命令][2] 来查看系统性能。它被用来检查是什么进程在服务器上占有如此高的使用率,对于大多数 Linux 系统管理员来说很常见,现实世界中被 Linux 系统管理员广泛采用。 + +如果在进程输出中你没有看到很大的不同,你仍然有选择查看其他东西。我会建议你在 `top` 输出中检查 `wa` 状态,因为大多数时间里服务器性能由于在硬盘上的高 I/O 读和写降低了性能。如果它很高或者波动,很可能就是它造成的。因此,我们需要检查硬盘上的 I/O 活动。 + +我们可以在 Linux 中使用 `iotop` 和 `iostat` 命令监控所有的磁盘和文件系统的磁盘 I/O 统计。 + +### 什么是 iotop? + +`iotop` 是一个类似 `top` 的工具,用来显示实时的磁盘活动。 + +`iotop` 监控 Linux 内核输出的 I/O 使用信息,并且显示一个系统中进程或线程的当前 I/O 使用情况。 + +它显示每个进程/线程读写 I/O 带宽。它同样显示当等待换入和等待 I/O 的线程/进程花费的时间的百分比。 + +`Total DISK READ` 和 `Total DISK WRITE` 的值一方面表示了进程和内核线程之间的总的读写带宽,另一方面也表示内核块设备子系统的。 + +`Actual DISK READ` 和 `Actual DISK WRITE` 的值表示在内核块设备子系统和下面硬件(HDD、SSD 等等)对应的实际磁盘 I/O 带宽。 + +### 如何在 Linux 中安装 iotop ? + +我们可以轻松在包管理器的帮助下安装,因为该软件包在所有的 Linux 发行版仓库中都可以获得。 + +对于 Fedora 系统,使用 [DNF 命令][3] 来安装 `iotop`。 + +``` +$ sudo dnf install iotop +``` + +对于 Debian/Ubuntu 系统,使用 [API-GET 命令][4] 或者 [APT 命令][5] 来安装 `iotop`。 + +``` +$ sudo apt install iotop +``` + +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `iotop`。 + +``` +$ sudo pacman -S iotop +``` + +对于 RHEL/CentOS 的系统,使用 [YUM Command][7] 来安装 `iotop`。 + +``` +$ sudo yum install iotop +``` + +对于使用 openSUSE Leap 的系统,使用 [Zypper Command][8] 来安装 `iotop`。 + +``` +$ sudo zypper install iotop +``` + +### 在 Linux 中如何使用 iotop 命令来监控磁盘 I/O 活动/统计? + +`iotop` 命令有很多参数来检查关于磁盘 I/O 的变化: + +``` +# iotop +``` + +![10] + +如果你想检查那个进程实际在做 I/O,那么运行 `iotop` 命令加上 `-o` 或者 `--only` 参数。 + +``` +# iotop --only +``` + +![11] + +细节: + + * `IO`:它显示每个进程的 I/O 利用率,包含磁盘和交换。 + * `SWAPIN`: 它只显示每个进程的交换使用率。 + +### 什么是 iostat? + +`iostat` 被用来报告中央处理单元(CPU)的统计和设备与分区的输出/输出的统计。 + +`iostat` 命令通过观察与它们平均传输率相关的设备活跃时间来监控系统输入/输出设备负载。 + +`iostat` 命令生成的报告可以被用来改变系统配置来更好的平衡物理磁盘之间的输入/输出负载。 + +所有的统计都在 `iostat` 命令每次运行时被报告。该报告包含一个 CPU 头部,后面是一行 CPU 统计。 + +在多处理器系统中,CPU 统计被计算为系统层面的所有处理器的平均值。设备头行后紧跟显示每个配置的设备一行的统计。 + +`iostat` 命令生成两种类型的报告,CPU 利用率报告和设备利用率报告。 + +### 在 Linux 中怎样安装 iostat? + +`iostat` 工具是 `sysstat` 包的一部分,所以我们可以轻松地在包管理器地帮助下安装,因为在所有的 Linux 发行版的仓库都是可以获得的。 + +对于 Fedora 系统,使用 [DNF Command][3] 来安装 `sysstat`。 + +``` +$ sudo dnf install sysstat +``` + +对于 Debian/Ubuntu 系统,使用 [APT-GET Command][4] 或者 [APT Command][5] 来安装 `sysstat`。 + +``` +$ sudo apt install sysstat +``` + +对于基于 Arch Linux 的系统,使用 [Pacman Command][6] 来安装 `sysstat`。 + +``` +$ sudo pacman -S sysstat +``` + +对于 RHEL/CentOS 系统,使用 [YUM Command][7] 来安装 `sysstat`。 + +``` +$ sudo yum install sysstat +``` + +对于 openSUSE Leap 系统,使用 [Zypper Command][8] 来安装 `sysstat`。 + +``` +$ sudo zypper install sysstat +``` + +### 在 Linux 中如何使用 sysstat 命令监控磁盘 I/O 活动/统计? + +在 `iostat` 命令中有很多参数来检查关于 I/O 和 CPU 的变化统计信息。 + +不加参数运行 `iostat` 命令会看到完整的系统统计。 + +``` +# iostat + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.45 0.02 16.47 0.12 0.00 53.94 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0 +sda 0.18 6.77 80.24 0.00 3115036 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +运行 `iostat` 命令加上 `-d` 参数查看所有设备的 I/O 统计。 + +``` +# iostat -d + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.95 124.97 0.00 58420030 57509090 0 +sda 0.18 6.77 80.24 0.00 3115292 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +运行 `iostat` 命令加上 `-p` 参数查看所有的设备和分区的 I/O 统计。 + +``` +# iostat -p + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.42 0.02 16.45 0.12 0.00 53.99 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0 +nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0 +nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0 +sda 0.18 6.77 80.23 0.00 3116060 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +sda2 0.18 6.76 80.23 0.00 3111508 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 +``` + +运行 `iostat` 命令加上 `-x` 参数显示所有设备的详细的 I/O 统计信息。 + +``` +# iostat -x + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.41 0.02 16.45 0.12 0.00 54.00 + +Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await dareq-sz aqu-sz %util +nvme0n1 2.45 126.93 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 3.16 29.54 0.00 0.00 0.00 0.00 0.00 0.00 0.31 30.28 +sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.13 +loop0 0.00 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop1 0.00 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +loop2 0.00 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 +``` + +运行 `iostat` 命令加上 `-d [设备名]` 参数查看具体设备和它的分区的 I/O 统计信息。 + +``` +# iostat -p [Device_Name] + +# iostat -p sda + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.38 0.02 16.43 0.12 0.00 54.05 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +sda 0.18 6.77 80.21 0.00 3117468 36924764 0 +sda2 0.18 6.76 80.21 0.00 3112916 36924764 0 +sda1 0.00 0.01 0.00 0.00 3224 0 0 +``` + +运行 `iostat` 命令加上 `-m` 参数以 MB 为单位而不是 KB 查看所有设备的统计。默认以 KB 显示输出。 + +``` +# iostat -m + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.36 0.02 16.41 0.12 0.00 54.09 + +Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_dscd +nvme0n1 6.68 0.12 0.12 0.00 57050 56176 0 +sda 0.18 0.01 0.08 0.00 3045 36059 0 +loop0 0.00 0.00 0.00 0.00 2 0 0 +loop1 0.00 0.00 0.00 0.00 1 0 0 +loop2 0.00 0.00 0.00 0.00 1 0 0 +``` + +运行 `iostat` 命令使用特定的间隔使用如下的格式。在这个例子中,我们打算以 5 秒捕获的间隔捕获两个报告。 + +``` +# iostat [Interval] [Number Of Reports] + +# iostat 5 2 + +Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _x86_64_ (8 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 29.35 0.02 16.41 0.12 0.00 54.10 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0 +sda 0.18 6.77 80.20 0.00 3118492 36924764 0 +loop0 0.00 0.00 0.00 0.00 2160 0 0 +loop1 0.00 0.00 0.00 0.00 1093 0 0 +loop2 0.00 0.00 0.00 0.00 1077 0 0 + +avg-cpu: %user %nice %system %iowait %steal %idle + 3.71 0.00 2.51 0.05 0.00 93.73 + +Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscd +nvme0n1 19.00 0.20 311.40 0.00 1 1557 0 +sda 0.20 25.60 0.00 0.00 128 0 0 +loop0 0.00 0.00 0.00 0.00 0 0 0 +loop1 0.00 0.00 0.00 0.00 0 0 0 +loop2 0.00 0.00 0.00 0.00 0 0 0 +``` + +运行 `iostat` 命令与 `-N` 参数来查看 LVM 磁盘 I/O 统计报告。 + +``` +# iostat -N + +Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _x86_64_ (2 CPU) + +avg-cpu: %user %nice %system %iowait %steal %idle + 0.38 0.07 0.18 0.26 0.00 99.12 + +Device tps kB_read/s kB_wrtn/s kB_read kB_wrtn +sda 3.60 57.07 69.06 968729 1172340 +sdb 0.02 0.33 0.00 5680 0 +sdc 0.01 0.12 0.00 2108 0 +2g-2gvol1 0.00 0.07 0.00 1204 0 +``` + +运行 `nfsiostat` 命令来查看 Network File System(NFS)的 I/O 统计。 + +``` +# nfsiostat +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-monitor-disk-io-in-linux-using-iotop-iostat-command/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/monitoring-tools/ +[2]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[3]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[7]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[8]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-1.jpg +[11]: https://www.2daygeek.com/wp-content/uploads/2015/03/monitor-disk-io-activity-using-iotop-iostat-command-in-linux-2.jpg diff --git a/published/201905/20190425 Automate backups with restic and systemd.md b/published/201905/20190425 Automate backups with restic and systemd.md new file mode 100644 index 0000000000..677a87c3f4 --- /dev/null +++ b/published/201905/20190425 Automate backups with restic and systemd.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10875-1.html) +[#]: subject: (Automate backups with restic and systemd) +[#]: via: (https://fedoramagazine.org/automate-backups-with-restic-and-systemd/) +[#]: author: (Link Dupont https://fedoramagazine.org/author/linkdupont/) + +使用 restic 和 systemd 自动备份 +====== + +![][1] + +及时备份很重要。即使在 [Fedora Magazine][3] 中,[备份软件][2] 也是一个常见的讨论话题。本文演示了如何仅使用 systemd 以及 `restic` 来自动备份。 + +有关 `restic` 的介绍,请查看我们的文章[在 Fedora 上使用 restic 进行加密备份][4]。然后继续阅读以了解更多详情。 + +为了自动创建快照以及清理数据,需要运行两个 systemd 服务。第一个运行*备份*命令的服务需要以常规频率运行。第二个服务负责数据清理。 + +如果你根本不熟悉 systemd,那么这是个很好的学习机会。查看 [Magazine 上关于 systemd 的系列文章] [5],从单元文件的这个入门开始: + +- [systemd 单元文件基础][6] + +如果你还没有安装 `restic`,请注意它在官方的 Fedora 仓库中。要安装它,请[带上 sudo][7] 运行此命令: + +``` +$ sudo dnf install restic +``` + +### 备份 + +首先,创建 `~/.config/systemd/user/restic-backup.service`。将下面的文本复制并粘贴到文件中以获得最佳效果。 + +``` +[Unit] +Description=Restic backup service +[Service] +Type=oneshot +ExecStart=restic backup --verbose --one-file-system --tag systemd.timer $BACKUP_EXCLUDES $BACKUP_PATHS +ExecStartPost=restic forget --verbose --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS +EnvironmentFile=%h/.config/restic-backup.conf +``` + +此服务引用环境文件来加载密钥(例如 `RESTIC_PASSWORD`)。创建 `~/.config/restic-backup.conf`。复制并粘贴以下内容以获得最佳效果。此示例使用 BackBlaze B2 存储。请相应地调整 ID、密钥、仓库和密码值。 + +``` +BACKUP_PATHS="/home/rupert" +BACKUP_EXCLUDES="--exclude-file /home/rupert/.restic_excludes --exclude-if-present .exclude_from_backup" +RETENTION_DAYS=7 +RETENTION_WEEKS=4 +RETENTION_MONTHS=6 +RETENTION_YEARS=3 +B2_ACCOUNT_ID=XXXXXXXXXXXXXXXXXXXXXXXXX +B2_ACCOUNT_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +RESTIC_REPOSITORY=b2:XXXXXXXXXXXXXXXXXX:/ +RESTIC_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` + +现在已安装该服务,请重新加载 systemd:`systemctl -user daemon-reload`。尝试手动运行该服务以创建备份:`systemctl -user start restic-backup`。 + +因为该服务类型是*一次性*,它将运行一次并退出。验证服务运行并根据需要创建快照后,设置计时器以定期运行此服务。例如,要每天运行 `restic-backup.service`,请按如下所示创建 `~/.config/systemd/user/restic-backup.timer`。再次复制并粘贴此文本: + +``` +[Unit] +Description=Backup with restic daily +[Timer] +OnCalendar=daily +Persistent=true +[Install] +WantedBy=timers.target +``` + +运行以下命令启用: + +``` +$ systemctl --user enable --now restic-backup.timer +``` + +### 清理 + +虽然主服务运行 `forget` 命令仅保留保留策略中的快照,但实际上并未从 `restic` 仓库中删除数据。 `prune` 命令检查仓库和当前快照,并删除与快照无关的所有数据。由于 `prune` 可能是一个耗时的过程,因此无需在每次运行备份时运行。这是第二个服务和计时器的场景。首先,通过复制和粘贴此文本来创建文件 `~/.config/systemd/user/restic-prune.service`: + +``` +[Unit] +Description=Restic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=restic prune +EnvironmentFile=%h/.config/restic-backup.conf +``` + +与主 `restic-backup.service` 服务类似,`restic-prune` 也是一次性服务,并且可以手动运行。设置完服务后,创建 `~/.config/systemd/user/restic-prune.timer` 并启用相应的计时器: + +``` +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target +``` + +就是这些了!`restic` 将会每日运行并按月清理数据。 + +* * * + +图片来自 [Unsplash][9] 由 [Samuel Zeller][8] 拍摄。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automate-backups-with-restic-and-systemd/ + +作者:[Link Dupont][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://fedoramagazine.org/author/linkdupont/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/restic-systemd-816x345.jpg +[2]: https://restic.net/ +[3]: https://fedoramagazine.org/?s=backup +[4]: https://fedoramagazine.org/use-restic-encrypted-backups/ +[5]: https://fedoramagazine.org/series/systemd-series/ +[6]: https://fedoramagazine.org/systemd-getting-a-grip-on-units/ +[7]: https://fedoramagazine.org/howto-use-sudo/ +[8]: https://unsplash.com/photos/JuFcQxgCXwA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/search/photos/archive?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201905/20190430 Upgrading Fedora 29 to Fedora 30.md b/published/201905/20190430 Upgrading Fedora 29 to Fedora 30.md new file mode 100644 index 0000000000..4d9123601f --- /dev/null +++ b/published/201905/20190430 Upgrading Fedora 29 to Fedora 30.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10854-1.html) +[#]: subject: (Upgrading Fedora 29 to Fedora 30) +[#]: via: (https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +将 Fedora 29 升级到 Fedora 30 +====== + +![][1] + +Fedora 30 [已经发布了][2]。你可能希望将系统升级到最新版本的 Fedora。Fedora 工作站版本有图形化升级的方法。另外,Fedora 也提供了一个命令行方法,用于将 Fedora 29 升级到 Fedora 30。 + +### 将 Fedora 29 工作站版本升级到 Fedora 30 + +在发布不久后,桌面会显示一条通知告诉你可以升级。你可以单击通知启动 “GNOME 软件” 应用。或者你可以从 GNOME Shell 中选择“软件”。 + +在 “GNOME 软件” 中选择*更新*选项卡,你会看到一个页面通知你可以更新 Fedora 30。 + +如果你在屏幕上看不到任何内容,请尝试点击左上角的重新加载按钮。发布后,所有系统都可能需要一段时间才能看到可用的升级。 + +选择“下载”获取升级包。你可以继续做其他的事直到下载完成。然后使用 “GNOME 软件” 重启系统并应用升级。升级需要时间,因此你可以喝杯咖啡,稍后再回来。 + +### 使用命令行 + +如果你过去升级过 Fedora 版本,你可能熟悉 `dnf upgrade` 插件。这是从 Fedora 29 升级到 Fedora 30 的推荐和支持的方式。使用这个插件将使你的 Fedora 30 升级简单易行。 + +#### 1、更新软件并备份系统 + +在你执行任何操作之前,你需要确保在开始升级之前拥有 Fedora 29 的最新软件。要更新软件,请使用 “GNOME 软件” 或在终端中输入以下命令。 + +``` +sudo dnf upgrade --refresh +``` + +此外,请确保在继续之前备份系统。关于备份的帮助,请参阅 Fedora Magazine 上的[备份系列][3]。 + +#### 2、安装 DNF 插件 + +接下来,打开终端并输入以下命令来安装插件: + +``` +sudo dnf install dnf-plugin-system-upgrade +``` + +#### 3、使用 DNF 开始更新 + +现在你的系统是最新的,完成了备份,并且已安装 DNF 插件,你可以在终端中使用以下命令开始升级: + +``` +sudo dnf system-upgrade download --releasever=30 +``` + +此命令将开始在本地下载所有升级文件以准备升级。如果你因为没有更新包、错误的依赖,或过时的包在升级时遇到问题,请在输入上面的命令时添加 `-- allowerasing` 标志。这将允许 DNF 删除可能阻止系统升级的软件包。 + +#### 4、重启并升级 + +当前面的命令完成下载所有升级文件后,你的系统就可以重启了。要将系统引导至升级过程,请在终端中输入以下命令: + +``` +sudo dnf system-upgrade reboot +``` + +此后你的系统将重启。在许多版本之前,`fedup` 工具将在内核选择/引导页面上创建一个新选项。使用 `dnf-plugin-system-upgrade` 包,你的系统将使用当前 Fedora 29 安装的内核重启。这个是正常的。在内核选择页面后不久,系统开始升级过程。 + +现在可以休息一下了!完成后你的系统将重启,你就可以登录新升级的 Fedora 30 了。 + +![][4] + +### 解决升级问题 + +升级系统时偶尔可能会出现意外问题。如果你遇到任何问题,请访问 [DNF 系统升级的维基页面][5],以获取有关出现问题时的故障排除的更多信息。 + +如果你在升级时遇到问题并在系统上安装了第三方仓库,那么可能需要在升级时禁用这些仓库。有关 Fedora 对未提供仓库的支持,请与仓库的提供商联系。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/upgrading-fedora-29-to-fedora-30/ + +作者:[Ryan Lerch][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://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/29-30-816x345.jpg +[2]: https://fedoramagazine.org/announcing-fedora-30/ +[3]: https://fedoramagazine.org/taking-smart-backups-duplicity/ +[4]: https://cdn.fedoramagazine.org/wp-content/uploads/2016/06/Screenshot_f23-ws-upgrade-test_2016-06-10_110906-1024x768.png +[5]: https://fedoraproject.org/wiki/DNF_system_upgrade#Resolving_post-upgrade_issues diff --git a/published/201905/20190501 3 apps to manage personal finances in Fedora.md b/published/201905/20190501 3 apps to manage personal finances in Fedora.md new file mode 100644 index 0000000000..dee4fb0985 --- /dev/null +++ b/published/201905/20190501 3 apps to manage personal finances in Fedora.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10903-1.html) +[#]: subject: (3 apps to manage personal finances in Fedora) +[#]: via: (https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +3 款在 Fedora 中管理个人财务的应用 +====== + +![][1] + +网上有很多可以用来管理你个人财务的服务。虽然它们可能很方便,但这通常也意味着将你最宝贵的个人数据放在你无法监控的公司。也有些人对这些不太在意。 + +无论你是否在意,你可能会对你自己系统上的应用感兴趣。这意味着如果你不想,你的数据永远不会离开自己的计算机。这三款之一可能就是你想找的。 + +### HomeBank + +HomeBank 是一款可以管理多个账户的全功能软件。它很容易设置并保持更新。它有多种方式画出你的分类和负债,以便你可以看到资金流向何处。它可以通过官方 Fedora 仓库下载。 + +![A simple account set up in HomeBank with a few transactions.][2] + +要安装 HomeBank,请打开“软件中心”,搜索 “HomeBank”,然后选择该应用。单击“安装”将其添加到你的系统中。HomeBank 也可以通过 Flatpak 安装。 + +### KMyMoney + +KMyMoney 是一个成熟的应用,它已经存在了很长一段时间。它有一系列稳定的功能,可帮助你管理多个帐户,包括资产、负债、税收等。KMyMoney 包含一整套用于管理投资和进行预测的工具。它还提供大量报告,以了解你的资金运作方式。 + +![A subset of the many reports available in KMyMoney.][3] + +要安装它,请使用软件中心,或使用命令行: + +``` +$ sudo dnf install kmymoney +``` + +### GnuCash + +用于个人财务的最受欢迎的免费 GUI 应用之一是 GnuCash。GnuCash 不仅可以用于个人财务。它还有管理企业收入、资产和负债的功能。这并不意味着你不能用它来管理自己的账户。从查看[在线教程和指南][4]开始了解。 + +![Checking account records shown in GnuCash.][5] + +打开“软件中心”,搜索 “GnuCash”,然后选择应用。单击“安装”将其添加到你的系统中。或者如上所述使用 `dnf install` 来安装 “gnucash” 包。 + +它现在可以通过 Flathub 安装,这使得安装变得简单。如果你没有安装 Flathub,请查看 [Fedora Magazine 上的这篇文章][6]了解如何使用它。这样你也可以在终端使用 `flatpak install gnucash` 命令。 + +* * * + +照片由 [Fabian Blank][7] 拍摄,发布在 [Unsplash][8] 上。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/3-apps-to-manage-personal-finances-in-fedora/ + +作者:[Paul W. Frields][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://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/personal-finance-3-apps-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-16-16-1024x637.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-27-10-1-1024x649.png +[4]: https://www.gnucash.org/viewdoc.phtml?rev=3&lang=C&doc=guide +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/Screenshot-from-2019-04-28-16-41-27-1024x631.png +[6]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[7]: https://unsplash.com/photos/pElSkGRA2NU?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/money?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201905/20190501 Cisco issues critical security warning for Nexus data-center switches.md b/published/201905/20190501 Cisco issues critical security warning for Nexus data-center switches.md new file mode 100644 index 0000000000..e71bd21d6b --- /dev/null +++ b/published/201905/20190501 Cisco issues critical security warning for Nexus data-center switches.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10876-1.html) +[#]: subject: (Cisco issues critical security warning for Nexus data-center switches) +[#]: via: (https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科针对 Nexus 数据中心交换机发出危急安全预警 +====== + +> 思科围绕着 Nexus 的交换机、Firepower 防火墙和其他设备,发布了 40 个安全报告。 + +![Thinkstock][1] + +日前,思科发布了 40 个左右的安全报告,但只有其中的一个被评定为“[危急][2]”:思科 Nexus 9000 系列应用中心基础设施(ACI)模式数据中心交换机中的一个漏洞,可能会让攻击者隐秘地访问到系统资源。 + +这个新发现的漏洞,被通用漏洞评分系统给到了 9.8 分(满分 10 分),思科表示,它是思科 Nexus 9000 系列的安全 shell (ssh)密钥管理方面的问题,这个漏洞允许远程攻击者以 root 用户的权限来连接到受影响的系统。 + +思科表示,“**这个漏洞是因为所有的设备都存在一对默认的 ssh 密钥对**,攻击者可以使用提取到的密钥材料,并通过 IPv6 来创建连接到目标设备的 SSH 连接。这个漏洞仅能通过 IPv6 来进行利用,IPv4 不会被攻击”。 + +型号为 Nexus 9000 系列且 NX-OS 软件版本在 14.1 之前的设备会受此漏洞的影响,该公司表示没有解决这个问题的变通办法。 + +然而,思科公司已经为解决这个漏洞[发布了免费的软件更新][4]。 + +该公司同样对 Nexus 9000 系列发布了一个“高危”级别的安全预警报告,报告中表示存在一种攻击,允许攻击者以 root 用户权限在受影响的设备上执行任意操作系统命令。思科表示,如果要用这种方式攻击成功,攻击者需要对应设备的有效的管理员用户凭证。 + +[思科表示][5],这个漏洞是由于过于宽泛的系统文件权限造成的。攻击者可以通过向受影响的设备进行认证,构造一个精心设计的命令字符串,并将这个字符串写入到特定位置的文件里。攻击者通过这种方式来利用这个漏洞。 + +思科发布了解决这个漏洞的软件更新。 + +另外两个被评为“高危”级别的漏洞的影响范围同样包括 Nexus 9000 系列: + +- 思科 Nexus 9000 系列软件后台操作功能中的[漏洞][7],能够允许一个已认证的本地攻击者在受影响的设备上提权到 root 权限。这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。思科表示,攻击者可以通过登录到受影响设备的命令行界面,并在文件系统的特定目录中构造一个精心设计过的文件,以此来利用这个漏洞。 +- 交换机软件后台操作功能中的[弱点][7]能够允许攻击者登录到受影响设备的命令行界面,并在文件系统的特定目录里创建一个精心构造过的文件。思科表示,这个漏洞是由于在受影响的设备上用户提供的文件验证不充分。 + +思科同样为这些漏洞[发布了软件更新][4]。 + +此外,这些安全警告中的一部分是针对思科 FirePower 防火墙系列中大量的“高危”漏洞警告。 + +例如,思科[写道][8],思科 Firepower 威胁防御软件的 SMB 协议预处理检测引擎中的多个漏洞能够允许未认证的相邻、远程攻击者造成拒绝服务攻击(DoS)的情况。 + +思科表示,思科 Firepower 2100 系列中思科 Firepower 软件里的内部数据包处理功能有[另一个漏洞][9],能够让未认证的远程攻击者造成受影响的设备停止处理流量,从而导致 DOS 的情况。 + +[软件补丁][4]可用于这些漏洞。 + +其他的产品,比如思科[自适应安全虚拟设备][10]和 [web 安全设备][11]同样也有高优先级的补丁。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3392858/cisco-issues-critical-security-warning-for-nexus-data-center-switches.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.idgesg.net/images/article/2018/02/lock_broken_unlocked_binary_code_security_circuits_protection_privacy_thinkstock_873916354-100750739-large.jpg +[2]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-sshkey +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://www.cisco.com/c/en/us/about/legal/cloud-and-software/end_user_license_agreement.html +[5]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-nexus9k-rpe +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-aci-hw-clock-util +[8]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-smb-snort +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-frpwr-dos +[10]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-asa-ipsec-dos +[11]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190501-wsa-privesc +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/published/201905/20190501 Write faster C extensions for Python with Cython.md b/published/201905/20190501 Write faster C extensions for Python with Cython.md new file mode 100644 index 0000000000..b3ff2f0edd --- /dev/null +++ b/published/201905/20190501 Write faster C extensions for Python with Cython.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10859-1.html) +[#]: subject: (Write faster C extensions for Python with Cython) +[#]: via: (https://opensource.com/article/19/5/python-cython) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/foundjem/users/jugmac00) + +使用 Cython 为 Python 编写更快的 C 扩展 +====== + +> 在我们这个包含了 7 个 PyPI 库的系列文章中学习解决常见的 Python 问题的方法。 + +![Hand drawing out the word "code"](https://img.linux.net.cn/data/attachment/album/201905/15/225506fnn2mz6l3u122n70.jpg) + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。首先是 [Cython][4],一个简化 Python 编写 C 扩展的语言。 + +### Cython + +使用 Python 很有趣,但有时,用它编写的程序可能很慢。所有的运行时动态调度会带来很大的代价:有时它比用 C 或 Rust 等系统语言编写的等效代码慢 10 倍。 + +将代码迁移到一种全新的语言可能会在成本和可靠性方面付出巨大代价:所有的手工重写工作都将不可避免地引入错误。我们可以两者兼得么? + +为了练习一下优化,我们需要一些慢代码。有什么比斐波那契数列的意外指数实现更慢? + +``` +def fib(n): + if n < 2: + return 1 + return fib(n-1) + fib(n-2) +``` + +由于对 `fib` 的调用会导致两次再次调用,因此这种效率极低的算法需要很长时间才能执行。例如,在我的新笔记本电脑上,`fib(36)` 需要大约 4.5 秒。这个 4.5 秒会成为我们探索 Python 的 Cython 扩展能提供的帮助的基准。 + +使用 Cython 的正确方法是将其集成到 `setup.py` 中。然而,使用 `pyximport` 可以快速地进行尝试。让我们将 `fib` 代码放在 `fib.pyx` 中并使用 Cython 运行它。 + +``` +>>> import pyximport; pyximport.install() +>>> import fib +>>> fib.fib(36) +``` + +只使用 Cython 而不*修改*代码,这个算法在我笔记本上花费的时间减少到大约 2.5 秒。几乎无需任何努力,这几乎减少了 50% 的运行时间。当然,得到了一个不错的成果。 + +加把劲,我们可以让它变得更快。 + +``` +cpdef int fib(int n): + if n < 2: + return 1 + return fib(n - 1) + fib(n - 2) +``` + +我们将 `fib` 中的代码变成用 `cpdef` 定义的函数,并添加了两个类型注释:它接受一个整数并返回一个整数。 + +这个变得快*多*了,大约只用了 0.05 秒。它是如此之快,以至于我可能开始怀疑我的测量方法包含噪声:之前,这种噪声在信号中丢失了。 + +当下次你的 Python 代码花费太多 CPU 时间时,也许会导致风扇狂转,为何不看看 Cython 是否可以解决问题呢? + +在本系列的下一篇文章中,我们将看一下 Black,一个自动纠正代码格式错误的项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-cython + +作者:[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/users/moshez/users/foundjem/users/jugmac00 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/Cython/ diff --git a/published/201905/20190502 Format Python however you like with Black.md b/published/201905/20190502 Format Python however you like with Black.md new file mode 100644 index 0000000000..dd56785451 --- /dev/null +++ b/published/201905/20190502 Format Python however you like with Black.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10864-1.html) +[#]: subject: (Format Python however you like with Black) +[#]: via: (https://opensource.com/article/19/5/python-black) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez/users/moshez) + +使用 Black 自由格式化 Python +====== + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解解决 Python 问题的更多信息。 + +![OpenStack source code \(Python\) in VIM](https://img.linux.net.cn/data/attachment/album/201905/16/220249ethkikh5h1uib5iy.jpg) + +Python 是当今使用最多的[流行编程语言][2]之一,因为:它是开源的,它有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区可以让我们在 [Python Package Index][3](PyPI)中有如此庞大、多样化的软件包,用以扩展和改进 Python 并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。在第一篇文章中,我们了解了 [Cython][4]。今天,我们将使用 [Black][5] 这个代码格式化工具。 + +### Black + +有时创意可能是一件美妙的事情。有时它只是一种痛苦。我喜欢创造性地解决难题,但我希望我的 Python 格式尽可能一致。没有人对使用“有趣”缩进的代码印象深刻。 + +但是比不一致的格式更糟糕的是除了检查格式之外什么都没有做的代码审查。这对审查者来说很烦人,对于被审查者来说甚至更烦人。当你的 linter 告诉你代码缩进不正确时,但没有提示*正确*的缩进量,这也会令人气愤。 + +使用 Black,它不会告诉你*要*做什么,它是一个优良、勤奋的机器人:它将为你修复代码。 + +要了解它如何工作的,请随意写一些非常不一致的内容,例如: + +``` +def add(a, b): return a+b + +def mult(a, b): + return \ + a * b +``` + +Black 抱怨了么?并没有,它为你修复了! + +``` +$ black math +reformatted math +All done! ✨ 🍰 ✨ +1 file reformatted. +$ cat math +def add(a, b): + return a + b + + +def mult(a, b): + return a * b +``` + +Black 确实提供了报错而不是修复的选项,甚至还有输出 diff 编辑样式的选项。这些选项在持续集成 (CI)系统中非常有用,可以在本地强制运行 Black。此外,如果 diff 输出被记录到 CI 输出中,你可以直接将其粘贴到 `patch` 中,以便在极少数情况下你需要修复输出,但无法本地安装 Black 使用。 + + +``` +$ black --check --diff bad +--- math 2019-04-09 17:24:22.747815 +0000 ++++ math 2019-04-09 17:26:04.269451 +0000 +@@ -1,7 +1,7 @@ +-def add(a, b): return a + b ++def add(a, b): ++ return a + b + + + def mult(a, b): +- return \ +- a * b ++ return a * b + +would reformat math +All done! 💥 💔 💥 +1 file would be reformatted. +$ echo $? +1 +``` + +在本系列的下一篇文章中,我们将介绍 attrs ,这是一个可以帮助你快速编写简洁、正确的代码的库。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-black + +作者:[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/users/moshez/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://opensource.com/article/19/4/7-python-problems-solved-cython +[5]: https://pypi.org/project/black/ diff --git a/published/201905/20190502 Get started with Libki to manage public user computer access.md b/published/201905/20190502 Get started with Libki to manage public user computer access.md new file mode 100644 index 0000000000..347196d553 --- /dev/null +++ b/published/201905/20190502 Get started with Libki to manage public user computer access.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10880-1.html) +[#]: subject: (Get started with Libki to manage public user computer access) +[#]: via: (https://opensource.com/article/19/5/libki-computer-access) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/tony-thomas) + +使用 Libki 来管理公共用户访问计算机 +====== +> Libki 是一个跨平台的计算机预约和用时管理系统。 + +![](https://img.linux.net.cn/data/attachment/album/201905/20/230201d26yuo261uu6s61i.jpg) + +提供公共计算机的图书馆、学校、学院和其他组织需要一种管理用户访问权限的好方法 —— 否则,就无法阻止某些人独占机器并确保每个人都有公平的用时。这是 [Libki][2] 要解决的问题。 + +Libki 是一个面向 Windows 和 Linux PC 的开源、跨平台的计算机预约和用时管理系统。它提供了一个基于 Web 的服务器和一个基于 Web 的管理系统,员工可以使用它来管理计算机访问,包括创建和删除用户、设置帐户用时限制、登出和禁止用户以及设置访问限制。 + +根据其首席开发人员 [Kyle Hall][3] 所说,Libki 主要用于 PC 用时控制,作为 Envisionware 出品的专有计算机访问控制软件的开源替代品。当用户登录 Libki 管理的计算机时,他们会有一段使用计算机的时间。时间到了之后,他们就会被登出。时间默认设置为 45 分钟,但可以使用基于 Web 的管理系统轻松调整。一些组织在登出用户之前提供 24 小时访问权限,而有的组织则使用它来跟踪使用情况而不设置用时限制。 + +Kyle 目前是 [ByWater Solutions][4] 的首席开发人员,该公司为图书馆提供开源软件解决方案(包括 Libki)。在职业生涯早期,他在宾夕法尼亚州的[米德维尔公共图书馆][5]担任 IT 技术时开发了 Libki。在其他员工的午休期间,偶尔会要求他关注孩子们的房间。图书馆使用纸质注册表来管理对儿童房间计算机的访问,这意味着不断的监督和检查,以确保来到那里的人能够公平地使用。 + +Kyle 说,“我发现这很笨拙而不便的,我想找到一个解决方案。这个解决方案需要同时是 FOSS 和跨平台的。最后,没有现有的软件适合我们的特殊需求,那就是为什么我开发了 Libki。“ + +或者,正如 Libki 的网站所宣称的那样,“Libki 的诞生是为了避免与青少年打交道(的麻烦),现在允许图书馆员避免与世界各地的青少年打交道(的麻烦)!” + +### 易于安装和使用 + +我最近决定在我经常在那里做志愿者的当地的公共图书馆尝试 Libki。我按照[文档][6]在 Ubuntu 18.04 Server 中自动进行了安装,它很快就启动起来了。 + +我计划在我们当地的图书馆支持 Libki,但我想知道在那些没有 IT 相关经验的人或者无法构建和部署服务器的图书馆是怎样的。Kyle 说:“ByWater Solutions 可以云端托管 Libki 服务器,这使得每个人的维护和管理变得更加简单。” + +Kyle 表示,ByWater 并不打算将 Libki 与其最受欢迎的产品,开源集成图书馆系统 (ILS)Koha 或其支持的任何其他[项目][7]捆绑在一起。他说: “Libki 和 Koha 是不同[类型]的软件,满足不同的需求,但它们在图书馆中确实很好地协同工作。事实上,我很早就开发了 Libki 的 SIP2 集成,因此它可以支持使用 Koha 进行单点登录。“ + +### 如何贡献 + +Libki 客户端是 GPLv3 许可,Libki 服务器是 AGPLv3 许可。Kyle 说他希望 Libki 拥有一个更加活跃和强大的社区,项目一直在寻找新人加入其[贡献者][8]。如果你想参加,请访问 [Libki 社区页面][9]并加入邮件列表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/libki-computer-access + +作者:[Don Watkins][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/don-watkins/users/tony-thomas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 +[2]: https://libki.org/ +[3]: https://www.linkedin.com/in/kylemhallinfo/ +[4]: https://opensource.com/article/19/4/software-libraries +[5]: https://meadvillelibrary.org/ +[6]: https://manual.libki.org/master/libki-manual.html#_automatic_installation +[7]: https://bywatersolutions.com/projects +[8]: https://github.com/Libki/libki-server/graphs/contributors +[9]: https://libki.org/community/ diff --git a/published/201905/20190503 API evolution the right way.md b/published/201905/20190503 API evolution the right way.md new file mode 100644 index 0000000000..069687be7a --- /dev/null +++ b/published/201905/20190503 API evolution the right way.md @@ -0,0 +1,693 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10900-1.html) +[#]: subject: (API evolution the right way) +[#]: via: (https://opensource.com/article/19/5/api-evolution-right-way) +[#]: author: (A. Jesse https://opensource.com/users/emptysquare) + +API 演进的正确方式 +====== + +> 负责任的库作者与其用户的十个约定。 + +![Browser of things](https://img.linux.net.cn/data/attachment/album/201905/26/134131jnymeg7t7gmo6qcy.jpg) + +想象一下你是一个造物主,为一个生物设计一个身体。出于仁慈,你希望它能随着时间进化:首先,因为它必须对环境的变化作出反应;其次,因为你的智慧在增长,你对这个小东西想到了更好的设计,它不应该永远保持一个样子。 + +![Serpents][2] + +然而,这个生物可能有赖于其目前解剖学的特征。你不能无所顾忌地添加翅膀或改变它的身材比例。它需要一个有序的过程来适应新的身体。作为一个负责任的设计者,你如何才能温柔地引导这种生物走向更大的进步呢? + +对于负责任的库维护者也是如此。我们向依赖我们代码的人保证我们的承诺:我们会发布 bug 修复和有用的新特性。如果对库的未来有利,我们有时会删除某些特性。我们会不断创新,但我们不会破坏使用我们库的人的代码。我们怎样才能一次实现所有这些目标呢? + +### 添加有用的特性 + +你的库不应该永远保持不变:你应该添加一些特性,使你的库更适合用户。例如,如果你有一个爬行动物类,并且如果有个可以飞行的翅膀是有用的,那就去添加吧。 + +``` +class Reptile: + @property + def teeth(self): + return 'sharp fangs' + + # 如果 wings 是有用的,那就添加它! + @property + def wings(self): + return 'majestic wings' +``` + +但要注意,特性是有风险的。考虑 Python 标准库中以下功能,看看它出了什么问题。 + +``` +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == False +``` + +这很奇怪:将任何时间对象转换为布尔值都会得到 True,但午夜时间除外。(更糟糕的是,时区感知时间的规则更加奇怪。) + +我已经写了十多年的 Python 了,但直到上周才发现这条规则。这种奇怪的行为会在用户代码中引起什么样的 bug? + +比如说一个日历应用程序,它带有一个创建事件的函数。如果一个事件有一个结束时间,那么函数也应该要求它有一个开始时间。 + +``` +def create_event(day, + start_time=None, + end_time=None): + if end_time and not start_time: + raise ValueError("Can't pass end_time without start_time") + +# 女巫集会从午夜一直开到凌晨 4 点 +create_event(datetime.date.today(), + datetime.time(0, 0), + datetime.time(4, 0)) +``` + +不幸的是,对于女巫来说,从午夜开始的事件无法通过校验。当然,一个了解午夜怪癖的细心程序员可以正确地编写这个函数。 + +``` +def create_event(day, + start_time=None, + end_time=None): + if end_time is not None and start_time is None: + raise ValueError("Can't pass end_time without start_time") +``` + +但这种微妙之处令人担忧。如果一个库作者想要创建一个伤害用户的 API,那么像午夜的布尔转换这样的“特性”很有效。 + +![Man being chased by an alligator][3] + +但是,负责任的创建者的目标是使你的库易于正确使用。 + +这个功能是由 Tim Peters 在 2002 年首次编写 datetime 模块时造成的。即时是像 Tim 这样的奠基 Python 的高手也会犯错误。[这个怪异之处后来被消除了][4],现在所有时间的布尔值都是 True。 + +``` +# Python 3.5 以后 + +bool(datetime.time(9, 30)) == True +bool(datetime.time(0, 0)) == True +``` + +不知道午夜怪癖的古怪之处的程序员现在可以从这种晦涩的 bug 中解脱出来,但是一想到任何依赖于古怪的旧行为的代码现在没有注意变化,我就会感到紧张。如果从来没有实现这个糟糕的特性,情况会更好。这就引出了库维护者的第一个承诺: + +#### 第一个约定:避免糟糕的特性 + +最痛苦的变化是你必须删除一个特性。一般来说,避免糟糕特性的一种方法是少添加特性!没有充分的理由,不要使用公共方法、类、功能或属性。因此: + +#### 第二个约定:最小化特性 + +特性就像孩子:在充满激情的瞬间孕育,但是它们必须要支持多年(LCTT 译注:我怀疑作者在开车,可是我没有证据)。不要因为你能做傻事就去做傻事。不要画蛇添足! + +![Serpents with and without feathers][5] + +但是,当然,在很多情况下,用户需要你的库中尚未提供的东西,你如何选择合适的功能给他们?以下另一个警示故事。 + +### 一个来自 asyncio 的警示故事 + +你可能知道,当你调用一个协程函数,它会返回一个协程对象: + +``` +async def my_coroutine(): + pass + +print(my_coroutine()) +``` + +``` + +``` + +你的代码必须 “等待await” 这个对象以此来运行协程。人们很容易忘记这一点,所以 asyncio 的开发人员想要一个“调试模式”来捕捉这个错误。当协程在没有等待的情况下被销毁时,调试模式将打印一个警告,并在其创建的行上进行回溯。 + +当 Yury Selivanov 实现调试模式时,他添加了一个“协程装饰器”的基础特性。装饰器是一个函数,它接收一个协程并返回任何内容。Yury 使用它在每个协程上接入警告逻辑,但是其他人可以使用它将协程转换为字符串 “hi!”。 + +``` +import sys + +def my_wrapper(coro): + return 'hi!' + +sys.set_coroutine_wrapper(my_wrapper) + +async def my_coroutine(): + pass + +print(my_coroutine()) +``` + +``` +hi! +``` + +这是一个地狱般的定制。它改变了 “异步async" 的含义。调用一次 `set_coroutine_wrapper` 将在全局永久改变所有的协程函数。正如 [Nathaniel Smith 所说][6]:“一个有问题的 API” 很容易被误用,必须被删除。如果 asyncio 开发人员能够更好地按照其目标来设计该特性,他们就可以避免删除该特性的痛苦。负责任的创建者必须牢记这一点: + +#### 第三个约定:保持特性单一 + +幸运的是,Yury 有良好的判断力,他将该特性标记为临时,所以 asyncio 用户知道不能依赖它。Nathaniel 可以用更单一的功能替换 `set_coroutine_wrapper`,该特性只定制回溯深度。 + +``` +import sys + +sys.set_coroutine_origin_tracking_depth(2) + +async def my_coroutine(): + pass + +print(my_coroutine()) + +``` + +``` + + +RuntimeWarning:'my_coroutine' was never awaited + +Coroutine created at (most recent call last) + File "script.py", line 8, in + print(my_coroutine()) +``` + +这样好多了。没有可以更改协程的类型的其他全局设置,因此 asyncio 用户无需编写防御代码。造物主应该像 Yury 一样有远见。 + +#### 第四个约定:标记实验特征“临时” + +如果你只是预感你的生物需要犄角和四叉舌,那就引入这些特性,但将它们标记为“临时”。 + +![Serpent with horns][7] + +你可能会发现犄角是无关紧要的,但是四叉舌是有用的。在库的下一个版本中,你可以删除前者并标记后者为正式的。 + +### 删除特性 + +无论我们如何明智地指导我们的生物进化,总会有一天想要删除一个正式特征。例如,你可能已经创建了一只蜥蜴,现在你选择删除它的腿。也许你想把这个笨拙的家伙变成一条时尚而现代的蟒蛇。 + +![Lizard transformed to snake][8] + +删除特性主要有两个原因。首先,通过用户反馈或者你自己不断增长的智慧,你可能会发现某个特性是个坏主意。午夜怪癖的古怪行为就是这种情况。或者,最初该特性可能已经很好地适应了你的库环境,但现在生态环境发生了变化,也许另一个神发明了哺乳动物,你的生物想要挤进哺乳动物的小洞穴里,吃掉里面美味的哺乳动物,所以它不得不失去双腿。 + +![A mouse][9] + +同样,Python 标准库会根据语言本身的变化删除特性。考虑 asyncio 的 Lock 功能,在把 `await` 作为一个关键字添加进来之前,它一直在等待: + +``` +lock = asyncio.Lock() + +async def critical_section(): + await lock + try: + print('holding lock') + finally: + lock.release() +``` + +但是现在,我们可以做“异步锁”: + + +``` +lock = asyncio.Lock() + +async def critical_section(): + async with lock: + print('holding lock') +``` + +新方法好多了!很短,并且在一个大函数中使用其他 try-except 块时不容易出错。因为“尽量找一种,最好是唯一一种明显的解决方案”,[旧语法在 Python 3.7 中被弃用][10],并且很快就会被禁止。 + +不可避免的是,生态变化会对你的代码产生影响,因此要学会温柔地删除特性。在此之前,请考虑删除它的成本或好处。负责任的维护者不会愿意让用户更改大量代码或逻辑。(还记得 Python 3 在重新添加会 `u` 字符串前缀之前删除它是多么痛苦吗?)如果代码删除是机械性的动作,就像一个简单的搜索和替换,或者如果该特性是危险的,那么它可能值得删除。 + +#### 是否删除特性 + +![Balance scales][11] + +反对 | 支持 +---|--- +代码必须改变 | 改变是机械性的 +逻辑必须改变 | 特性是危险的 + +就我们饥饿的蜥蜴而言,我们决定删除它的腿,这样它就可以滑进老鼠洞里吃掉它。我们该怎么做呢?我们可以删除 `walk` 方法,像下面一样修改代码: + +``` +class Reptile: + def walk(self): + print('step step step') +``` + +变成这样: + +``` +class Reptile: + def slither(self): + print('slide slide slide') +``` + +这不是一个好主意,这个生物习惯于走路!或者,就库而言,你的用户拥有依赖于现有方法的代码。当他们升级到最新库版本时,他们的代码将会崩溃。 + +``` +# 用户的代码,哦,不! +Reptile.walk() +``` + +因此,负责任的创建者承诺: + +#### 第五条预定:温柔地删除 + +温柔地删除一个特性需要几个步骤。从用腿走路的蜥蜴开始,首先添加新方法 `slither`。接下来,弃用旧方法。 + +``` +import warnings + +class Reptile: + def walk(self): + warnings.warn( + "walk is deprecated, use slither", + DeprecationWarning, stacklevel=2) + print('step step step') + + def slither(self): + print('slide slide slide') +``` + +Python 的 warnings 模块非常强大。默认情况下,它会将警告输出到 stderr,每个代码位置只显示一次,但你可以禁用警告或将其转换为异常,以及其它选项。 + +一旦将这个警告添加到库中,PyCharm 和其他 IDE 就会使用删除线呈现这个被弃用的方法。用户马上就知道该删除这个方法。 + +> Reptile().~~walk()~~ + +当他们使用升级后的库运行代码时会发生什么? + +``` +$ python3 script.py + +DeprecationWarning: walk is deprecated, use slither + script.py:14: Reptile().walk() + +step step step +``` + +默认情况下,他们会在 stderr 上看到警告,但脚本会成功并打印 “step step step”。警告的回溯显示必须修复用户代码的哪一行。(这就是 `stacklevel` 参数的作用:它显示了用户需要更改的调用,而不是库中生成警告的行。)请注意,错误消息有指导意义,它描述了库用户迁移到新版本必须做的事情。 + +你的用户可能会希望测试他们的代码,并证明他们没有调用弃用的库方法。仅警告不会使单元测试失败,但异常会失败。Python 有一个命令行选项,可以将弃用警告转换为异常。 + +``` +> python3 -Werror::DeprecationWarning script.py + +Traceback (most recent call last): + File "script.py", line 14, in + Reptile().walk() + File "script.py", line 8, in walk + DeprecationWarning, stacklevel=2) +DeprecationWarning: walk is deprecated, use slither +``` + +现在,“step step step” 没有输出出来,因为脚本以一个错误终止。 + +因此,一旦你发布了库的一个版本,该版本会警告已启用的 `walk` 方法,你就可以在下一个版本中安全地删除它。对吧? + +考虑一下你的库用户在他们项目的 `requirements` 中可能有什么。 + +``` +# 用户的 requirements.txt 显示 reptile 包的依赖关系 +reptile +``` + +下次他们部署代码时,他们将安装最新版本的库。如果他们尚未处理所有的弃用,那么他们的代码将会崩溃,因为代码仍然依赖 `walk`。你需要温柔一点,你必须向用户做出三个承诺:维护更改日志,选择版本化方案和编写升级指南。 + +#### 第六个约定:维护变更日志 + +你的库必须有更改日志,其主要目的是宣布用户所依赖的功能何时被弃用或删除。 + +> **版本 1.1 中的更改** +> +> **新特性** +> +> * 新功能 Reptile.slither() +> +> **弃用** +> +> * Reptile.walk() 已弃用,将在 2.0 版本中删除,请使用 slither() + +负责任的创建者会使用版本号来表示库发生了怎样的变化,以便用户能够对升级做出明智的决定。“版本化方案”是一种用于交流变化速度的语言。 + +#### 第七个约定:选择一个版本化方案 + +有两种广泛使用的方案,[语义版本控制][12]和基于时间的版本控制。我推荐任何库都进行语义版本控制。Python 的风格在 [PEP 440][13] 中定义,像 `pip` 这样的工具可以理解语义版本号。 + +如果你为库选择语义版本控制,你可以使用版本号温柔地删除腿,例如: + +> 1.0: 第一个“稳定”版,带有 `walk()` +> 1.1: 添加 `slither()`,废弃 `walk()` +> 2.0: 删除 `walk()` + +你的用户依赖于你的库的版本应该有一个范围,例如: + +``` +# 用户的 requirements.txt +reptile>=1,<2 +``` + +这允许他们在主要版本中自动升级,接收错误修正并可能引发一些弃用警告,但不会升级到**下**个主要版本并冒着更改破坏其代码的风险。 + +如果你遵循基于时间的版本控制,则你的版本可能会编号: + +> 2017.06.0: 2017 年 6 月的版本 +> 2018.11.0: 添加 `slither()`,废弃 `walk()` +> 2019.04.0: 删除 `walk()` + +用户可以这样依赖于你的库: + +``` +# 用户的 requirements.txt,基于时间控制的版本 +reptile==2018.11.* +``` + +这非常棒,但你的用户如何知道你的版本方案,以及如何测试代码来进行弃用呢?你必须告诉他们如何升级。 + +#### 第八个约定:写一个升级指南 + +下面是一个负责任的库创建者如何指导用户: + +> **升级到 2.0** +> +> **从弃用的 API 迁移** +> +> 请参阅更改日志以了解已弃用的特性。 +> +> **启用弃用警告** +> +> 升级到 1.1 并使用以下代码测试代码: +> +> `python -Werror::DeprecationWarning` +> +>​​​​​​ 现在可以安全地升级了。 + +你必须通过向用户显示命令行选项来教会用户如何处理弃用警告。并非所有 Python 程序员都知道这一点 —— 我自己就每次都得查找这个语法。注意,你必须*发布*一个版本,它输出来自每个弃用的 API 的警告,以便用户可以在再次升级之前使用该版本进行测试。在本例中,1.1 版本是小版本。它允许你的用户逐步重写代码,分别修复每个弃用警告,直到他们完全迁移到最新的 API。他们可以彼此独立地测试代码和库的更改,并隔离 bug 的原因。 + +如果你选择语义版本控制,则此过渡期将持续到下一个主要版本,从 1.x 到 2.0,或从 2.x 到 3.0 以此类推。删除生物腿部的温柔方法是至少给它一个版本来调整其生活方式。不要一次性把腿删掉! + +![A skink][14] + +版本号、弃用警告、更改日志和升级指南可以协同工作,在不违背与用户约定的情况下温柔地改进你的库。[Twisted 项目的兼容性政策][15] 解释的很漂亮: + +> “先行者总是自由的” +> +> 运行的应用程序在没有任何警告的情况下都可以升级为 Twisted 的一个次要版本。 +> +> 换句话说,任何运行其测试而不触发 Twisted 警告的应用程序应该能够将其 Twisted 版本升级至少一次,除了可能产生新警告之外没有任何不良影响。 +> + +现在,我们的造物主已经获得了智慧和力量,可以通过添加方法来添加特性,并温柔地删除它们。我们还可以通过添加参数来添加特性,但这带来了新的难度。你准备好了吗? + +### 添加参数 + +想象一下,你只是给了你的蛇形生物一对翅膀。现在你必须允许它选择是滑行还是飞行。目前它的 `move` 功能只接受一个参数。 + +``` +# 你的库代码 +def move(direction): + print(f'slither {direction}') + +# 用户的应用 +move('north') +``` + +你想要添加一个 `mode` 参数,但如果用户升级库,这会破坏他们的代码,因为他们只传递了一个参数。 + +``` +# 你的库代码 +def move(direction, mode): + assert mode in ('slither', 'fly') + print(f'{mode} {direction}') + +# 一个用户的代码,出现错误! +move('north') +``` + +一个真正聪明的创建者者会承诺不会以这种方式破坏用户的代码。 + +#### 第九条约定:兼容地添加参数 + +要保持这个约定,请使用保留原始行为的默认值添加每个新参数。 + +``` +# 你的库代码 +def move(direction, mode='slither'): + assert mode in ('slither', 'fly') + print(f'{mode} {direction}') + +# 用户的应用 +move('north') +``` + +随着时间推移,参数是函数演化的自然历史。它们首先列出最老的参数,每个都有默认值。库用户可以传递关键字参数以选择特定的新行为,并接受所有其他行为的默认值。 + +``` +# 你的库代码 +def move(direction, + mode='slither', + turbo=False, + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户应用 +move('north', extra_sinuous=True) +``` + +但是有一个危险,用户可能会编写如下代码: + +``` +# 用户应用,简写 +move('north', 'slither', False, True) +``` + +如果在你在库的下一个主要版本中去掉其中一个参数,例如 `turbo`,会发生什么? + +``` +# 你的库代码,下一个主要版本中 "turbo" 被删除 +def move(direction, + mode='slither', + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户应用,简写 +move('north', 'slither', False, True) +``` + +用户的代码仍然能编译,这是一件坏事。代码停止了曲折的移动并开始招呼 Lyft,这不是它的本意。我相信你可以预测我接下来要说的内容:删除参数需要几个步骤。当然,首先弃用 `trubo` 参数。我喜欢这种技术,它可以检测任何用户的代码是否依赖于这个参数。 + +``` +# 你的库代码 +_turbo_default = object() + +def move(direction, + mode='slither', + turbo=_turbo_default, + extra_sinuous=False, + hail_lyft=False): + if turbo is not _turbo_default: + warnings.warn( + "'turbo' is deprecated", + DeprecationWarning, + stacklevel=2) + else: + # The old default. + turbo = False +``` + +但是你的用户可能不会注意到警告。警告声音不是很大:它们可以在日志文件中被抑制或丢失。用户可能会漫不经心地升级到库的下一个主要版本——那个删除 `turbo` 的版本。他们的代码运行时将没有错误、默默做错误的事情!正如 Python 之禅所说:“错误绝不应该被默默 pass”。实际上,爬行动物的听力很差,所有当它们犯错误时,你必须非常大声地纠正它们。 + +![Woman riding an alligator][16] + +保护用户的最佳方法是使用 Python 3 的星型语法,它要求调用者传递关键字参数。 + +``` +# 你的库代码 +# 所有 “*” 后的参数必须以关键字方式传输。 +def move(direction, + *, + mode='slither', + turbo=False, + extra_sinuous=False, + hail_lyft=False): + # ... + +# 用户代码,简写 +# 错误!不能使用位置参数,关键字参数是必须的 +move('north', 'slither', False, True) +``` + +有了这个星,以下是唯一允许的语法: + +``` +# 用户代码 +move('north', extra_sinuous=True) +``` + +现在,当你删除 `turbo` 时,你可以确定任何依赖于它的用户代码都会明显地提示失败。如果你的库也支持 Python2,这没有什么大不了。你可以模拟星型语法([归功于 Brett Slatkin][17]): + +``` +# 你的库代码,兼容 Python 2 +def move(direction, **kwargs): + mode = kwargs.pop('mode', 'slither') + turbo = kwargs.pop('turbo', False) + sinuous = kwargs.pop('extra_sinuous', False) + lyft = kwargs.pop('hail_lyft', False) + + if kwargs: + raise TypeError('Unexpected kwargs: %r' + % kwargs) + +# ... +``` + +要求关键字参数是一个明智的选择,但它需要远见。如果允许按位置传递参数,则不能仅在以后的版本中将其转换为仅关键字。所以,现在加上星号。你可以在 asyncio API 中观察到,它在构造函数、方法和函数中普遍使用星号。尽管到目前为止,`Lock` 只接受一个可选参数,但 asyncio 开发人员立即添加了星号。这是幸运的。 + +``` +# In asyncio. +class Lock: + def __init__(self, *, loop=None): + # ... +``` + +现在,我们已经获得了改变方法和参数的智慧,同时保持与用户的约定。现在是时候尝试最具挑战性的进化了:在不改变方法或参数的情况下改变行为。 + +### 改变行为 + +假设你创造的生物是一条响尾蛇,你想教它一种新行为。 + +![Rattlesnake][18] + +横向移动!这个生物的身体看起来是一样的,但它的行为会发生变化。我们如何为这一进化步骤做好准备? + +![][19] + +*Image by HCA [[CC BY-SA 4.0][20]], [via Wikimedia Commons][21], 由 Opensource.com 修改* + +当行为在没有新函数或新参数的情况下发生更改时,负责任的创建者可以从 Python 标准库中学习。很久以前,os 模块引入了 `stat` 函数来获取文件统计信息,比如创建时间。起初,这个时间总是整数。 + +``` +>>> os.stat('file.txt').st_ctime +1540817862 +``` + +有一天,核心开发人员决定在 `os.stat` 中使用浮点数来提供亚秒级精度。但他们担心现有的用户代码还没有做好准备更改。于是他们在 Python 2.3 中创建了一个设置 `stat_float_times`,默认情况下是 `False` 。用户可以将其设置为 True 来选择浮点时间戳。 + +``` +>>> # Python 2.3. +>>> os.stat_float_times(True) +>>> os.stat('file.txt').st_ctime +1540817862.598021 +``` + +从 Python 2.5 开始,浮点时间成为默认值,因此 2.5 及之后版本编写的任何新代码都可以忽略该设置并期望得到浮点数。当然,你可以将其设置为 `False` 以保持旧行为,或将其设置为 `True` 以确保所有 Python 版本都得到浮点数,并为删除 `stat_float_times` 的那一天准备代码。 + +多年过去了,在 Python 3.1 中,该设置已被弃用,以便为人们为遥远的未来做好准备,最后,经过数十年的旅程,[这个设置被删除][22]。浮点时间现在是唯一的选择。这是一个漫长的过程,但负责任的神灵是有耐心的,因为我们知道这个渐进的过程很有可能于意外的行为变化拯救用户。 + +#### 第十个约定:逐渐改变行为 + +以下是步骤: + + * 添加一个标志来选择新行为,默认为 `False`,如果为 `False` 则发出警告 + * 将默认值更改为 `True`,表示完全弃用标记 + * 删除该标志 + +如果你遵循语义版本控制,版本可能如下: + +库版本 | 库 API | 用户代码 +---|---|--- +1.0 | 没有标志 | 预期的旧行为 +1.1 | 添加标志,默认为 `False`,如果是 `False`,则警告 | 设置标志为 `True`,处理新行为 +2.0 | 改变默认为 `True`,完全弃用标志 | 处理新行为 +3.0 | 移除标志 | 处理新行为 + +你需要**两**个主要版本来完成该操作。如果你直接从“添加标志,默认为 `False`,如果是 `False` 则发出警告”变到“删除标志”,而没有中间版本,那么用户的代码将无法升级。为 1.1 正确编写的用户代码必须能够升级到下一个版本,除了新警告之外,没有任何不良影响,但如果在下一个版本中删除了该标志,那么该代码将崩溃。一个负责任的神明从不违反扭曲的政策:“先行者总是自由的”。 + +### 负责任的创建者 + +![Demeter][23] + +我们的 10 个约定大致可以分为三类: + +**谨慎发展** + + 1. 避免不良功能 + 2. 最小化特性 + 3. 保持功能单一 + 4. 标记实验特征“临时” + 5. 温柔删除功能 + +**严格记录历史** + + 1. 维护更改日志 + 2. 选择版本方案 + 3. 编写升级指南 + +**缓慢而明显地改变** + + 1. 兼容添加参数 + 2. 逐渐改变行为 + +如果你对你所创造的物种保持这些约定,你将成为一个负责任的造物主。你的生物的身体可以随着时间的推移而进化,一直在改善和适应环境的变化,而不是在生物没有准备好就突然改变。如果你维护一个库,请向用户保留这些承诺,这样你就可以在不破坏依赖该库的代码的情况下对库进行更新。 + +* * * + +_这篇文章最初是在 [A. Jesse Jiryu Davis 的博客上'][24]出现的,经允许转载。_ + +插图参考: + + * [《世界进步》, Delphian Society, 1913][25] + * [《走进蛇的历史》, Charles Owen, 1742][26] + * [关于哥斯达黎加的 batrachia 和爬行动物,关于尼加拉瓜和秘鲁的爬行动物和鱼类学的记录, Edward Drinker Cope, 1875][27] + * [《自然史》, Richard Lydekker et. al., 1897][28] + * [Mes Prisons, Silvio Pellico, 1843][29] + * [Tierfotoagentur / m.blue-shadow][30] + * [洛杉矶公共图书馆, 1930][31] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/api-evolution-right-way + +作者:[A. Jesse][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/emptysquare +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://opensource.com/sites/default/files/uploads/praise-the-creator.jpg (Serpents) +[3]: https://opensource.com/sites/default/files/uploads/bite.jpg (Man being chased by an alligator) +[4]: https://bugs.python.org/issue13936 +[5]: https://opensource.com/sites/default/files/uploads/feathers.jpg (Serpents with and without feathers) +[6]: https://bugs.python.org/issue32591 +[7]: https://opensource.com/sites/default/files/uploads/horns.jpg (Serpent with horns) +[8]: https://opensource.com/sites/default/files/uploads/lizard-to-snake.jpg (Lizard transformed to snake) +[9]: https://opensource.com/sites/default/files/uploads/mammal.jpg (A mouse) +[10]: https://bugs.python.org/issue32253 +[11]: https://opensource.com/sites/default/files/uploads/scale.jpg (Balance scales) +[12]: https://semver.org +[13]: https://www.python.org/dev/peps/pep-0440/ +[14]: https://opensource.com/sites/default/files/uploads/skink.jpg (A skink) +[15]: https://twistedmatrix.com/documents/current/core/development/policy/compatibility-policy.html +[16]: https://opensource.com/sites/default/files/uploads/loudly.jpg (Woman riding an alligator) +[17]: http://www.informit.com/articles/article.aspx?p=2314818 +[18]: https://opensource.com/sites/default/files/uploads/rattlesnake.jpg (Rattlesnake) +[19]: https://opensource.com/sites/default/files/articles/neonate_sidewinder_sidewinding_with_tracks_unlabeled.png +[20]: https://creativecommons.org/licenses/by-sa/4.0 +[21]: https://commons.wikimedia.org/wiki/File:Neonate_sidewinder_sidewinding_with_tracks_unlabeled.jpg +[22]: https://bugs.python.org/issue31827 +[23]: https://opensource.com/sites/default/files/uploads/demeter.jpg (Demeter) +[24]: https://emptysqua.re/blog/api-evolution-the-right-way/ +[25]: https://www.gutenberg.org/files/42224/42224-h/42224-h.htm +[26]: https://publicdomainreview.org/product-att/artist/charles-owen/ +[27]: https://archive.org/details/onbatrachiarepti00cope/page/n3 +[28]: https://www.flickr.com/photos/internetarchivebookimages/20556001490 +[29]: https://www.oldbookillustrations.com/illustrations/stationery/ +[30]: https://www.alamy.com/mediacomp/ImageDetails.aspx?ref=D7Y61W +[31]: https://www.vintag.es/2013/06/riding-alligator-c-1930s.html diff --git a/published/201905/20190503 Check your spelling at the command line with Ispell.md b/published/201905/20190503 Check your spelling at the command line with Ispell.md new file mode 100644 index 0000000000..a4c84a78d8 --- /dev/null +++ b/published/201905/20190503 Check your spelling at the command line with Ispell.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10895-1.html) +[#]: subject: (Check your spelling at the command line with Ispell) +[#]: via: (https://opensource.com/article/19/5/spelling-command-line-ispell) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +使用 Ispell 在命令行中检查拼写 +====== + +> Ispell 可以帮助你在纯文本中消除超过 50 种语言的拼写错误。 + +![Command line prompt](https://img.linux.net.cn/data/attachment/album/201905/24/192644wqqv6d0lztmqoqyl.jpg) + +好的拼写是一种技巧。它是一项需要时间学习和掌握的技能。也就是说,有些人从来没有完全掌握这种技能,我知道有两三个出色的作家就无法完全掌握拼写。 + +即使你拼写得很好,偶尔也会输入错字。特别是在最后期限前如果你快速敲击键盘,那就更是如此。无论你的拼写的是什么,通过拼写检查器检查你所写的内容总是一个好主意。 + +我用[纯文本][2]完成了我的大部分写作,并经常使用名为 [Aspell][3] 的命令行拼写检查器来完成这项工作。Aspell 不是唯一的工具。你可能还想要看下不错的 [Ispell][4]。 + +### 入门 + +自 1971 年以来,Ispell 就以各种形式出现过。不要被它的年龄欺骗。Ispell 仍然是一个可以在 21 世纪高效使用的应用。 + +在开始之前,请打开终端窗口并输入 `which ispell` 来检查计算机上是否安装了 Ispell。如果未安装,请打开发行版的软件包管理器并从那里安装 Ispell。 + +不要忘记为你使用的语言安装词典。我唯一使用的语言是英语,所以我只需下载美国和英国英语字典。你可以不局限于我的(也是唯一的)母语。Ispell 有[超过 50 种语言的词典][5]。 + +![Installing Ispell dictionaries][6] + +### 使用 Ispell + +如果你还没有猜到,Ispell 只能用在文本文件。这包括用 HTML、LaTeX 和 [nroff 或 troff][7] 标记的文档。之后会有更多相关内容。 + +要开始使用,请打开终端窗口并进入包含要运行拼写检查的文件的目录。输入 `ispell` 后跟文件名,然后按回车键。 + +![Checking spelling with Ispell][8] + +Ispell 高亮了它无法识别的第一个词。如果单词拼写错误,Ispell 通常会提供一个或多个备选方案。按下 `R`,然后按下正确选择旁边的数字。在上面的截图中,我按了 `R` 和 `0` 来修复错误。 + +另一方面,如果单词拼写正确,请按下 `A` 然后移动到下一个拼写错误的单词。 + +继续这样做直到到达文件的末尾。Ispell 会保存你的更改,创建你刚检查的文件的备份(扩展名为 `.bak`),然后关闭。 + +### 其他几个选项 + +此示例说明了 Ispell 的基本用法。这个程序有[很多选项][9],有些你*可能*会用到,而另一些你*可能永远*不会使用。让我们快速看下我经常使用的一些。 + +之前我提到过 Ispell 可以用于某些标记语言。你需要告诉它文件的格式。启动 Ispell 时,为 TeX 或 LaTeX 文件添加 `-t`,为 HTML 文件添加 `-H`,对于 groff 或 troff 文件添加 `-n`。例如,如果输入 `ispell -t myReport.tex`,Ispell 将忽略所有标记。 + +如果你不想在检查文件后创建备份文件,请将 `-x` 添加到命令行。例如,`ispell -x myFile.txt`。 + +如果 Ispell 遇到拼写正确但不在其字典中的单词,比如名字,会发生什么?你可以按 `I` 将该单词添加到个人单词列表中。这会将单词保存到 `/home` 目录下的 `.ispell_default` 的文件中。 + +这些是我在使用 Ispell 时最有用的选项,但请查看 [Ispell 的手册页][9]以了解其所有选项。 + +Ispell 比 Aspell 或其他命令行拼写检查器更好或者更快么?我会说它不比其他的差或者慢。Ispell 不是适合所有人。它也许也不适合你。但有更多选择也不错,不是么? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/spelling-command-line-ispell + +作者:[Scott Nesbitt][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://plaintextproject.online +[3]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[4]: https://www.cs.hmc.edu/~geoff/ispell.html +[5]: https://www.cs.hmc.edu/~geoff/ispell-dictionaries.html +[6]: https://opensource.com/sites/default/files/uploads/ispell-install-dictionaries.png (Installing Ispell dictionaries) +[7]: https://opensource.com/article/18/2/how-format-academic-papers-linux-groff-me +[8]: https://opensource.com/sites/default/files/uploads/ispell-checking.png (Checking spelling with Ispell) +[9]: https://www.cs.hmc.edu/~geoff/ispell-man.html diff --git a/published/201905/20190503 Say goodbye to boilerplate in Python with attrs.md b/published/201905/20190503 Say goodbye to boilerplate in Python with attrs.md new file mode 100644 index 0000000000..f6d3d5a0c0 --- /dev/null +++ b/published/201905/20190503 Say goodbye to boilerplate in Python with attrs.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Say goodbye to boilerplate in Python with attrs) +[#]: via: (https://opensource.com/article/19/5/python-attrs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/moshez) + +使用 attrs 来告别 Python 中的样板 +====== + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 + +![Programming at a browser, orange hands](https://img.linux.net.cn/data/attachment/album/201905/18/211211lhqqbemqwkeqc2bb.jpg) + +Python是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [attrs][4],这是一个帮助你快速编写简洁、正确的代码的 Python 包。 + +### attrs + +如果你已经写过一段时间的 Python,那么你可能习惯这样写代码: + +``` +class Book(object): + + def __init__(self, isbn, name, author): + self.isbn = isbn + self.name = name + self.author = author +``` + +接着写一个 `__repr__` 函数。否则,很难记录 `Book` 的实例: + + +``` +def __repr__(self): + return f"Book({self.isbn}, {self.name}, {self.author})" +``` + +接下来你会写一个好看的 docstring 来记录期望的类型。但是你注意到你忘了添加 `edition` 和 `published_year` 属性,所以你必须在五个地方修改它们。 + +如果你不必这么做如何? + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str + name: str + author: str + published_year: int + edition: int +``` + +使用新的类型注释语法注释类型属性,`attrs` 会检测注释并创建一个类。 + +ISBN 有特定格式。如果我们想强行使用该格式怎么办? + +``` +@attr.s(auto_attribs=True) +class Book(object): + isbn: str = attr.ib() + @isbn.validator + def pattern_match(self, attribute, value): + m = re.match(r"^(\d{3}-)\d{1,3}-\d{2,3}-\d{1,7}-\d$", value) + if not m: + raise ValueError("incorrect format for isbn", value) + name: str + author: str + published_year: int + edition: int +``` + +`attrs` 库也对[不可变式编程][5]支持良好。将第一行改成 `@attr.s(auto_attribs=True, frozen=True)` 意味着 `Book` 现在是不可变的:尝试修改一个属性将会引发一个异常。相反,比如,如果希望将发布日期向后一年,我们可以修改成 `attr.evolve(old_book, published_year=old_book.published_year+1)` 来得到一个*新的*实例。 + +本系列的下一篇文章我们将来看下 `singledispatch`,一个能让你向 Python 库添加方法的库。 + +#### 查看本系列先前的文章 + +* [Cython][6] +* [Black][7] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-attrs + +作者:[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/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/attrs/ +[5]: https://opensource.com/article/18/10/functional-programming-python-immutable-data-structures +[6]: https://linux.cn/article-10859-1.html +[7]: https://linux.cn/article-10864-1.html diff --git a/published/201905/20190504 Add methods retroactively in Python with singledispatch.md b/published/201905/20190504 Add methods retroactively in Python with singledispatch.md new file mode 100644 index 0000000000..b0704dd59f --- /dev/null +++ b/published/201905/20190504 Add methods retroactively in Python with singledispatch.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10887-1.html) +[#]: subject: (Add methods retroactively in Python with singledispatch) +[#]: via: (https://opensource.com/article/19/5/python-singledispatch) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 singledispatch 在 Python 中追溯地添加方法 +====== + +> 在我们覆盖 7 个 PyPI 库的系列文章中了解更多解决 Python 问题的信息。 + +![](https://img.linux.net.cn/data/attachment/album/201905/23/093515sgmu4auml9caz54l.jpg) + +Python 是当今使用最多[流行的编程语言][2]之一,因为:它是开源的,它具有广泛的用途(例如 Web 编程、业务应用、游戏、科学编程等等),它有一个充满活力和专注的社区支持它。这个社区是我们在 [Python Package Index][3](PyPI)中提供如此庞大、多样化的软件包的原因,用以扩展和改进 Python。并解决不可避免的问题。 + +在本系列中,我们将介绍七个可以帮助你解决常见 Python 问题的 PyPI 库。今天,我们将研究 [singledispatch][4],这是一个能让你追溯地向 Python 库添加方法的库。 + +### singledispatch + +想象一下,你有一个有 Circle、Square 等类的“形状”库。 + +Circle 类有半径、Square 有边、Rectangle 有高和宽。我们的库已经存在,我们不想改变它。 + +然而,我们想给库添加一个面积计算。如果我们不会和其他人共享这个库,我们只需添加 `area` 方法,这样我们就能调用 `shape.area()` 而无需关心是什么形状。 + +虽然可以进入类并添加一个方法,但这是一个坏主意:没有人希望他们的类会被添加新的方法,程序会因奇怪的方式出错。 + +相反,functools 中的 `singledispatch` 函数可以帮助我们。 + + +``` +@singledispatch +def get_area(shape): + raise NotImplementedError("cannot calculate area for unknown shape", + shape) +``` + +`get_area` 函数的“基类”实现会报错。这保证了如果我们出现一个新的形状时,我们会明确地报错而不是返回一个无意义的结果。 + + +``` +@get_area.register(Square) +def _get_area_square(shape): + return shape.side ** 2 +@get_area.register(Circle) +def _get_area_circle(shape): + return math.pi * (shape.radius ** 2) +``` + +这种方式的好处是如果某人写了一个匹配我们代码的*新*形状,它们可以自己实现 `get_area`。 + + +``` +from area_calculator import get_area + +@attr.s(auto_attribs=True, frozen=True) +class Ellipse: + horizontal_axis: float + vertical_axis: float + +@get_area.register(Ellipse) +def _get_area_ellipse(shape): + return math.pi * shape.horizontal_axis * shape.vertical_axis +``` + +*调用* `get_area` 很直接。 + + +``` +print(get_area(shape)) +``` + +这意味着我们可以将大量的 `if isintance()`/`elif isinstance()` 的代码以这种方式修改,而无需修改接口。下一次你要修改 if isinstance,你试试 `singledispatch! + +在本系列的下一篇文章中,我们将介绍 tox,一个用于自动化 Python 代码测试的工具。 + +#### 回顾本系列的前几篇文章: + + * [Cython][5] + * [Black][6] + * [attrs][7] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/python-singledispatch + +作者:[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/computer_code_programming_laptop.jpg?itok=ormv35tV +[2]: https://opensource.com/article/18/5/numbers-python-community-trends +[3]: https://pypi.org/ +[4]: https://pypi.org/project/singledispatch/ +[5]: https://linux.cn/article-10859-1.html +[6]: https://linux.cn/article-10864-1.html +[7]: https://linux.cn/article-10871-1.html diff --git a/published/201905/20190504 Using the force at the Linux command line.md b/published/201905/20190504 Using the force at the Linux command line.md new file mode 100644 index 0000000000..8b340047f6 --- /dev/null +++ b/published/201905/20190504 Using the force at the Linux command line.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: (Moelf) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10881-1.html) +[#]: subject: (Using the force at the Linux command line) +[#]: via: (https://opensource.com/article/19/5/may-the-force-linux) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +在 Linux 命令行下使用“原力” +====== + +> 和绝地武士的原力一样,`-f` 参数是很强大的,并伴随着潜在的毁灭性,在你能用好的时候又很便利。 + +![Fireworks](https://img.linux.net.cn/data/attachment/album/201905/21/083913jqbwn4ywq1jqnb9y.jpg) + +近些年来,科幻发烧友开始在每年的 5 月 4 日庆祝[星战节][2],其口号是绝地武士的祝福语”愿原力Force和你同在“。虽然大多数 Linux 用户可能不是绝地武士,但我们依然可以使用原力Force。自然,如果尤达大师只是叫天行者卢克输入什么 “man X-Wing 战机“、“man 原力”,或者 RTFM(去读原力手册,肯定是这个意思对不对),那这电影肯定没啥意思。(LCTT 译注:RTFM 是 “Read The Fucking Manual” 的缩写 —— 读读该死的手册吧)。 + +很多 Linux 命令都有 `-f` 选项,意思你现在肯定也知道了,原力(LCTT 译注:force 选项原意是“强制”)!很多时候你先尝试执行命令然后失败了,或者提示你需要补充输入更多选项。通常这都是为了保护你试着改变的文件,或者告诉用户该设备正忙或文件已经存在之类的。 + +如果你不想被这些提醒打扰或者压根就不在乎,就使用原力吧! + +不过要小心,通常使用原力选项是摧毁性的。所以用户一定要格外注意!并且确保你知道自己在做什么!用原力就要承担后果! + +以下是一些常见 Linux 命令的原力选项和它们的效果,以及常见使用场景。 + +### cp + +`cp` 是 “copy” 的缩写,这是个被用来复制文件或者目录的命令。其 [man 页面][3] 说: + +> -f, --force +> +> 如果已经存在的目标文件无法被打开,删除它并重试 + +你可能会用它来处理只读状态的文件: + +``` +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 13 May 1 12:24 Hoth +-r--r----- 1 alan alan 14 May 1 12:23 Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Green Planet +``` + +如果你想要复制一个叫做 `Hoth` 的文件到 `Naboo`,但因为 `Naboo` 目前是只读状态,`cp` 命令不会执行: + +``` +[alan@workstation ~]$ cp Hoth Naboo +cp: cannot create regular file 'Naboo': Permission denied +``` + +但通过使用原力,`cp` 会强制执行。`Hoth` 的内容和文件权限会直接被复制到 `Naboo`: + + +``` +[alan@workstation ~]$ cp -f Hoth Naboo +[alan@workstation ~]$ cat Hoth Naboo +Icy Planet + +Icy Planet + +[alan@workstation ~]$ ls -l +total 8 +-rw-rw---- 1 alan alan 12 May 1 12:32 Hoth +-rw-rw---- 1 alan alan 12 May 1 12:38 Naboo +``` + +### ln + +`ln` 命令是用来在文件之间建立链接的,其 [man 页面][4] 描述的原力选项如下: + + +> -f, --force +> +> 移除当前存在的文件 + + +假设莱娅公主在维护一个 Java 应用服务器,并且她又一个存放这所有 Java 版本的目录,比如: + +``` +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +正如你所看到的,这里有很多个版本的 JDK,并有一个符号链接指向最新版的 JDK。她接着用一个脚本来安装最新版本的 JDK。但是如果没有原力选项的话以下命令是不会成功的: + +``` +tar xvzmf jdk1.8.0_181.tar.gz -C jdk1.8.0_181/ +ln -vs jdk1.8.0_181 jdk +``` + +`tar` 命令会解压 .gz 文件到一个特定的目标目录,但 `ln` 命令会失败,因为这个链接已经存在了。这样的结果是该符号链接不会指向最新版本的 JDK: + +``` +leia@workstation:/usr/lib/java$ ln -vs jdk1.8.0_181 jdk +ln: failed to create symbolic link 'jdk/jdk1.8.0_181': File exists +leia@workstation:/usr/lib/java$ ls -lt +total 28 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +lrwxrwxrwx 1 leia leia 12 Mar 5 2018 jdk -> jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +她可以通过使用原力选项强制 `ln` 更新链接,但这里她还需要使用 `-n`,`-n` 是因为这个情况下链接其实指向一个目录而非文件。这样的话,链接就会正确指向最新版本的JDK了。 + +``` +leia@workstation:/usr/lib/java$ ln -vsnf jdk1.8.0_181 jdk +'jdk' -> 'jdk1.8.0_181' +leia@workstation:/usr/lib/java$ ls -lt +total 28 +lrwxrwxrwx 1 leia leia 12 May 1 16:13 jdk -> jdk1.8.0_181 +drwxr-x--- 2 leia leia 4096 May 1 15:44 jdk1.8.0_181 +drwxr-xr-x 8 leia leia 4096 Mar 5 2018 jdk1.8.0_162 +drwxr-xr-x 8 leia leia 4096 Aug 28 2017 jdk1.8.0_144 +``` + +你可以配置 Java 应用使其一直使用在 `/usr/lib/java/jdk` 处的 JDK,而不用每次升级都更新。 + +### rm + +`rm` 命令是 “remove” 的缩写(也叫做删除,因为某些系统 `del` 命令也干这事)。其 [man 页面][5] 对原力选项的描述如下: + + +> -f, --force +> +> 无视不存在的文件或者参数,不向用户确认 + +如果你尝试删除一个只读的文件,`rm` 会寻求用户的确认: + +``` +[alan@workstation ~]$ ls -l +total 4 +-r--r----- 1 alan alan 16 May 1 11:38 B-wing +[alan@workstation ~]$ rm B-wing +rm: remove write-protected regular file 'B-wing'? +``` + +你一定要输入 `y` 或者 `n` 来回答确认才能让 `rm` 命令继续。如果你使用原力选项,`rm` 就不会寻求你的确认而直接删除文件: + +``` +[alan@workstation ~]$ rm -f B-wing +[alan@workstation ~]$ ls -l +total 0 +[alan@workstation ~]$ +``` + +最常见的 `rm` 原力选项用法是用来删除目录。 `-r`(递归)选项会让 `rm` 删除目录,当和原力选项结合起来,它会删除这个文件夹及其内容而无需用户确认。 + +`rm` 命令和一些选项结合起来是致命的,一直以来互联网上都有关于误用 `rm` 删除整个系统之类的玩笑和鬼故事。比如最出名的一不当心执行 `rm -rf .` 会直接删除目录和文件(没有用户确认)。(LCTT 译注:真的这么干过的校对飘过~~请按下回车前再三确认:我是谁,我在哪里,我在干什么) + +### userdel + +`userdel` 命令使用来删除用户的。其 [man 页面][6] 是这样描述它的原力选项的: + +> -f, --force +> +> 这个选项会强制移除用户,即便用户当前处于登入状态。它同时还会强制 +删除用户的目录和邮件存储,即便这个用户目录被别人共享或者邮件存储并不 +属于这个用户。如果 `USERGROUPS_ENAB` 在 `/etc/login.defs` 里是 `yes` +并且有一个组和此用户同名的话,这个组也会被移除,即便这个组还是别 +的用户的主要用户组也一样。 +> +> 注意:这个选项有风险并可能让系统处于不稳定状态。 + +当欧比旺抵达穆斯塔法星的时候,他知道自己的使命。他需要删掉达斯·维达的用户账户——而达斯还在里面呢。 + +``` +[root@workstation ~]# ps -fu darth +UID PID PPID C STIME TTY TIME CMD +darth 7663 7655 0 13:28 pts/3 00:00:00 -bash +[root@workstation ~]# userdel darth +userdel: user darth is currently used by process 7663 +``` + +因为达斯还登在系统里,欧比旺需要使用原力选项操作 `userdel`。这能强制删除当前登入的用户。 + +``` +[root@workstation ~]# userdel -f darth +userdel: user darth is currently used by process 7663 +[root@workstation ~]# finger darth +finger: darth: no such user. +[root@workstation ~]# ps -fu darth +error: user name does not exist +``` + +正如我们所见到的一样,`finger` 和 `ps` 命令让我们确认了达斯已经被删除了。 + +### 在 Shell 脚本里使用原力 + +很多命令都有原力选项,而在 shell 脚本里他们特别有用。因为我们经常使用脚本完成定期或者自动化的任务,避免用户输入至关重要,不然的话自动任务就无法完成了 + +我希望上面的几个例子能帮你理解一些需要使用原力的情况。你在命令行使用原力或把它们写入脚本之前应当完全理解它们的作用。误用原力会有毁灭性的后果——时常是对整个系统,甚至不仅限于一台设备。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-force-linux + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[Jerry Ling](https://github.com/Moelf) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fireworks_light_art_design.jpg?itok=hfx9i4By (Fireworks) +[2]: https://www.starwars.com/star-wars-day +[3]: http://man7.org/linux/man-pages/man1/cp.1.html +[4]: http://man7.org/linux/man-pages/man1/ln.1.html +[5]: http://man7.org/linux/man-pages/man1/rm.1.html +[6]: http://man7.org/linux/man-pages/man8/userdel.8.html diff --git a/published/201905/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md b/published/201905/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md new file mode 100644 index 0000000000..13d10c9c57 --- /dev/null +++ b/published/201905/20190505 Duc - A Collection Of Tools To Inspect And Visualize Disk Usage.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10892-1.html) +[#]: subject: (Duc – A Collection Of Tools To Inspect And Visualize Disk Usage) +[#]: via: (https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Duc:一个能够可视化洞察硬盘使用情况的工具包 +====== + +![Duc:一个能够洞察并可视化硬盘使用情况的工具包][1] + +Duc 是一个在类 Unix 操作系统上可以用来索引、洞察及可视化硬盘使用情况的工具包。别把它当成一个仅能用漂亮图表展现硬盘使用情况的 CLI 工具。它对巨大的文件系统也支持的很好。Duc 已在由超过五亿个文件和几 PB 的存储组成的系统上测试过,没有任何问题。 + +Duc 是一个快速而且灵活的工具。它将你的硬盘使用情况存在一个优化过的数据库里,这样你就可以在索引完成后迅速找到你的数据。此外,它自带不同的用户交互界面与后端以访问数据库并绘制图表。 + +以下列出的是目前支持的用户界面(UI): + + 1. 命令行界面(`duc ls`) + 2. Ncurses 控制台界面(`duc ui`) + 3. X11 GUI(`duc gui`) + 4. OpenGL GUI(`duc gui`) + +支持的后端数据库: + + * Tokyocabinet + * Leveldb + * Sqlite3 + +Duc 默认使用 Tokyocabinet 作为后端数据库。 + +### 安装 Duc + +Duc 可以从 Debian 以及其衍生品例如 Ubuntu 的默认仓库中获取。因此在基于 DEB 的系统上安装 Duc 是小菜一碟。 + +``` +$ sudo apt-get install duc +``` + +在其它 Linux 发行版上你需要像以下所展示的那样手动从源代码编译安装 Duc。 + +可以从 Github 上的[发行][2]页面下载最新的 Duc 源代码的 .tgz 文件。在写这篇教程的时候,最新的版本是1.4.4。 + +``` +$ wget https://github.com/zevv/duc/releases/download/1.4.4/duc-1.4.4.tar.gz +``` + +然后一个接一个地运行以下命令来安装 DUC。 + +``` +$ tar -xzf duc-1.4.4.tar.gz +$ cd duc-1.4.4 +$ ./configure +$ make +$ sudo make install +``` + +### 使用 Duc + +`duc` 的典型用法是: + +``` +$ duc +``` + +你可以通过运行以下命令来浏览总的选项列表以及子命令: + +``` +$ duc help +``` + +你也可以像下面这样了解一个特定子命令的用法。 + +``` +$ duc help +``` + +要查看所有命令与其选项的列表,仅需运行: + +``` +$ duc help --all +``` + +让我们看看一些 `duc` 工具的特定用法。 + +### 创建索引(数据库) + +首先,你需要创建一个你文件系统的索引文件(数据库)。使用 `duc index` 命令以创建索引文件。 + +比如说,要创建你的 `/home` 目录的索引,仅需运行: + +``` +$ duc index /home +``` + +上述命令将会创建你的 `/home` 目录的索引,并将其保存在 `$HOME/.duc.db` 文件中。如果你以后需要往 `/home` 目录添加新的文件或目录,只要在之后重新运行一下上面的命令来重建索引。 + +### 查询索引 + +Duc 有不同的子命令来查询并探索索引。 + +要查看可访问的索引列表,运行: + +``` +$ duc info +``` + +示例输出: + +``` +Date Time Files Dirs Size Path +2019-04-09 15:45:55 3.5K 305 654.6M /home +``` + +如你在上述输出所见,我已经索引好了 `/home` 目录。 + +要列出当前工作目录中所有的文件和目录,你可以这样做: + +``` +$ duc ls +``` + +要列出指定的目录,例如 `/home/sk/Downloads` 中的文件/目录,仅需像下面这样将路径作为参数传过去。 + +``` +$ duc ls /home/sk/Downloads +``` + +类似的,运行 `duc ui` 命令来打开基于 ncurses 的控制台用户界面以探索文件系统使用情况,运行`duc gui` 以打开图形界面(X11)来探索文件系统。 + +要了解更多子命令的用法,仅需参考帮助部分。 + +``` +$ duc help ls +``` + +上述命令将会展现 `ls` 子命令的帮助部分。 + +### 可视化硬盘使用状况 + +在之前的部分我们以及看到如何用 duc 子命令列出文件和目录。在此之外,你甚至可以用一张漂亮的图表展示文件大小。 + +要展示所提供目录的图表,像以下这样使用 `ls` 子命令。 + +``` +$ duc ls -Fg /home/sk +``` + +示例输出: + +![使用 “duc ls” 命令可视化硬盘使用情况][3] + +如你在上述输出所见,`ls` 子命令查询 duc 数据库并列出了所提供目录包含的文件与目录的大小,在这里就是 `/home/sk/`。 + +这里 `-F` 选项是往条目中用来添加文件类型指示符(`/`),`-g` 选项是用来绘制每个条目相对大小的图表。 + +请注意如果未提供任何路径,就会使用当前工作目录。 + +你可以使用 `-R` 选项来用[树状结构][4]浏览硬盘使用情况。 + +``` +$ duc ls -R /home/sk +``` + +![用树状结构可视化硬盘使用情况][5] + +要查询 duc 数据库并打开基于 ncurses 的控制台以探索所提供的目录,像以下这样使用 `ui` 子命令。 + +``` +$ duc ui /home/sk +``` + +![][6] + +类似的,我们使用 `gui *` 子命令来查询 duc 数据库以及打开一个图形界面(X11)来了解指定路径的硬盘使用情况。 + +``` +$ duc gui /home/sk +``` + +![][7] + +像我之前所提到的,我们可以像下面这样了解更多关于特定子命令的用法。 + +``` +$ duc help <子命令名字> +``` + +我仅仅覆盖了基本用法的部分,参考 man 页面了解关于 `duc` 工具的更多细节。 + +``` +$ man duc +``` + +相关阅读: + + * [Filelight – 在你的 Linux 系统上可视化硬盘使用情况][8] + * [一些好的 du 命令的替代品][9] + * [如何在 Linux 中用 Ncdu 检查硬盘使用情况][10] + * [Agedu——发现 Linux 中被浪费的硬盘空间][11] + * [如何在 Linux 中找到目录大小][12] + * [为初学者打造的带有示例的 df 命令教程][13] + +### 总结 + +Duc 是一款简单却有用的硬盘用量查看器。如果你想要快速简便地知道哪个文件/目录占用你的硬盘空间,Duc 可能是一个好的选择。你还等什么呢?获取这个工具,扫描你的文件系统,摆脱无用的文件/目录。 + +现在就到此为止了。希望这篇文章有用处。更多好东西马上就到。保持关注! + +欢呼吧! + +资源: + + * [Duc 网站][14] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/duc-a-collection-of-tools-to-inspect-and-visualize-disk-usage/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/duc-720x340.png +[2]: https://github.com/zevv/duc/releases +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-1-1.png +[4]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-2.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-3.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/duc-4.png +[8]: https://www.ostechnix.com/filelight-visualize-disk-usage-on-your-linux-system/ +[9]: https://www.ostechnix.com/some-good-alternatives-to-du-command/ +[10]: https://www.ostechnix.com/check-disk-space-usage-linux-using-ncdu/ +[11]: https://www.ostechnix.com/agedu-find-out-wasted-disk-space-in-linux/ +[12]: https://www.ostechnix.com/find-size-directory-linux/ +[13]: https://www.ostechnix.com/the-df-command-tutorial-with-examples-for-beginners/ +[14]: https://duc.zevv.nl/ diff --git a/published/201905/20190505 How To Create SSH Alias In Linux.md b/published/201905/20190505 How To Create SSH Alias In Linux.md new file mode 100644 index 0000000000..2438fb745a --- /dev/null +++ b/published/201905/20190505 How To Create SSH Alias In Linux.md @@ -0,0 +1,197 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10851-1.html) +[#]: subject: (How To Create SSH Alias In Linux) +[#]: via: (https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +如何在 Linux 中创建 SSH 别名 +====== + +![How To Create SSH Alias In Linux](https://img.linux.net.cn/data/attachment/album/201905/13/222910h2uwy06um3byr68r.jpg) + +如果你经常通过 SSH 访问许多不同的远程系统,这个技巧将为你节省一些时间。你可以通过 SSH 为频繁访问的系统创建 SSH 别名,这样你就不必记住所有不同的用户名、主机名、SSH 端口号和 IP 地址等。此外,它避免了在 SSH 到 Linux 服务器时重复输入相同的用户名、主机名、IP 地址、端口号。 + +### 在 Linux 中创建 SSH 别名 + +在我知道这个技巧之前,我通常使用以下任意一种方式通过 SSH 连接到远程系统。 + +使用 IP 地址: + +``` +$ ssh 192.168.225.22 +``` + +或使用端口号、用户名和 IP 地址: + +``` +$ ssh -p 22 sk@192.168.225.22 +``` + +或使用端口号、用户名和主机名: + +``` +$ ssh -p 22 sk@server.example.com +``` + +这里 + + * `22` 是端口号, + * `sk` 是远程系统的用户名, + * `192.168.225.22` 是我远程系统的 IP, + * `server.example.com` 是远程系统的主机名。 + +我相信大多数 Linux 新手和(或一些)管理员都会以这种方式通过 SSH 连接到远程系统。但是,如果你通过 SSH 连接到多个不同的系统,记住所有主机名或 IP 地址,还有用户名是困难的,除非你将它们写在纸上或者将其保存在文本文件中。别担心!这可以通过为 SSH 连接创建别名(或快捷方式)轻松解决。 + +我们可以用两种方法为 SSH 命令创建别名。 + +#### 方法 1 – 使用 SSH 配置文件 + +这是我创建别名的首选方法。 + +我们可以使用 SSH 默认配置文件来创建 SSH 别名。为此,编辑 `~/.ssh/config` 文件(如果此文件不存在,只需创建一个): + +``` +$ vi ~/.ssh/config +``` + +添加所有远程主机的详细信息,如下所示: + +``` +Host webserver + HostName 192.168.225.22 + User sk + +Host dns + HostName server.example.com + User root + +Host dhcp + HostName 192.168.225.25 + User ostechnix + Port 2233 +``` + +![][2] + +*使用 SSH 配置文件在 Linux 中创建 SSH 别名* + +将 `Host`、`Hostname`、`User` 和 `Port` 配置的值替换为你自己的值。添加所有远程主机的详细信息后,保存并退出该文件。 + +现在你可以使用以下命令通过 SSH 进入系统: + +``` +$ ssh webserver +$ ssh dns +$ ssh dhcp +``` + +就是这么简单! + +看看下面的截图。 + +![][3] + +*使用 SSH 别名访问远程系统* + +看到了吗?我只使用别名(例如 `webserver`)来访问 IP 地址为 `192.168.225.22` 的远程系统。 + +请注意,这只使用于当前用户。如果要为所有用户(系统范围内)提供别名,请在 `/etc/ssh/ssh_config` 文件中添加以上行。 + +你还可以在 SSH 配置文件中添加许多其他内容。例如,如果你[已配置基于 SSH 密钥的身份验证][4],说明 SSH 密钥文件的位置,如下所示: + +``` +Host ubuntu + HostName 192.168.225.50 + User senthil + IdentityFIle ~/.ssh/id_rsa_remotesystem +``` + +确保已使用你自己的值替换主机名、用户名和 SSH 密钥文件路径。 + +现在使用以下命令连接到远程服务器: + +``` +$ ssh ubuntu +``` + +这样,你可以添加希望通过 SSH 访问的任意多台远程主机,并使用别名快速访问它们。 + +#### 方法 2 – 使用 Bash 别名 + +这是创建 SSH 别名的一种应急变通的方法,可以加快通信的速度。你可以使用 [alias 命令][5]使这项任务更容易。 + +打开 `~/.bashrc` 或者 `~/.bash_profile` 文件: + +``` +alias webserver='ssh sk@server.example.com' +alias dns='ssh sk@server.example.com' +alias dhcp='ssh sk@server.example.com -p 2233' +alias ubuntu='ssh sk@server.example.com -i ~/.ssh/id_rsa_remotesystem' +``` + +再次确保你已使用自己的值替换主机、主机名、端口号和 IP 地址。保存文件并退出。 + +然后,使用命令应用更改: + +``` +$ source ~/.bashrc +``` + +或者 + +``` +$ source ~/.bash_profile +``` + +在此方法中,你甚至不需要使用 `ssh 别名` 命令。相反,只需使用别名,如下所示。 + +``` +$ webserver +$ dns +$ dhcp +$ ubuntu +``` + +![][6] + +这两种方法非常简单,但对于经常通过 SSH 连接到多个不同系统的人来说非常有用,而且非常方便。使用适合你的上述任何一种方法,通过 SSH 快速访问远程 Linux 系统。 + +建议阅读: + + * [允许或拒绝 SSH 访问 Linux 中的特定用户或组][7] + * [如何在 Linux 上 SSH 到特定目录][8] + * [如何在 Linux 中断开 SSH 会话][9] + * [4 种方式在退出 SSH 会话后保持命令运行][10] + * [SSLH – 共享相同端口的 HTTPS 和 SSH][11] + +目前这就是全部了,希望它对你有帮助。更多好东西要来了,敬请关注! + +干杯! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-create-ssh-alias-in-linux/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/ssh-alias-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2019/04/Create-SSH-Alias-In-Linux.png +[3]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias.png +[4]: https://www.ostechnix.com/configure-ssh-key-based-authentication-linux/ +[5]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/create-ssh-alias-1.png +[7]: https://www.ostechnix.com/allow-deny-ssh-access-particular-user-group-linux/ +[8]: https://www.ostechnix.com/how-to-ssh-into-a-particular-directory-on-linux/ +[9]: https://www.ostechnix.com/how-to-stop-ssh-session-from-disconnecting-in-linux/ +[10]: https://www.ostechnix.com/4-ways-keep-command-running-log-ssh-session/ +[11]: https://www.ostechnix.com/sslh-share-port-https-ssh/ diff --git a/published/201905/20190505 Kindd - A Graphical Frontend To dd Command.md b/published/201905/20190505 Kindd - A Graphical Frontend To dd Command.md new file mode 100644 index 0000000000..fbcf447bad --- /dev/null +++ b/published/201905/20190505 Kindd - A Graphical Frontend To dd Command.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10847-1.html) +[#]: subject: (Kindd – A Graphical Frontend To dd Command) +[#]: via: (https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Kindd:一个图形化 dd 命令前端 +====== + +![Kindd - A Graphical Frontend To dd Command][1] + +前不久,我们已经学习如何在类 Unix 系统中 [使用 dd 命令创建可启动的 ISO][2]。请记住,`dd` 命令是最具危险性和破坏性的命令之一。如果你不确定你实际在做什么,你可能会在几分钟内意外地擦除你的硬盘数据。`dd` 命令仅仅从 `if` 参数获取数据,并写入数据到 `of` 参数。它将不关心它正在覆盖什么,它也不关心是否在磁道上有一个分区表,或一个启动扇区,或者一个家文件夹,或者任何重要的东西。它将简单地做它被告诉去做的事。如果你是初学者,一般地尝试避免使用 `dd` 命令来做实验。幸好,这有一个支持 `dd` 命令的简单的 GUI 实用程序。向 “Kindd” 问好,一个属于 `dd` 命令的图形化前端。它是自由开源的、用 Qt Quick 所写的工具。总的来说,这个工具对那些对命令行不适应的初学者是非常有用的。 + +它的开发者创建这个工具主要是为了提供: + +1. 一个用于 `dd` 命令的现代化的、简单而安全的图形化用户界面, +2. 一种简单地创建可启动设备的图形化方法,而不必使用终端。 + +### 安装 Kindd + +Kindd 在 [AUR][3] 中是可用的。所以,如果你是 Arch 用户,使用任一的 AUR 助手工具来安装它,例如 [Yay][4] 。 + +要安装其 Git 发布版,运行: + +``` +$ yay -S kindd-git +``` + +要安装正式发布版,运行: + +``` +$ yay -S kindd +``` + +在安装后,从菜单或应用程序启动器启动 Kindd。 + +对于其它的发行版,你需要从源文件手动编译和安装它,像下面所示。 + +确保你已经安装下面的必要条件。 + + * git + * coreutils + * polkit + * qt5-base + * qt5-quickcontrols + * qt5-quickcontrols2 + * qt5-graphicaleffects + +一旦所有必要条件安装,使用 `git` 克隆 Kindd 储存库: + +``` +git clone https://github.com/LinArcX/Kindd/ +``` + +转到你刚刚克隆 Kindd 的目录,并编译和安装它: + +``` +cd Kindd +qmake +make +``` + +最后运行下面的命令来启动 Kindd 应用程序: + +``` +./kindd +``` + +Kindd 内部使用 pkexec。pkexec 代理被默认安装在大多数桌面环境中。但是,如果你使用 i3 (或者可能还有一些其它的桌面环境),你应该首先安装 polkit-gnome ,然后粘贴下面的行到 i3 配置文件: + +``` +exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & +``` + +### 使用 Kindd 创建可启动的 ISO + +为从一个 ISO 创建一个可启动的 USB,插入 USB 驱动器。然后,从菜单或终端启动 Kindd 。 + +这是 Kindd 默认界面的外观: + +![][5] + +*Kindd 界面* + +正如你所能看到的,Kindd 界面是非常简单的和明白易懂的。这里仅有两部分,即设备列表,它显示你的系统上的可用的设备(hdd 和 Usb),并创建可启动的 .iso 。默认情况下,你将在“创建可启动 .iso”部分。 + +在第一列中输入块大小,在第二列中选择 ISO 文件的路径,并在第三列中选择正确的设备(USB 驱动器路径)。单击“转换/复制”按钮来开始创建可启动的 ISO 。 + +![][6] + +一旦进程被完成,你将看到成功的信息。 + +![][7] + +现在,拔出 USB 驱动器,并用该 USB 启动器启动你的系统,来检查它是否真地工作。 + +如果你不知道真实的设备名称(目标路径),只需要在列出的设备上单击,并检查 USB 驱动器名称。 + +![][8] + +Kindd 还处在早期开发阶段。因此,可能有错误。如果你找到一些错误,请在这篇的指南的结尾所给的 GitHub 页面报告它们。 + +这就是全部。希望这是有用的。更多的好东西将会来。敬请期待! + +谢谢! + +资源: + + * [Kindd GitHub 储存库][11] + +相关阅读: + + * [Etcher:一个来创建可启动 SD 卡或 USB 驱动器的漂亮的应用程序][9] + * [Bootiso 让你安全地创建可启动的 USB 驱动器][10] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/kindd-a-graphical-frontend-to-dd-command/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/kindd-720x340.png +[2]: https://www.ostechnix.com/how-to-create-bootable-usb-drive-using-dd-command/ +[3]: https://aur.archlinux.org/packages/kindd-git/ +[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-interface.png +[6]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-1.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-2.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/04/kindd-3.png +[9]: https://www.ostechnix.com/etcher-beauitiful-app-create-bootable-sd-cards-usb-drives/ +[10]: https://www.ostechnix.com/bootiso-lets-you-safely-create-bootable-usb-drive/ +[11]: https://github.com/LinArcX/Kindd diff --git a/published/201905/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md b/published/201905/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md new file mode 100644 index 0000000000..c981988120 --- /dev/null +++ b/published/201905/20190505 Linux Shell Script To Monitor Disk Space Usage And Send Email.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10868-1.html) +[#]: subject: (Linux Shell Script To Monitor Disk Space Usage And Send Email) +[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +用 Linux Shell 脚本来监控磁盘使用情况并发送邮件 +============================================ + +市场上有很多用来监控 Linux 系统的监控工具,当系统到达阀值后它将发送一封邮件。它监控所有的东西例如 CPU 利用率、内存利用率、交换空间利用率、磁盘空间利用率等等。然而,它更适合小环境和大环境。 + +想一想如果你只有少量系统,那么什么是最好的方式来应对这种情况。 + +是的,我们想要写一个 [shell 脚本][1] 来实现。 + +在这篇指南中我们打算写一个 shell 脚本来监控系统的磁盘空间使用率。当系统到达给定的阀值,它将给对应的邮件地址发送一封邮件。在这篇文章中我们总共添加了四个 shell 脚本,每个用于不同的目的。之后,我们会想出其他 shell 脚本来监控 CPU,内存和交换空间利用率。 + +在此之前,我想澄清一件事,根据我观察的磁盘空间使用率 shell 脚本使用情况。 + +大多数用户在多篇博客中评论说,当他们运行磁盘空间使用率脚本时他们获得了以下错误。 + +``` +# sh /opt/script/disk-usage-alert-old.sh + +/dev/mapper/vg_2g-lv_root +test-script.sh: line 7: [: /dev/mapper/vg_2g-lv_root: integer expression expected +/ 9.8G +``` + +是的,这是对的。甚至,当我第一次运行这个脚本的时候我遇到了相同的问题。之后,我发现了根本原因。 + +当你在基于 RHEL 5 & RHEL 6 的系统上运行包含用于磁盘空间警告的 `df -h` 或 `df -H` 的 shell 脚本中时,你会发现上述错误信息,因为输出格式不对,查看下列输出。 + +为了解决这个问题,我们需要用 `df -Ph` (POSIX 输出格式),但是默认的 `df -h` 在基于 RHEL 7 的系统上运行的很好。 + +``` +# df -h + +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/vg_2g-lv_root + 10G 6.7G 3.4G 67% / +tmpfs 7.8G 0 7.8G 0% /dev/shm +/dev/sda1 976M 95M 830M 11% /boot +/dev/mapper/vg_2g-lv_home + 5.0G 4.3G 784M 85% /home +/dev/mapper/vg_2g-lv_tmp + 4.8G 14M 4.6G 1% /tmp +``` + +### 方法一:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 + +你可以使用下列 shell 脚本在 Linux 系统中来监控磁盘空间使用率。 + +当系统到达给定的阀值限制时,它将发送一封邮件。在这个例子中,我们设置阀值为 60% 用于测试目的,你可以改变这个限制来符合你的需求。 + +如果超过一个文件系统到达给定的阀值,它将发送多封邮件,因为这个脚本使用了循环。 + +同样,替换你的邮件地址来获取这份警告。 + +``` +# vi /opt/script/disk-usage-alert.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + echo $output + used=$(echo $output | awk '{print $1}' | sed s/%//g) + partition=$(echo $output | awk '{print $2}') + if [ $used -ge 60 ]; then + echo "The partition \"$partition\" on $(hostname) has used $used% at $(date)" | mail -s "Disk Space Alert: $used% Used On $(hostname)" [email protected] + fi +done +``` + +输出:我获得了下列两封邮件警告。 + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert.sh +``` + +### 方法二:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 + +作为代替,你可以使用下列的 shell 脚本。对比上面的脚本我们做了少量改变。 + +``` +# vi /opt/script/disk-usage-alert-1.sh + +#!/bin/sh +df -Ph | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5,$1 }' | while read output; +do + max=60% + echo $output + used=$(echo $output | awk '{print $1}') + partition=$(echo $output | awk '{print $2}') + if [ ${used%?} -ge ${max%?} ]; then + echo "The partition \"$partition\" on $(hostname) has used $used at $(date)" | mail -s "Disk Space Alert: $used Used On $(hostname)" [email protected] + fi +done +``` + +输出:我获得了下列两封邮件警告。 + + +``` +The partition "/dev/mapper/vg_2g-lv_home" on 2g.CentOS7 has used 85% at Mon Apr 29 06:16:14 IST 2019 + +The partition "/dev/mapper/vg_2g-lv_root" on 2g.CentOS7 has used 67% at Mon Apr 29 06:16:14 IST 2019 +``` + +最终添加了一个 [cronjob][2] 来自动完成。它会每 10 分钟运行一次。 + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-1.sh +``` + +### 方法三:Linux Shell 脚本来监控磁盘空间使用率和发送邮件 + +我更喜欢这种方法。因为,它工作起来很有魔力,你只会收到一封关于所有事的邮件。 + +这相当简单和直接。 + +``` +*/10 * * * * df -Ph | sed s/%//g | awk '{ if($5 > 60) print $0;}' | mail -s "Disk Space Alert On $(hostname)" [email protected] +``` + +输出: 我获得了一封关于所有警告的邮件。 + +``` +Filesystem Size Used Avail Use Mounted on +/dev/mapper/vg_2g-lv_root 10G 6.7G 3.4G 67 / +/dev/mapper/vg_2g-lv_home 5.0G 4.3G 784M 85 /home +``` + +### 方法四:Linux Shell 脚本来监控某个分区的磁盘空间使用情况和发送邮件 + +``` +# vi /opt/script/disk-usage-alert-2.sh + +#!/bin/bash +used=$(df -Ph | grep '/dev/mapper/vg_2g-lv_dbs' | awk {'print $5'}) +max=80% +if [ ${used%?} -ge ${max%?} ]; then +echo "The Mount Point "/DB" on $(hostname) has used $used at $(date)" | mail -s "Disk space alert on $(hostname): $used used" [email protected] +fi +``` + +输出: 我得到了下面的邮件警告。 + +``` +The partition /dev/mapper/vg_2g-lv_dbs on 2g.CentOS6 has used 82% at Mon Apr 29 06:16:14 IST 2019 +``` + +最终添加了一个 [cronjob][2] 来自动完成这些工作。它将每 10 分钟运行一次。 + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/script/disk-usage-alert-2.sh +``` + +注意: 你将在 10 分钟后收到一封邮件警告,因为这个脚本被计划为每 10 分钟运行一次(但也不是精确的 10 分钟,取决于时间)。 + +例如这个例子。如果你的系统在 8:25 到达了限制,你将在 5 分钟后收到邮件警告。希望现在讲清楚了。 + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-shell-script-to-monitor-disk-space-usage-and-send-email/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/shell-script/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ + + + + + + + diff --git a/published/201905/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md b/published/201905/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md new file mode 100644 index 0000000000..8d90b5b520 --- /dev/null +++ b/published/201905/20190505 Ping Multiple Servers And Show The Output In Top-like Text UI.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10824-1.html) +[#]: subject: (Ping Multiple Servers And Show The Output In Top-like Text UI) +[#]: via: (https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +ping 多台服务器并在类似 top 的界面中显示 +====== + +![Ping Multiple Servers And Show The Output In Top-like Text UI][1] + +不久前,我们写了篇关于 [fping][2] 的文章,该程序能使我们能够同时 ping 多台主机。与传统的 `ping` 不同,`fping` 不会等待一台主机的超时。它使用循环法,这表示它将 ICMP Echo 请求发送到一台主机,然后转到另一台主机,最后一次显示哪些主机开启或关闭。今天,我们将讨论一个名为 `pingtop` 的类似程序。顾名思义,它会一次 ping 多台服务器,并在类似 `top` 的终端 UI 中显示结果。它是用 Python 写的自由开源程序。 + +### 安装 pingtop + +可以使用 `pip` 安装 `pingtop`,`pip` 是一个软件包管理器,用于安装用 Python 开发的程序。确保已在 Linux 中安装了 Python 3.7.x 和 pip。 + +要在 Linux 上安装 `pip`,请参阅以下链接。 + +* [如何使用 pip 管理 Python 包][3] + +安装 `pip` 后,运行以下命令安装 `pingtop`: + +``` +$ pip install pingtop +``` + +现在让我们继续使用 `pingtop` ping 多个系统。 + +### ping 多台服务器并在类似 top 的终端 UI 中显示 + +要 ping 多个主机/系统,请运行: + +``` +$ pingtop ostechnix.com google.com facebook.com twitter.com +``` + +现在,你将在一个漂亮的类似 `top` 的终端 UI 中看到结果,如下所示。 + +![][4] + +*使用 pingtop ping 多台服务器* + + +建议阅读: + + * [一些你可能想知道的替代 “top” 命令的程序][5] + +我个人目前没有使用 pingtop 的情况。但我喜欢在这个在文本界面中展示 ping 命令输出的想法。试试看它,也许有帮助。 + +就是这些了。还有更多好东西。敬请期待!干杯! + +资源: + + * [pingtop GitHub 仓库][6] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/ping-multiple-servers-and-show-the-output-in-top-like-text-ui/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-720x340.png +[2]: https://www.ostechnix.com/ping-multiple-hosts-linux/ +[3]: https://linux.cn/article-10110-1.html +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/pingtop-1.gif +[5]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[6]: https://github.com/laixintao/pingtop diff --git a/published/201905/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md b/published/201905/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md new file mode 100644 index 0000000000..fa7db2e2bb --- /dev/null +++ b/published/201905/20190505 apt-clone - Backup Installed Packages And Restore Those On Fresh Ubuntu System.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10837-1.html) +[#]: subject: (apt-clone : Backup Installed Packages And Restore Those On Fresh Ubuntu System) +[#]: via: (https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +apt-clone:备份已安装的软件包并在新的 Ubuntu 系统上恢复它们 +====== + +当我们在基于 Ubuntu/Debian 的系统上使用 `apt-clone`,包安装会变得更加容易。如果你需要在少量系统上安装相同的软件包时,`apt-clone` 会适合你。 + +如果你想在每个系统上手动构建和安装必要的软件包,这是一个耗时的过程。它可以通过多种方式实现,Linux 中有许多程序可用。我们过去曾写过一篇关于 [Aptik][1] 的文章。它是能让 Ubuntu 用户备份和恢复系统设置和数据的程序之一。 + +### 什么是 apt-clone? + +[apt-clone][2] 能让你为 Debian/Ubuntu 系统创建所有已安装软件包的备份,这些软件包可以在新安装的系统(或容器)或目录中恢复。 + +该备份可以在相同操作系统版本和架构的多个系统上还原。 + +### 如何安装 apt-clone? + +`apt-clone` 包可以在 Ubuntu/Debian 的官方仓库中找到,所以,使用 [apt 包管理器][3] 或 [apt-get 包管理器][4] 来安装它。 + +使用 `apt` 包管理器安装 `apt-clone`。 + +``` +$ sudo apt install apt-clone +``` + +使用 `apt-get` 包管理器安装 `apt-clone`。 + +``` +$ sudo apt-get install apt-clone +``` + +### 如何使用 apt-clone 备份已安装的软件包? + +成功安装 `apt-clone` 之后。只需提供一个保存备份文件的位置。我们将在 `/backup` 目录下保存已安装的软件包备份。 + +`apt-clone` 会将已安装的软件包列表保存到 `apt-clone-state-Ubuntu18.2daygeek.com.tar.gz` 中。 + +``` +$ sudo apt-clone clone /backup +``` + +我们同样可以通过运行 `ls` 命令来检查。 + +``` +$ ls -lh /backup/ +total 32K +-rw-r--r-- 1 root root 29K Apr 20 19:06 apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +运行以下命令,查看备份文件的详细信息。 + +``` +$ apt-clone info /backup/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +Hostname: Ubuntu18.2daygeek.com +Arch: amd64 +Distro: bionic +Meta: libunity-scopes-json-def-desktop, ubuntu-desktop +Installed: 1792 pkgs (194 automatic) +Date: Sat Apr 20 19:06:43 2019 +``` + +根据上面的输出,备份文件中总共有 1792 个包。 + +### 如何恢复使用 apt-clone 进行备份的软件包? + +你可以使用任何远程复制程序来复制远程服务器上的文件。 + +``` +$ scp /backup/apt-clone-state-ubunt-18-04.tar.gz Destination-Server:/opt +``` + +复制完成后,使用 `apt-clone` 执行还原。 + +使用以下命令进行还原。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz +``` + +请注意,还原将覆盖现有的 `/etc/apt/sources.list` 并安装/删除包。所以要小心。 + +如果你要将所有软件包还原到文件夹而不是实际还原,可以使用以下命令。 + +``` +$ sudo apt-clone restore /opt/apt-clone-state-Ubuntu18.2daygeek.com.tar.gz --destination /opt/oldubuntu +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/apt-clone-backup-installed-packages-and-restore-them-on-fresh-ubuntu-system/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/aptik-backup-restore-ppas-installed-apps-users-data/ +[2]: https://github.com/mvo5/apt-clone +[3]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ diff --git a/published/201905/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md b/published/201905/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md new file mode 100644 index 0000000000..2e6946ac79 --- /dev/null +++ b/published/201905/20190506 How to Add Application Shortcuts on Ubuntu Desktop.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10872-1.html) +[#]: subject: (How to Add Application Shortcuts on Ubuntu Desktop) +[#]: via: (https://itsfoss.com/ubuntu-desktop-shortcut/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 桌面手动添加应用快捷方式 +=============================== + +> 在这篇快速指南中,你将学到如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中添加应用图标。 + +一个经典的桌面操作系统在“桌面屏”上总是有图标的。这些桌面图标包括文件管理器、回收站和应用图标。 + +当在 Windows 中安装应用时,一些程序会询问你是否在桌面创建一个快捷方式。但在 Linux 系统中不是这样。 + +但是如果你热衷于这个特点,让我给你展示如何在 Ubuntu 桌面和其他使用 GNOME 桌面的发行版中创建应用的快捷方式。 + +![Application Shortcuts on Desktop in Ubuntu with GNOME desktop][2] + +如果你想知道我的桌面外观,我正在使用 Ant 主题和 Tela 图标集。你可以获取一些 [GTK 主题][3] 和 [为 Ubuntu 准备的图标集][4]并换成你喜欢的。 + +### 在 Ubuntu 中添加桌面快捷方式 + +![][5] + +个人来讲,我更喜欢为应用图标准备的 Ubuntu 启动器方式。如果我经常使用一个程序,我会添加到启动器。但是我知道不是每个人都有相同的偏好,可能少数人更喜欢桌面的快捷方式。 + +让我们看在桌面中创建应用快捷方式的最简单方式。 + +> 免责声明 + +> 这篇指南已经在 Ubuntu 18.04 LTS 的 GNOME 桌面上测试过了。它可能在其他发行版和桌面环境上也能发挥作用,但你必须自己尝试。一些 GNOME 特定步骤可能会变,所以请在[其他桌面环境][7]尝试时注意。 + +#### 准备 + +首先最重要的事是确保你有 GNOME 桌面的图标权限。 + +如果你跟随 Ubuntu 18.04 自定义提示,你会知道如何安装 GNOME Tweaks 工具。在这个工具中,确保你设置“Show Icons”选项为启用。 + +![Allow icons on desktop in GNOME][9] + +一旦你确保已经设置,是时候在桌面添加应用快捷方式了。 + +#### 第一步:定位应用的 .desktop 文件 + +到 “Files -> Other Location -> Computer”。 + +![Go to Other Locations -> Computer][11] + +从这里,到目录 “usr -> share -> applications”。你会在这里看到几个你已经安装的 [Ubuntu 应用][12]。即使你没有看到图标,你应该看到被命名为“应用名.desktop”形式的文件。 + +![Application Shortcuts][13] + +#### 第二步:拷贝 .desktop 文件到桌面 + +现在你要做的只是查找应用图标(或者它的 desktop 文件)。当你找到后,拖文件到桌面或者拷贝文件(使用 `Ctrl+C` 快捷方式)并在桌面粘贴(使用 `Ctrl+V` 快捷方式)。 + +![Add .desktop file to the desktop][14] + +#### 第三步:运行 desktop 文件 + +当你这么做,你应该在桌面上看到一个图标的文本文件而不是应用 logo。别担心,一会就不一样了。 + +你要做的就是双击桌面的那个文件。它将警告你它是一个“未信任的应用启动器’,点击“信任并启动”。 + +![Launch Desktop Shortcut][15] + +这个应用像往常一样启动,好事是你会察觉到 .desktop 文件现在已经变成应用图标了。我相信你喜欢应用图标的方式,不是吗? + +![Application shortcut on the desktop][16] + +#### Ubuntu 19.04 或者 GNOME 3.32 用户的疑难杂症 + +如果你使用 Ubuntu 19.04 或者 GNOME 3.32,你的 .desktop 文件可能根本不会启动。你应该右击 .desktop 文件并选择 “允许启动”。 + +在这之后,你应该能够启动应用并且桌面上的应用快捷方式能够正常显示了。 + +### 总结 + +如果你不喜欢桌面的某个应用启动器,选择删除就是了。它会删除应用快捷方式,但是应用仍安全的保留在你的系统中。 + +我希望你发现这篇快速指南有帮助并喜欢在 Ubuntu 桌面上的应用快捷方式。 + +如果你有问题或建议,请在下方评论让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-desktop-shortcut/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.ubuntu.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-ubuntu-desktop.jpeg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/best-gtk-themes/ +[4]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-ubuntu-desktop-shortcut.jpeg?resize=800%2C450&ssl=1 +[6]: https://www.gnome.org/ +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/allow-icons-on-desktop-gnome.jpg?ssl=1 +[10]: https://itsfoss.com/replace-linux-from-dual-boot/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Adding-desktop-shortcut-Ubuntu-gnome-1.png?resize=800%2C436&ssl=1 +[12]: https://itsfoss.com/best-ubuntu-apps/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/application-shortcuts-in-ubuntu.png?resize=800%2C422&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/add-desktop-file-to-desktop.jpeg?resize=800%2C458&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/launch-desktop-shortcut-.jpeg?resize=800%2C349&ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/app-shortcut-on-desktop-ubuntu-gnome.jpeg?resize=800%2C375&ssl=1 +[17]: https://itsfoss.com/install-nemo-file-manager-ubuntu/ diff --git a/published/201905/20190508 How to use advanced rsync for large Linux backups.md b/published/201905/20190508 How to use advanced rsync for large Linux backups.md new file mode 100644 index 0000000000..694158d9d4 --- /dev/null +++ b/published/201905/20190508 How to use advanced rsync for large Linux backups.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10865-1.html) +[#]: subject: (How to use advanced rsync for large Linux backups) +[#]: via: (https://opensource.com/article/19/5/advanced-rsync) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/marcobravo) + +如何使用 rsync 的高级用法进行大型备份 +===================================== + +> 基础的 `rsync` 命令通常足够来管理你的 Linux 备份,但是额外的选项使大型备份集更快、更强大。 + +![Filing papers and documents][1] + +很明显,备份一直是 Linux 世界的热门话题。回到 2017,David Both 为 [Opensource.com][2] 的读者在[使用 rsync 备份 Linux 系统][3]方面提了一些建议,在这年的更早时候,他发起了一项问卷调查询问大家,[在 Linux 中你的 /home 目录的主要备份策略是什么][4],在今年的另一个问卷调查中,Don Watkins 问到,[你使用哪种开源备份解决方案][5]。 + +我的回复是 [rsync][6]。我真的非常喜欢 rsync!市场上有大量大而复杂的工具,对于管理磁带机或者存储库设备,这些可能是必要的,但是可能你需要的只是一个简单的开源命令行工具。 + +### rsync 基础 + +我为一个大概拥有 35,000 开发者并有着几十 TB 文件的全球性机构管理二进制仓库。我经常一次移动或者归档上百 GB 的数据。使用的是 `rsync`。这种经历使我对这个简单的工具充满信心。(所以,是的,我在家使用它来备份我的 Linux 系统) + +基础的 `rsync` 命令很简单。 + + +``` +rsync -av 源目录 目的地目录 +``` + +实际上,在各种指南中教的 `rsync` 命令在大多数通用情况下都运行的很好。然而,假设我们需要备份大量的数据。例如包含 2,000 个子目录的目录,每个包含 50GB 到 700GB 的数据。在这个目录运行 `rsync` 可能需要大量时间,尤其是当你使用校验选项时(我倾向使用)。 + +当我们试图同步大量数据或者通过慢的网络连接时,可能遇到性能问题。让我给你展示一些我使用的方法来确保好的性能和可靠性。 + +### rsync 高级用法 + +`rsync` 运行时出现的第一行是:“正在发送增量文件列表。” 如果你在网上搜索这一行,你将看到很多类似的问题:为什么它一直运行,或者为什么它似乎挂起了。 + +这里是一个基于这个场景的例子。假设我们有一个 `/storage` 的目录,我们想要备份到一个外部 USB 磁盘,我们可以使用下面的命令: + +``` +rsync -cav /storage /media/WDPassport +``` + +`-c` 选项告诉 `rsync` 使用文件校验和而不是时间戳来决定改变的文件,这通常消耗的时间更久。为了分解 `/storage` 目录,我通过子目录同步,使用 `find` 命令。这是一个例子: + + +``` +find /storage -type d -exec rsync -cav {} /media/WDPassport \; +``` + +这看起来可以,但是如果 `/storage` 目录有任何文件,它们将被跳过。因此,我们如何同步 `/storage` 目录中的文件呢?同样有一个细微的差别是这些选项将造成 `rsync` 会同步 `.` 目录,该目录是源目录自身;这意味着它会同步子目录两次,这并不是我们想要的。 + +长话短说,我的解决方案是一个 “双-递增”脚本。这允许我分解一个目录,例如,当你的家目录有多个大的目录,例如音乐或者家庭照片时,分解 `/home` 目录为单个的用户家目录。 + +这是我的脚本的一个例子: + +``` +HOMES="alan" +DRIVE="/media/WDPassport" + +for HOME in $HOMES; do +cd /home/$HOME +rsync -cdlptgov --delete . /$DRIVE/$HOME +find . -maxdepth 1 -type d -not -name "." -exec rsync -crlptgov --delete {} /$DRIVE/$HOME \; +done +``` + +第一个 `rsync` 命令拷贝它在源目录中发现的文件和目录。然而,它将目录留着不处理,因此我们能够通过 `find` 命令迭代它们。这通过传递 `-d` 参数来完成,它告诉 `rsync` 不要递归目录。 + + +``` +-d, --dirs 传输目录而不递归 +``` + +然后 `find` 命令传递每个目录来单独运行 `rsync`。之后 `rsync` 拷贝目录的内容。这通过传递 `-r` 参数来完成,它告诉 `rsync` 要递归目录。 + + +``` +-r, --recursive 递归进入目录 +``` + +这使得 `rsync` 使用的增量文件保持在一个合理的大小。 + +大多数 `rsync` 指南为了简便使用 `-a` (或者 `archive`) 参数。这实际是一个复合参数。 + +``` +-a, --archive 归档模式;等价于 -rlptgoD(没有 -H,-A,-X) +``` + +我传递的其他参数包含在 `a` 中;这些是 `-l`、`-p`、`-t`、`-g`和 `-o`。 + + +``` +-l, --links 复制符号链接作为符号链接 +-p, --perms 保留权限 +-t, --times 保留修改时间 +-g, --group 保留组 +-o, --owner 保留拥有者(只适用于超级管理员) +``` + +`--delete` 选项告诉 `rsync` 删除目的地目录中所有在源目录不存在的任意文件。这种方式,运行的结果仅仅是复制。你同样可以排除 `.Trash` 目录或者 MacOS 创建的 `.DS_Store` 文件。 + + +``` +-not -name ".Trash*" -not -name ".DS_Store" +``` + +### 注意 + +最后一条建议: `rsync` 可以是破坏性的命令。幸运的是,它的睿智的创造者提供了 “空运行” 的能力。如果我们加入 `n` 选项,rsync 会显示预期的输出但不写任何数据。 + + +``` +`rsync -cdlptgovn --delete . /$DRIVE/$HOME` +``` + +这个脚本适用于非常大的存储规模和高延迟或者慢链接的情况。一如既往,我确信仍有提升的空间。如果你有任何建议,请在下方评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/advanced-rsync + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: http://Opensource.com +[3]: https://linux.cn/article-8237-1.html +[4]: https://opensource.com/poll/19/4/backup-strategy-home-directory-linux +[5]: https://opensource.com/article/19/2/linux-backup-solutions +[6]: https://en.wikipedia.org/wiki/Rsync diff --git a/published/201905/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md b/published/201905/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md new file mode 100644 index 0000000000..f3ac78e47a --- /dev/null +++ b/published/201905/20190509 21 Best Kali Linux Tools for Hacking and Penetration Testing.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10860-1.html) +[#]: subject: (21 Best Kali Linux Tools for Hacking and Penetration Testing) +[#]: via: (https://itsfoss.com/best-kali-linux-tools/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +用于黑客渗透测试的 21 个最佳 Kali Linux 工具 +====== + +> 这里是最好的 Kali Linux 工具列表,它们可以让你评估 Web 服务器的安全性,并帮助你执行黑客渗透测试。 + +如果你读过 [Kali Linux 点评][1],你就知道为什么它被认为是[最好的黑客渗透测试的 Linux 发行版][2]之一,而且名副其实。它带有许多工具,使你可以更轻松地测试、破解以及进行与数字取证相关的任何其他工作。 + +它是道德黑客ethical hacker最推荐的 Linux 发行版之一。即使你不是黑客而是网站管理员 —— 你仍然可以利用其中某些工具轻松地扫描你的网络服务器或网页。 + +在任何一种情况下,无论你的目的是什么 —— 让我们来看看你应该使用的一些最好的 Kali Linux 工具。 + +*注意:这里不是所提及的所有工具都是开源的。* + +### 用于黑客渗透测试的 Kali Linux 工具 + +![Kali Linux](https://img.linux.net.cn/data/attachment/album/201905/15/234125c22rx77mmz9m37zo.jpg) + +Kali Linux 预装了几种类型的工具。如果你发现有的工具没有安装,只需下载并进行设置即可。这很简单。 + +#### 1、Nmap + +![Kali Linux Nmap][4] + +[Nmap][5] (即 “网络映射器Network Mapper”)是 Kali Linux 上最受欢迎的信息收集工具之一。换句话说,它可以获取有关主机的信息:其 IP 地址、操作系统检测以及网络安全的详细信息(如开放的端口数量及其含义)。 + +它还提供防火墙规避和欺骗功能。 + +#### 2、Lynis + +![Lynis Kali Linux Tool][6] + +[Lynis][7] 是安全审计、合规性测试和系统强化的强大工具。当然,你也可以将其用于漏洞检测和渗透测试。 + +它将根据检测到的组件扫描系统。例如,如果它检测到 Apache —— 它将针对入口信息运行与 Apache 相关的测试。 + +#### 3、WPScan + +![][8] + +WordPress 是[最好的开源 CMS][9]之一,而这个工具是最好的免费 WordpPress 安全审计工具。它是免费的,但不是开源的。 + +如果你想知道一个 WordPress 博客是否在某种程度上容易受到攻击,[WPScan][10] 就是你的朋友。 + +此外,它还为你提供了所用的插件的详细信息。当然,一个安全性很好的博客可能不会暴露给你很多细节,但它仍然是 WordPress 安全扫描找到潜在漏洞的最佳工具。 + +#### 4、Aircrack-ng + +![][11] + +[Aircrack-ng][12] 是评估 WiFi 网络安全性的工具集合。它不仅限于监控和获取信息 —— 还包括破坏网络(WEP、WPA 1 和 WPA 2)的能力。 + +如果你忘记了自己的 WiFi 网络的密码,可以尝试使用它来重新获得访问权限。它还包括各种无线攻击能力,你可以使用它们来定位和监控 WiFi 网络以增强其安全性。 + +#### 5、Hydra + +![][13] + +如果你正在寻找一个有趣的工具来破解登录密码,[Hydra][14] 将是 Kali Linux 预装的最好的工具之一。 + +它可能不再被积极维护,但它现在放在 [GitHub][15] 上,所以你也可以为它做贡献。 + +#### 6、Wireshark + +![][17] + +[Wireshark][18] 是 Kali Linux 上最受欢迎的网络分析仪。它也可以归类为用于网络嗅探的最佳 Kali Linux 工具之一。 + +它正在积极维护,所以我肯定会建议你试试它。 + +#### 7、Metasploit Framework + +![][19] + +[Metsploit Framework][20](MSF)是最常用的渗透测试框架。它提供两个版本:一个开源版,另外一个是其专业版。使用此工具,你可以验证漏洞、测试已知漏洞并执行完整的安全评估。 + +当然,免费版本不具备所有功能,所以如果你在意它们的区别,你应该在[这里][21]比较一下版本。 + +#### 8、Skipfish + +![][22] + +与 WPScan 类似,但它不仅仅专注于 WordPress。[Skipfish][23] 是一个 Web 应用扫描程序,可以为你提供几乎所有类型的 Web 应用程序的洞察信息。它快速且易于使用。此外,它的递归爬取方法使它更好用。 + +Skipfish 生成的报告可以用于专业的 Web 应用程序安全评估。 + +#### 9、Maltego + +![][24] + +[Maltego][25] 是一种令人印象深刻的数据挖掘工具,用于在线分析信息并连接信息点(如果有的话)。 根据这些信息,它创建了一个有向图,以帮助分析这些数据之间的链接。 + +请注意,这不是一个开源工具。 + +它已预装,但你必须注册才能选择要使用的版本。如果个人使用,社区版就足够了(只需要注册一个帐户),但如果想用于商业用途,则需要订阅 classic 或 XL 版本。 + +#### 10、Nessus + +![Nessus][26] + +如果你的计算机连接到了网络,Nessus 可以帮助你找到潜在攻击者可能利用的漏洞。当然,如果你是多台连接到网络的计算机的管理员,则可以使用它并保护这些计算机。 + +但是,它不再是免费的工具了,你可以从[官方网站][27]免费试用 7 天。 + +#### 11、Burp Suite Scanner + +![][28] + +[Burp Suite Scanner][29] 是一款出色的网络安全分析工具。与其它 Web 应用程序安全扫描程序不同,Burp 提供了 GUI 和一些高级工具。 + +社区版仅将功能限制为一些基本的手动工具。对于专业人士,你必须考虑升级。与前面的工具类似,这也不是开源的。 + +我使用过免费版本,但是如果你想了解更多细节,你应该查看他们[官方网站][29]上提供的功能。 + +#### 12、BeEF + +![][30] + +BeEF(浏览器利用框架Browser Exploitation Framework)是另一个令人印象深刻的工具。它专为渗透测试人员量身定制,用于评估 Web 浏览器的安全性。 + +这是最好的 Kali Linux 工具之一,因为很多用户在谈论 Web 安全时希望了解并修复客户端的问题。 + +#### 13、Apktool + +![][31] + +[Apktool][32] 确实是 Kali Linux 上用于逆向工程 Android 应用程序的流行工具之一。当然,你应该正确利用它 —— 出于教育目的。 + +使用此工具,你可以自己尝试一下,并让原开发人员了解你的想法。你认为你会用它做什么? + +#### 14、sqlmap + +![][34] + +如果你正在寻找一个开源渗透测试工具 —— [sqlmap][35] 是最好的之一。它可以自动化利用 SQL 注入漏洞的过程,并帮助你接管数据库服务器。 + +#### 15、John the Ripper + +![John The Ripper][36] + +[John the Ripper][37] 是 Kali Linux 上流行的密码破解工具。它也是自由开源的。但是,如果你对[社区增强版][37]不感兴趣,可以用于商业用途的[专业版][38]。 + +#### 16、Snort + +想要实时流量分析和数据包记录功能吗?[Snort][39] 可以鼎力支持你。即使它是一个开源的入侵防御系统,也有很多东西可以提供。 + +如果你还没有安装它,[官方网站][40]提及了安装过程。 + +#### 17、Autopsy Forensic Browser + +![][41] + +[Autopsy][42] 是一个数字取证工具,用于调查计算机上发生的事情。那么,你也可以使用它从 SD 卡恢复图像。它也被执法官员使用。你可以阅读[文档][43]来探索可以用它做什么。 + +你还应该查看他们的 [GitHub 页面][44]。 + +#### 18、King Phisher + +![King Phisher][45] + +网络钓鱼攻击现在非常普遍。[King Phisher 工具][46]可以通过模拟真实的网络钓鱼攻击来帮助测试和提升用户意识。出于显而易见的原因,在模拟一个组织的服务器内容前,你需要获得许可。 + +#### 19、Nikto + +![Nikto][47] + +[Nikto][48] 是一款功能强大的 Web 服务器扫描程序 —— 这使其成为最好的 Kali Linux 工具之一。 它会检查存在潜在危险的文件/程序、过时的服务器版本等等。 + +#### 20、Yersinia + +![][49] + +[Yersinia][50] 是一个有趣的框架,用于在网络上执行第 2 层攻击(第 2 层是指 [OSI 模型][51]的数据链路层)。当然,如果你希望你的网络安全,则必须考虑所有七个层。但是,此工具侧重于第 2 层和各种网络协议,包括 STP、CDP,DTP 等。 + +#### 21、Social Engineering Toolkit (SET) + +![][52] + +如果你正在进行相当严格的渗透测试,那么这应该是你应该检查的最佳工具之一。社交工程是一个大问题,使用 [SET][53] 工具,你可以帮助防止此类攻击。 + +### 总结 + +实际上 Kali Linux 捆绑了很多工具。请参考 Kali Linux 的[官方工具列表页面][54]来查找所有内容。 + +你会发现其中一些是完全自由开源的,而有些则是专有解决方案(但是免费)。但是,出于商业目的,你应该始终选择高级版本。 + +我们可能错过了你最喜欢的某个 Kali Linux 工具。请在下面的评论部分告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kali-linux-tools/ + +作者:[Ankush Das][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/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/kali-linux-review/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-tools.jpg?resize=800%2C518&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/kali-linux-nmap.jpg?resize=800%2C559&ssl=1 +[5]: https://nmap.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/lynis-kali-linux-tool.jpg?resize=800%2C525&ssl=1 +[7]: https://cisofy.com/lynis/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/wpscan-kali-linux.jpg?resize=800%2C545&ssl=1 +[9]: https://itsfoss.com/open-source-cms/ +[10]: https://wpscan.org/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/aircrack-ng-kali-linux-tool.jpg?resize=800%2C514&ssl=1 +[12]: https://www.aircrack-ng.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/hydra-kali-linux.jpg?resize=800%2C529&ssl=1 +[14]: https://github.com/vanhauser-thc/thc-hydra +[15]: https://github.com/vanhauser-thc/THC-Archive +[16]: https://itsfoss.com/new-linux-distros-2013/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/wireshark-network-analyzer.jpg?resize=800%2C556&ssl=1 +[18]: https://www.wireshark.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/metasploit-framework.jpg?resize=800%2C561&ssl=1 +[20]: https://github.com/rapid7/metasploit-framework +[21]: https://www.rapid7.com/products/metasploit/download/editions/ +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/skipfish-kali-linux-tool.jpg?resize=800%2C515&ssl=1 +[23]: https://gitlab.com/kalilinux/packages/skipfish/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/maltego.jpg?resize=800%2C403&ssl=1 +[25]: https://www.paterva.com/web7/buy/maltego-clients.php +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nessus.jpg?resize=800%2C456&ssl=1 +[27]: https://www.tenable.com/try +[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/burp-suite-community-edition-800x582.jpg?resize=800%2C582&ssl=1 +[29]: https://portswigger.net/burp +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/beef-framework.jpg?resize=800%2C339&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/apktool.jpg?resize=800%2C504&ssl=1 +[32]: https://github.com/iBotPeaches/Apktool +[33]: https://itsfoss.com/format-factory-alternative-linux/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sqlmap.jpg?resize=800%2C528&ssl=1 +[35]: http://sqlmap.org/ +[36]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/john-the-ripper.jpg?ssl=1 +[37]: https://github.com/magnumripper/JohnTheRipper +[38]: https://www.openwall.com/john/pro/ +[39]: https://www.snort.org/ +[40]: https://www.snort.org/#get-started +[41]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/autopsy-forensic-browser.jpg?resize=800%2C319&ssl=1 +[42]: https://www.sleuthkit.org/autopsy/ +[43]: https://www.sleuthkit.org/autopsy/docs.php +[44]: https://github.com/sleuthkit/autopsy +[45]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/king-phisher.jpg?resize=800%2C626&ssl=1 +[46]: https://github.com/securestate/king-phisher +[47]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/nikto.jpg?resize=800%2C511&ssl=1 +[48]: https://gitlab.com/kalilinux/packages/nikto/ +[49]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/yersinia.jpg?resize=800%2C516&ssl=1 +[50]: https://github.com/tomac/yersinia +[51]: https://en.wikipedia.org/wiki/OSI_model +[52]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/social-engineering-toolkit.jpg?resize=800%2C511&ssl=1 +[53]: https://www.trustedsec.com/social-engineer-toolkit-set/ +[54]: https://tools.kali.org/tools-listing diff --git a/published/201905/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md b/published/201905/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md new file mode 100644 index 0000000000..f3de1044ee --- /dev/null +++ b/published/201905/20190510 How to Use 7Zip in Ubuntu and Other Linux -Quick Tip.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10855-1.html) +[#]: subject: (How to Use 7Zip in Ubuntu and Other Linux [Quick Tip]) +[#]: via: (https://itsfoss.com/use-7zip-ubuntu-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 和其他 Linux 发行版上使用 7Zip +============================================== + +![](https://img.linux.net.cn/data/attachment/album/201905/14/154515xqy7nbq6eyjzu7qj.jpg) + +> 不能在 Linux 中提取 .7z 文件?学习如何在 Ubuntu 和其他 Linux 发行版中安装和使用 7zip。 + +[7Zip][1](更适当的写法是 7-Zip)是一种在 Windows 用户中广泛流行的归档格式。一个 7Zip 归档文件通常以 .7z 扩展结尾。它大部分是开源的,除了包含一些少量解压 rar 文件的代码。 + +默认大多数 Linux 发行版不支持 7Zip。如果你试图提取它,你会看见这个错误: + +> 不能打开这种文件类型 + +> 没有已安装的适用 7-zip 归档文件的命令。你想搜索一个命令来打开这个文件吗? + +![][2] + +不要担心,你可以轻松的在 Ubuntu 和其他 Linux 发行版中安装 7zip。 + +一个问题是你会注意到如果你试图用 [apt-get install 命令][3],你会发现没有以 7zip 开头的候选安装。因为在 Linux 中 7Zip 包的名字是 [p7zip][4]。以字母 “p” 开头而不是预期的数字 “7”。 + +让我们看一下如何在 Ubuntu 和其他 Linux 发行版中安装 7zip。 + +### 在 Ubuntu Linux 中安装 7Zip + +你需要做的第一件事是安装 p7zip 包。你会在 Ubuntu 中发现 3 个包:p7zip、p7zip-full 和 pzip-rar。 + +pzip 和 p7zip-full 的不同是 pzip 是一个轻量级的版本,仅仅对 .7z 文件提供支持,而 p7zip-full 提供了更多的 7z 压缩算法(例如音频文件)。 + +p7zip-rar 包在 7z 中提供了对 [RAR 文件][6] 的支持 + +在大多数情况下安装 p7zip-full 就足够了,但是你可能想安装 p7zip-rar 来支持 rar 文件的解压。 + +p7zip 包在 [Ubuntu 的 universe 仓库][7] 因此保证你可以使用以下命令: + +``` +sudo add-apt-repository universe +sudo apt update +``` + +在 Ubuntu 和基于 Debian 的发行版中使用以下命令。 + +``` +sudo apt install p7zip-full p7zip-rar +``` + +这很好。现在在你的系统就有了 7zip 归档的支持。 + +### 在 Linux 中提取 7Zip 归档文件 + +安装了 7Zip 后,在 Linux 中,你可以在图形用户界面或者 命令行中提取 7zip 文件。 + +在图形用户界面,你可以像提取其他压缩文件一样提取 .7z 文件。右击文件来提取它。 + +在终端中,你可以使用下列命令提取 .7z 归档文件: + +``` +7z e file.7z +``` + +### 在 Linux 中压缩文件为 7zip 归档格式 + +你可以在图形界面压缩文件为 7zip 归档格式。简单的在文件或目录上右击,选择“压缩”。你应该看到几种类型的文件格式选项。选择 .7z。 + +![7zip Archive Ubuntu][9] + +作为替换,你也可以在命令行中使用。这里是你可以用来压缩的命令: + +``` +7z a 输出的文件名 要压缩的文件 +``` + +默认,归档文件有 .7z 扩展。你可以通过在指定输出文件扩展名为 .zip 以压缩为 zip 格式。 + +### 总结 + +就是这样。看,在 Linux 中使用 7zip 多简单?我希望你喜欢这个快速指南。如果你有问题或者建议,请随意在下方评论让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/use-7zip-ubuntu-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.7-zip.org/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/07/Install_7zip_ubuntu_1.png?ssl=1 +[3]: https://itsfoss.com/apt-get-linux-guide/ +[4]: https://sourceforge.net/projects/p7zip/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-linux.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/use-rar-ubuntu-linux/ +[7]: https://itsfoss.com/ubuntu-repositories/ +[8]: https://itsfoss.com/easily-share-files-linux-windows-mac-nitroshare/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/7zip-archive-ubuntu.png?resize=800%2C239&ssl=1 diff --git a/published/201905/20190510 PHP in 2019.md b/published/201905/20190510 PHP in 2019.md new file mode 100644 index 0000000000..5b6aa01eb2 --- /dev/null +++ b/published/201905/20190510 PHP in 2019.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10870-1.html) +[#]: subject: (PHP in 2019) +[#]: via: (https://stitcher.io/blog/php-in-2019) +[#]: author: (Brent https://stitcher.io/blog/php-in-2019) + +9102 年的 PHP +====== + +你还记得篇流行的博客文章《[PHP:设计糟糕的分形][3]》吗?我第一次读到它时,我在一个有很多遗留的 PHP 项目的糟糕地方工作。这篇文章让我觉得我是否应该放弃,并去做与编程完全不同的事情。 + +还好,我之后很快就换了工作,更重要的是,自从 5.x 版本以来,PHP 成功地进步了很多。今天,我在向那些不再使用 PHP 编程,或者陷入遗留项目的人们致意。 + +剧透:今天有些事情仍然很糟糕,就像几乎每种编程语言都有它的怪癖一样。许多核心功能仍然有不一致的调用方法,仍然有令人困惑的配置设置,仍然有许多开发人员在那里写蹩脚的代码 —— 因为他们必须如此,或是他们不知道更好的写法。 + +今天我想看看好的一面:让我们关注已经发生变化的事情,以及编写干净而可维护的 PHP 代码的方法。在此之前,我想请你暂时搁置任何偏见。 + +然后,你可以像以前一样对 PHP 自由吐槽。虽然,你可能会对 PHP 在过去的几年里的一些改进感到惊讶。(LCTT 译注:说实话,我是真的感到吃惊) + +### 提前看结论 + +* PHP 在积极地开发,每年都有新版本 +* 自 PHP 5 时代以来的性能已经翻倍,如果不是三倍的话 +* 有一个非常活跃的框架、包和平台的生态系统 +* PHP 在过去几年中添加了许多新功能,并且这种语言在不断发展 +* 像静态分析这样的工具在过去几年中已经成熟,并且一直保持增长 +   +更新:人们让我展示一些实际的代码。我觉得这没问题!这是我的一个业余项目的[源代码][4],用 PHP 和 Laravel 编写的;[这里][5]列出了我们在办公室维护的几百个自由开源软件包。这两者都是现代 PHP 项目的好例子。 + +那让我们开始吧。 + +### 历史总结 + +出于更好地衡量的目的,让我们快速回顾一下如今的 PHP 发布周期。我们现在的 PHP 为 7.3,预计在 2019 年底为 7.4。PHP 8.0 将是 7.4 之后的下一个版本。 + +自从 5.x 时代以来,核心团队试图保持每年发布一个版本的周期,并且他们在过去的四年中成功地做到了这一点。 + +一般来说,每个新版本都会在两年内得到积极支持,并再获得一年以上的“安全修复”。其目标是激励 PHP 开发人员尽可能保持最新:例如,每年进行小规模升级比在 5.4 到 7.0 之间跳转更容易。 + +可以在 [这里][6] 找到 PHP 时间轴的活动概述。 + +最后,PHP 5.6 是最新的 5.x 版本,而 8.0 是当前的下一个大版本。如果你想知道 PHP 6 发生了什么,你可以听听 [PHP Roundtable 播客][7]。 + +了解了这个,让我们揭穿一些关于现代 PHP 的常见误解。 + +### PHP 的性能 + +早在 5.x 时代,PHP 的表现就是……嗯,平均水平。但是在 7.0 版本中,PHP 从头开始重写了核心部分,导致其性能提升了两到三倍! + +但光是嘴说是不够的。让我们来看看基准测试。幸运的是,人们花了很多时间对 PHP 性能进行了基准测试。 我发现 [Kinsta][8] 有一个很好的更新的测试列表。 + +自 7.0 升级以来,性能就一直在提升而没有回退。PHP Web 应用程序的性能可与其它语言中的 Web 框架相提并论,甚至在某些情况下更好。你可以看看这个[广泛的基准测试套件][9]。 + +当然 PHP 框架不会胜过 C 和 Rust,但它们比 Rails 或 Django 要好得多,并且与 ExpressJS 相当。 + +### 框架和生态系统 + +说到框架:PHP 可不仅仅是 WordPress。让我告诉你 —— 某些专业的 PHP 开发人员:WordPress 绝不代表当代的 PHP 生态系统。 + +一般来说,有两个主要的 Web 应用程序框架,[Symfony][10] 和 [Laravel][11],以及一些较小的应用程序框架。当然还有 Zend、Yii、Cake、Code Igniter 等等,但是如果你想知道现代 PHP 开发是怎么样的,这两者之一都是很好的选择。 + +这两个框架都有一个庞大的包和产品的生态系统。从管理面板和 CRM 到独立软件包,从 CI 到分析器,以及几个 Web 套接字服务器、队列管理器、支付集成等众多服务。老实说,要列出的内容太多了。 + +这些框架虽然适用于实际开发。如果你只是需要个内容管理系统(CMS),WordPress 和 CraftCMS 等平台就够了。 + +衡量 PHP 生态系统当前状态的一种方法是查看 Packagist,这是 PHP 主要的软件包存储库。它现在呈指数级增长。每天下载量达到了 2500 万次,可以说 PHP 生态系统已不再是以前的小型弱势群体了。 + +请查看此图表,它列出一段时间内的软件包和版本数量变化。它也可以在 [Packagist 网站][12]上找到它。 + +![][13] + +除了应用程序框架和 CMS 之外,我们还看到过去几年里异步框架的兴起。 + +这些是用 PHP 或其他语言编写的框架和服务器,允许用户运行真正的异步 PHP,这些例子包括 [Swoole][14](创始人韩天峰),以及 [Amp][15] 和 [ReactPHP][16]。 + +我们已经进入了异步的世界,像 Web 套接字和具有大量 I/O 的应用程序之类的东西在 PHP 世界中已经变得非常重要。 + +在内部邮件列表里(PHP 核心开发人员讨论语言开发的地方)已经谈到了[将 libuv 添加到核心][17]。如果你还不知道 libuv:Node.js 全有赖它提供异步性。 + +### 语言本身 + +虽然尚未提供 `async` 和 `await`,但在过去几年中,PHP 语言本身已经有了很多改进。这是 PHP 中新功能的非详尽列表: + + ++ [短闭包](https://stitcher.io/blog/short-closures-in-php)(箭头函数) ++ [Null 合并操作符](https://stitcher.io/blog/shorthand-comparisons-in-php#null-coalescing-operator)(`??`) ++ [Trait](https://www.php.net/manual/en/language.oop5.traits.php)(一种代码重用方式) ++ [属性类型](https://stitcher.io/blog/new-in-php-74#typed-properties-rfc) ++ [展开操作符](https://wiki.php.net/rfc/argument_unpacking)(参数解包 `...`) ++ [JIT 编译器](https://wiki.php.net/rfc/jit)(即时编译器) ++ [FFI](https://wiki.php.net/rfc/ffi)(外部函数接口) ++ [匿名类](https://www.php.net/manual/en/language.oop5.anonymous.php) ++ [返回类型声明](https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration) ++ [现代化的加密支持](https://wiki.php.net/rfc/libsodium) ++ [生成器](https://wiki.php.net/rfc/generators) ++ [等等](https://www.php.net/ChangeLog-7.php) + +当我们讨论语言功能时,我们还要谈谈当今该语言的发展过程。虽然社区可以提出 RFC,但是得有一个活跃的志愿者核心团队才能推着它前进。 + +接下来,这些 RFC 将在“内部”邮件列表中进行讨论,这个邮件列表也可以[在线阅读][18]。在添加新的语言特性之前,必须进行投票。只有得到了至少 2/3 多数同意的 RFC 才能进入核心。 + +可能有大约 100 人能够投票,但不需要每个人对每个 RFC 进行投票。核心团队的成员当然可以投票,他们是维护代码库的人。除了他们之外,还有一群人从 PHP 社区中被单独挑选出来。这些人包括 PHP 文档的维护者,对 PHP 项目整体有贡献的人,以及 PHP 社区中的杰出开发人员。 + +虽然大多数核心开发都是在自愿的基础上完成的,但其中一位核心 PHP 开发人员 Nikita Popov 最近受雇于 [JetBrains][19] 全职从事于 PHP 语言的开发。另一个例子是 Linux 基金会最近决定[投资 Zend 框架][20]。像这样的雇佣和收购确保了 PHP 未来发展的稳定性。 + +### 工具 + +除了核心本身,我们看到过去几年中围绕它的工具有所增加。首先浮现于我脑海中的是静态分析器,比如由 Vimeo 创建 [Psalm][21],以及 [Phan][22] 和 [PHPStan][23]。 + +这些工具将静态分析你的 PHP 代码并报告任何类型错误和可能的错误等。在某种程度上,它们提供的功能可以与 TypeScript 进行比较,但是现在这种语言不能转译transpiling,因此不支持使用自定义语法。 + +尽管这意味着我们需要依赖 docblocks,但是 PHP 之父 Rasmus Lerdorf 确实提到了[添加静态分析引擎][24]到核心的想法。虽然会有很多潜力,但这是一项艰巨的任务。 + +说到转译,以及受到 JavaScript 社区的启发;他们已经努力在用户领域中扩展 PHP 语法。一个名为 [Pre][25] 的项目正是如此:允许将新的 PHP 语法转译为普通的 PHP 代码。 + +虽然这个思路已经在 JavaScript 世界中被证明了,但如果提供了适当的 IDE 和静态分析支持,它就能在 PHP 中工作了。这是一个非常有趣的想法,但必须发展起来才能称之为“主流”。 + +### 结语 + +尽管如此,你仍然可以将 PHP 视为一种糟糕的语言。虽然这种语言肯定有它的缺点和背负了 20 年的遗产;但我可以放胆地说,我喜欢用它工作。 + +根据我的经验,我能够创建可靠、可维护和高质量的软件。我工作的客户对最终结果感到满意,“俺也一样”。 + +尽管仍然可以用 PHP 做很多乱七八糟的事情,但我认为如果明智和正确地使用的话,它是 Web 开发的绝佳选择。 + +你不同意吗?让我知道为什么!你可以通过 [Twitter][2] 或 [电子邮件][26] 与我联系。 + +-------------------------------------------------------------------------------- + +via: https://stitcher.io/blog/php-in-2019 + +作者:[Brent][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://stitcher.io/blog/php-in-2019 +[b]: https://github.com/lujun9972 +[1]: https://stitcher.io/ +[2]: https://twitter.com/brendt_gd +[3]: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ +[4]: https://github.com/brendt/aggregate.stitcher.io +[5]: https://spatie.be/open-source/packages +[6]: https://www.php.net/supported-versions.php +[7]: https://www.phproundtable.com/episode/what-happened-to-php-6 +[8]: https://kinsta.com/blog/php-benchmarks/ +[9]: https://github.com/the-benchmarker/web-frameworks +[10]: https://symfony.com/ +[11]: https://laravel.com/ +[12]: https://packagist.org/statistics +[13]: https://stitcher.io/resources/img/blog/php-in-2019/packagist.png +[14]: https://www.swoole.co.uk/ +[15]: https://amphp.org/ +[16]: https://reactphp.org/ +[17]: https://externals.io/message/102415#102415 +[18]: https://externals.io/ +[19]: https://blog.jetbrains.com/phpstorm/2019/01/nikita-popov-joins-phpstorm-team/ +[20]: https://getlaminas.org/ +[21]: https://github.com/vimeo/psalm +[22]: https://github.com/phan/phan +[23]: https://github.com/phpstan/phpstan +[24]: https://externals.io/message/101477#101592 +[25]: https://preprocess.io/ +[26]: mailto:brendt@stitcher.io diff --git a/published/201905/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md b/published/201905/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md new file mode 100644 index 0000000000..ca59e6c392 --- /dev/null +++ b/published/201905/20190513 How to SSH into a Raspberry Pi -Beginner-s Tip.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10888-1.html) +[#]: subject: (How to SSH into a Raspberry Pi [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/ssh-into-raspberry/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +新手教程:如何 SSH 进入树莓派 +====== + +> 在这篇树莓派文章中,你将学到如何在树莓派中启用 SSH 以及之后如何通过 SSH 进入树莓派。 + +在你可以用[树莓派][1]做的所有事情中,将其作为一个家庭网络的服务器是十分流行的做法。小体积与低功耗使它成为运行轻量级服务器的完美设备。 + +在这种情况下你做得到的事情之一是能够每次在树莓派上无须接上显示器、键盘、鼠标以及走到放置你的树莓派的地方就可以运行指令。 + +你可以从其它任意电脑、笔记本、台式机甚至你的手机通过 SSH([Secure Shell][2])登入你的树莓派来做到这一点。让我展示给你看: + +### 如何 SSH 进入树莓派 + +![][3] + +我假设你已经[在你的树莓派上运行 Raspbian][4] 并已经成功通过有线或者无线网连进网络了。你的树莓派接入网络这点是很重要的,否则你无法通过 SSH 连接树莓派(抱歉说出这种显而易见的事实)。 + +#### 步骤一:在树莓派上启用 SSH + +SSH 在树莓派上是默认关闭的,因此在你安装好全新的 Raspbian 后打开树莓派时,你需要启用它。 + +首先通过菜单进入树莓派的配置界面。 + +![树莓派菜单,树莓派配置][5] + +现在进入接口interfaces标签,启动 SSH 并重启你的树莓派。 + +![在树莓派上启动 SSH][6] + +你也可以通过终端直接启动 SSH。仅需输入命令 `sudo raspi-config` 然后进入高级设置以启用 SSH。 + +#### 步骤二: 找到树莓派的 IP 地址 + +在大多数情况下,你的树莓派会被分配一个看起来长得像 `192.168.x.x` 或者 `10.x.x.x` 的本地 IP 地址。你可以[使用多种 Linux 命令来找到 IP 地址][7]。 + +我在这使用古老而好用的 `ifconfig` 命令,但是你也可以使用 `ip address`。 + +``` +ifconfig +``` + +![树莓派网络配置][9] + +这行命令展现了所有活跃中的网络适配器以及其配置的列表。第一个条目(`eth0`)展示了例如`192.168.2.105` 的有效 IP 地址。我用有线网将我的树莓派连入网络,因此这里显示的是 `eth0`。如果你用无线网的话在叫做 `wlan0` 的条目下查看。 + +你也可以用其他方法例如查看你的路由器或者调制解调器的网络设备表以找到 IP 地址。 + +#### 步骤三:SSH 进你的树莓派 + +既然你已经启用了 SSH 功能并且找到了 IP 地址,你可以从任何电脑 SSH 进入你的树莓派。你同样需要树莓派的用户名和密码。 + +默认用户名和密码是: + + * 用户名:`pi` + * 密码:`raspberry` + +如果你已改变了默认的密码,那就使用新的而不是以上的密码。理想状态下你必须改变默认的密码。在过去,有一款[恶意软件感染数千使用默认用户名和密码的树莓派设备][8]。 + +(在 Mac 或 Linux 上)从你想要 SSH 进树莓派的电脑上打开终端输入以下命令,在 Windows 上,你可以用类似 [Putty][10] 的 SSH 客户端。 + +这里,使用你在之前步骤中找到的 IP 地址。 + +``` +ssh [受保护的邮件] +``` + +> 注意: 确保你的树莓派和你用来 SSH 进入树莓派的电脑接入了同一个网络。 + +![通过命令行 SSH][11] + +第一次你会看到一个警告,输入 `yes` 并按下回车。 + +![输入密码 \(默认是 ‘raspberry‘\)][12] + +现在,输入密码按下回车。 + +![成功通过 SSH 登入][13] + +成功登入你将会看到树莓派的终端。现在你可以通过这个终端无需物理上访问你的树莓派就可以远程(在当前网络内)在它上面运行指令。 + +在此之上你也可以设置 SSH 密钥这样每次通过 SSH 登入时就可以无需输入密码,但那完全是另一个话题了。 + +我希望你通过跟着这个教程已能够 SSH 进入你的树莓派。在下方评论中让我知道你打算用你的树莓派做些什么! + +-------------------------------------------------------------------------- + +via: https://itsfoss.com/ssh-into-raspberry/ + +作者:[Chinmay][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://en.wikipedia.org/wiki/Secure_Shell +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ssh-into-raspberry-pi.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Raspberry-pi-configuration.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/enable-ssh-raspberry-pi.png?ssl=1 +[7]: https://linuxhandbook.com/find-ip-address/ +[8]: https://itsfoss.com/raspberry-pi-malware-threat/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/ifconfig-rapberry-pi.png?ssl=1 +[10]: https://itsfoss.com/putty-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-warning.png?fit=800%2C199&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-pi-password.png?fit=800%2C202&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/SSH-into-Pi-successful-login.png?fit=800%2C306&ssl=1 +[14]: https://itsfoss.com/speed-up-ubuntu-unity-on-low-end-system/ diff --git a/published/201905/20190516 Building Smaller Container Images.md b/published/201905/20190516 Building Smaller Container Images.md new file mode 100644 index 0000000000..35efa5ea3a --- /dev/null +++ b/published/201905/20190516 Building Smaller Container Images.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10885-1.html) +[#]: subject: (Building Smaller Container Images) +[#]: via: (https://fedoramagazine.org/building-smaller-container-images/) +[#]: author: (Muayyad Alsadi https://fedoramagazine.org/author/alsadi/) + +构建更小的容器镜像的技巧 +====== + +![][1] + +Linux 容器已经成为一个热门话题,保证容器镜像较小被认为是一个好习惯。本文提供了有关如何构建较小 Fedora 容器镜像的一些技巧。 + +### microdnf + +Fedora 的 DNF 是用 Python 编写的,因为它有各种各样的插件,因此它的设计是可扩展的。但是 有一个 Fedora 基本容器镜像替代品,它使用一个较小的名为 [microdnf][2] 的包管理器,使用 C 编写。要在 Dockerfile 中使用这个最小的镜像,`FROM` 行应该如下所示: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +``` + +如果你的镜像不需要像 Python 这样的典型 DNF 依赖项,例如,如果你在制作 NodeJS 镜像时,那么这是一个重要的节省项。 + +### 在一个层中安装和清理 + +为了节省空间,使用 `dnf clean all` 或其 microdnf 等效的 `microdnf clean all` 删除仓库元数据非常重要。但是你不应该分两步执行此操作,因为这实际上会将这些文件保存在容器镜像中,然后在另一层中将其标记为删除。要正确地执行此操作,你应该像这样一步完成安装和清理: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN microdnf install nodejs && microdnf clean all +``` + +### 使用 microdnf 进行模块化 + +模块化是一种给你选择不同堆栈版本的方法。例如,你可能需要在项目中用非 LTS 的 NodeJS v11,旧的 LTS NodeJS v8 用于另一个,最新的 LTS NodeJS v10 用于另一个。你可以使用冒号指定流。 + +``` +# dnf module list +# dnf module install nodejs:8 +``` + +`dnf module install` 命令意味着两个命令,一个启用流,另一个是从它安装 nodejs。 + +``` +# dnf module enable nodejs:8 +# dnf install nodejs +``` + +尽管 `microdnf` 不提供与模块化相关的任何命令,但是可以启用带有配置文件的模块,并且 libdnf(被 microdnf 使用)[似乎][3]支持模块化流。该文件看起来像这样: + +``` +/etc/dnf/modules.d/nodejs.module +[nodejs] +name=nodejs +stream=8 +profiles= +state=enabled +``` + +使用模块化的 `microdnf` 的完整 Dockerfile 如下所示: + +``` +FROM registry.fedoraproject.org/fedora-minimal:30 +RUN \ + echo -e "[nodejs]\nname=nodejs\nstream=8\nprofiles=\nstate=enabled\n" > /etc/dnf/modules.d/nodejs.module && \ + microdnf install nodejs zopfli findutils busybox && \ + microdnf clean all +``` + +### 多阶段构建 + +在许多情况下,你可能需要大量的无需用于运行软件的构建时依赖项,例如构建一个静态链接依赖项的 Go 二进制文件。多阶段构建是分离应用构建和应用运行时的有效方法。 + +例如,下面的 Dockerfile 构建了一个 Go 应用 [confd][4]。 + +``` +# building container +FROM registry.fedoraproject.org/fedora-minimal AS build +RUN mkdir /go && microdnf install golang && microdnf clean all +WORKDIR /go +RUN export GOPATH=/go; CGO_ENABLED=0 go get github.com/kelseyhightower/confd + +FROM registry.fedoraproject.org/fedora-minimal +WORKDIR / +COPY --from=build /go/bin/confd /usr/local/bin +CMD ["confd"] +``` + +通过在 `FROM` 指令之后添加 `AS` 并从基本容器镜像中添加另一个 `FROM` 然后使用 `COPY --from=` 指令将内容从*构建*的容器复制到第二个容器来完成多阶段构建。 + +可以使用 `podman` 构建并运行此 Dockerfile: + +``` +$ podman build -t myconfd . +$ podman run -it myconfd +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/building-smaller-container-images/ + +作者:[Muayyad Alsadi][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://fedoramagazine.org/author/alsadi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/smaller-container-images-816x345.jpg +[2]: https://github.com/rpm-software-management/microdnf +[3]: https://bugzilla.redhat.com/show_bug.cgi?id=1575626 +[4]: https://github.com/kelseyhightower/confd diff --git a/published/201905/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md b/published/201905/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md new file mode 100644 index 0000000000..5c51721c84 --- /dev/null +++ b/published/201905/20190516 Querying 10 years of GitHub data with GHTorrent and Libraries.io.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10906-1.html) +[#]: subject: (Querying 10 years of GitHub data with GHTorrent and Libraries.io) +[#]: via: (https://opensource.com/article/19/5/chaossearch-github-ghtorrent) +[#]: author: (Pete Cheslock https://opensource.com/users/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes) + +用 GHTorrent 和 Libraries.io 查询 10 年的 GitHub 数据 +====== + +> 有一种方法可以在没有任何本地基础设施的情况下使用开源数据集探索 GitHub 数据。 + +![magnifying glass on computer screen](https://img.linux.net.cn/data/attachment/album/201905/27/220200jlzrlz333vkfl8ok.jpg) + +我一直在寻找新的数据集,以用它们来展示我们团队工作的力量。[CHAOSSEARCH][2] 可以将你的 [Amazon S3][3] 对象存储数据转换为完全可搜索的 [Elasticsearch][4] 式集群。使用 Elasticsearch API 或 [Kibana][5] 等工具,你可以查询你所要找的任何数据。 + +当我找到 [GHTorrent][6] 项目进行探索时,我很兴奋。GHTorrent 旨在通过 GitHub API 构建所有可用数据的离线版本。如果你喜欢数据集,这是一个值得一看的项目,甚至你可以考虑[捐赠一个 GitHub API 密钥][7]。 + +### 访问 GHTorrent 数据 + +有许多方法可以访问和使用 [GHTorrent 的数据][8],它以 [NDJSON][9] 格式提供。这个项目可以以多种形式提供数据,包括用于恢复到 [MySQL][11] 数据库的 [CSV][10],可以转储所有对象的 [MongoDB][12],以及用于将数据直接导出到 Google 对象存储中的 Google Big Query(免费)。 有一点需要注意:这个数据集有从 2008 年到 2017 年几乎完整的数据集,但从 2017 年到现在的数据还不完整。这将影响我们确定性查询的能力,但它仍然是一个令人兴奋的信息量。 + +我选择 Google Big Query 来避免自己运行任何数据库,那么我就可以很快下载包括用户和项目在内的完整数据库。CHAOSSEARCH 可以原生分析 NDJSON 格式,因此在将数据上传到 Amazon S3 之后,我能够在几分钟内对其进行索引。CHAOSSEARCH 平台不要求用户设置索引模式或定义其数据的映射,它可以发现所有字段本身(字符串、整数等)。 + +随着我的数据完全索引并准备好进行搜索和聚合,我想深入了解看看我们可以发现什么,比如哪些软件语言是 GitHub 项目最受欢迎的。 + +(关于格式化的说明:下面这是一个有效的 JSON 查询,我们不会在这里正确格式化以避免滚动疲劳。要正确格式化它,你可以在本地复制它并发送到命令行实用程序,如 [jq][13]。) + +``` +{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}} +``` + +对于那些近年来跟踪开源语言状态的人来说,这个结果并不令人惊讶。 + +![Which software languages are the most popular on GitHub.][14] + +[JavaScript][15] 仍然是卫冕冠军,虽然有些人认为 JavaScript 正在逐渐消失,但它仍然是 800 磅重的大猩猩,很可能会保持这种状态一段时间。[Java][16] 面临类似的谣言,但这些数据表明它是开源生态系统的重要组成部分。 + +考虑到像 [Docker][17] 和 [Kubernetes][18] 这样的项目的流行,你可能会想,“Go([Golang][19])怎么样?”这是一个提醒的好时机,这里讨论的 GitHub 数据集包含一些空缺,最明显的是在 2017 年之后我看到 Golang 项目随处可见,而这里并没有显示。我希望用完整的 GitHub 数据集重复此搜索,看看它是否会改变排名。 + +现在让我们来探讨项目创建的速度。 (提醒:这是为了便于阅读而合并的有效 JSON。) + +``` +{"aggs":{"2":{"date_histogram":{"field":"root.created_at","interval":"1M","time_zone":"America/New_York","min_doc_count":1}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["root.created_at","root.updated_at"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"root.language":{"query":""}}}]}}} +``` + +我们可以看到创建新项目的速度,也会给人留下深刻的印象,从 2012 年左右开始大幅增长: + +![The rate at which new projects are created on GitHub.][20] + +既然我知道了创建项目的速度以及用于创建这些项目的最流行的语言,我还想知道这些项目选择的开源许可证。遗憾的是,这个 GitHub 项目数据集中并不存在这些数据,但是 [Tidelift][21] 的精彩团队在 [Libraries.io][22] [数据][23] 里发布了一个 GitHub 项目的详细列表,包括使用的许可证以及其中有关开源软件状态的其他详细信息。将此数据集导入 CHAOSSEARCH 只花了几分钟,让我看看哪些开源软件许可证在 GitHub 上最受欢迎: + +(提醒:这是为了便于阅读而合并的有效 JSON。) + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +结果显示了一些重要的异常值: + +![Which open source software licenses are the most popular on GitHub.][24] + +如你所见,[MIT 许可证][25] 和 [Apache 2.0 许可证][26] 的开源项目远远超过了其他大多数开源许可证,而 [各种 BSD 和 GPL 许可证][27] 则差得很远。鉴于 GitHub 的开放模式,我不能说我对这些结果感到惊讶。我猜想是用户(而不是公司)创建了大多数项目,并且他们使用 MIT 许可证可以使其他人轻松地使用、共享和贡献。而鉴于有不少公司希望确保其商标得到尊重并为其业务提供开源组件,那么 Apache 2.0 许可证数量高企的背后也是有道理的。 + +现在我确定了最受欢迎的许可证,我很想看看最少使用的许可证。通过调整我的上一个查询,我将前 10 名逆转为最后 10 名,并且只找到了两个使用 [伊利诺伊大学 - NCSA 开源许可证][28] 的项目。我之前从未听说过这个许可证,但它与 Apache 2.0 非常接近。看到所有 GitHub 项目中使用了多少个不同的软件许可证,这很有意思。 + +![The University of Illinois/NCSA open source license.][29] + +之后,我针对特定语言(JavaScript)来查看最常用的许可证。(提醒:这是为了便于阅读而合并的有效JSON。) + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"JavaScript"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +这个输出有一些意外。 + +![The most popular open source licenses used for GitHub JavaScript projects.][30] + +尽管使用 `npm init` 创建的 [NPM][31] 模块的默认许可证是来自 [Internet Systems Consortium(ISC)][32] 的许可证,但你可以看到相当多的这些项目使用 MIT 以及 Apache 2.0 的开源许可证。 + +由于 Libraries.io 数据集中包含丰富的开源项目内容,并且由于 GHTorrent 数据缺少最近几年的数据(因此缺少有关 Golang 项目的任何细节),因此我决定运行类似的查询来查看 Golang 项目是如何许可他们的代码的。 + +(提醒:这是为了便于阅读而合并的有效 JSON。) + +``` +{"aggs":{"2":{"terms":{"field":"Repository License","size":10,"order":{"_count":"desc"}}}},"size":0,"_source":{"excludes":[]},"stored_fields":["*"],"script_fields":{},"docvalue_fields":["Created Timestamp","Last synced Timestamp","Latest Release Publish Timestamp","Updated Timestamp"],"query":{"bool":{"must":[{"match_phrase":{"Repository Language":{"query":"Go"}}}],"filter":[{"match_all":{}}],"should":[],"must_not":[{"match_phrase":{"Repository License":{"query":""}}}]}}} +``` + +结果与 Javascript 完全不同。 + +![How Golang projects license their GitHub code.][33] + +Golang 项目与 JavaScript 项目惊人逆转 —— 使用 Apache 2.0 的 Golang 项目几乎是 MIT 许可证的三倍。虽然很难准确地解释为什么会出现这种情况,但在过去的几年中,Golang 已经出现了大规模的增长,特别是在开源和商业化的项目和软件产品公司中。 + +正如我们上面所了解的,这些公司中的许多公司都希望强制执行其商标策略,因此转向 Apache 2.0 许可证是有道理的。 + +#### 总结 + +最后,我通过深入了解 GitHub 用户和项目的数据找到了一些有趣的结果。其中一些我肯定会猜到,但是一些结果对我来说也是惊喜,特别是像很少使用的 NCSA 许可证这样的异常值。 + +总而言之,你可以看到 CHAOSSEARCH 平台能够快速轻松地找到有趣问题的复杂答案。我无需自己运行任何数据库就可以深入研究这个数据集,甚至可以在 Amazon S3 上以低成本的方式存储数据,因此无需维护。 现在,我可以随时查询有关这些数据的任何其他问题。 + +你对数据提出了哪些其他问题,以及你使用了哪些数据集?请在评论或推特上告诉我 [@petecheslock] [34]。 + +本文的一个版本最初发布在 [CHAOSSEARCH][35],有更多结果可供发现。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/chaossearch-github-ghtorrent + +作者:[Pete Cheslock][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/petecheslock/users/ghaff/users/payalsingh/users/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://chaossearch.io/ +[3]: https://aws.amazon.com/s3/ +[4]: https://www.elastic.co/ +[5]: https://www.elastic.co/products/kibana +[6]: http://ghtorrent.org +[7]: http://ghtorrent.org/services.html +[8]: http://ghtorrent.org/downloads.html +[9]: http://ndjson.org +[10]: https://en.wikipedia.org/wiki/Comma-separated_values +[11]: https://en.wikipedia.org/wiki/MySQL +[12]: https://www.mongodb.com/ +[13]: https://stedolan.github.io/jq/ +[14]: https://opensource.com/sites/default/files/uploads/github-1_500.png (Which software languages are the most popular on GitHub.) +[15]: https://en.wikipedia.org/wiki/JavaScript +[16]: /resources/java +[17]: /resources/what-docker +[18]: /resources/what-is-kubernetes +[19]: https://golang.org/ +[20]: https://opensource.com/sites/default/files/uploads/github-2_500.png (The rate at which new projects are created on GitHub.) +[21]: https://tidelift.com +[22]: http://libraries.io/ +[23]: https://libraries.io/data +[24]: https://opensource.com/sites/default/files/uploads/github-3_500.png (Which open source software licenses are the most popular on GitHub.) +[25]: https://opensource.org/licenses/MIT +[26]: https://opensource.org/licenses/Apache-2.0 +[27]: https://opensource.org/licenses +[28]: https://tldrlegal.com/license/university-of-illinois---ncsa-open-source-license-(ncsa) +[29]: https://opensource.com/sites/default/files/uploads/github-4_500_0.png (The University of Illinois/NCSA open source license.) +[30]: https://opensource.com/sites/default/files/uploads/github-5_500_0.png (The most popular open source licenses used for GitHub JavaScript projects.) +[31]: https://www.npmjs.com/ +[32]: https://en.wikipedia.org/wiki/ISC_license +[33]: https://opensource.com/sites/default/files/uploads/github-6_500.png (How Golang projects license their GitHub code.) +[34]: https://twitter.com/petecheslock +[35]: https://chaossearch.io/blog/where-are-the-github-users-part-1/ diff --git a/published/201905/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md b/published/201905/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md new file mode 100644 index 0000000000..15c51dc608 --- /dev/null +++ b/published/201905/20190518 Change Power Modes in Ubuntu with Slimbook Battery Optimizer.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (zhs852) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10897-1.html) +[#]: subject: (Change Power Modes in Ubuntu with Slimbook Battery Optimizer) +[#]: via: (https://itsfoss.com/slimbook-battry-optimizer-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Ubuntu 中使用 Slimbook Battery Optimizer 切换电源模式 +====== + +> Slimbook Battery Optimizer 是一个美观实用的指示器小程序,它可以让你在安装了 Linux 的笔记本上快速切换电源模式来延长续航时间。 + +[Slimbook][1] 是一个销售 [预装 Linux 的笔记本电脑][2] 的西班牙电脑制造商,他们发布了一款好用的小程序,用来在基于 Ubuntu 的 Linux 发行版下调整电池性能。 + +因为 Slimbook 销售他们自己的 Linux 系统,所以他们制作了一些在 Linux 上用于调整他们自己硬件性能的小工具。Battery Optimizer 就是这样一个工具。 + +要使用这个实用小程序,你不必购买 Slimbook 的产品,因为 Slimbook 已经将它在 [他们的官方 PPA 源][3] 发行了。 + +### Slimbook Battery Optimizer 简介 + +这个程序叫 Slimbook Battery。它是一个常驻顶栏的指示器小程序,使得你可以快速切换电源模式。 + +![Slimbook Battery Mode Ubuntu][4] + +你可能在 Windows 中见过类似的程序。Slimbook Battery 和它们一样,提供了类似的电源计划: + + * 节能:最大程度延长电池续航时间 + * 平衡:性能与节能间的最佳平衡 + * 高性能:最大程度提高性能 + +你可以在高级模式中配置这些模式: + +![配置多种多样的电源模式][5] + +如果你觉得你把设置调乱了,你可以用“恢复默认设置”的按钮还原它。 + +你也可以修改像程序自启或默认电源模式这样的通用设置。 + +![Slimbook Battery 通用设置][6] + +Slimbook 有专门为多种电源管理参数提供的页面。如果你希望自己配置,请参照 [此页][7]。 + +不过,我认为 Slimbook 的界面需要一些改进。例如,某些页面上的“问题标记”的图标应该改为可点击的,以此提供更多信息。然而,在我写这篇文章时,那个标记仍然无法点击。 + +总的来说,Slimbook Battery 是一个小巧精美的软件,你可以用它来快速切换电源模式。如果你决定在 Ubuntu 及其衍生发行版上(比如 Linux Mint 或 elementary OS 等),你可以使用官方 [PPA 源][8]。 + +#### 在基于 Ubuntu 的发行版上安装 Slimbook Battery + +打开终端,一步一步地使用以下命令: + +``` +sudo add-apt-repository ppa:slimbook/slimbook +sudo apt update +sudo apt install slimbookbattery +``` + +安装好之后,在菜单中搜索 Slimbook Battery: + +![启动 Slimbook Battery Optimizer][10] + +在你点击它之后,你会发现它出现在了顶栏。你可以在这里选择你希望使用的电源模式。 + +![Slimbook Battery 电源模式][4] + +#### 卸载 Slimbook Battery + +如果你不再使用它,你可以通过以下命令来卸载它: + +``` +sudo apt remove slimbookbattery +sudo add-apt-repository -r ppa:slimbook/slimbook +``` + +在我看来,这样的应用程序为某些特定的目的服务,这是值得鼓励的。这个工具给了你一条调整电源模式的捷径,和调整性能的更多选项。 + +你用过 Slimbook Battery 吗?你觉得它如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/slimbook-battry-optimizer-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[zhs852](https://github.com/zhs852) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://slimbook.es/en/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://launchpad.net/~slimbook/+archive/ubuntu/slimbook +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-mode-ubuntu.jpg?resize=800%2C400&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer-1.jpg?ssl=1 +[7]: https://slimbook.es/en/tutoriales/aplicaciones-slimbook/398-slimbook-battery-3-application-for-optimize-battery-of-your-laptop +[8]: https://itsfoss.com/ppa-guide/ +[9]: https://itsfoss.com/ubuntu-forums-hacked-again/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/slimbook-battery-optimizer.jpg?ssl=1 diff --git a/published/201905/20190520 PiShrink - Make Raspberry Pi Images Smaller.md b/published/201905/20190520 PiShrink - Make Raspberry Pi Images Smaller.md new file mode 100644 index 0000000000..3913d663df --- /dev/null +++ b/published/201905/20190520 PiShrink - Make Raspberry Pi Images Smaller.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10894-1.html) +[#]: subject: (PiShrink – Make Raspberry Pi Images Smaller) +[#]: via: (https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +PiShrink:使树莓派镜像更小 +====== + +![Make Raspberry Pi Images Smaller With PiShrink In Linux][1] + +树莓派不需要过多介绍。它是一款小巧、价格实惠,只有信用卡大小的电脑,它可以连接到显示器或电视。我们可以连接一个标准的键盘和鼠标,并将其用作一台成熟的台式计算机来完成日常任务,如互联网浏览、播放视频/玩游戏、文字处理和电子表格制作等。它主要是为学校的计算机科学教学而开发的。如今,树莓派被广泛用于大学、中小型组织和研究所来教授编码。 + +如果你有一台树莓派,你可能需要了解一个名为 PiShrink 的 bash 脚本,该脚本可使树莓派镜像更小。PiShrink 将自动缩小镜像,然后在启动时将其调整为 SD 卡的最大大小。这能更快地将镜像复制到 SD 卡中,同时缩小的镜像将更好地压缩。这对于将大容量镜像放入 SD 卡非常有用。在这个简短的指南中,我们将学习如何在类 Unix 系统中将树莓派镜像缩小到更小。 + +### 安装 PiShrink + +要在 Linux 机器上安装 PiShrink,请先使用以下命令下载最新版本: + +``` +$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh +``` + +接下来,将下载的 PiShrink 变成二进制可执行文件: + +``` +$ chmod +x pishrink.sh +``` + +最后,移动到目录: + +``` +$ sudo mv pishrink.sh /usr/local/bin/ +``` + +### 使树莓派镜像更小 + +你可能已经知道,Raspbian 是所有树莓派型号的官方操作系统。树莓派基金会为 PC 和 Mac 开发了树莓派桌面版本。你可以创建一个 live CD,并在虚拟机中运行它,甚至也可以将其安装在桌面上。树莓派也有少量非官方​​操作系统镜像。为了测试,我从[官方下载页面][2]下载了官方的 Raspbian 系统。 + +解压下载的系统镜像: + +``` +$ unzip 2019-04-08-raspbian-stretch-lite.zip +``` + +上面的命令将提取当前目录中 `2019-04-08-raspbian-stretch-lite.zip` 文件的内容。 + +让我们看下提取文件的实际大小: + +``` +$ du -h 2019-04-08-raspbian-stretch-lite.img +1.7G 2019-04-08-raspbian-stretch-lite.img +``` + +如你所见,提取的树莓派系统镜像大小为 1.7G。 + +现在,使用 PiShrink 缩小此文件的大小,如下所示: + +``` +$ sudo pishrink.sh 2019-04-08-raspbian-stretch-lite.img +``` + +示例输出: + +``` +Creating new /etc/rc.local +rootfs: 39795/107072 files (0.1% non-contiguous), 239386/428032 blocks +resize2fs 1.45.0 (6-Mar-2019) +resize2fs 1.45.0 (6-Mar-2019) +Resizing the filesystem on /dev/loop1 to 280763 (4k) blocks. +Begin pass 3 (max = 14) +Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +Begin pass 4 (max = 3728) +Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +The filesystem on /dev/loop1 is now 280763 (4k) blocks long. + +Shrunk 2019-04-08-raspbian-stretch-lite.img from 1.7G to 1.2G +``` + +正如你在上面的输出中看到的,树莓派镜像的大小已减少到 1.2G。 + +你还可以使用 `-s` 标志跳过该过程的自动扩展部分。 + +``` +$ sudo pishrink.sh -s 2019-04-08-raspbian-stretch-lite.img newpi.img +``` + +这将创建一个源镜像文件(即 `2019-04-08-raspbian-stretch-lite.img`)的副本到一个新镜像文件(`newpi.img`)并进行处理。有关更多详细信息,请查看最后给出的官方 GitHub 页面。 + +就是这些了。希望本文有用。还有更多好东西,敬请期待! + + +资源: + + * [PiShrink 的 GitHub 仓库][4] + * [树莓派网站][5] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/pishrink-make-raspberry-pi-images-smaller/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-720x340.png +[2]: https://www.raspberrypi.org/downloads/ +[3]: http://www.ostechnix.com/wp-content/uploads/2019/05/pishrink-1.png +[4]: https://github.com/Drewsif/PiShrink +[5]: https://www.raspberrypi.org/ diff --git a/published/201905/20190520 xsos - A Tool To Read SOSReport In Linux.md b/published/201905/20190520 xsos - A Tool To Read SOSReport In Linux.md new file mode 100644 index 0000000000..af4e47f976 --- /dev/null +++ b/published/201905/20190520 xsos - A Tool To Read SOSReport In Linux.md @@ -0,0 +1,396 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10889-1.html) +[#]: subject: (xsos – A Tool To Read SOSReport In Linux) +[#]: via: (https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +xsos:一个在 Linux 上阅读 SOSReport 的工具 +====== + +![](https://img.linux.net.cn/data/attachment/album/201905/23/133305accwpsvhk1epsisc.jpg) + +我们都已经知道 [SOSReport][1]。它用来收集可用于诊断的系统信息。Redhat 的支持服务建议我们在提交案例时提供 SOSReport 来分析当前的系统状态。 + +它会收集全部类型的报告,以帮助用户找出问题的根本原因。我们可以轻松地提取和阅读 SOSReport,但它很难阅读。因为它的每个部分都是一个单独的文件。 + +那么,在 Linux 中使用语法高亮显示阅读所有这些内容的最佳方法是什么。是的,这可以通过 `xsos` 工具做到。 + +### sosreport + +`sosreport` 命令是一个从运行中的系统(尤其是 RHEL 和 OEL 系统)收集大量配置细节、系统信息和诊断信息的工具。它可以帮助技术支持工程师在很多方面分析系统。 + +此报告包含有关系统的大量信息,例如引导信息、文件系统、内存、主机名、已安装的 RPM、系统 IP、网络详细信息、操作系统版本、已安装的内核、已加载的内核模块、打开的文件列表、PCI 设备列表、挂载点及其细节、运行中的进程信息、进程树输出、系统路由、位于 `/etc` 文件夹中的所有配置文件,以及位于 `/var` 文件夹中的所有日志文件。 + +这将需要一段时间来生成报告,这取决于你的系统安装和配置。 + +完成后,`sosreport` 将在 `/tmp` 目录下生成一个压缩的归档文件。 + +### xsos + +[xsos][3] 是一个帮助用户轻松读取 Linux 系统上的 `sosreport` 的工具。另一方面,我们可以说它是 `sosreport` 考官。 + +它可以立即从 `sosreport` 或正在运行的系统中汇总系统信息。 + +`xsos` 将尝试简化、解析、计算并格式化来自数十个文件(和命令)的数据,以便为你提供有关系统的详细概述。 + +你可以通过运行以下命令立即汇总系统信息。 + +``` +# curl -Lo ./xsos bit.ly/xsos-direct; chmod +x ./xsos; ./xsos -ya +``` + +![][5] + +### 如何在 Linux 上安装 xsos + +我们可以使用以下两种方法轻松安装 `xsos`。 + +如果你正在寻找最新的前沿版本。使用以下步骤: + +``` +# curl -Lo /usr/local/bin/xsos bit.ly/xsos-direct +# chmod +x /usr/local/bin/xsos +``` + +下面是安装 `xsos` 的推荐方法。它将从 rpm 文件安装 `xsos`。 + +``` +# yum install http://people.redhat.com/rsawhill/rpms/latest-rsawaroha-release.rpm +# yum install xsos +``` + +### 如何在 Linux 上使用 xsos + +一旦通过上述方法之一安装了 xsos。只需运行 `xsos` 命令,不带任何选项,它们会显示有关系统的基本信息。 + +``` +# xsos + +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + Runlevel: N 5 (default graphical) + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 0 (kernel untainted) + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:05:21 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 15 min, 1 user + LoadAvg: [1 CPU] 0.00 (0%), 0.04 (4%), 0.09 (9%) + /proc/stat: + procs_running: 2 procs_blocked: 0 processes [Since boot]: 6423 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +### 如何使用 xsos 命令在 Linux 中查看生成的 SOSReport 输出? + +我们需要份 SOSReport 以使用 `xsos` 命令进一步阅读。 + +是的,我已经生成了一个 SOSReport,文件如下。 + +``` +# ls -lls -lh /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +9.8M -rw-------. 1 root root 9.8M May 12 10:13 /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +运行如下命令解开它。 + +``` +# tar xf sosreport-CentOS7-01-1005-2019-05-12-pomeqsa.tar.xz +``` + +要查看全部信息,带上 `-a` 或 `--all` 开关运行 `xsos`: + +``` +# xsos --all /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +``` + +要查看 BIOS 信息,带上 `-b` 或 `--bios` 开关运行 `xsos`。 + +``` +# xsos --bios /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +DMIDECODE + BIOS: + Vend: innotek GmbH + Vers: VirtualBox + Date: 12/01/2006 + BIOS Rev: + FW Rev: + System: + Mfr: innotek GmbH + Prod: VirtualBox + Vers: 1.2 + Ser: 0 + UUID: 002f47b8-2af2-48f5-be1d-67b67e03514c + CPU: + 0 of 0 CPU sockets populated, 0 cores/0 threads per CPU + 0 total cores, 0 total threads + Mfr: + Fam: + Freq: + Vers: + Memory: + Total: 0 MiB (0 GiB) + DIMMs: 0 of 0 populated + MaxCapacity: 0 MiB (0 GiB / 0.00 TiB) +``` + +要查看系统基本信息,如主机名、发行版、SELinux、内核信息、正常运行时间等,请使用 `-o` 或 `--os` 开关运行 `xsos`。 + +``` +# xsos --os /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +OS + Hostname: CentOS7.2daygeek.com + Distro: [redhat-release] CentOS Linux release 7.6.1810 (Core) + [centos-release] CentOS Linux release 7.6.1810 (Core) + [os-release] CentOS Linux 7 (Core) 7 (Core) + RHN: (missing) + RHSM: (missing) + YUM: 2 enabled plugins: fastestmirror, langpacks + SELinux: enforcing (default enforcing) + Arch: mach=x86_64 cpu=x86_64 platform=x86_64 + Kernel: + Booted kernel: 3.10.0-957.el7.x86_64 + GRUB default: 3.10.0-957.el7.x86_64 + Build version: + Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red + Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 8 23:39:32 UTC 2018 + Booted kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + GRUB default kernel cmdline: + root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet + LANG=en_US.UTF-8 + Taint-check: 536870912 (see https://access.redhat.com/solutions/40594) + 29 TECH_PREVIEW: Technology Preview code is loaded + - - - - - - - - - - - - - - - - - - - + Sys time: Sun May 12 10:12:22 CDT 2019 + Boot time: Sun May 12 09:50:20 CDT 2019 (epoch: 1557672620) + Time Zone: America/Chicago + Uptime: 22 min, 1 user + LoadAvg: [1 CPU] 1.19 (119%), 0.27 (27%), 0.14 (14%) + /proc/stat: + procs_running: 8 procs_blocked: 2 processes [Since boot]: 9005 + cpu [Utilization since boot]: + us 1%, ni 0%, sys 1%, idle 99%, iowait 0%, irq 0%, sftirq 0%, steal 0% +``` + +要查看 kdump 配置,请使用 `-k` 或 `--kdump` 开关运行 `xsos`。 + +``` +# xsos --kdump /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +KDUMP CONFIG + kexec-tools rpm version: + kexec-tools-2.0.15-21.el7.x86_64 + Service enablement: + UNIT STATE + kdump.service enabled + kdump initrd/initramfs: + 13585734 Feb 19 05:51 initramfs-3.10.0-957.el7.x86_64kdump.img + Memory reservation config: + /proc/cmdline { crashkernel=auto } + GRUB default { crashkernel=auto } + Actual memory reservation per /proc/iomem: + 2a000000-340fffff : Crash kernel + kdump.conf: + path /var/crash + core_collector makedumpfile -l --message-level 1 -d 31 + kdump.conf "path" available space: + System MemTotal (uncompressed core size) { 1.80 GiB } + Available free space on target path's fs { 22.68 GiB } (fs=/) + Panic sysctls: + kernel.sysrq [bitmask] = "16" (see proc man page) + kernel.panic [secs] = 0 (no autoreboot on panic) + kernel.hung_task_panic = 0 + kernel.panic_on_oops = 1 + kernel.panic_on_io_nmi = 0 + kernel.panic_on_unrecovered_nmi = 0 + kernel.panic_on_stackoverflow = 0 + kernel.softlockup_panic = 0 + kernel.unknown_nmi_panic = 0 + kernel.nmi_watchdog = 1 + vm.panic_on_oom [0-2] = 0 (no panic) +``` + +要查看有关 CPU 的信息,请使用 `-c` 或 `--cpu` 开关运行 `xsos`。 + +``` +# xsos --cpu /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +CPU + 1 logical processors + 1 Intel Core i7-6700HQ CPU @ 2.60GHz (flags: aes,constant_tsc,ht,lm,nx,pae,rdrand) +``` + +要查看内存利用情况,请使用 `-m` 或 `--mem` 开关运行 `xsos`。 + +``` +# xsos --mem /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +MEMORY + Stats graphed as percent of MemTotal: + MemUsed ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊..................... 58.8% + Buffers .................................................. 0.6% + Cached ▊▊▊▊▊▊▊▊▊▊▊▊▊▊▊................................... 29.9% + HugePages .................................................. 0.0% + Dirty .................................................. 0.7% + RAM: + 1.8 GiB total ram + 1.1 GiB (59%) used + 0.5 GiB (28%) used excluding Buffers/Cached + 0.01 GiB (1%) dirty + HugePages: + No ram pre-allocated to HugePages + LowMem/Slab/PageTables/Shmem: + 0.09 GiB (5%) of total ram used for Slab + 0.02 GiB (1%) of total ram used for PageTables + 0.01 GiB (1%) of total ram used for Shmem + Swap: + 0 GiB (0%) used of 2 GiB total +``` + +要查看添加的磁盘信息,请使用 `-d` 和 `-disks` 开关运行 `xsos`。 + +``` +# xsos --disks /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +STORAGE + Whole Disks from /proc/partitions: + 2 disks, totaling 40 GiB (0.04 TiB) + - - - - - - - - - - - - - - - - - - - - - + Disk Size in GiB + ---- ----------- + sda 30 + sdb 10 +``` + +要查看网络接口配置,请使用 `-e` 或 `--ethtool` 开关运行 `xsos`。 + +``` +# xsos --ethtool /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +ETHTOOL + Interface Status: + enp0s10 0000:00:0a.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + enp0s9 0000:00:09.0 link=up 1000Mb/s full (autoneg=Y) rx ring 256/4096 drv e1000 v7.3.21-k8-NAPI / fw UNKNOWN + virbr0 N/A link=DOWN rx ring UNKNOWN drv bridge v2.3 / fw N/A + virbr0-nic tap link=DOWN rx ring UNKNOWN drv tun v1.6 / fw UNKNOWN +``` + +要查看有关 IP 地址的信息,请使用 `-i` 或 `--ip` 开关运行 `xsos`。 + +``` +# xsos --ip /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +IP4 + Interface Master IF MAC Address MTU State IPv4 Address + ========= ========= ================= ====== ===== ================== + lo - - 65536 up 127.0.0.1/8 + enp0s9 - 08:00:27:0b:bc:e9 1500 up 192.168.1.8/24 + enp0s10 - 08:00:27:b2:08:91 1500 up 192.168.1.9/24 + virbr0 - 52:54:00:ae:01:94 1500 up 192.168.122.1/24 + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - + +IP6 + Interface Master IF MAC Address MTU State IPv6 Address Scope + ========= ========= ================= ====== ===== =========================================== ===== + lo - - 65536 up ::1/128 host + enp0s9 - 08:00:27:0b:bc:e9 1500 up fe80::945b:8333:f4bc:9723/64 link + enp0s10 - 08:00:27:b2:08:91 1500 up fe80::7ed4:1fab:23c3:3790/64 link + virbr0 - 52:54:00:ae:01:94 1500 up - - + virbr0-nic virbr0 52:54:00:ae:01:94 1500 DOWN - - +``` + +要通过 `ps` 查看正在运行的进程,请使用 `-p` 或 `--ps` 开关运行 `xsos`。 + +``` +# xsos --ps /var/tmp/sosreport-CentOS7-01-1005-2019-05-12-pomeqsa +PS CHECK + Total number of threads/processes: + 501 / 171 + Top users of CPU & MEM: + USER %CPU %MEM RSS + root 20.6% 14.1% 0.30 GiB + gdm 0.3% 16.8% 0.33 GiB + postfix 0.0% 0.6% 0.01 GiB + polkitd 0.0% 0.6% 0.01 GiB + daygeek 0.0% 0.2% 0.00 GiB + colord 0.0% 0.4% 0.01 GiB + Uninteruptible sleep threads/processes (0/0): + [None] + Defunct zombie threads/processes (0/0): + [None] + Top CPU-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 7582 3.0 0.1 10 2 pts/0 S 10:12 0:00 /bin/bash /usr/sbin/dracut --print-cmdline + root 7969 0.7 0.1 95 4 ? Ss 10:12 0:00 /usr/sbin/certmonger -S -p + root 7889 0.4 0.2 24 4 ? Ss 10:12 0:00 /usr/lib/systemd/systemd-hostnamed + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 8553 0.2 0.1 47 3 ? S 10:12 0:00 /usr/lib/systemd/systemd-udevd + root 6971 0.2 0.4 342 9 ? Sl 10:12 0:00 /usr/sbin/abrt-dbus -t133 + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 2855 0.1 0.1 88 3 ? Ss 09:50 0:01 /sbin/rngd -f + rtkit 2826 0.0 0.0 194 2 ? SNsl 09:50 0:00 /usr/libexec/rtkit-daemon + Top MEM-using processes: + USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + gdm 3866 0.3 7.1 2856 131 ? Sl 09:50 0:04 /usr/bin/gnome-shell + root 6542 15.6 4.2 875 78 pts/0 Sl+ 10:11 0:07 /usr/bin/python /sbin/sosreport + root 3264 0.0 1.2 271 23 tty1 Ssl+ 09:50 0:00 /usr/bin/X :0 -background + root 3200 0.2 0.9 982 18 ? Ssl 09:50 0:02 /usr/sbin/libvirtd + root 3189 0.0 0.9 560 17 ? Ssl 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + gdm 4072 0.0 0.9 988 17 ? Sl 09:50 0:00 /usr/libexec/gsd-media-keys + gdm 4076 0.0 0.8 625 16 ? Sl 09:50 0:00 /usr/libexec/gsd-power + gdm 4056 0.0 0.8 697 16 ? Sl 09:50 0:00 /usr/libexec/gsd-color + root 2853 0.0 0.7 622 14 ? Ssl 09:50 0:00 /usr/sbin/NetworkManager --no-daemon + gdm 4110 0.0 0.7 544 14 ? Sl 09:50 0:00 /usr/libexec/gsd-wacom + Top thread-spawning processes: + # USER PID %CPU %MEM VSZ-MiB RSS-MiB TTY STAT START TIME COMMAND + 17 root 3200 0.2 0.9 982 18 ? - 09:50 0:02 /usr/sbin/libvirtd + 12 root 6542 16.1 4.5 876 83 pts/0 - 10:11 0:07 /usr/bin/python /sbin/sosreport + 10 gdm 3866 0.3 7.1 2856 131 ? - 09:50 0:04 /usr/bin/gnome-shell + 7 polkitd 2864 0.0 0.6 602 13 ? - 09:50 0:01 /usr/lib/polkit-1/polkitd --no-debug + 6 root 2865 0.0 0.0 203 1 ? - 09:50 0:00 /usr/sbin/gssproxy -D + 5 root 3189 0.0 0.9 560 17 ? - 09:50 0:00 /usr/bin/python2 -Es /usr/sbin/tuned + 5 root 2823 0.0 0.3 443 6 ? - 09:50 0:00 /usr/libexec/udisks2/udisksd + 5 gdm 4102 0.0 0.2 461 5 ? - 09:50 0:00 /usr/libexec/gsd-smartcard + 4 root 3215 0.0 0.2 470 4 ? - 09:50 0:00 /usr/sbin/gdm + 4 gdm 4106 0.0 0.2 444 5 ? - 09:50 0:00 /usr/libexec/gsd-sound +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/xsos-a-tool-to-read-sosreport-in-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-create-collect-sosreport-in-linux/ +[2]: https://www.2daygeek.com/oswbb-how-to-install-and-configure-oswatcher-black-box-for-system-diagnostics/ +[3]: https://github.com/ryran/xsos +[4]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[5]: https://www.2daygeek.com/wp-content/uploads/2019/05/xsos-a-tool-to-read-sosreport-in-linux-1.jpg diff --git a/published/20190501 Looking into Linux modules.md b/published/20190501 Looking into Linux modules.md new file mode 100644 index 0000000000..59532ccedb --- /dev/null +++ b/published/20190501 Looking into Linux modules.md @@ -0,0 +1,211 @@ +[#]: collector: (lujun9972) +[#]: translator: (LazyWolfLin) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11075-1.html) +[#]: subject: (Looking into Linux modules) +[#]: via: (https://www.networkworld.com/article/3391362/looking-into-linux-modules.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +深入学习 Linux 内核模块 +====== + +> lsmod 命令能够告诉你当前系统上加载了哪些内核模块,以及关于使用它们的一些有趣的细节。 + +![Rob Oo \(CC BY 2.0\)][1] + +### 什么是 Linux 内核模块? + +内核模块是可以根据需要加载到内核中或从内核中卸载的代码块,因此无需重启就可以扩展内核的功能。事实上,除非用户使用类似 `lsmod` 这样的命令来查询模块信息,否则用户不太可能知道内核发生的任何变化。 + +需要知道的重要一点是,在你的 Linux 系统上总会有*很多*可用的模块,并且如果你可以深入其中了解到很多细节。 + +`lsmod` 的主要用途之一是在系统不能正常工作时检查模块。然而,大多数情况下,模块会根据需要加载的,而且用户不需要知道它们如何运作。 + +### 显示内核模块 + +显示内核模块最简单的方法是使用 `lsmod` 命令。虽然这个命令包含了很多细节,但输出却是非常用户友好。 + +``` +$ lsmod +Module Size Used by +snd_hda_codec_realtek 114688 1 +snd_hda_codec_generic 77824 1 snd_hda_codec_realtek +ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek +snd_hda_codec_hdmi 53248 1 +snd_hda_intel 40960 2 +snd_hda_codec 131072 4 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec_realtek +snd_hda_core 86016 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel + ,snd_hda_codec,snd_hda_codec_realtek +snd_hwdep 20480 1 snd_hda_codec +snd_pcm 102400 4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda + _core +snd_seq_midi 20480 0 +snd_seq_midi_event 16384 1 snd_seq_midi +dcdbas 20480 0 +snd_rawmidi 36864 1 snd_seq_midi +snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event +coretemp 20480 0 +snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi +snd_timer 36864 2 snd_seq,snd_pcm +kvm_intel 241664 0 +kvm 626688 1 kvm_intel +radeon 1454080 10 +irqbypass 16384 1 kvm +joydev 24576 0 +input_leds 16384 0 +ttm 102400 1 radeon +drm_kms_helper 180224 1 radeon +drm 475136 13 drm_kms_helper,radeon,ttm +snd 81920 15 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda + _codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd + _hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi +i2c_algo_bit 16384 1 radeon +fb_sys_fops 16384 1 drm_kms_helper +syscopyarea 16384 1 drm_kms_helper +serio_raw 20480 0 +sysfillrect 16384 1 drm_kms_helper +sysimgblt 16384 1 drm_kms_helper +soundcore 16384 1 snd +mac_hid 16384 0 +sch_fq_codel 20480 2 +parport_pc 40960 0 +ppdev 24576 0 +lp 20480 0 +parport 53248 3 parport_pc,lp,ppdev +ip_tables 28672 0 +x_tables 40960 1 ip_tables +autofs4 45056 2 +raid10 57344 0 +raid456 155648 0 +async_raid6_recov 24576 1 raid456 +async_memcpy 20480 2 raid456,async_raid6_recov +async_pq 24576 2 raid456,async_raid6_recov +async_xor 20480 3 async_pq,raid456,async_raid6_recov +async_tx 20480 5 async_pq,async_memcpy,async_xor,raid456,async_raid6_re + cov +xor 24576 1 async_xor +raid6_pq 114688 3 async_pq,raid456,async_raid6_recov +libcrc32c 16384 1 raid456 +raid1 45056 0 +raid0 24576 0 +multipath 20480 0 +linear 20480 0 +hid_generic 16384 0 +psmouse 151552 0 +i2c_i801 32768 0 +pata_acpi 16384 0 +lpc_ich 24576 0 +usbhid 53248 0 +hid 126976 2 usbhid,hid_generic +e1000e 245760 0 +floppy 81920 0 +``` + +在上面的输出中: + + * `Module` 显示每个模块的名称 + * `Size` 显示每个模块的大小(并不是它们占的内存大小) + * `Used by` 显示每个模块被使用的次数和使用它们的模块 + +显然,这里有*很多*模块。加载的模块数量取决于你的系统和版本以及正在运行的内容。我们可以这样计数: + +``` +$ lsmod | wc -l +67 +``` + +要查看系统中可用的模块数(不止运行当中的),试试这个命令: + +``` +$ modprobe -c | wc -l +41272 +``` + +### 与内核模块相关的其他命令 + +Linux 提供了几条用于罗列、加载及卸载、测试,以及检查模块状态的命令。 + + * `depmod` —— 生成 `modules.dep` 和映射文件 + * `insmod` —— 一个往 Linux 内核插入模块的程序 + * `lsmod` —— 显示 Linux 内核中模块状态 + * `modinfo` —— 显示 Linux 内核模块信息 + * `modprobe` —— 添加或移除 Linux 内核模块 + * `rmmod` —— 一个从 Linux 内核移除模块的程序 + +### 显示内置的内核模块 + +正如前文所说,`lsmod` 命令是显示内核模块最方便的命令。然而,也有其他方式可以显示它们。`modules.builtin` 文件中列出了所有构建在内核中的模块,在 `modprobe` 命令尝试添加文件中的模块时会使用它。注意,以下命令中的 `$(uname -r)` 提供了内核版本的名称。 + +``` +$ more /lib/modules/$(uname -r)/modules.builtin | head -10 +kernel/arch/x86/crypto/crc32c-intel.ko +kernel/arch/x86/events/intel/intel-uncore.ko +kernel/arch/x86/platform/intel/iosf_mbi.ko +kernel/mm/zpool.ko +kernel/mm/zbud.ko +kernel/mm/zsmalloc.ko +kernel/fs/binfmt_script.ko +kernel/fs/mbcache.ko +kernel/fs/configfs/configfs.ko +kernel/fs/crypto/fscrypto.ko +``` + +你可以使用 `modinfo` 获得一个模块的更多细节,虽然没有对模块提供的服务的简单说明。下面输出内容中省略了冗长的签名。 + +``` +$ modinfo floppy | head -16 +filename: /lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +alias: block-major-2-* +license: GPL +author: Alain L. Knaff +srcversion: EBEAA26742DF61790588FD9 +alias: acpi*:PNP0700:* +alias: pnp:dPNP0700* +depends: +retpoline: Y +intree: Y +name: floppy +vermagic: 5.0.0-13-generic SMP mod_unload +sig_id: PKCS#7 +signer: +sig_key: +sig_hashalgo: md4 +``` + +你可以使用 `modprobe` 命令加载或卸载模块。使用下面这条命令,你可以找到特定模块关联的内核对象: + +``` +$ find /lib/modules/$(uname -r) -name floppy* +/lib/modules/5.0.0-13-generic/kernel/drivers/block/floppy.ko +``` + +如果你想要加载模块,你可以使用这个命令: + +``` +$ sudo modprobe floppy +``` + +### 总结 + +很明显,内核模块的加载和卸载非常重要。它使得 Linux 系统比使用通用内核运行时更加灵活和高效。这同样意味着你可以进行重大更改而无需重启,例如添加硬件。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391362/looking-into-linux-modules.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[LazyWolfLin](https://github.com/LazyWolfLin) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/modules-100794941-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md b/published/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md new file mode 100644 index 0000000000..6b950bc807 --- /dev/null +++ b/published/20190505 Blockchain 2.0 - Public Vs Private Blockchain Comparison -Part 7.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (zionfuo) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11080-1.html) +[#]: subject: (Blockchain 2.0 – Public Vs Private Blockchain Comparison [Part 7]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +区块链 2.0:公有链与私有链(七) +====== + +![Public vs Private blockchain][1] + +[区块链 2.0][2]系列的前一篇文章探索了[智能合同的现状][3]。这篇文章旨在揭示可以创建的不同类型的区块链。它们每个都用于非常不同的应用程序,并且根据用例的不同,每个应用程序所遵循的协议也不同。现在,让我们将公有链之于私有链对比一下开源软件之于专有技术。 + +正如我们所知,基于区块链的分布式分类账本的基本三层结构如下: + +![][4] + +*图 1 – 区块链分布式账本的基本结构* + +这里提到的类型之间的差异主要归因于底层区块链其所依赖的协议。该协议规定了参与者的规则和参与的方式。 + +阅读本文时,请记住以下几点事项: + +- 任何平台的产生都是为了解决需求而生。技术应该采取最好的方向。例如,区块链具有巨大的应用价值,其中一些可能需要丢弃在其他情形中看起来很重要的功能。在这方面,**分布式存储**就是最好的例子。 +- 区块链本质上是一个数据库系统,通过时间戳和区块的形式组织数据来跟踪信息。此类区块链的创建者可以选择谁有权产出这些区块并进行修改。 +- 区块链也可以“中心化”,参与的程度可以限定于由“中央权威”认定为符合条件的人。 + +大多数区块链要么是公有的,要么是私有的。广义上说,公有链可以被认为是开源软件的等价物,大多数私有链可以被视为源自公有链的专有平台。下图应该会让大多数人明显地看出基本的区别。 + +![][5] + +*图 2 – 公有链/私有链与开源/专有技术的对比* + +虽然这是最受欢迎的理解。但是这并不是说所有的私有链都是从公有链中衍生出来的。 + +### 公有链 + +公有链可以被视为是一个无需许可的、开放的平台或网络。任何拥有专业知识和计算资源的人都可以参与其中。这将产生以下影响: + +- 任何人都可以加入公有链网络并参与到其中。“参与者” 所需要的只是稳定的网络资源和计算资源。 +- 参与行为包括了读取、写入、验证和提供交易期间的共识。比特币矿工就是很好的例子。作为网络的参与者,矿工会得到比特币作为回报。 +- 平台完全去中心,完全冗余。 +- 由于去中心化,没有一个实体可以完全控制分类账本中记录的数据。所有 (或大多数) 参与者都需要通过验证区块的方式检查数据。 +- 这意味着,一旦信息被验证和记录,就不能轻易改变。即使能改变,也不可能不留下痕迹。 +- 在比特币和莱特币等平台上,参与者的身份仍然是匿名的。设计这些平台的目的是保护和保护用户身份。这主要是由上层协议栈提供的功能。 +- 公有链有比特币、莱特币、以太坊等不同的网络。 +- 广泛的去中心化意味着,在区块链分布式网络实现的交易,获得共识可能需要一段时间,对于旨在每时每刻都在推动大量交易的大型企业来说,吞吐量可能是一个挑战。 +- 开放式参与,使比特币等公有链中的大量参与者,往往会增加对计算设备和能源成本的初始投资。 +- 公有链以设计安全著称。它们的实现依靠以下几点: + - 匿名参与者 + - 多个节点上的分布式和冗余的加密存储 + - 创建和更改数据需要大量的共识 + +### 私有链 + +相比之下,私有链是一个*被许可的区块链**。这意味着: + +- 参与网络的许可受到限制,并由监督网络的所有者或机构主持。这意味着,即使个人能够存储数据并进行交易(例如,发送和接收付款),这些交易的验证和存储也只能由选定的参与者来完成。 +- 参与者一旦获得中心机构的许可,将受到条款的限制。例如,在金融机构运营的私有链网络中,并不是每个客户都可以访问整个区块链的分布式账本,甚至在那些获得许可的客户中吗,也不是每个人都能访问所有的东西。在这种情况下,中心机构将授予访问选择服务的权限。这通常被称为 “**通道**”。 +- 与公有链相比,这种系统具有更大的吞吐量能力,也展示了更快的交易速度,因为区块只需要由少数几个人验证。 + +私有链通常在其协议中没有任何特征。这使得该系统仅与目前使用的大多数基于云的数据库系统一样安全。 + +### 智者的观点 + +需要注意的一点是,它们被命名为公有或私有(或开源、闭源)的事实与底层代码库无关。在这两种情况下,平台所基于的代码或文字基础可能是公开的,也可能不是公开的。R3 是一家 DLT(分布式分类账本**D**istributed **L**edger **T**echnology)公司,领导着由 200 多家跨国机构组成的公有财团。他们的目标是在金融和商业领域进一步发展区块链和相关分布式账本技术。corda 是这一共同努力的产物。R3 将 corda 定义为专门为企业构建的区块链平台。其代码库同样是开源的,鼓励世界各地的开发人员为这个项目做出贡献。然而,考虑到 corda 面临的业务性质和旨在满足的需求,corda 被归类为许可的封闭区块链平台。这意味着企业可以在部署后选择网络的参与者,并通过使用原生可用的智能合约工具选择这些参与者可以访问的信息类型。 + +虽然像比特币和以太坊这样的公有链负责该领域的广泛认知和发展,但仍然可以认为,为企业或商业环境中的特定用例设计的私有链将在短期内引领货币投资。这些都是我们大多数人在不久的将来会看到以实际方式运用起来的平台。 + +请继续阅读本系列中下一篇有关 Hyperledger 项目的文章。 + +- [区块链 2.0:Hyperledger(HLP)项目介绍][6] + +我们正在研究更多有趣的区块链技术话题。敬请期待! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ + +作者:[ostechnix][a] +选题:[lujun9972][b] +译者:[zionfuo](https://github.com/zionfuo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Public-Vs-Private-Blockchain-720x340.png +[2]: https://linux.cn/article-10650-1.html +[3]: https://linux.cn/article-11013-1.html +[4]: http://www.ostechnix.com/wp-content/uploads/2019/04/blockchain-architecture.png +[5]: http://www.ostechnix.com/wp-content/uploads/2019/04/Public-vs-Private-blockchain-comparison.png +[6]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ diff --git a/published/20190513 When to be concerned about memory levels on Linux.md b/published/20190513 When to be concerned about memory levels on Linux.md new file mode 100644 index 0000000000..dc63f7089f --- /dev/null +++ b/published/20190513 When to be concerned about memory levels on Linux.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (luuming) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11067-1.html) +[#]: subject: (When to be concerned about memory levels on Linux) +[#]: via: (https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +何时需要关注 Linux 的内存用量? +====== + +> Linux 上的内存管理很复杂。尽管使用率高但未必存在问题。你也应当关注一些其他的事情。 + +![](https://img.linux.net.cn/data/attachment/album/201907/06/173913n6rjbxwj6bfrjxwx.jpg) + +在 Linux 上用光内存通常并不意味着存在严重的问题。为什么?因为健康的 Linux 系统会在内存中缓存磁盘活动,基本上占用掉了未被使用的内存,这显然是一件好事情。 + +换句话说,它不让内存浪费掉。使用空闲的内存增加磁盘访问速度,并且不占用运行中应用程序的内存。你也能够想到,使用这种内存缓存比起直接访问硬盘驱动器(HDD)快上数百倍,也比明显快于直接访问固态硬盘驱动。内存占满或几乎占满通常意味着系统正在尽可能高效地运行当中 —— 并不是运行中遇到了问题。 + +### 缓存如何工作 + +磁盘缓存简单地意味着系统充分利用未使用的资源(空闲内存)来加速磁盘读取与写入。应用程序不会失去任何东西,并且大多数时间里能够按需求获得更多的内存。此外,磁盘缓存不会导致应用程序转而使用交换分区。反而,用作磁盘缓存的内存空间当被需要时会立即归还,并且磁盘内容会被更新。 + +### 主要和次要的页故障 + +Linux 系统通过分割物理内存来为进程分配空间,将分割成的块称为“页”,并且映射这些页到每个进程的虚拟内存上。不再会用到的页也许会从内存中移除,尽管相关的进程还在运行。当进程需要一个没有被映射或没在内存中页时,故障便会产生。所以,这个“故障fault”并不意味着“错误error”而是“不可用unavailables”,并且故障在内存管理中扮演者一个重要的角色。 + +次要故障意味着在内存中的页未分配给请求的进程,或未在内存管理单元中标记为出现。主要故障意味着页没有保留在内存中。 + +如果你想切身感受一下次要页故障和主要页故障出现的频率,像这样试一下 `ps` 命令。注意我们要的是与页故障和产生它的命令相关的项。输出中省略了很多行。`MINFL` 显示出次要故障的数目,而 `MAJFL` 表示了主要故障的数目。 + +``` +$ ps -eo min_flt,maj_flt,cmd + MINFL MAJFL CMD +230760 150 /usr/lib/systemd/systemd --switched-root --system --deserialize 18 + 0 0 [kthreadd] + 0 0 [rcu_gp] + 0 0 [rcu_par_gp] + 0 0 [kworker/0:0H-kblockd] + ... + 166 20 gpg-agent --homedir /var/lib/fwupd/gnupg --use-standard-socket --daemon + 525 1 /usr/libexec/gvfsd-trash --spawner :1.16 /org/gtk/gvfs/exec_spaw/0 + 4966 4 /usr/libexec/gnome-terminal-server + 3617 0 bash + 0 0 [kworker/1:0H-kblockd] + 927 0 gdm-session-worker [pam/gdm-password] +``` + +汇报单一进程,你可以尝试这样的命令(LCTT 译注:参数里面的 `1` 是要查看的进程的 PID): + +``` +$ ps -o min_flt,maj_flt 1 + MINFL MAJFL +230064 150 +``` + +你也可以添加其他的显示字段,例如进程所有者的 UID 和 GID。 + +``` +$ ps -o min_flt,maj_flt,cmd,args,uid,gid 1 + MINFL MAJFL CMD COMMAND UID GID +230064 150 /usr/lib/systemd/systemd -- /usr/lib/systemd/systemd -- 0 0 +``` + +### 多少才算满? + +一种较好的方法来掌握内存究竟使用了多少是用 `free -m` 命令。`-m` 选项指定了数字的单位是 MiBmebibyte 而不是字节。 + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +注意 `free`(未使用)的内存可能会不足,而 `available`(可用于启动新的应用)会显示更大的数量。这两者的区别值得我们去关注。可用available意味着它可以在需要时恢复使用,而空闲free意味着现在就能够使用。 + +### 什么时候要担心 + +如果 Linux 系统上的性能表现良好 —— 应用程序响应度高,命令行没有显示出问题 —— 很可能系统状况良好。记住,一些应用也许会出于某种原因而变慢,但它不影响整个系统。 + +过多的硬故障也许表明确实存在问题,但要将其与观察到的性能相比较。 + +一个好的方法是当可用内存接近 0 或者“用作交换swap used”项显著增长或波动时开始担心。如果“可用”项占总内存可用量的百分比合理,那么就无需担心,就像下面的例子那样: + +``` +$ free -m + total used free shared buff/cache available +Mem: 3244 3069 35 49 140 667 +Swap: 3535 0 3535 +``` + +### Linux 性能很复杂 + +抛开这些不说,Linux 系统上的内存可能会变满,并且性能可能会降低。当系统出现问题时不要仅将单一的内存使用报告作为指标。 + +Linux 系统的内存管理很复杂,因为它采取的措施需要确保系统资源得到最好的利用。不要受到一开始内存占满的欺骗,使你认为系统存在问题,但实际上并没有。 + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394603/when-to-be-concerned-about-memory-levels-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/full-swimming-pool-100796221-large.jpg +[2]: https://www.networkworld.com/article/3391029/must-know-linux-commands.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/20190531 Use Firefox Send with ffsend in Fedora.md b/published/20190531 Use Firefox Send with ffsend in Fedora.md new file mode 100644 index 0000000000..e5c11d0d8d --- /dev/null +++ b/published/20190531 Use Firefox Send with ffsend in Fedora.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11042-1.html) +[#]: subject: (Use Firefox Send with ffsend in Fedora) +[#]: via: (https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/) +[#]: author: (Sylvia Sánchez https://fedoramagazine.org/author/lailah/) + +在 Fedora 中利用 ffsend 使用 Firefox Send +====== + +![][1] + +`ffsend` 是 Firefox Send 的命令行客户端。本文将展示 Firefox Send 和 `ffsend` 如何工作。还会详细介绍如何在 Fedora 中安装和使用它。 + +### 什么是 Firefox Send 和 ffsend? + +Firefox Send 是 Mozilla 的一个文件共享工具,它能将加密文件发送给其他用户。你可以在自己的服务器上安装 Send,也可以使用 Mozilla 托管的链接 [send.firefox.com][2]。它最大支持 1GB 的文件,链接会在可配置的下载次数(默认值为 1)或 24 小时后过期,然后会删除发送服务器上的所有文件。此工具仍*处于实验阶段*,因此不应在生产中使用或共享重要或敏感数据。 + +虽然 Firefox Send 本身就是工具,并且可以在 Web 中使用,但 `ffsend` 是一个可以与脚本和参数一起使用的命令行程序。它有多种配置选项,并且可以在后台工作而无需任何人为干预。 + +### 它如何工作? + +`ffsend` 可以上传和下载文件。远程主机可以使用 Firefox 工具或其他 Web 浏览器来下载文件。 Firefox Send 和 `ffsend` 都不需要使用 Firefox。 + +值得一提 `ffsend` 使用了客户端加密。这意味着文件在上传*前*被加密。链接中就有密钥,因此在共享时要小心,因为任何有链接的人都可以下载该文件。作为额外的保护,你可以使用以下参数使用密码保护文件: + +``` +ffsend password URL -p PASSWORD +``` + +### 其他功能 + +还有一些值得一提的其他功能: + +* 链接到期前可配置的下载限制,范围从 1 到 20 次之间 +* 内置解压和归档功能 +* 跟踪共享文件的历史记录 +* 检查或删除共享文件 +* 文件夹也可以按原样共享,也可以作为压缩文件共享 +* 生成 QR 码,便于在手机上下载 + +### 如何在 Fedora 中安装 + +虽然 Fedora Send 可以在 Firefox 中使用而无需安装其他,但你需要安装 CLI 工具才能使用 `ffsend`。此工具在官方仓库中,因此你只需使用 `dnf` 命令,并使用 [sudo][3]。 + +``` +$ sudo dnf install ffsend +``` + +之后,你可以在终端使用 `ffsend`。 + + +### 上传文件 + +上传文件很简单。 + +``` +$ ffsend upload /etc/os-release +Upload complete +Share link: https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +``` + +现在可以使用 “Share link” URL 轻松共享该文件。 + +### 下载文件 + +下载文件和上传一样简单。 + +``` +$ ffsend download https://send.firefox.com/download/05826227d70b9a4b/#RM_HSBq6kuyeBem8Z013mg +Download complete +``` + +在下载之前,检查文件是否存在并获取有关它的信息会有用。`ffsend` 为此提供了 2 个方便的命令。 + +``` +$ ffsend exists https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +Exists: true +Password: false +$ ffsend info https://send.firefox.com/download/88a6324e2a99ebb6/#YRJDh8ZDQsnZL2KZIA-PaQ +ID: 88a6324e2a99ebb6 +Downloads: 0 of 1 +Expiry: 23h59m (86388s +``` + +### 上传历史 + +`ffsend` 还提供了一种查看使用工具上传的历史记录的方法。例如,如果你用脚本上传了大量文件并且想要跟踪每个文件的下载状态,那么这非常有用。 + +``` +$ ffsend history +LINK EXPIRY + 1 https://send.firefox.com/download/#8TJ9QNw 23h59m + 2 https://send.firefox.com/download/KZIA-PaQ 23h54m +``` + +### 删除文件 + +另一个有用的功能是删除文件。 + +``` +ffsend delete https://send.firefox.com/download/2d9faa7f34bb1478/#phITKvaYBjCGSRI8TJ9QNw +``` + +Firefox Send 是一项很棒的服务,`ffsend` 使得它在终端使用起来非常方便。[Gitlab 仓库][4]中有关于 `ffsend` 的更多示例和文档。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-firefox-send-with-ffsend-in-fedora/ + +作者:[Sylvia Sánchez][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://fedoramagazine.org/author/lailah/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/firefox-send-816x345.png +[2]: http://send.firefox.com/ +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://gitlab.com/timvisee/ffsend diff --git a/published/201906/20170410 Writing a Time Series Database from Scratch.md b/published/201906/20170410 Writing a Time Series Database from Scratch.md new file mode 100644 index 0000000000..9093e4dc2a --- /dev/null +++ b/published/201906/20170410 Writing a Time Series Database from Scratch.md @@ -0,0 +1,484 @@ +从零写一个时间序列数据库 +================== + +编者按:Prometheus 是 CNCF 旗下的开源监控告警解决方案,它已经成为 Kubernetes 生态圈中的核心监控系统。本文作者 Fabian Reinartz 是 Prometheus 的核心开发者,这篇文章是其于 2017 年写的一篇关于 Prometheus 中的时间序列数据库的设计思考,虽然写作时间有点久了,但是其中的考虑和思路非常值得参考。长文预警,请坐下来慢慢品味。 + +--- + +![](https://img.linux.net.cn/data/attachment/album/201906/11/180646l7cqbhazqs7nsqsn.jpg) + +我从事监控工作。特别是在 [Prometheus][2] 上,监控系统包含一个自定义的时间序列数据库,并且集成在 [Kubernetes][3] 上。 + +在许多方面上 Kubernetes 展现出了 Prometheus 所有的设计用途。它使得持续部署continuous deployments弹性伸缩auto scaling和其他高动态环境highly dynamic environments下的功能可以轻易地访问。查询语句和操作模型以及其它概念决策使得 Prometheus 特别适合这种环境。但是,如果监控的工作负载动态程度显著地增加,这就会给监控系统本身带来新的压力。考虑到这一点,我们就可以特别致力于在高动态或瞬态服务transient services环境下提升它的表现,而不是回过头来解决 Prometheus 已经解决的很好的问题。 + +Prometheus 的存储层在历史以来都展现出卓越的性能,单一服务器就能够以每秒数百万个时间序列的速度摄入多达一百万个样本,同时只占用了很少的磁盘空间。尽管当前的存储做的很好,但我依旧提出一个新设计的存储子系统,它可以修正现存解决方案的缺点,并具备处理更大规模数据的能力。 + +> 备注:我没有数据库方面的背景。我说的东西可能是错的并让你误入歧途。你可以在 Freenode 的 #prometheus 频道上对我(fabxc)提出你的批评。 + +## 问题,难题,问题域 + +首先,快速地概览一下我们要完成的东西和它的关键难题。我们可以先看一下 Prometheus 当前的做法 ,它为什么做的这么好,以及我们打算用新设计解决哪些问题。 + +### 时间序列数据 + +我们有一个收集一段时间数据的系统。 + +``` +identifier -> (t0, v0), (t1, v1), (t2, v2), (t3, v3), .... +``` + +每个数据点是一个时间戳和值的元组。在监控中,时间戳是一个整数,值可以是任意数字。64 位浮点数对于计数器和测量值来说是一个好的表示方法,因此我们将会使用它。一系列严格单调递增的时间戳数据点是一个序列,它由标识符所引用。我们的标识符是一个带有标签维度label dimensions字典的度量名称。标签维度划分了单一指标的测量空间。每一个指标名称加上一个唯一标签集就成了它自己的时间序列,它有一个与之关联的数据流value stream。 + +这是一个典型的序列标识符series identifier集,它是统计请求指标的一部分: + +``` +requests_total{path="/status", method="GET", instance=”10.0.0.1:80”} +requests_total{path="/status", method="POST", instance=”10.0.0.3:80”} +requests_total{path="/", method="GET", instance=”10.0.0.2:80”} +``` + +让我们简化一下表示方法:度量名称可以当作另一个维度标签,在我们的例子中是 `__name__`。对于查询语句,可以对它进行特殊处理,但与我们存储的方式无关,我们后面也会见到。 + +``` +{__name__="requests_total", path="/status", method="GET", instance=”10.0.0.1:80”} +{__name__="requests_total", path="/status", method="POST", instance=”10.0.0.3:80”} +{__name__="requests_total", path="/", method="GET", instance=”10.0.0.2:80”} +``` + +我们想通过标签来查询时间序列数据。在最简单的情况下,使用 `{__name__="requests_total"}` 选择所有属于 `requests_total` 指标的数据。对于所有选择的序列,我们在给定的时间窗口内获取数据点。 + +在更复杂的语句中,我们或许想一次性选择满足多个标签的序列,并且表示比相等条件更复杂的情况。例如,非语句(`method!="GET"`)或正则表达式匹配(`method=~"PUT|POST"`)。 + +这些在很大程度上定义了存储的数据和它的获取方式。 + +### 纵与横 + +在简化的视图中,所有的数据点可以分布在二维平面上。水平维度代表着时间,序列标识符域经纵轴展开。 + +``` +series + ^ + | . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} + | . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} + | . . . . . . . + | . . . . . . . . . . . . . . . . . . . ... + | . . . . . . . . . . . . . . . . . . . . . + | . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} + | . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} + | . . . . . . . . . . . . . . + | . . . . . . . . . . . . . . . . . . . ... + | . . . . . . . . . . . . . . . . . . . . + v + <-------------------- time ---------------------> +``` + +Prometheus 通过定期地抓取一组时间序列的当前值来获取数据点。我们从中获取到的实体称为目标。因此,写入模式完全地垂直且高度并发,因为来自每个目标的样本是独立摄入的。 + +这里提供一些测量的规模:单一 Prometheus 实例从数万个目标中收集数据点,每个数据点都暴露在数百到数千个不同的时间序列中。 + +在每秒采集数百万数据点这种规模下,批量写入是一个不能妥协的性能要求。在磁盘上分散地写入单个数据点会相当地缓慢。因此,我们想要按顺序写入更大的数据块。 + +对于旋转式磁盘,它的磁头始终得在物理上向不同的扇区上移动,这是一个不足为奇的事实。而虽然我们都知道 SSD 具有快速随机写入的特点,但事实上它不能修改单个字节,只能写入一页或更多页的 4KiB 数据量。这就意味着写入 16 字节的样本相当于写入满满一个 4Kib 的页。这一行为就是所谓的[写入放大][4],这种特性会损耗你的 SSD。因此它不仅影响速度,而且还毫不夸张地在几天或几个周内破坏掉你的硬件。 + +关于此问题更深层次的资料,[“Coding for SSDs”系列][5]博客是极好的资源。让我们想想主要的用处:顺序写入和批量写入分别对于旋转式磁盘和 SSD 来说都是理想的写入模式。大道至简。 + +查询模式比起写入模式明显更不同。我们可以查询单一序列的一个数据点,也可以对 10000 个序列查询一个数据点,还可以查询一个序列几个周的数据点,甚至是 10000 个序列几个周的数据点。因此在我们的二维平面上,查询范围不是完全水平或垂直的,而是二者形成矩形似的组合。 + +[记录规则][6]可以减轻已知查询的问题,但对于点对点ad-hoc查询来说并不是一个通用的解决方法。 + +我们知道我们想要批量地写入,但我们得到的仅仅是一系列垂直数据点的集合。当查询一段时间窗口内的数据点时,我们不仅很难弄清楚在哪才能找到这些单独的点,而且不得不从磁盘上大量随机的地方读取。也许一条查询语句会有数百万的样本,即使在最快的 SSD 上也会很慢。读入也会从磁盘上获取更多的数据而不仅仅是 16 字节的样本。SSD 会加载一整页,HDD 至少会读取整个扇区。不论哪一种,我们都在浪费宝贵的读取吞吐量。 + +因此在理想情况下,同一序列的样本将按顺序存储,这样我们就能通过尽可能少的读取来扫描它们。最重要的是,我们仅需要知道序列的起始位置就能访问所有的数据点。 + +显然,将收集到的数据写入磁盘的理想模式与能够显著提高查询效率的布局之间存在着明显的抵触。这是我们 TSDB 需要解决的一个基本问题。 + +#### 当前的解决方法 + +是时候看一下当前 Prometheus 是如何存储数据来解决这一问题的,让我们称它为“V2”。 + +我们创建一个时间序列的文件,它包含所有样本并按顺序存储。因为每几秒附加一个样本数据到所有文件中非常昂贵,我们在内存中打包 1Kib 样本序列的数据块,一旦打包完成就附加这些数据块到单独的文件中。这一方法解决了大部分问题。写入目前是批量的,样本也是按顺序存储的。基于给定的同一序列的样本相对之前的数据仅发生非常小的改变这一特性,它还支持非常高效的压缩格式。Facebook 在他们 Gorilla TSDB 上的论文中描述了一个相似的基于数据块的方法,并且[引入了一种压缩格式][7],它能够减少 16 字节的样本到平均 1.37 字节。V2 存储使用了包含 Gorilla 变体等在内的各种压缩格式。 + +``` + +----------+---------+---------+---------+---------+ series A + +----------+---------+---------+---------+---------+ + +----------+---------+---------+---------+---------+ series B + +----------+---------+---------+---------+---------+ + . . . + +----------+---------+---------+---------+---------+---------+ series XYZ + +----------+---------+---------+---------+---------+---------+ + chunk 1 chunk 2 chunk 3 ... +``` + +尽管基于块存储的方法非常棒,但为每个序列保存一个独立的文件会给 V2 存储带来麻烦,因为: + +* 实际上,我们需要的文件比当前收集数据的时间序列数量要多得多。多出的部分在序列分流Series Churn上。有几百万个文件,迟早会使用光文件系统中的 [inode][1]。这种情况我们只能通过重新格式化来恢复磁盘,这种方式是最具有破坏性的。我们通常不想为了适应一个应用程序而格式化磁盘。 +* 即使是分块写入,每秒也会产生数千块的数据块并且准备持久化。这依然需要每秒数千次的磁盘写入。尽管通过为每个序列打包好多个块来缓解,但这反过来还是增加了等待持久化数据的总内存占用。 +* 要保持所有文件打开来进行读写是不可行的。特别是因为 99% 的数据在 24 小时之后不再会被查询到。如果查询它,我们就得打开数千个文件,找到并读取相关的数据点到内存中,然后再关掉。这样做就会引起很高的查询延迟,数据块缓存加剧会导致新的问题,这一点在“资源消耗”一节另作讲述。 +* 最终,旧的数据需要被删除,并且数据需要从数百万文件的头部删除。这就意味着删除实际上是写密集型操作。此外,循环遍历数百万文件并且进行分析通常会导致这一过程花费数小时。当它完成时,可能又得重新来过。喔天,继续删除旧文件又会进一步导致 SSD 产生写入放大。 +* 目前所积累的数据块仅维持在内存中。如果应用崩溃,数据就会丢失。为了避免这种情况,内存状态会定期的保存在磁盘上,这比我们能接受数据丢失窗口要长的多。恢复检查点也会花费数分钟,导致很长的重启周期。 + +我们能够从现有的设计中学到的关键部分是数据块的概念,我们当然希望保留这个概念。最新的数据块会保持在内存中一般也是好的主意。毕竟,最新的数据会大量的查询到。 + +一个时间序列对应一个文件,这个概念是我们想要替换掉的。 + +### 序列分流 + +在 Prometheus 的上下文context中,我们使用术语序列分流series churn来描述一个时间序列集合变得不活跃,即不再接收数据点,取而代之的是出现一组新的活跃序列。 + +例如,由给定微服务实例产生的所有序列都有一个相应的“instance”标签来标识其来源。如果我们为微服务执行了滚动更新rolling update,并且为每个实例替换一个新的版本,序列分流便会发生。在更加动态的环境中,这些事情基本上每小时都会发生。像 Kubernetes 这样的集群编排Cluster orchestration系统允许应用连续性的自动伸缩和频繁的滚动更新,这样也许会创建成千上万个新的应用程序实例,并且伴随着全新的时间序列集合,每天都是如此。 + +``` +series + ^ + | . . . . . . + | . . . . . . + | . . . . . . + | . . . . . . . + | . . . . . . . + | . . . . . . . + | . . . . . . + | . . . . . . + | . . . . . + | . . . . . + | . . . . . + v + <-------------------- time ---------------------> +``` + +所以即便整个基础设施的规模基本保持不变,过一段时间后数据库内的时间序列还是会成线性增长。尽管 Prometheus 很愿意采集 1000 万个时间序列数据,但要想在 10 亿个序列中找到数据,查询效果还是会受到严重的影响。 + +#### 当前解决方案 + +当前 Prometheus 的 V2 存储系统对所有当前保存的序列拥有基于 LevelDB 的索引。它允许查询语句含有给定的标签对label pair,但是缺乏可伸缩的方法来从不同的标签选集中组合查询结果。 + +例如,从所有的序列中选择标签 `__name__="requests_total"` 非常高效,但是选择  `instance="A" AND __name__="requests_total"` 就有了可伸缩性的问题。我们稍后会重新考虑导致这一点的原因和能够提升查找延迟的调整方法。 + +事实上正是这个问题才催生出了对更好的存储系统的最初探索。Prometheus 需要为查找亿万个时间序列改进索引方法。 + +### 资源消耗 + +当试图扩展 Prometheus(或其他任何事情,真的)时,资源消耗是永恒不变的话题之一。但真正困扰用户的并不是对资源的绝对渴求。事实上,由于给定的需求,Prometheus 管理着令人难以置信的吞吐量。问题更在于面对变化时的相对未知性与不稳定性。通过其架构设计,V2 存储系统缓慢地构建了样本数据块,这一点导致内存占用随时间递增。当数据块完成之后,它们可以写到磁盘上并从内存中清除。最终,Prometheus 的内存使用到达稳定状态。直到监测环境发生了改变——每次我们扩展应用或者进行滚动更新,序列分流都会增加内存、CPU、磁盘 I/O 的使用。 + +如果变更正在进行,那么它最终还是会到达一个稳定的状态,但比起更加静态的环境,它的资源消耗会显著地提高。过渡时间通常为数个小时,而且难以确定最大资源使用量。 + +为每个时间序列保存一个文件这种方法也使得一个单个查询就很容易崩溃 Prometheus 进程。当查询的数据没有缓存在内存中,查询的序列文件就会被打开,然后将含有相关数据点的数据块读入内存。如果数据量超出内存可用量,Prometheus 就会因 OOM 被杀死而退出。 + +在查询语句完成之后,加载的数据便可以被再次释放掉,但通常会缓存更长的时间,以便更快地查询相同的数据。后者看起来是件不错的事情。 + +最后,我们看看之前提到的 SSD 的写入放大,以及 Prometheus 是如何通过批量写入来解决这个问题的。尽管如此,在许多地方还是存在因为批量太小以及数据未精确对齐页边界而导致的写入放大。对于更大规模的 Prometheus 服务器,现实当中会发现缩减硬件寿命的问题。这一点对于高写入吞吐量的数据库应用来说仍然相当普遍,但我们应该放眼看看是否可以解决它。 + +### 重新开始 + +到目前为止我们对于问题域、V2 存储系统是如何解决它的,以及设计上存在的问题有了一个清晰的认识。我们也看到了许多很棒的想法,这些或多或少都可以拿来直接使用。V2 存储系统相当数量的问题都可以通过改进和部分的重新设计来解决,但为了好玩(当然,在我仔细的验证想法之后),我决定试着写一个完整的时间序列数据库——从头开始,即向文件系统写入字节。 + +性能与资源使用这种最关键的部分直接影响了存储格式的选取。我们需要为数据找到正确的算法和磁盘布局来实现一个高性能的存储层。 + +这就是我解决问题的捷径——跳过令人头疼、失败的想法,数不尽的草图,泪水与绝望。 + +### V3—宏观设计 + +我们存储系统的宏观布局是什么?简而言之,是当我们在数据文件夹里运行 `tree` 命令时显示的一切。看看它能给我们带来怎样一副惊喜的画面。 + +``` +$ tree ./data +./data ++-- b-000001 +| +-- chunks +| | +-- 000001 +| | +-- 000002 +| | +-- 000003 +| +-- index +| +-- meta.json ++-- b-000004 +| +-- chunks +| | +-- 000001 +| +-- index +| +-- meta.json ++-- b-000005 +| +-- chunks +| | +-- 000001 +| +-- index +| +-- meta.json ++-- b-000006 + +-- meta.json + +-- wal + +-- 000001 + +-- 000002 + +-- 000003 +``` + +在最顶层,我们有一系列以 `b-` 为前缀编号的block。每个块中显然保存了索引文件和含有更多编号文件的 `chunk` 文件夹。`chunks` 目录只包含不同序列数据点的原始块raw chunks of data points。与 V2 存储系统一样,这使得通过时间窗口读取序列数据非常高效并且允许我们使用相同的有效压缩算法。这一点被证实行之有效,我们也打算沿用。显然,这里并不存在含有单个序列的文件,而是一堆保存着许多序列的数据块。 + +`index` 文件的存在应该不足为奇。让我们假设它拥有黑魔法,可以让我们找到标签、可能的值、整个时间序列和存放数据点的数据块。 + +但为什么这里有好几个文件夹都是索引和块文件的布局?并且为什么存在最后一个包含 `wal` 文件夹?理解这两个疑问便能解决九成的问题。 + +#### 许多小型数据库 + +我们分割横轴,即将时间域分割为不重叠的块。每一块扮演着完全独立的数据库,它包含该时间窗口所有的时间序列数据。因此,它拥有自己的索引和一系列块文件。 + +``` + +t0 t1 t2 t3 now + +-----------+ +-----------+ +-----------+ +-----------+ + | | | | | | | | +------------+ + | | | | | | | mutable | <--- write ---- ┤ Prometheus | + | | | | | | | | +------------+ + +-----------+ +-----------+ +-----------+ +-----------+ ^ + +--------------+-------+------+--------------+ | + | query + | | + merge -------------------------------------------------+ +``` + +每一块的数据都是不可变的immutable。当然,当我们采集新数据时,我们必须能向最近的块中添加新的序列和样本。对于该数据块,所有新的数据都将写入内存中的数据库中,它与我们的持久化的数据块一样提供了查找属性。内存中的数据结构可以高效地更新。为了防止数据丢失,所有传入的数据同样被写入临时的预写日志write ahead log中,这就是 `wal` 文件夹中的一些列文件,我们可以在重新启动时通过它们重新填充内存数据库。 + +所有这些文件都带有序列化格式,有我们所期望的所有东西:许多标志、偏移量、变体和 CRC32 校验和。纸上得来终觉浅,绝知此事要躬行。 + +这种布局允许我们扩展查询范围到所有相关的块上。每个块上的部分结果最终合并成完整的结果。 + +这种横向分割增加了一些很棒的功能: + +* 当查询一个时间范围,我们可以简单地忽略所有范围之外的数据块。通过减少需要检查的数据集,它可以初步解决序列分流的问题。 +* 当完成一个块,我们可以通过顺序的写入大文件从内存数据库中保存数据。这样可以避免任何的写入放大,并且 SSD 与 HDD 均适用。 +* 我们延续了 V2 存储系统的一个好的特性,最近使用而被多次查询的数据块,总是保留在内存中。 +* 很好,我们也不再受限于 1KiB 的数据块尺寸,以使数据在磁盘上更好地对齐。我们可以挑选对单个数据点和压缩格式最合理的尺寸。 +* 删除旧数据变得极为简单快捷。我们仅仅只需删除一个文件夹。记住,在旧的存储系统中我们不得不花数个小时分析并重写数亿个文件。 + +每个块还包含了 `meta.json` 文件。它简单地保存了关于块的存储状态和包含的数据,以便轻松了解存储状态及其包含的数据。 + +##### mmap + +将数百万个小文件合并为少数几个大文件使得我们用很小的开销就能保持所有的文件都打开。这就解除了对 [mmap(2)][8] 的使用的阻碍,这是一个允许我们通过文件透明地回传虚拟内存的系统调用。简单起见,你可以将其视为交换空间swap space,只是我们所有的数据已经保存在了磁盘上,并且当数据换出内存后不再会发生写入。 + +这意味着我们可以当作所有数据库的内容都视为在内存中却不占用任何物理内存。仅当我们访问数据库文件某些字节范围时,操作系统才会从磁盘上惰性加载lazy load页数据。这使得我们将所有数据持久化相关的内存管理都交给了操作系统。通常,操作系统更有资格作出这样的决定,因为它可以全面了解整个机器和进程。查询的数据可以相当积极的缓存进内存,但内存压力会使得页被换出。如果机器拥有未使用的内存,Prometheus 目前将会高兴地缓存整个数据库,但是一旦其他进程需要,它就会立刻返回那些内存。 + +因此,查询不再轻易地使我们的进程 OOM,因为查询的是更多的持久化的数据而不是装入内存中的数据。内存缓存大小变得完全自适应,并且仅当查询真正需要时数据才会被加载。 + +就个人理解,这就是当今大多数数据库的工作方式,如果磁盘格式允许,这是一种理想的方式,——除非有人自信能在这个过程中超越操作系统。我们做了很少的工作但确实从外面获得了很多功能。 + +#### 压缩 + +存储系统需要定期“切”出新块并将之前完成的块写入到磁盘中。仅在块成功的持久化之后,才会被删除之前用来恢复内存块的日志文件(wal)。 + +我们希望将每个块的保存时间设置的相对短一些(通常配置为 2 小时),以避免内存中积累太多的数据。当查询多个块,我们必须将它们的结果合并为一个整体的结果。合并过程显然会消耗资源,一个星期的查询不应该由超过 80 个的部分结果所组成。 + +为了实现两者,我们引入压缩compaction。压缩描述了一个过程:取一个或更多个数据块并将其写入一个可能更大的块中。它也可以在此过程中修改现有的数据。例如,清除已经删除的数据,或重建样本块以提升查询性能。 + +``` + +t0 t1 t2 t3 t4 now + +------------+ +----------+ +-----------+ +-----------+ +-----------+ + | 1 | | 2 | | 3 | | 4 | | 5 mutable | before + +------------+ +----------+ +-----------+ +-----------+ +-----------+ + +-----------------------------------------+ +-----------+ +-----------+ + | 1 compacted | | 4 | | 5 mutable | after (option A) + +-----------------------------------------+ +-----------+ +-----------+ + +--------------------------+ +--------------------------+ +-----------+ + | 1 compacted | | 3 compacted | | 5 mutable | after (option B) + +--------------------------+ +--------------------------+ +-----------+ +``` + +在这个例子中我们有顺序块 `[1,2,3,4]`。块 1、2、3 可以压缩在一起,新的布局将会是 `[1,4]`。或者,将它们成对压缩为 `[1,3]`。所有的时间序列数据仍然存在,但现在整体上保存在更少的块中。这极大程度地缩减了查询时间的消耗,因为需要合并的部分查询结果变得更少了。 + +#### 保留 + +我们看到了删除旧的数据在 V2 存储系统中是一个缓慢的过程,并且消耗 CPU、内存和磁盘。如何才能在我们基于块的设计上清除旧的数据?相当简单,只要删除我们配置的保留时间窗口里没有数据的块文件夹即可。在下面的例子中,块 1 可以被安全地删除,而块 2 则必须一直保留,直到它落在保留窗口边界之外。 + +``` + | + +------------+ +----+-----+ +-----------+ +-----------+ +-----------+ + | 1 | | 2 | | | 3 | | 4 | | 5 | . . . + +------------+ +----+-----+ +-----------+ +-----------+ +-----------+ + | + | + retention boundary +``` + +随着我们不断压缩先前压缩的块,旧数据越大,块可能变得越大。因此必须为其设置一个上限,以防数据块扩展到整个数据库而损失我们设计的最初优势。 + +方便的是,这一点也限制了部分存在于保留窗口内部分存在于保留窗口外的块的磁盘消耗总量。例如上面例子中的块 2。当设置了最大块尺寸为总保留窗口的 10% 后,我们保留块 2 的总开销也有了 10% 的上限。 + +总结一下,保留与删除从非常昂贵到了几乎没有成本。 + +> 如果你读到这里并有一些数据库的背景知识,现在你也许会问:这些都是最新的技术吗?——并不是;而且可能还会做的更好。 +> +> 在内存中批量处理数据,在预写日志中跟踪,并定期写入到磁盘的模式在现在相当普遍。 +> +> 我们看到的好处无论在什么领域的数据里都是适用的。遵循这一方法最著名的开源案例是 LevelDB、Cassandra、InfluxDB 和 HBase。关键是避免重复发明劣质的轮子,采用经过验证的方法,并正确地运用它们。 +> +> 脱离场景添加你自己的黑魔法是一种不太可能的情况。 + +### 索引 + +研究存储改进的最初想法是解决序列分流的问题。基于块的布局减少了查询所要考虑的序列总数。因此假设我们索引查找的复杂度是 `O(n^2)`,我们就要设法减少 n 个相当数量的复杂度,之后就相当于改进 `O(n^2)` 复杂度。——恩,等等……糟糕。 + +快速回顾一下“算法 101”课上提醒我们的,在理论上它并未带来任何好处。如果之前就很糟糕,那么现在也一样。理论是如此的残酷。 + +实际上,我们大多数的查询已经可以相当快响应。但是,跨越整个时间范围的查询仍然很慢,尽管只需要找到少部分数据。追溯到所有这些工作之前,最初我用来解决这个问题的想法是:我们需要一个更大容量的[倒排索引][9]。 + +倒排索引基于数据项内容的子集提供了一种快速的查找方式。简单地说,我可以通过标签 `app="nginx"` 查找所有的序列而无需遍历每个文件来看它是否包含该标签。 + +为此,每个序列被赋上一个唯一的 ID ,通过该 ID 可以恒定时间内检索它(`O(1)`)。在这个例子中 ID 就是我们的正向索引。 + +> 示例:如果 ID 为 10、29、9 的序列包含标签 `app="nginx"`,那么 “nginx”的倒排索引就是简单的列表 `[10, 29, 9]`,它就能用来快速地获取所有包含标签的序列。即使有 200 多亿个数据序列也不会影响查找速度。 + +简而言之,如果 `n` 是我们序列总数,`m` 是给定查询结果的大小,使用索引的查询复杂度现在就是 `O(m)`。查询语句依据它获取数据的数量 `m` 而不是被搜索的数据体 `n` 进行缩放是一个很好的特性,因为 `m` 一般相当小。 + +为了简单起见,我们假设可以在恒定时间内查找到倒排索引对应的列表。 + +实际上,这几乎就是 V2 存储系统具有的倒排索引,也是提供在数百万序列中查询性能的最低需求。敏锐的人会注意到,在最坏情况下,所有的序列都含有标签,因此 `m` 又成了 `O(n)`。这一点在预料之中,也相当合理。如果你查询所有的数据,它自然就会花费更多时间。一旦我们牵扯上了更复杂的查询语句就会有问题出现。 + +#### 标签组合 + +与数百万个序列相关的标签很常见。假设横向扩展着数百个实例的“foo”微服务,并且每个实例拥有数千个序列。每个序列都会带有标签 `app="foo"`。当然,用户通常不会查询所有的序列而是会通过进一步的标签来限制查询。例如,我想知道服务实例接收到了多少请求,那么查询语句便是 `__name__="requests_total" AND app="foo"`。 + +为了找到满足两个标签选择子的所有序列,我们得到每一个标签的倒排索引列表并取其交集。结果集通常会比任何一个输入列表小一个数量级。因为每个输入列表最坏情况下的大小为 `O(n)`,所以在嵌套地为每个列表进行暴力求解brute force solution下,运行时间为 `O(n^2)`。相同的成本也适用于其他的集合操作,例如取并集(`app="foo" OR app="bar"`)。当在查询语句上添加更多标签选择子,耗费就会指数增长到 `O(n^3)`、`O(n^4)`、`O(n^5)`……`O(n^k)`。通过改变执行顺序,可以使用很多技巧以优化运行效率。越复杂,越是需要关于数据特征和标签之间相关性的知识。这引入了大量的复杂度,但是并没有减少算法的最坏运行时间。 + +这便是 V2 存储系统使用的基本方法,幸运的是,看似微小的改动就能获得显著的提升。如果我们假设倒排索引中的 ID 都是排序好的会怎么样? + +假设这个例子的列表用于我们最初的查询: + +``` +__name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, 2000003 ] + app="foo" -> [ 1, 3, 10, 11, 12, 100, 311, 320, 1000, 1001, 10002 ] + + intersection => [ 1000, 1001 ] +``` + +它的交集相当小。我们可以为每个列表的起始位置设置游标,每次从最小的游标处移动来找到交集。当二者的数字相等,我们就添加它到结果中并移动二者的游标。总体上,我们以锯齿形扫描两个列表,因此总耗费是 `O(2n)=O(n)`,因为我们总是在一个列表上移动。 + +两个以上列表的不同集合操作也类似。因此 `k` 个集合操作仅仅改变了因子 `O(k*n)` 而不是最坏情况下查找运行时间的指数 `O(n^k)`。 + +我在这里所描述的是几乎所有[全文搜索引擎][10]使用的标准搜索索引的简化版本。每个序列描述符都视作一个简短的“文档”,每个标签(名称 + 固定值)作为其中的“单词”。我们可以忽略搜索引擎索引中通常遇到的很多附加数据,例如单词位置和和频率。 + +关于改进实际运行时间的方法似乎存在无穷无尽的研究,它们通常都是对输入数据做一些假设。不出意料的是,还有大量技术来压缩倒排索引,其中各有利弊。因为我们的“文档”比较小,而且“单词”在所有的序列里大量重复,压缩变得几乎无关紧要。例如,一个真实的数据集约有 440 万个序列与大约 12 个标签,每个标签拥有少于 5000 个单独的标签。对于最初的存储版本,我们坚持使用基本的方法而不压缩,仅做微小的调整来跳过大范围非交叉的 ID。 + +尽管维持排序好的 ID 听起来很简单,但实践过程中不是总能完成的。例如,V2 存储系统为新的序列赋上一个哈希值来当作 ID,我们就不能轻易地排序倒排索引。 + +另一个艰巨的任务是当磁盘上的数据被更新或删除掉后修改其索引。通常,最简单的方法是重新计算并写入,但是要保证数据库在此期间可查询且具有一致性。V3 存储系统通过每块上具有的独立不可变索引来解决这一问题,该索引仅通过压缩时的重写来进行修改。只有可变块上的索引需要被更新,它完全保存在内存中。 + +## 基准测试 + +我从存储的基准测试开始了初步的开发,它基于现实世界数据集中提取的大约 440 万个序列描述符,并生成合成数据点以输入到这些序列中。这个阶段的开发仅仅测试了单独的存储系统,对于快速找到性能瓶颈和高并发负载场景下的触发死锁至关重要。 + +在完成概念性的开发实施之后,该基准测试能够在我的 Macbook Pro 上维持每秒 2000 万的吞吐量 —— 并且这都是在打开着十几个 Chrome 的页面和 Slack 的时候。因此,尽管这听起来都很棒,它这也表明推动这项测试没有的进一步价值(或者是没有在高随机环境下运行)。毕竟,它是合成的数据,因此在除了良好的第一印象外没有多大价值。比起最初的设计目标高出 20 倍,是时候将它部署到真正的 Prometheus 服务器上了,为它添加更多现实环境中的开销和场景。 + +我们实际上没有可重现的 Prometheus 基准测试配置,特别是没有对于不同版本的 A/B 测试。亡羊补牢为时不晚,[不过现在就有一个了][11]! + +我们的工具可以让我们声明性地定义基准测试场景,然后部署到 AWS 的 Kubernetes 集群上。尽管对于全面的基准测试来说不是最好环境,但它肯定比 64 核 128GB 内存的专用裸机服务器bare metal servers更能反映出我们的用户群体。 + +我们部署了两个 Prometheus 1.5.2 服务器(V2 存储系统)和两个来自 2.0 开发分支的 Prometheus (V3 存储系统)。每个 Prometheus 运行在配备 SSD 的专用服务器上。我们将横向扩展的应用部署在了工作节点上,并且让其暴露典型的微服务度量。此外,Kubernetes 集群本身和节点也被监控着。整套系统由另一个 Meta-Prometheus 所监督,它监控每个 Prometheus 的健康状况和性能。 + +为了模拟序列分流,微服务定期的扩展和收缩来移除旧的 pod 并衍生新的 pod,生成新的序列。通过选择“典型”的查询来模拟查询负载,对每个 Prometheus 版本都执行一次。 + +总体上,伸缩与查询的负载以及采样频率极大的超出了 Prometheus 的生产部署。例如,我们每隔 15 分钟换出 60% 的微服务实例去产生序列分流。在现代的基础设施上,一天仅大约会发生 1-5 次。这就保证了我们的 V3 设计足以处理未来几年的工作负载。就结果而言,Prometheus 1.5.2 和 2.0 之间的性能差异在极端的环境下会变得更大。 + +总而言之,我们每秒从 850 个目标里收集大约 11 万份样本,每次暴露 50 万个序列。 + +在此系统运行一段时间之后,我们可以看一下数字。我们评估了两个版本在 12 个小时之后到达稳定时的几个指标。 + +> 请注意从 Prometheus 图形界面的截图中轻微截断的 Y 轴 + +![Heap usage GB](https://fabxc.org/tsdb/assets/heap_usage.png) + +*堆内存使用(GB)* + +内存资源的使用对用户来说是最为困扰的问题,因为它相对的不可预测且可能导致进程崩溃。 + +显然,查询的服务器正在消耗内存,这很大程度上归咎于查询引擎的开销,这一点可以当作以后优化的主题。总的来说,Prometheus 2.0 的内存消耗减少了 3-4 倍。大约 6 小时之后,在 Prometheus 1.5 上有一个明显的峰值,与我们设置的 6 小时的保留边界相对应。因为删除操作成本非常高,所以资源消耗急剧提升。这一点在下面几张图中均有体现。 + +![CPU usage cores](https://fabxc.org/tsdb/assets/cpu_usage.png) + +*CPU 使用(核心/秒)* + +类似的模式也体现在 CPU 使用上,但是查询的服务器与非查询的服务器之间的差异尤为明显。每秒获取大约 11 万个数据需要 0.5 核心/秒的 CPU 资源,比起评估查询所花费的 CPU 时间,我们的新存储系统 CPU 消耗可忽略不计。总的来说,新存储需要的 CPU 资源减少了 3 到 10 倍。 + +![Disk writes](https://fabxc.org/tsdb/assets/disk_writes.png) + +*磁盘写入(MB/秒)* + +迄今为止最引人注目和意想不到的改进表现在我们的磁盘写入利用率上。这就清楚的说明了为什么 Prometheus 1.5 很容易造成 SSD 损耗。我们看到最初的上升发生在第一个块被持久化到序列文件中的时期,然后一旦删除操作引发了重写就会带来第二个上升。令人惊讶的是,查询的服务器与非查询的服务器显示出了非常不同的利用率。 + +在另一方面,Prometheus 2.0 每秒仅向其预写日志写入大约一兆字节。当块被压缩到磁盘时,写入定期地出现峰值。这在总体上节省了:惊人的 97-99%。 + +![Disk usage](https://fabxc.org/tsdb/assets/disk_usage.png) + +*磁盘大小(GB)* + +与磁盘写入密切相关的是总磁盘空间占用量。由于我们对样本(这是我们的大部分数据)几乎使用了相同的压缩算法,因此磁盘占用量应当相同。在更为稳定的系统中,这样做很大程度上是正确地,但是因为我们需要处理高的序列分流,所以还要考虑每个序列的开销。 + +如我们所见,Prometheus 1.5 在这两个版本达到稳定状态之前,使用的存储空间因其保留操作而急速上升。Prometheus 2.0 似乎在每个序列上的开销显著降低。我们可以清楚的看到预写日志线性地充满整个存储空间,然后当压缩完成后瞬间下降。事实上对于两个 Prometheus 2.0 服务器,它们的曲线并不是完全匹配的,这一点需要进一步的调查。 + +前景大好。剩下最重要的部分是查询延迟。新的索引应当优化了查找的复杂度。没有实质上发生改变的是处理数据的过程,例如 `rate()` 函数或聚合。这些就是查询引擎要做的东西了。 + +![Query latency](https://fabxc.org/tsdb/assets/query_latency.png) + +*第 99 个百分位查询延迟(秒)* + +数据完全符合预期。在 Prometheus 1.5 上,查询延迟随着存储的序列而增加。只有在保留操作开始且旧的序列被删除后才会趋于稳定。作为对比,Prometheus 2.0 从一开始就保持在合适的位置。 + +我们需要花一些心思在数据是如何被采集上,对服务器发出的查询请求通过对以下方面的估计来选择:范围查询和即时查询的组合,进行更轻或更重的计算,访问更多或更少的文件。它并不需要代表真实世界里查询的分布。也不能代表冷数据的查询性能,我们可以假设所有的样本数据都是保存在内存中的热数据。 + +尽管如此,我们可以相当自信地说,整体查询效果对序列分流变得非常有弹性,并且在高压基准测试场景下提升了 4 倍的性能。在更为静态的环境下,我们可以假设查询时间大多数花费在了查询引擎上,改善程度明显较低。 + +![Ingestion rate](https://fabxc.org/tsdb/assets/ingestion_rate.png) + +*摄入的样本/秒* + +最后,快速地看一下不同 Prometheus 服务器的摄入率。我们可以看到搭载 V3 存储系统的两个服务器具有相同的摄入速率。在几个小时之后变得不稳定,这是因为不同的基准测试集群节点由于高负载变得无响应,与 Prometheus 实例无关。(两个 2.0 的曲线完全匹配这一事实希望足够具有说服力) + +尽管还有更多 CPU 和内存资源,两个 Prometheus 1.5.2 服务器的摄入率大大降低。序列分流的高压导致了无法采集更多的数据。 + +那么现在每秒可以摄入的绝对最大absolute maximum样本数是多少? + +但是现在你可以摄取的每秒绝对最大样本数是多少? + +我不知道 —— 虽然这是一个相当容易的优化指标,但除了稳固的基线性能之外,它并不是特别有意义。 + +有很多因素都会影响 Prometheus 数据流量,而且没有一个单独的数字能够描述捕获质量。最大摄入率在历史上是一个导致基准出现偏差的度量,并且忽视了更多重要的层面,例如查询性能和对序列分流的弹性。关于资源使用线性增长的大致猜想通过一些基本的测试被证实。很容易推断出其中的原因。 + +我们的基准测试模拟了高动态环境下 Prometheus 的压力,它比起真实世界中的更大。结果表明,虽然运行在没有优化的云服务器上,但是已经超出了预期的效果。最终,成功将取决于用户反馈而不是基准数字。 + +> 注意:在撰写本文的同时,Prometheus 1.6 正在开发当中,它允许更可靠地配置最大内存使用量,并且可能会显著地减少整体的消耗,有利于稍微提高 CPU 使用率。我没有重复对此进行测试,因为整体结果变化不大,尤其是面对高序列分流的情况。 + +## 总结 + +Prometheus 开始应对高基数序列与单独样本的吞吐量。这仍然是一项富有挑战性的任务,但是新的存储系统似乎向我们展示了未来的一些好东西。 + +第一个配备 V3 存储系统的 [alpha 版本 Prometheus 2.0][12] 已经可以用来测试了。在早期阶段预计还会出现崩溃,死锁和其他 bug。 + +存储系统的代码可以在[这个单独的项目中找到][13]。Prometheus 对于寻找高效本地存储时间序列数据库的应用来说可能非常有用,这一点令人非常惊讶。 + +> 这里需要感谢很多人作出的贡献,以下排名不分先后: + +> Bjoern Rabenstein 和 Julius Volz 在 V2 存储引擎上的打磨工作以及 V3 存储系统的反馈,这为新一代的设计奠定了基础。 + +> Wilhelm Bierbaum 对新设计不断的建议与见解作出了很大的贡献。Brian Brazil 不断的反馈确保了我们最终得到的是语义上合理的方法。与 Peter Bourgon 深刻的讨论验证了设计并形成了这篇文章。 + +> 别忘了我们整个 CoreOS 团队与公司对于这项工作的赞助与支持。感谢所有那些听我一遍遍唠叨 SSD、浮点数、序列化格式的同学。 + +-------------------------------------------------------------------------------- + +via: https://fabxc.org/blog/2017-04-10-writing-a-tsdb/ + +作者:[Fabian Reinartz][a] +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://twitter.com/fabxc +[1]:https://en.wikipedia.org/wiki/Inode +[2]:https://prometheus.io/ +[3]:https://kubernetes.io/ +[4]:https://en.wikipedia.org/wiki/Write_amplification +[5]:http://codecapsule.com/2014/02/12/coding-for-ssds-part-1-introduction-and-table-of-contents/ +[6]:https://prometheus.io/docs/practices/rules/ +[7]:http://www.vldb.org/pvldb/vol8/p1816-teller.pdf +[8]:https://en.wikipedia.org/wiki/Mmap +[9]:https://en.wikipedia.org/wiki/Inverted_index +[10]:https://en.wikipedia.org/wiki/Search_engine_indexing#Inverted_indices +[11]:https://github.com/prometheus/prombench +[12]:https://prometheus.io/blog/2017/04/10/promehteus-20-sneak-peak/ +[13]:https://github.com/prometheus/tsdb diff --git a/published/201906/20170414 5 projects for Raspberry Pi at home.md b/published/201906/20170414 5 projects for Raspberry Pi at home.md new file mode 100644 index 0000000000..3d6f5b2382 --- /dev/null +++ b/published/201906/20170414 5 projects for Raspberry Pi at home.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10936-1.html) +[#]: subject: (5 projects for Raspberry Pi at home) +[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +5 个可在家中使用的树莓派项目 +====================================== + +![5 projects for Raspberry Pi at home][1] + +[树莓派][2] 电脑可被用来进行多种设置用于不同的目的。显然它在教育市场帮助学生在教室和创客空间中学习编程与创客技巧方面占有一席之地,它在工作场所和工厂中有大量行业应用。我打算介绍五个你可能想要在你的家中构建的项目。 + +### 媒体中心 + +在家中人们常用树莓派作为媒体中心来服务多媒体文件。它很容易搭建,树莓派提供了大量的 GPU(图形处理单元)运算能力来在大屏电视上渲染你的高清电视节目和电影。将 [Kodi][3](从前的 XBMC)运行在树莓派上是一个很棒的方式,它可以播放你的硬盘或网络存储上的任何媒体。你同样可以安装一个插件来播放 YouTube 视频。 + +还有几个略微不同的选择,最常见的是 [OSMC][4](开源媒体中心)和 [LibreELEC][5],都是基于 Kodi 的。它们在放映媒体内容方面表现的都非常好,但是 OSMC 有一个更酷炫的用户界面,而 LibreElec 更轻量级。你要做的只是选择一个发行版,下载镜像并安装到一个 SD 卡中(或者仅仅使用 [NOOBS][6]),启动,然后就准备好了。 + +![LibreElec ][7] + +*LibreElec;树莓派基金会, CC BY-SA* + +![OSMC][8] + +*OSMC.tv, 版权所有, 授权使用* + +在往下走之前,你需要决定[使用哪种树莓派][9]。这些发行版在任何树莓派(1、2、3 或 Zero)上都能运行,视频播放在这些树莓派中的任何一个上都能胜任。除了 Pi 3(和 Zero W)有内置 Wi-Fi,唯一可察觉的不同是用户界面的反应速度,在 Pi 3 上更快。Pi 2 也不会慢太多,所以如果你不需要 Wi-Fi 它也是可以的,但是当切换菜单时,你会注意到 Pi 3 比 Pi 1 和 Zero 表现的更好。 + +### SSH 网关 + +如果你想从外部网络访问你的家庭局域网的电脑和设备,你必须打开这些设备的端口来允许外部访问。在互联网中开放这些端口有安全风险,意味着你总是你总是处于被攻击、滥用或者其他各种未授权访问的风险中。然而,如果你在你的网络中安装一个树莓派,并且设置端口映射来仅允许通过 SSH 访问树莓派,你可以这么用来作为一个安全的网关来跳到网络中的其他树莓派和 PC。 + +大多数路由允许你配置端口映射规则。你需要给你的树莓派一个固定的内网 IP 地址来设置你的路由器端口 22 映射到你的树莓派端口 22。如果你的网络服务提供商给你提供了一个静态 IP 地址,你能够通过 SSH 和主机的 IP 地址访问(例如,`ssh pi@123.45.56.78`)。如果你有一个域名,你可以配置一个子域名指向这个 IP 地址,所以你没必要记住它(例如,`ssh pi@home.mydomain.com`)。 + +![][11] + +然而,如果你不想将树莓派暴露在互联网上,你应该非常小心,不要让你的网络处于危险之中。如果你遵循一些简单的步骤来使它更安全: + +1. 大多数人建议你更换你的登录密码(有道理,默认密码 “raspberry” 是众所周知的),但是这不能阻挡暴力攻击。你可以改变你的密码并添加一个双重验证(所以你需要你的密码*和*一个手机生成的与时间相关的密码),这么做更安全。但是,我相信最好的方法阻止入侵者访问你的树莓派是在你的 SSH 配置中[禁止密码认证][12],这样只能通过 SSH 密匙进入。这意味着任何试图猜测你的密码尝试登录的人都不会成功。只有你的私有密匙可以访问。简单来说,很多人建议将 SSH 端口从默认的 22 换成其他的,但是通过简单的 [Nmap][13] 扫描你的 IP 地址,你信任的 SSH 端口就会暴露。 +2. 最好,不要在这个树莓派上运行其他的软件,这样你不会意外暴露其他东西。如果你想要运行其他软件,你最好在网络中的其他树莓派上运行,它们没有暴露在互联网上。确保你经常升级来保证你的包是最新的,尤其是 `openssh-server` 包,这样你的安全缺陷就被打补丁了。 +3. 安装 [sshblack][14] 或 [fail2ban][15] 来将任何表露出恶意的用户加入黑名单,例如试图暴力破解你的 SSH 密码。 + +使树莓派安全后,让它在线,你将可以在世界的任何地方登录你的网络。一旦你登录到你的树莓派,你可以用 SSH 访问本地网络上的局域网地址(例如,192.168.1.31)访问其他设备。如果你在这些设备上有密码,用密码就好了。如果它们同样只允许 SSH 密匙,你需要确保你的密匙通过 SSH 转发,使用 `-A` 参数:`ssh -A pi@123.45.67.89`。 + +### CCTV / 宠物相机 + +另一个很棒的家庭项目是安装一个相机模块来拍照和录视频,录制并保存文件,在内网或者外网中进行流式传输。你想这么做有很多原因,但两个常见的情况是一个家庭安防相机或监控你的宠物。 + +[树莓派相机模块][16] 是一个优秀的配件。它提供全高清的相片和视频,包括很多高级配置,很[容易编程][17]。[红外线相机][18]用于这种目的是非常理想的,通过一个红外线 LED(树莓派可以控制的),你就能够在黑暗中看见东西。 + +如果你想通过一定频率拍摄静态图片来留意某件事,你可以仅仅写一个简短的 [Python][19] 脚本或者使用命令行工具 [raspistill][20], 在 [Cron][21] 中规划它多次运行。你可能想将它们保存到 [Dropbox][22] 或另一个网络服务,上传到一个网络服务器,你甚至可以创建一个[web 应用][23]来显示他们。 + +如果你想要在内网或外网中流式传输视频,那也相当简单。在 [picamera 文档][24]中(在 “web streaming” 章节)有一个简单的 MJPEG(Motion JPEG)例子。简单下载或者拷贝代码到文件中,运行并访问树莓派的 IP 地址的 8000 端口,你会看见你的相机的直播输出。 + +有一个更高级的流式传输项目 [pistreaming][25] 也可以,它通过在网络服务器中用 [JSMpeg][26] (一个 JavaScript 视频播放器)和一个用于相机流的单独运行的 websocket。这种方法性能更好,并且和之前的例子一样简单,但是如果要在互联网中流式传输,则需要包含更多代码,并且需要你开放两个端口。 + +一旦你的网络流建立起来,你可以将你的相机放在你想要的地方。我用一个来观察我的宠物龟: + +![Tortoise ][27] + +*Ben Nuttall, CC BY-SA* + +如果你想控制相机位置,你可以用一个舵机。一个优雅的方案是用 Pimoroni 的 [Pan-Tilt HAT][28],它可以让你简单的在二维方向上移动相机。为了与 pistreaming 集成,可以看看该项目的 [pantilthat 分支][29]. + +![Pan-tilt][30] + +*Pimoroni.com, Copyright, 授权使用* + +如果你想将你的树莓派放到户外,你将需要一个防水的外围附件,并且需要一种给树莓派供电的方式。POE(通过以太网提供电力)电缆是一个不错的实现方式。 + +### 家庭自动化或物联网 + +现在是 2017 年(LCTT 译注:此文发表时间),到处都有很多物联网设备,尤其是家中。我们的电灯有 Wi-Fi,我们的面包烤箱比过去更智能,我们的茶壶处于俄国攻击的风险中,除非你确保你的设备安全,不然别将没有必要的设备连接到互联网,之后你可以在家中充分的利用物联网设备来完成自动化任务。 + +市场上有大量你可以购买或订阅的服务,像 Nest Thermostat 或 Philips Hue 电灯泡,允许你通过你的手机控制你的温度或者你的亮度,无论你是否在家。你可以用一个树莓派来催动这些设备的电源,通过一系列规则包括时间甚至是传感器来完成自动交互。用 Philips Hue,你做不到的当你进房间时打开灯光,但是有一个树莓派和一个运动传感器,你可以用 Python API 来打开灯光。类似地,当你在家的时候你可以通过配置你的 Nest 打开加热系统,但是如果你想在房间里至少有两个人时才打开呢?写一些 Python 代码来检查网络中有哪些手机,如果至少有两个,告诉 Nest 来打开加热器。 + +不用选择集成已存在的物联网设备,你可以用简单的组件来做的更多。一个自制的窃贼警报器,一个自动化的鸡笼门开关,一个夜灯,一个音乐盒,一个定时的加热灯,一个自动化的备份服务器,一个打印服务器,或者任何你能想到的。 + +### Tor 协议和屏蔽广告 + +Adafruit 的 [Onion Pi][31] 是一个 [Tor][32] 协议来使你的网络通讯匿名,允许你使用互联网而不用担心窥探者和各种形式的监视。跟随 Adafruit 的指南来设置 Onion Pi,你会找到一个舒服的匿名的浏览体验。 + +![Onion-Pi][33] + +*Onion-pi from Adafruit, Copyright, 授权使用* + +![Pi-hole][34] + +可以在你的网络中安装一个树莓派来拦截所有的网络交通并过滤所有广告。简单下载 [Pi-hole][35] 软件到 Pi 中,你的网络中的所有设备都将没有广告(甚至屏蔽你的移动设备应用内的广告)。 + +树莓派在家中有很多用法。你在家里用树莓派来干什么?你想用它干什么? + +在下方评论让我们知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) +[2]: https://www.raspberrypi.org/ +[3]: https://kodi.tv/ +[4]: https://osmc.tv/ +[5]: https://libreelec.tv/ +[6]: https://www.raspberrypi.org/downloads/noobs/ +[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) +[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) +[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project +[10]: mailto:pi@home.mydomain.com +[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png +[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication +[13]: https://nmap.org/ +[14]: http://www.pettingers.org/code/sshblack.html +[15]: https://www.fail2ban.org/wiki/index.php/Main_Page +[16]: https://www.raspberrypi.org/products/camera-module-v2/ +[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects +[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ +[19]: http://picamera.readthedocs.io/ +[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md +[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md +[22]: https://github.com/RZRZR/plant-cam +[23]: https://github.com/bennuttall/bett-bot +[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming +[25]: https://github.com/waveform80/pistreaming +[26]: http://jsmpeg.com/ +[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) +[28]: https://shop.pimoroni.com/products/pan-tilt-hat +[29]: https://github.com/waveform80/pistreaming/tree/pantilthat +[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) +[31]: https://learn.adafruit.com/onion-pi/overview +[32]: https://www.torproject.org/ +[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) +[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) +[35]: https://pi-hole.net/ + + + diff --git a/published/201906/20180324 Memories of writing a parser for man pages.md b/published/201906/20180324 Memories of writing a parser for man pages.md new file mode 100644 index 0000000000..ffaebad575 --- /dev/null +++ b/published/201906/20180324 Memories of writing a parser for man pages.md @@ -0,0 +1,103 @@ +为 man 手册页编写解析器的备忘录 +====== +![](https://img.linux.net.cn/data/attachment/album/201906/11/235607fiqfqapvpzqhh8n1.jpg) + +我一般都很喜欢无所事事,但有时候太无聊了也不行 —— 2015 年的一个星期天下午就是这样,我决定开始写一个开源项目来让我不那么无聊。 + +在我寻求创意时,我偶然发现了一个请求,要求构建一个由 [Mathias Bynens][2] 提出的“[按 Web 标准构建的 Man 手册页查看器][1]”。没有考虑太多,我开始使用 JavaScript 编写一个手册页解析器,经过大量的反复思考,最终做出了一个 [Jroff][3]。 + +那时候,我非常熟悉手册页这个概念,而且使用过很多次,但我知道的仅止于此,我不知道它们是如何生成的,或者是否有一个标准。在经过两年后,我有了一些关于此事的想法。 + +### man 手册页是如何写的 + +当时令我感到惊讶的第一件事是,手册页的核心只是存储在系统某处的纯文本文件(你可以使用 `manpath` 命令检查这些目录)。 + +此文件中不仅包含文档,还包含使用了 20 世纪 70 年代名为 `troff` 的排版系统的格式化信息。 + +> troff 及其 GNU 实现 groff 是处理文档的文本描述以生成适合打印的排版版本的程序。**它更像是“你所描述的即你得到的”,而不是你所见即所得的。** +> +> - 摘自 [troff.org][4] + +如果你对排版格式毫不熟悉,可以将它们视为 steroids 期刊用的 Markdown,但其灵活性带来的就是更复杂的语法: + +![groff-compressor][5] + +`groff` 文件可以手工编写,也可以使用许多不同的工具从其他格式生成,如 Markdown、Latex、HTML 等。 + +为什么 `groff` 和 man 手册页绑在一起是有历史原因的,其格式[随时间有变化][6],它的血统由一系列类似命名的程序组成:RUNOFF > roff > nroff > troff > groff。 + +但这并不一定意味着 `groff` 与手册页有多紧密的关系,它是一种通用格式,已被用于[书籍][7],甚至用于[照相排版][8]。 + +此外,值得注意的是 `groff` 也可以调用后处理器将其中间输出结果转换为最终格式,这对于终端显示来说不一定是 ascii !一些支持的格式是:TeX DVI、HTML、Canon、HP LaserJet4 兼容格式、PostScript、utf8 等等。 + +### 宏 + +该格式的其他很酷的功能是它的可扩展性,你可以编写宏来增强其基本功能。 + +鉴于 *nix 系统的悠久历史,有几个可以根据你想要生成的输出而将特定功能组合在一起的宏包,例如 `man`、`mdoc`、`mom`、`ms`、`mm` 等等。 + +手册页通常使用 `man` 和 `mdoc` 宏包编写。 + +区分原生的 `groff` 命令和宏的方式是通过标准 `groff` 包大写其宏名称。对于 `man` 宏包,每个宏的名称都是大写的,如 `.PP`、`.TH`、`.SH` 等。对于 `mdoc` 宏包,只有第一个字母是大写的: `.Pp`、`.Dt`、`.Sh`。 + +![groff-example][9] + +### 挑战 + +无论你是考虑编写自己的 `groff` 解析器,还是只是好奇,这些都是我发现的一些更具挑战性的问题。 + +#### 上下文敏感的语法 + +表面上,`groff` 的语法是上下文无关的,遗憾的是,因为宏描述的是主体不透明的令牌,所以包中的宏集合本身可能不会实现上下文无关的语法。 + +这导致我在那时做不出来一个解析器生成器(不管好坏)。 + +#### 嵌套的宏 + +`mdoc` 宏包中的大多数宏都是可调用的,这差不多意味着宏可以用作其他宏的参数,例如,你看看这个: + +* 宏 `Fl`(Flag)会在其参数中添加破折号,因此 `Fl s` 会生成 `-s` +* 宏 `Ar`(Argument)提供了定义参数的工具 +* 宏 `Op`(Optional)会将其参数括在括号中,因为这是将某些东西定义为可选的标准习惯用法 +* 以下组合 `.Op Fl s Ar file ` 将生成 `[-s file]`,因为 `Op` 宏可以嵌套。 + +#### 缺乏适合初学者的资源 + +让我感到困惑的是缺乏一个规范的、定义明确的、清晰的来源,网上有很多信息,这些信息对读者来说很重要,需要时间来掌握。 + +### 有趣的宏 + +总结一下,我会向你提供一个非常简短的宏列表,我在开发 jroff 时发现它很有趣: + +`man` 宏包: + +* `.TH`:用 `man` 宏包编写手册页时,你的第一个不是注释的行必须是这个宏,它接受五个参数:`title`、`section`、`date`、`source`、`manual`。 +* `.BI`:粗体加斜体(特别适用于函数格式) +* `.BR`:粗体加正体(特别适用于参考其他手册页) + +`mdoc` 宏包: + +* `.Dd`、`.Dt`、`.Os`:类似于 `man` 宏包需要 `.TH`,`mdoc` 宏也需要这三个宏,需要按特定顺序使用。它们的缩写分别代表:文档日期、文档标题和操作系统。 +* `.Bl`、`.It`、`.El`:这三个宏用于创建列表,它们的名称不言自明:开始列表、项目和结束列表。 + +-------------------------------------------------------------------------------- + +via: https://monades.roperzh.com/memories-writing-parser-man-pages/ + +作者:[Roberto Dip][a] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://monades.roperzh.com +[1]:https://github.com/h5bp/lazyweb-requests/issues/114 +[2]:https://mathiasbynens.be/ +[3]:jroff +[4]:https://www.troff.org/ +[5]:https://user-images.githubusercontent.com/4419992/37868021-2e74027c-2f7f-11e8-894b-80829ce39435.gif +[6]:https://manpages.bsd.lv/history.html +[7]:https://rkrishnan.org/posts/2016-03-07-how-is-gopl-typeset.html +[8]:https://en.wikipedia.org/wiki/Phototypesetting +[9]:https://user-images.githubusercontent.com/4419992/37866838-e602ad78-2f6e-11e8-97a9-2a4494c766ae.jpg diff --git a/published/201906/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/published/201906/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md new file mode 100644 index 0000000000..4afa58fffa --- /dev/null +++ b/published/201906/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md @@ -0,0 +1,191 @@ +如何使用 GParted 实用工具缩放根分区 +====== + +今天,我们将讨论磁盘分区。这是 Linux 中的一个好话题。这允许用户来重新调整在 Linux 中的活动 root 分区。 + +在这篇文章中,我们将教你如何使用 GParted 缩放在 Linux 上的活动根分区。 + +比如说,当我们安装 Ubuntu 操作系统时,并没有恰当地配置,我们的系统仅有 30 GB 磁盘。我们需要安装另一个操作系统,因此我们想在其中制作第二个分区。 + +虽然不建议重新调整活动分区。然而,我们要执行这个操作,因为没有其它方法来释放系统分区。 + +> 注意:在执行这个动作前,确保你备份了重要的数据,因为如果一些东西出错(例如,电源故障或你的系统重启),你可以得以保留你的数据。 + +### Gparted 是什么 + +[GParted][1] 是一个自由的分区管理器,它使你能够缩放、复制和移动分区,而不丢失数据。通过使用 GParted 的 Live 可启动镜像,我们可以使用 GParted 应用程序的所有功能。GParted Live 可以使你能够在 GNU/Linux 以及其它的操作系统上使用 GParted,例如,Windows 或 Mac OS X 。 + +#### 1) 使用 df 命令检查磁盘空间利用率 + +我只是想使用 `df` 命令向你显示我的分区。`df` 命令输出清楚地表明我仅有一个分区。 + +``` +$ df -h +Filesystem Size Used Avail Use% Mounted on +/dev/sda1 30G 3.4G 26.2G 16% / +none 4.0K 0 4.0K 0% /sys/fs/cgroup +udev 487M 4.0K 487M 1% /dev +tmpfs 100M 844K 99M 1% /run +none 5.0M 0 5.0M 0% /run/lock +none 498M 152K 497M 1% /run/shm +none 100M 52K 100M 1% /run/user +``` + +#### 2) 使用 fdisk 命令检查磁盘分区 + +我将使用 `fdisk` 命令验证这一点。 + +``` +$ sudo fdisk -l +[sudo] password for daygeek: + +Disk /dev/sda: 33.1 GB, 33129218048 bytes +255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors +Units = sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 512 bytes +I/O size (minimum/optimal): 512 bytes / 512 bytes +Disk identifier: 0x000473a3 + + Device Boot Start End Blocks Id System +/dev/sda1 * 2048 62609407 31303680 83 Linux +/dev/sda2 62611454 64704511 1046529 5 Extended +/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris +``` + +#### 3) 下载 GParted live ISO 镜像 + +使用下面的命令来执行下载 GParted live ISO。 + +``` +$ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso +``` + +#### 4) 使用 GParted Live 安装介质启动你的系统 + +使用 GParted Live 安装介质(如烧录的 CD/DVD 或 USB 或 ISO 镜像)启动你的系统。你将获得类似于下面屏幕的输出。在这里选择 “GParted Live (Default settings)” ,并敲击回车按键。 + +![][3] + +#### 5) 键盘选择 + +默认情况下,它选择第二个选项,按下回车即可。 + +![][4] + +#### 6) 语言选择 + +默认情况下,它选择 “33” 美国英语,按下回车即可。 + +![][5] + +#### 7) 模式选择(图形用户界面或命令行) + +默认情况下,它选择 “0” 图形用户界面模式,按下回车即可。 + +![][6] + +#### 8) 加载 GParted Live 屏幕 + +现在,GParted Live 屏幕已经加载,它显示我以前创建的分区列表。 + +![][7] + +#### 9) 如何重新调整根分区大小 + +选择你想重新调整大小的根分区,在这里仅有一个分区,所以我将编辑这个分区以便于安装另一个操作系统。 + +![][8] + +为做到这一点,按下 “Resize/Move” 按钮来重新调整分区大小。 + +![][9] + +现在,在第一个框中输入你想从这个分区中取出的大小。我将索要 “10GB”,所以,我添加 “10240MB”,并让该对话框的其余部分为默认值,然后点击 “Resize/Move” 按钮。 + +![][10] + +它将再次要求你确认重新调整分区的大小,因为你正在编辑活动的系统分区,然后点击 “Ok”。 + +![][11] + +分区从 30GB 缩小到 20GB 已经成功。也显示 10GB 未分配的磁盘空间。 + +![][12] + +最后点击 “Apply” 按钮来执行下面剩余的操作。 + +![][13] + +`e2fsck` 是一个文件系统检查实用程序,自动修复文件系统中与 HDD 相关的坏扇道、I/O 错误。 + +![][14] + +`resize2fs` 程序将重新调整 ext2、ext3 或 ext4 文件系统的大小。它可以被用于扩大或缩小一个位于设备上的未挂载的文件系统。 + +![][15] + +`e2image` 程序将保存位于设备上的关键的 ext2、ext3 或 ext4 文件系统的元数据到一个指定文件中。 + +![][16] + +所有的操作完成,关闭对话框。 + +![][17] + +现在,我们可以看到未分配的 “10GB” 磁盘分区。 + +![][18] + +重启系统来检查这一结果。 + +![][19] + +#### 10) 检查剩余空间 + +重新登录系统,并使用 `fdisk` 命令来查看在分区中可用的空间。是的,我可以看到这个分区上未分配的 “10GB” 磁盘空间。 + +``` +$ sudo parted /dev/sda print free +[sudo] password for daygeek: +Model: ATA VBOX HARDDISK (scsi) +Disk /dev/sda: 32.2GB +Sector size (logical/physical): 512B/512B +Partition Table: msdos +Disk Flags: + +Number Start End Size Type File system Flags + 32.3kB 10.7GB 10.7GB Free Space + 1 10.7GB 32.2GB 21.5GB primary ext4 boot +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility/ + +作者:[Magesh Maruthamuthu][a] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/magesh/ +[1]:https://gparted.org/ +[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-1.png +[4]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-2.png +[5]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-3.png +[6]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-4.png +[7]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-5.png +[8]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-6.png +[9]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-7.png +[10]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-8.png +[11]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-9.png +[12]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-10.png +[13]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-11.png +[14]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-12.png +[15]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-13.png +[16]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-14.png +[17]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-15.png +[18]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-16.png +[19]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-17.png diff --git a/published/201906/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/published/201906/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md new file mode 100644 index 0000000000..c16f90cfad --- /dev/null +++ b/published/201906/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md @@ -0,0 +1,172 @@ +BootISO:从 ISO 文件中创建一个可启动的 USB 设备 +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/16/110109qq0b7atyaped3ij2.jpg) + +为了安装操作系统,我们中的大多数人(包括我)经常从 ISO 文件中创建一个可启动的 USB 设备。为达到这个目的,在 Linux 中有很多自由可用的应用程序。甚至在过去我们写了几篇介绍这种实用程序的文章。 + +每个人使用不同的应用程序,每个应用程序有它们自己的特色和功能。在这些应用程序中,一些应用程序属于 CLI 程序,一些应用程序则是 GUI 的。 + +今天,我们将讨论名为 BootISO 的实用程序类似工具。它是一个简单的 bash 脚本,允许用户来从 ISO 文件中创建一个可启动的 USB 设备。 + +很多 Linux 管理员使用 `dd` 命令开创建可启动的 ISO ,它是一个著名的原生方法,但是与此同时,它也是一个非常危险的命令。因此,小心,当你用 `dd` 命令执行一些动作时。 + +建议阅读: + +- [Etcher:从一个 ISO 镜像中创建一个可启动的 USB 驱动器 & SD 卡的简单方法][1] +- [在 Linux 上使用 dd 命令来从一个 ISO 镜像中创建一个可启动的 USB 驱动器][2] + +### BootISO 是什么 + +[BootISO][3] 是一个简单的 bash 脚本,允许用户来安全的从一个 ISO 文件中创建一个可启动的 USB 设备,它是用 bash 编写的。 + +它不提供任何图形用户界面而是提供了大量的选项,可以让初学者顺利地在 Linux 上来创建一个可启动的 USB 设备。因为它是一个智能工具,能自动地选择连接到系统上的 USB 设备。 + +当系统有多个 USB 设备连接,它将打印出列表。当你手动选择了另一个硬盘而不是 USB 时,在这种情况下,它将安全地退出,而不会在硬盘上写入任何东西。 + +这个脚本也将检查依赖关系,并提示用户安装,它可以与所有的软件包管理器一起工作,例如 apt-get、yum、dnf、pacman 和 zypper。 + +### BootISO 的功能 + + * 它检查选择的 ISO 是否是正确的 mime 类型。如果不是,那么退出。 + * 如果你选择除 USB 设备以外的任何其它的磁盘(本地硬盘),BootISO 将自动地退出。 + * 当你有多个驱动器时,BootISO 允许用户选择想要使用的 USB 驱动器。 + * 在擦除和分区 USB 设备前,BootISO 会提示用户确认。 + * BootISO 将正确地处理来自一个命令的任何错误,并退出。 + * BootISO 在遇到问题退出时将调用一个清理例行程序。 + +### 如何在 Linux 中安装 BootISO + +在 Linux 中安装 BootISO 有几个可用的方法,但是,我建议用户使用下面的方法安装。 + +``` +$ curl -L https://git.io/bootiso -O +$ chmod +x bootiso +$ sudo mv bootiso /usr/local/bin/ +``` + +一旦 BootISO 已经安装,运行下面的命令来列出可用的 USB 设备。 + +``` +$ bootiso -l + +Listing USB drives available in your system: +NAME HOTPLUG SIZE STATE TYPE +sdd 1 32G running disk +``` + +如果你仅有一个 USB 设备,那么简单地运行下面的命令来从一个 ISO 文件中创建一个可启动的 USB 设备。 + +``` +$ bootiso /path/to/iso file +``` + +``` +$ bootiso /opt/iso_images/archlinux-2018.05.01-x86_64.iso +Granting root privileges for bootiso. +Listing USB drives available in your system: +NAME HOTPLUG SIZE STATE TYPE +sdd 1 32G running disk +Autoselecting `sdd' (only USB device candidate) +The selected device `/dev/sdd' is connected through USB. +Created ISO mount point at `/tmp/iso.vXo' +`bootiso' is about to wipe out the content of device `/dev/sdd'. +Are you sure you want to proceed? (y/n)>y +Erasing contents of /dev/sdd... +Creating FAT32 partition on `/dev/sdd1'... +Created USB device mount point at `/tmp/usb.0j5' +Copying files from ISO to USB device with `rsync' +Synchronizing writes on device `/dev/sdd' +`bootiso' took 250 seconds to write ISO to USB device with `rsync' method. +ISO succesfully unmounted. +USB device succesfully unmounted. +USB device succesfully ejected. +You can safely remove it ! +``` + +当你有多个 USB 设备时,可以使用 `--device` 选项指明你的设备名称。 + +``` +$ bootiso -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso +``` + +默认情况下,BootISO 使用 `rsync` 命令来执行所有的动作,如果你想使用 `dd` 命令代替它,使用下面的格式。 + +``` +$ bootiso --dd -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso +``` + +如果你想跳过 mime 类型检查,BootISO 实用程序带有下面的选项。 + +``` +$ bootiso --no-mime-check -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso +``` + +为 BootISO 添加下面的选项来跳过在擦除和分区 USB 设备前的用户确认。 + +``` +$ bootiso -y -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso +``` + +连同 `-y` 选项一起,启用自动选择 USB 设备。 + +``` +$ bootiso -y -a /opt/iso_images/archlinux-2018.05.01-x86_64.iso +``` + +为知道更多的 BootISO 选项,运行下面的命令。 + +``` +$ bootiso -h +Create a bootable USB from any ISO securely. +Usage: bootiso [...] + +Options + +-h, --help, help Display this help message and exit. +-v, --version Display version and exit. +-d, --device Select block file as USB device. + If is not connected through USB, `bootiso' will fail and exit. + Device block files are usually situated in /dev/sXX or /dev/hXX. + You will be prompted to select a device if you don't use this option. +-b, --bootloader Install a bootloader with syslinux (safe mode) for non-hybrid ISOs. Does not work with `--dd' option. +-y, --assume-yes `bootiso' won't prompt the user for confirmation before erasing and partitioning USB device. + Use at your own risks. +-a, --autoselect Enable autoselecting USB devices in conjunction with -y option. + Autoselect will automatically select a USB drive device if there is exactly one connected to the system. + Enabled by default when neither -d nor --no-usb-check options are given. +-J, --no-eject Do not eject device after unmounting. +-l, --list-usb-drives List available USB drives. +-M, --no-mime-check `bootiso' won't assert that selected ISO file has the right mime-type. +-s, --strict-mime-check Disallow loose application/octet-stream mime type in ISO file. +-- POSIX end of options. +--dd Use `dd' utility instead of mounting + `rsync'. + Does not allow bootloader installation with syslinux. +--no-usb-check `bootiso' won't assert that selected device is a USB (connected through USB bus). + Use at your own risks. + +Readme + + Bootiso v2.5.2. + Author: Jules Samuel Randolph + Bugs and new features: https://github.com/jsamr/bootiso/issues + If you like bootiso, please help the community by making it visible: + * star the project at https://github.com/jsamr/bootiso + * upvote those SE post: https://goo.gl/BNRmvm https://goo.gl/YDBvFe +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/bootiso-a-simple-bash-script-to-securely-create-a-bootable-usb-device-in-linux-from-iso-file/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.2daygeek.com/author/prakash/ +[1]:https://www.2daygeek.com/etcher-easy-way-to-create-a-bootable-usb-drive-sd-card-from-an-iso-image-on-linux/ +[2]:https://www.2daygeek.com/create-a-bootable-usb-drive-from-an-iso-image-using-dd-command-on-linux/ +[3]:https://github.com/jsamr/bootiso diff --git a/published/201906/20180831 Get desktop notifications from Emacs shell commands .md b/published/201906/20180831 Get desktop notifications from Emacs shell commands .md new file mode 100644 index 0000000000..773e650420 --- /dev/null +++ b/published/201906/20180831 Get desktop notifications from Emacs shell commands .md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: (lujun9972) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10977-1.html) +[#]: subject: (Get desktop notifications from Emacs shell commands ·) +[#]: via: (https://blog.hoetzel.info/post/eshell-notifications/) +[#]: author: (Jürgen Hötzel https://blog.hoetzel.info) + +让 Emacs shell 命令发送桌面通知 +====== + +我总是使用 [Eshell][1] 来与操作系统进行交互,因为它与 Emacs 无缝整合、支持处理 (远程) [TRAMP][2] 文件,而且在 Windows 上也能工作得很好。 + +启动 shell 命令后 (比如耗时严重的构建任务) 我经常会由于切换缓冲区而忘了追踪任务的运行状态。 + +多亏了 Emacs 的 [钩子][3] 机制,你可以配置 Emacs 在某个外部命令完成后调用一个 elisp 函数。 + +我使用 [John Wiegleys][4] 所编写的超棒的 [alert][5] 包来发送桌面通知: + +``` +(require 'alert) + +(defun eshell-command-alert (process status) + "Send `alert' with severity based on STATUS when PROCESS finished." + (let* ((cmd (process-command process)) + (buffer (process-buffer process)) + (msg (format "%s: %s" (mapconcat 'identity cmd " ") status))) + (if (string-prefix-p "finished" status) + (alert msg :buffer buffer :severity 'normal) + (alert msg :buffer buffer :severity 'urgent)))) + +(add-hook 'eshell-kill-hook #'eshell-command-alert) +``` + +[alert][5] 的规则可以用程序来设置。就我这个情况来看,我只需要当对应的缓冲区不可见时得到通知: + +``` +(alert-add-rule :status '(buried) ;only send alert when buffer not visible + :mode 'eshell-mode + :style 'notifications) +``` + + +这甚至对于 [TRAMP][2] 也一样生效。下面这个截屏展示了失败的 `make` 命令产生的 Gnome 桌面通知。 + +![../../img/eshell.png][6] + +-------------------------------------------------------------------------------- + +via: https://blog.hoetzel.info/post/eshell-notifications/ + +作者:[Jürgen Hötzel][a] +选题:[lujun9972][b] +译者:[lujun9972](https://github.com/lujun9972) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.hoetzel.info +[b]: https://github.com/lujun9972 +[1]: https://www.gnu.org/software/emacs/manual/html_mono/eshell.html (Eshell) +[2]: https://www.gnu.org/software/tramp/ (TRAMP) +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html (hooks) +[4]: https://github.com/jwiegley (John Wiegleys) +[5]: https://github.com/jwiegley/alert (alert) +[6]: https://blog.hoetzel.info/img/eshell.png diff --git a/published/201906/20180914 A day in the life of a log message.md b/published/201906/20180914 A day in the life of a log message.md new file mode 100644 index 0000000000..3c86e1e815 --- /dev/null +++ b/published/201906/20180914 A day in the life of a log message.md @@ -0,0 +1,56 @@ +一条日志消息的现代生活 +====== + +> 从一条日志消息的角度来巡览现代分布式系统。 + +![](https://img.linux.net.cn/data/attachment/album/201906/18/193030frxkcoccjhorz42o.jpg) + +混沌系统往往是不可预测的。在构建像分布式系统这样复杂的东西时,这一点尤其明显。如果不加以控制,这种不可预测性会无止境的浪费时间。因此,分布式系统的每个组件,无论多小,都必须设计成以简化的方式组合在一起。 + +[Kubernetes][1] 为抽象计算资源提供了一个很有前景的模型 —— 但即使是它也必须与其他分布式平台(如 [Apache Kafka][2])协调一致,以确保可靠的数据传输。如果有人要整合这两个平台,它会如何运作?此外,如果你通过这样的系统跟踪像日志消息这么简单的东西,它会是什么样子?本文将重点介绍来自在 [OKD][3] 内运行的应用程序的日志消息如何通过 Kafka 进入数据仓库(OKD 是为 Red Hat OpenShift 提供支持的 Kubernetes 的原初社区发行版)。 + +### OKD 定义的环境 + +这样的旅程始于 OKD,因为该容器平台完全覆盖了它抽象的硬件。这意味着日志消息等待由驻留在容器中的应用程序写入 stdout 或 stderr 流。从那里,日志消息被容器引擎(例如 [CRI-O][4])重定向到节点的文件系统。 + +![](https://opensource.com/sites/default/files/uploads/logmessagepathway.png) + +在 OpenShift 中,一个或多个容器封装在称为 pod(豆荚)的虚拟计算节点中。实际上,在 OKD 中运行的所有应用程序都被抽象为 pod。这允许应用程序以统一的方式操纵。这也大大简化了分布式组件之间的通信,因为 pod 可以通过 IP 地址和[负载均衡服务][5]进行系统寻址。因此,当日志消息由日志收集器应用程序从节点的文件系统获取时,它可以很容易地传递到在 OpenShift 中运行的另一个 pod 中。 + +### 在豆荚里的两个豌豆 + +为了确保可以在整个分布式系统中四处传播日志消息,日志收集器需要将日志消息传递到在 OpenShift 中运行的 Kafka 集群数据中心。通过 Kafka,日志消息可以以可靠且容错的方式低延迟传递给消费应用程序。但是,为了在 OKD 定义的环境中获得 Kafka 的好处,Kafka 需要完全集成到 OKD 中。 + +运行 [Strimzi 操作子][6]将所有 Kafka 组件实例化为 pod,并将它们集成在 OKD 环境中运行。 这包括用于排队日志消息的 Kafka 代理,用于从 Kafka 代理读取和写入的 Kafka 连接器,以及用于管理 Kafka 集群状态的 Zookeeper 节点。Strimzi 还可以将日志收集器实例化兼做 Kafka 连接器,允许日志收集器将日志消息直接提供给在 OKD 中运行的 Kafka 代理 pod。 + +### 在 OKD 内的 Kafka + +当日志收集器 pod 将日志消息传递给 Kafka 代理时,收集器会写到单个代理分区,并将日志消息附加到该分区的末尾。使用 Kafka 的一个优点是它将日志收集器与日志的最终目标分离。由于解耦,日志收集器不关心日志最后是放在 [Elasticsearch][7]、Hadoop、Amazon S3 中的某个还是全都。Kafka 与所有基础设施连接良好,因此 Kafka 连接器可以在任何需要的地方获取日志消息。 + +一旦写入 Kafka 代理的分区,该日志消息就会在 Kafka 集群内的跨代理分区复制。这是它的一个非常强大的概念;结合平台的自愈功能,它创建了一个非常有弹性的分布式系统。例如,当节点变得不可用时,(故障)节点上运行的应用程序几乎立即在健康节点上生成。因此,即使带有 Kafka 代理的节点丢失或损坏,日志消息也能保证存活在尽可能多的节点上,并且新的 Kafka 代理将快速原位取代。 + +### 存储起来 + +在日志消息被提交到 Kafka 主题后,它将等待 Kafka 连接器使用它,该连接器将日志消息中继到分析引擎或日志记录仓库。在传递到其最终目的地时,可以分析日志消息以进行异常检测,也可以查询日志以立即进行根本原因分析,或用于其他目的。无论哪种方式,日志消息都由 Kafka 以安全可靠的方式传送到目的地。 + +OKD 和 Kafka 是正在迅速发展的功能强大的分布式平台。创建能够在不影响性能的情况下抽象出分布式计算的复杂特性的系统至关重要。毕竟,如果我们不能简化单一日志消息的旅程,我们怎么能夸耀全系统的效率呢? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/9/life-log-message + +作者:[Josef Karásek][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[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/jkarasek +[1]: https://kubernetes.io/ +[2]: https://kafka.apache.org/ +[3]: https://www.okd.io/ +[4]: http://cri-o.io/ +[5]: https://kubernetes.io/docs/concepts/services-networking/service/ +[6]: http://strimzi.io/ +[7]: https://www.elastic.co/ diff --git a/published/201906/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/published/201906/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md new file mode 100644 index 0000000000..48d7ca0474 --- /dev/null +++ b/published/201906/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10969-1.html) +[#]: subject: (GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer) +[#]: via: (https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/) +[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) + +GoAccess:一个实时的 Web 日志分析器及交互式查看器 +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/12/222616h80pl0k0tt811071.jpg) + +分析日志文件对于 Linux 管理员来说是一件非常令人头疼的事情,因为它记录了很多东西。大多数新手和初级管理员都不知道如何分析。如果你在分析日志方面拥有很多知识,那么你就成了 *NIX 系统高手。 + +Linux 中有许多工具可以轻松分析日志。GoAccess 是允许用户轻松分析 Web 服务器日志的工具之一。我们将在本文中详细讨论 GoAccess 工具。 + +### GoAccess + +GoAccess 是一个实时 Web 日志分析器和交互式查看器,可以在 *nix 系统中的终端运行或通过浏览器访问。 + +GoAccess 需要的依赖极少,它是用 C 语言编写的,只需要 ncurses。 + +它支持 Apache、Nginx 和 Lighttpd 日志。它为需要动态可视化服务器报告的系统管理员即时提供了快速且有价值的 HTTP 统计信息。 + +GoAccess 可以解析指定的 Web 日志文件并将数据输出到 X 终端和浏览器。 + +GoAccess 被设计成一个基于终端的快速日志分析器。其核心思想是实时快速分析和查看 Web 服务器统计信息,而无需使用浏览器。 + +默认输出是在终端输出,它也能够生成完整的、自包含的实时 HTML 报告,以及 JSON 和 CSV 报告。 + +GoAccess 支持任何自定义日志格式,并包含以下预定义日志格式选项:Apache/Nginx 中的组合日志格式 XLF/ELF,Apache 中的通用日志格式 CLF,但不限于此。 + +### GoAccess 功能 + +* 完全实时:所有指标在终端上每 200 毫秒更新一次,在 HTML 输出上每秒更新一次。 +* 跟踪应用程序响应时间:跟踪服务请求所需的时间。如果你想跟踪减慢了网站速度的网页,则非常有用。 +* 访问者:按小时或日期确定最慢运行的请求的点击量、访问者数、带宽数和指标。 +* 按虚拟主机的度量标准:如果有多个虚拟主机(`Server`),它提供了一个面板,可显示哪些虚拟主机正在消耗大部分 Web 服务器资源。 + +### 如何安装 GoAccess? + +我建议用户在包管理器的帮助下从发行版官方的存储库安装 GoAccess。它在大多数发行版官方存储库中都可用。 + +我们知道,我们在标准发行方式的发行版中得到的是过时的软件包,而滚动发行方式的发行版总是包含最新的软件包。 + +如果你使用标准发行方式的发行版运行操作系统,我建议你检查替代选项,如 PPA 或 GoAccess 官方维护者存储库等,以获取最新的软件包。 + +对于 Debian / Ubuntu 系统,使用 [APT-GET 命令][1]或 [APT 命令][2]在你的系统上安装 GoAccess。 + +``` +# apt install goaccess +``` + +要获取最新的 GoAccess 包,请使用以下 GoAccess 官方存储库。 + +``` +$ echo "deb https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list +$ wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - +$ sudo apt-get update +$ sudo apt-get install goaccess +``` + +对于 RHEL / CentOS 系统,使用 [YUM 包管理器][3]在你的系统上安装 GoAccess。 + +``` +# yum install goaccess +``` + +对于 Fedora 系统,使用 [DNF 包管理器][4]在你的系统上安装 GoAccess。 + +``` +# dnf install goaccess +``` + +对于基于 ArchLinux / Manjaro 的系统,使用 [Pacman 包管理器][5]在你的系统上安装 GoAccess。 + +``` +# pacman -S goaccess +``` + +对于 openSUSE Leap 系统,使用[Zypper 包管理器][6]在你的系统上安装 GoAccess。 + +``` +# zypper install goaccess +# zypper ar -f obs://server:http +# zypper ref && zypper in goaccess +``` + +### 如何使用 GoAccess? + +成功安装 GoAccess 后。只需输入 `goaccess` 命令,然后输入 Web 服务器日志位置即可查看。 + +``` +# goaccess [options] /path/to/Web Server/access.log +# goaccess /var/log/apache/2daygeek_access.log +``` + +执行上述命令时,它会要求您选择日志格式配置。 + +![][8] + +我用 Apache 访问日志对此进行了测试。Apache 日志被分为十五个部分。详情如下。主要部分显示了这十五个部分的摘要。 + +以下屏幕截图包括四个部分,例如唯一身份访问者、请求的文件、静态请求、未找到的网址。 + +![][10] + +以下屏幕截图包括四个部分,例如访客主机名和 IP、操作系统、浏览器、时间分布。 + +![][10] + +以下屏幕截图包括四个部分,例如来源网址、来源网站,Google 的搜索引擎结果、HTTP状态代码。 + +![][11] + +如果要生成 html 报告,请使用以下命令。最初我在尝试生成 html 报告时遇到错误。 + +``` +# goaccess 2daygeek_access.log -a > report.html + +GoAccess - version 1.3 - Nov 23 2018 11:28:19 +Config file: No config file used + +Fatal error has occurred +Error occurred at: src/parser.c - parse_log - 2764 +No time format was found on your conf file.Parsing... [0] [0/s] +``` + +它说“你的 conf 文件没有找到时间格式”。要解决此问题,请为其添加 “COMBINED” 日志格式选项。 + +``` +# goaccess -f 2daygeek_access.log --log-format=COMBINED -o 2daygeek.html +Parsing...[0,165] [50,165/s] +``` + +![][12] + +GoAccess 也允许你访问和分析实时日志并进行过滤和解析。 + +``` +# tail -f /var/log/apache/2daygeek_access.log | goaccess - +``` + +更多细节请参考其 man 手册页或帮助。 + +``` +# man goaccess +或 +# goaccess --help +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/ + +作者:[Vinoth Kumar][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.2daygeek.com/author/vinoth/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-1.png +[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-2.png +[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-3.png +[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-4.png +[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-5.png diff --git a/published/201906/20190111 Top 5 Linux Distributions for Productivity.md b/published/201906/20190111 Top 5 Linux Distributions for Productivity.md new file mode 100644 index 0000000000..57a17925cd --- /dev/null +++ b/published/201906/20190111 Top 5 Linux Distributions for Productivity.md @@ -0,0 +1,140 @@ +[#]: collector: "lujun9972" +[#]: translator: "qfzy1233" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-11028-1.html" +[#]: subject: "Top 5 Linux Distributions for Productivity" +[#]: via: "https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity" +[#]: author: "Jack Wallen https://www.linux.com/users/jlwallen" + +5 个最具生产力的 Linux 发行版 +====== + +> 如果你正在寻找一个适合开发工作的完美环境,我敢说你找不到比 Pop!_OS 更好的选择。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) + +必须承认的是,这样的一个热门话题其实很难被总结的话题。为什么呢?首先,Linux 在就是一种有生产力的操作系统。由于它极强的可靠性和稳定的平台,使得完成工作变得很容易。其次为了衡量工作的效率,你需要考虑到哪项工作需要得到生产力方面的助推。是日常办公?开发类工作?学校事务?数据挖掘?或者是人力资源?你可以看到这个问题有多复杂。 + +然而,这并不意味着某些发行版无法更好地配置将底层操作系统呈现为一个有效的平台来完成工作。恰恰相反,许多发行版在偏离生产力这条道路上越走越远,所以你不会意识到你自己处在工作的窘境中,而是继续挖掘自己的潜力在工期结束之前拼命赶上进度。这些 Linux 发行版可以帮助你化繁为简,因此或许可以减少你工作流程中的痛点。 + +让我们来看一下这些发行版并为你找出适合你的最佳选择。为了更具条理,我按照生产力诉求把它们分成了几类。这项任务本身也是一种挑战,因为每个人在生产力提升上的需要是千差万别的。然而,我所关注的是下列的几项: + + * 常规:适于那些只需要有效地完成多项工作的人。 + * 设计:适于那些从事设计创造和图像处理的人。 + * 开发:适于那些使用 Linux 桌面发行版来进行编程工作的人。 + * 运维:适于那些需要一个发行版来促进其执行系统管理任务的人。 + * 教育:适于那些需要桌面发行版可以助力他们在教育领域更高效的人。 + +诚然,有很多很多类别的发行版可供挑选,其中的很多可能用起来十分得心应手,但这五种或许是你最为需要的。 + +### 常规 + +对于常规的生产力诉求来说,你不会找到比 [Ubuntu][1] 更为高效的了。在这个类别中首推 Ubuntu 最主要的原因是因为它实现了桌面操作系统、软件、服务的无缝集成。你可能会问为什么我不选择同类别的 Linux Mint 呢?因为 Ubuntu 现在默认的的桌面环境为 GNOME 桌面,而它拥有 GNOME 许多扩展程序的优势的加成(图 1)。 + +![GNOME Clipboard][3] + +*图 1:运行中的 GNOME 桌面的剪切板管理工具。* + +这些扩展程序在提升生产力方面做了很多努力(所以 Ubuntu 比 Linux Mint 获得了更多的认可)。但是 Ubuntu 不仅仅是装了一个普通的 GNOME 桌面。事实上,他们致力于将它改进的更为轻量化、更为高效、以及用户友好度更高、开箱即用。总而言之,由于 Ubuntu 正确的融合了多种特性,开箱即用,完善的软件支持(仅对工作方面而言),这些特性使它几乎成为了生产力领域最为完美的一个平台。 + +不管你是要写一篇文档,制作一张电子表格,写一个新的软件,开发公司的网站,设计商用的图形,管理一个服务器或是网络,抑或是在你的公司内从事人力资源管理工作,Ubuntu 都可以满足你的需求。Ubuntu 桌面发行版也并不要求你耗费很大的精力才能开始开始开展工作……它直接就能使用(并且工作的十分优秀)。最后,得益于它是基于 Debian 的,使得在 Ubuntu 上安装第三方的软件十分简便。 + +很难不支持这一发行版独占生产力发行版列表的鳌头,尽管 Ubuntu 几乎已经成为几乎所有“某某类顶级发行版”列表的榜首。 + +### 设计 + +如果你正在寻求提升你的平面设计效率,你不能错过 [Fedora 设计套件][5]。这一 Fedora 衍生版是由负责 Fedora 相关的艺术作品的团队亲自操刀制作的。虽然其默认选择的应用程序并不是一个庞大的工具集合,但它所包含的工具都是创建和处理图像专用的。 + +有了 GIMP、Inkscape、Darktable、Krita、Entangle、Blender、Pitivi、Scribus 等应用程序(图 2),你可以找到完成图像编辑工作所需要的一切。但是 Fedora 设计套件并不仅限于此。这个桌面平台还包括一堆教程,涵盖了许多已安装的应用程序。对于任何想要尽可能提高效率的人来说,这将是一些非常有用的信息。不过,我要说的是,GNOME 收藏夹中的教程并没有超乎[此页中][6]链接的内容。 + +![Fedora Design Suite Favorites][8] + +*图 2:Fedora 设计套件收藏夹菜单包含了许多工具,可以让你用于图形设计。* + +那些使用数码相机的用户肯定会喜欢 Entangle 应用程序,它可以让你在电脑上控制单反相机。 + +### 开发 + +几乎所有的 Linux 发行版都是程序员的绝佳平台。然而,有一种特定的发行版脱颖而出,并超越了其他发行版,它将是你见过的用于编程类最有效率的工具之一。这个操作系统来自 [System76][9](LCTT 译注:一家美国的计算机制造商),名为 [Pop!\_OS][10]。Pop!\_OS 是专门为创作者定制的,但不是针对艺术类。相反,Pop!\_OS 面向专门从事开发、编程和软件制作的程序员。如果你需要一个既能完美的胜任开发工作又包含符合使用习惯的桌面操作系统的开发环境,Pop!\_OS 将会是你的不二选择。(图 3) + +可能会让你感到惊讶(考虑到这个操作系统是多么“年轻”)的是 Pop!\_OS 也是你将使用的基于 GNOME 平台的最稳定系统的之一。这意味着 Pop!\_OS 不只是为创作者和创客准备的,也是为任何想要一个可靠的操作系统的人准备的。你可以下载针对你的硬件的专门 ISO 文件,这一点是许多用户十分欣赏的。如果你有英特尔硬件,[下载][10] Intel 或 AMD 的版本。如果你的显卡是 NVIDIA,请下载该特定版本。不管怎样,你肯定会得到针对不同平台进行特殊定制的稳定版本。 + +![Pop!_OS][12] + +*图 3:装有 GNOME 桌面的 Pop!_OS 一览。* + +有趣的是,在 Pop!\_OS 中,你不会找到太多预装的开发工具。你也不会找到 IDE 或许多其他开发工具。但是,你可以在 Pop 商店中中找到所需的所有开发工具。 + +### 运维 + +如果你正在寻找适合系统管理的最具生产力的发行版,[Debian][13] 将会是你的不二之选。为什么这么说呢?因为 Debian 不仅仅拥有无与伦比的可靠性,它也是众多能从苦海中将你解救出来的最好的一个发行版。Debian 是易用性和无限可能性的完美结合。最重要的是,因为它是许多其他发行版的基础,所以可以打赌,如果你需要一个任务的管理工具,那么它一定支持 Debian 系统。当然,我们讨论的是一般的系统管理任务,这意味着大多数时候你需要使用终端窗口 SSH 连接到服务器(图 4),或者在浏览器上使用网络上基于 web 的 GUI 工具。既然如此为什么还要使用一个增加复杂性的桌面呢(比如 Fedora 中的 SELinux 或 openSUSE 中的 YaST)呢?所以,应选择更为简洁易用的那一种。 + +![Debian][15] + +*图 4:在 Debian 系统上通过 SSH 连接到远程服务器。* + +你可以选择你想要的不同的桌面(包括 GNOME、Xfce、KDE、Cinnamon、MATE、LXDE),可以确保你所使用的桌面外观最适合你的工作习惯。 + +### 教育 + +如果你是一名老师或学生,抑或是其他从事与教育相关工作的人士,你需要适当的工具来提高生产力。之前,有 Edubuntu 这样的版本。这一版本位列教育类相关发行版排名的前列。然而,自从 Ubuntu 14.04 版之后这一发行版就再也没有更新。还好,现在有一款基于 openSUSE 的新的以教育为基础的发行版有望夺摘得桂冠。这一改版叫做 [openSUSE:Education-Li-f-e][16](Li-f-e:Linux For Education - 图 5),它基于 openSUSE Leap 42.1 (所以它可能稍微有一点过时)。 + +openSUSE:Education-Li-f-e 包含了以下工具: + + * Brain Workshop(大脑工坊):一种基于 dual n-back 模式的大脑训练软件(LCTT 译注:dual n-back 训练是一种科学的智力训练方法,可以改善人的工作记忆和流体智力) + * GCompris:一种针对青少年的教育软件包 + * gElemental:一款元素周期表查看工具 + * iGNUit:一款通用的记忆卡片工具 + * Little Wizard:基于 Pascal 语言的少儿编程开发环境 + * Stellarium:天文模拟器 + * TuxMath:数学入门游戏 + * TuxPaint:一款少儿绘画软件 + * TuxType:一款为少儿准备的打字入门软件 + * wxMaxima:一个跨平台的计算机代数系统 + * Inkscape:矢量图形编辑软件 + * GIMP:图像处理软件(LCTT 译注:被誉为 Linux 上的 PhotoShop) + * Pencil:GUI 模型制作工具 + * Hugin:全景照片拼接及 HDR 效果混合软件 + + +![Education][18] + +*图 5:openSUSE:Education-Li-f-e 发行版拥有大量的工具可以帮你在学校中变得更为高效。* + +同时还集成在 openSUSE:Education-Li-f-e 中的还有 [KIWI-LTSP Server][19] 。KIWI-LTSP 服务器是一个灵活的、经济高效的解决方案,旨在使全世界的学校、企业和组织能够轻松地安装和部署桌面工作站。虽然这可能不会直接帮助学生变得更具生产力,但它肯定会使教育机构在部署供学生使用的桌面时更有效率。有关配置 KIWI-LTSP 的更多信息,请查看 openSUSE [KIWI-LTSP 快速入门指南][20]。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[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.ubuntu.com/ +[2]: /files/images/productivity1jpg +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w "GNOME Clipboard" +[4]: /licenses/category/used-permission +[5]: https://labs.fedoraproject.org/en/design-suite/ +[6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials +[7]: /files/images/productivity2jpg +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH "Fedora Design Suite Favorites" +[9]: https://system76.com/ +[10]: https://system76.com/pop +[11]: /files/images/productivity3jpg-0 +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD "Pop!_OS" +[13]: https://www.debian.org/ +[14]: /files/images/productivity4jpg +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 "Debian" +[16]: https://en.opensuse.org/openSUSE:Education-Li-f-e +[17]: /files/images/productivity5jpg +[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT "Education" +[19]: https://en.opensuse.org/Portal:KIWI-LTSP +[20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start +[21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/published/201906/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/published/201906/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md new file mode 100644 index 0000000000..07d273c666 --- /dev/null +++ b/published/201906/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: (luuming) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11004-1.html) +[#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) +[#]: via: (https://fosspost.org/lists/open-source-speech-recognition-speech-to-text) +[#]: author: (Simon James https://fosspost.org/author/simonjames) + +5 款不错的开源语音识别/语音文字转换系统 +====== + +![](https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/open-source-speech-recognition-speech-to-text.png?resize=1237%2C527&ssl=1) + +语音文字转换speech-to-text(STT)系统就像它名字所蕴含的意思那样,是一种将说出的单词转换为文本文件以供后续用途的方式。 + +语音文字转换技术非常有用。它可以用到许多应用中,例如自动转录,使用自己的声音写书籍或文本,用生成的文本文件和其他工具做复杂的分析等。 + +在过去,语音文字转换技术以专有软件和库为主导,要么没有开源替代品,要么有着严格的限制,也没有社区。这一点正在发生改变,当今有许多开源语音文字转换工具和库可以让你随时使用。 + +这里我列出了 5 个。 + +### 开源语音识别库 + +#### DeepSpeech 项目 + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 15 open source speech recognition][1] + +该项目由 Firefox 浏览器的开发组织 Mozilla 团队开发。它是 100% 的自由开源软件,其名字暗示使用了 TensorFlow 机器学习框架实现去功能。 + +换句话说,你可以用它训练自己的模型获得更好的效果,甚至可以用它来转换其它的语言。你也可以轻松的将它集成到自己的 Tensorflow 机器学习项目中。可惜的是项目当前默认仅支持英语。 + +它也支持许多编程语言,例如 Python(3.6)。可以让你在数秒之内完成工作: + +``` +pip3 install deepspeech +deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav +``` + +你也可以通过 `npm` 安装它: + +``` +npm install deepspeech +``` + +- [项目主页][2] + +#### Kaldi + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 17 open source speech recognition][3] + +Kaldi 是一个用 C++ 编写的开源语音识别软件,并且在 Apache 公共许可证下发布。它可以运行在 Windows、macOS 和 Linux 上。它的开发始于 2009。 + +Kaldi 超过其他语音识别软件的主要特点是可扩展和模块化。社区提供了大量的可以用来完成你的任务的第三方模块。Kaldi 也支持深度神经网络,并且在它的网站上提供了[出色的文档][4]。 + +虽然代码主要由 C++ 完成,但它通过 Bash 和 Python 脚本进行了封装。因此,如果你仅仅想使用基本的语音到文字转换功能,你就会发现通过 Python 或 Bash 能够轻易的实现。 + +- [项目主页][5] + +#### Julius + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 19 open source speech recognition][6] + +它可能是有史以来最古老的语音识别软件之一。它的开发始于 1991 年的京都大学,之后在 2005 年将所有权转移到了一个独立的项目组。 + +Julius 的主要特点包括了执行实时 STT 的能力,低内存占用(20000 单词少于 64 MB),能够输出最优词N-best word词图Word-graph,能够作为服务器单元运行等等。这款软件主要为学术和研究所设计。由 C 语言写成,并且可以运行在 Linux、Windows、macOS 甚至 Android(在智能手机上)。 + +它当前仅支持英语和日语。软件应该能够从 Linux 发行版的仓库中轻松安装。只要在软件包管理器中搜索 julius 即可。最新的版本[发布][7]于本文发布前大约一个半月之前。 + +- [项目主页][8] + +#### Wav2Letter++ + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 21 open source speech recognition][9] + +如果你在寻找一个更加时髦的,那么这款一定适合。Wav2Letter++ 是一款由 Facebook 的 AI 研究团队于 2 个月之前发布的开源语言识别软件。代码在 BSD 许可证下发布。 + +Facebook 描述它的库是“最快、最先进state-of-the-art的语音识别系统”。构建它时的理念使其默认针对性能进行了优化。Facebook 最新的机器学习库 [FlashLight][11] 也被用作 Wav2Letter++ 的底层核心。 + +Wav2Letter++ 需要你先为所描述的语言建立一个模型来训练算法。没有任何一种语言(包括英语)的预训练模型,它仅仅是个机器学习驱动的文本语音转换工具,它用 C++ 写成,因此被命名为 Wav2Letter++。 + +- [项目主页][12] + +#### DeepSpeech2 + +![5 Good Open Source Speech Recognition/Speech-to-Text Systems 23 open source speech recognition][13] + +中国软件巨头百度的研究人员也在开发他们自己的语音文字转换引擎,叫做“DeepSpeech2”。它是一个端对端的开源引擎,使用“PaddlePaddle”深度学习框架进行英语或汉语的文字转换。代码在 BSD 许可证下发布。 + +该引擎可以在你想用的任何模型和任何语言上训练。模型并未随代码一同发布。你要像其他软件那样自己建立模型。DeepSpeech2 的源代码由 Python 写成,如果你使用过就会非常容易上手。 + +- [项目主页][14] + +### 总结 + +语音识别领域仍然主要由专有软件巨头所占据,比如 Google 和 IBM(它们为此提供了闭源商业服务),但是开源同类软件很有前途。这 5 款开源语音识别引擎应当能够帮助你构建应用,随着时间推移,它们会不断地发展。在几年之后,我们希望开源成为这些技术中的常态,就像其他行业那样。 + +如果你对清单有其他的建议或评论,我们很乐意在下面听到。 + +-------------------------------------------------------------------------------- + +via: https://fosspost.org/lists/open-source-speech-recognition-speech-to-text + +作者:[Simon James][a] +选题:[lujun9972][b] +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fosspost.org/author/simonjames +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/hero_speech-machine-learning2.png?resize=820%2C280&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 16 open source speech recognition) +[2]: https://github.com/mozilla/DeepSpeech +[3]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-19-1134.png?resize=591%2C138&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 18 open source speech recognition) +[4]: http://kaldi-asr.org/doc/index.html +[5]: http://kaldi-asr.org +[6]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/mic_web.png?resize=385%2C100&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 20 open source speech recognition) +[7]: https://github.com/julius-speech/julius/releases +[8]: https://github.com/julius-speech/julius +[9]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/fully_convolutional_ASR.png?resize=850%2C177&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 22 open source speech recognition) +[10]: https://code.fb.com/ai-research/wav2letter/ +[11]: https://github.com/facebookresearch/flashlight +[12]: https://github.com/facebookresearch/wav2letter +[13]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/ds2.png?resize=850%2C313&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 24 open source speech recognition) +[14]: https://github.com/PaddlePaddle/DeepSpeech diff --git a/published/201906/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md b/published/201906/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md new file mode 100644 index 0000000000..62499247c1 --- /dev/null +++ b/published/201906/20190308 Blockchain 2.0 - Explaining Smart Contracts And Its Types -Part 5.md @@ -0,0 +1,163 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10956-1.html) +[#]: subject: (Blockchain 2.0 – Explaining Smart Contracts And Its Types [Part 5]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +区块链 2.0:智能合约及其类型(五) +====== + +![Explaining Smart Contracts And Its Types][1] + +这是 区块链 2.0 系列的第 5 篇文章。本系列的前一篇文章探讨了我们如何[在房地产行业实现区块链][2]。本文简要探讨了区块链及相关技术领域内的智能合约Smart Contract主题。智能合约是在区块链上验证和创建新“数据块”的基本协议,它被吹捧为该系统未来发展和应用的焦点。 然而,像所有“万灵药”一样,它不是一切的答案。我们将从基础知识中探索这个概念,以了解“智能合约”是什么以及它们不是什么。 + +### 不断发展的合同 + +这个世界建立在合同(合约)之上。在当前社会,没有合约的使用和再利用,地球上任何个人或公司都无法运作。订立、维护和执行合同的任务变得如此复杂,以至于整个司法和法律系统都必须以“合同法”的名义建立起来以支持它。事实上,大多数合同都是由一个“可信的”第三方监督,以确保最终的利益攸关者按照达成的条件得到妥善处理。有些合同甚至涉及到了第三方受益人。此类合同旨在对不是合同的活跃(或参与)方的第三方产生影响。解决和争论合同义务占据了民事诉讼所涉及的大部分法律纠纷。当然,更好的处理合同的方式来对于个人和企业来说都是天赐之物。更不用说它将以核查和证明的名义节省政府的巨大的[文书工作][7] [^1]。 + +本系列中的大多数文章都研究了如何利用现有的区块链技术。相比之下,这篇文章将更多地讲述对未来几年的预期。关于“智能合约”的讨论源于前一篇文章中提出的财产讨论。当前这篇文章旨在概述区块链自动执行“智能”可执行程序的能力。务实地处理这个问题意味着我们首先必须定义和探索这些“智能合约”是什么,以及它们如何适应现有的合同系统。我们将在下一篇题为“区块链 2.0:正在进行的项目”的文章中查看当前该领域正在进行的主要应用和项目。 + +### 定义智能合约 + +[本系列的第一篇文章][3]从基本的角度来看待区块链,将其看作由数据块组成的“分布式分类账本”,这些数据块是: + +* 防篡改 +* 不可否认(意味着每个数据块都是由某人显式创建的,并且该人不能否认相同的责任) +* 安全,且能抵御传统的网络攻击方法 +* 几乎是永久性的(当然这取决于区块链协议层) +* 高度冗余,通过存在于多个网络节点或参与者系统上,其中一个节点的故障不会以任何方式影响系统的功能,并且, +* 根据应用的不同可以提供更快的处理速度。 + +由于每个数据实例都是安全存储和通过适当的凭证访问的,因此区块链网络可以为精确验证事实和信息提供简便的基础,而无需第三方监督。区块链 2.0 开发也允许“分布式应用程序(DApp)”(我们将在接下来的文章中详细介绍这个术语)。这些分布式应用程序要求存在网络上并在其上运行。当用户需要它们时就会调用它们,并通过使用已经过审核并存储在区块链上的信息来执行它们。 + +上面的最后一段为智能合约的定义提供了基础。数字商会The Chamber for Digital Commerce提供了一个许多专家都同意的智能合约定义。 + +> “(智能合约是一种)计算机代码,在发生指定条件时,能够根据预先指定的功能自动运行。该代码可以在分布式分类帐本上存储和处理,并将产生的任何更改写入分布式分类帐本” [^2]。 + +智能合约如上所述是一种简单的计算机程序,就像 “if-then” 或 “if-else if” 语句一样工作。关于其“智能”的方面来自这样一个事实,即该程序的预定义输入来自区块链分类账本,如上所述,它是一个记录信息的安全可靠的来源。如有必要,程序可以调用外部服务或来源以获取信息,以验证操作条款,并且仅在满足所有预定义条件后才执行。 + +必须记住,与其名称所暗示的不同,智能合约通常不是自治实体,严格来说,也不是合同。1996 年,Nick Szabo 很早就提到了智能合约,他将其与接受付款并交付用户选择的产品的自动售货机进行了比较。可以在[这里][4]查看全文。此外,人们正在制定允许智能合约进入主流合同使用的法律框架,因此目前该技术的使用仅限于法律监督不那么明确和严格的领域 [^4]。 + +### 智能合约的主要类型 + +假设读者对合同和计算机编程有基本的了解,并且基于我们对智能合约的定义,我们可以将智能合约和协议粗略地分类为以下主要类别。 + +#### 1、智能法律合约 + +这大概是最明显的一种。大多数(如果不是全部)合同都具有法律效力。在不涉及太多技术问题的情况下,智能法律合约是涉及到严格的法律追索权的合同,以防参与合同的当事人不履行其交易的目的。如前所述,不同国家和地区的现行法律框架对区块链上的智能和自动化合约缺乏足够的支持,其法律地位也不明确。但是,一旦制定了法律,就可以订立智能合约,以简化目前涉及严格监管的流程,如金融和房地产市场交易、政府补贴、国际贸易等。 + +#### 2、DAO + +去中心化自治组织Decentralized Autonomous Organization,即DAO,可以粗略地定义为区块链上存在的社区。该社区可以通过一组规则来定义,这些规则通过智能合约来体现并放入代码中。然后,每个参与者的每一个行动都将受到这些规则的约束,其任务是在程序中断的情况下执行并获得追索权。许多智能合约构成了这些规则,它们协同监管和监督参与者。 + +名为“创世纪 DAO” 的 DAO 是由以太坊参与者于 2016 年 5 月创建。该社区旨在成为众筹和风险投资平台。在极短的时间内,他们设法筹集了惊人的 1.5 亿美元。然而,由于黑客在系统中发现了漏洞,并设法从众筹投资者手中窃取价值约 5000 万美元的以太币。这次黑客破坏的后果导致以太坊区块链[分裂为两个][8],以太坊和以太坊经典。 + +#### 3、应用逻辑合约(ALC) + +如果你已经听说过与区块链相结合的物联网,那么很可能它涉及到了应用逻辑合约Application logic contract,即 ALC。此类智能合约包含特定于应用的代码,这些代码可以与区块链上的其他智能合约和程序一起工作。它们有助于与设备进行通信并验证设备之间的通信(在物联网领域)。ALC 是每个多功能智能合约的关键部分,并且大多数都是在一个管理程序下工作。在这里引用的大多数例子中,它们到处都能找到[应用][9] [^6]。 + +*由于该领域还在开发中,因此目前所说的任何定义或标准最多只能说是变化而模糊的。* + +### 智能合约是如何工作的? + +为简化起见,让我们用个例子来说明。 + +约翰和彼得是两个争论足球比赛得分的人。他们对比赛结果持有相互矛盾的看法,他们都支持不同的球队(这是背景情况)。由于他们两个都需要去其他地方并且无法看完比赛,所以约翰认为如果 A 队在比赛中击败 B 队,他就*支付*给彼得 100 美元。彼得*考虑*之后*接受*了该赌注,同时明确表示他们必须接受这些条款。但是,他们没有兑现该赌注的相互信任,也没有时间和钱来指定第三方监督赌注。 + +假设约翰和彼得都使用像 [Etherparty][5] 这样的智能合约平台,它可以在合约谈判时自动结算赌注,他们都会将基于区块链的身份链接到该合约,并设置条款,明确表示一旦比赛结束,该程序将找出获胜方是谁,并自动将该金额从输家中归入获胜者银行账户。一旦比赛结束并且媒体报道同样的结果,该程序将在互联网上搜索规定的来源,确定哪支球队获胜,将其与合约条款联系起来,在这种情况下,如果 A 队赢了彼得将从约翰哪里得到钱,也就是说将约翰的 100 美元转移到彼得的账户。执行完毕后,除非另有说明,否则智能合约将终止并在未来所有的时间内处于非活动状态。 + +抛开例子的简单不说,这种情况涉及到一个经典的合同,而参与者选择使用智能合约实现了相同目的。所有的智能合约基本上都遵循类似的原则,对程序进行编码,以便在预定义的参数上执行,并且只抛出预期的输出。智能合同咨询的外部来源可以是有时被称为 IT 世界中的神谕Oracle。神谕是当今全球许多智能合约系统的常见部分。 + +在这种情况下使用智能合约使参与者可以获得以下好处: + +* 它比在一起并手动结算更快。 +* 从其中删除了信任问题。 +* 消除了受信任的第三方代表有关各方处理和解的必要性。 +* 执行时无需任何费用。 +* 在如何处理参数和敏感数据方面是安全的。 +* 相关数据将永久保留在他们运行的区块链平台中,未来可以通过调用相同的函数并为其提供更多输入来设置投注。 +* 随着时间的推移,假设约翰和彼得变得赌博成瘾,该程序可以帮助他们开发可靠的统计数据来衡量他们的连胜纪录。 +   +现在我们知道**什么是智能合约**和**它们如何工作**,我们还没有解决**为什么我们需要它们**。 + +### 智能合约的需要 + +正如之前的例子我们重点提到过的,出于各种原因,我们需要智能合约。 + +#### 透明度 + +交易对手非常清楚所涉及的条款和条件。此外,由于程序或智能合约的执行涉及某些明确的输入,因此用户可以非常直接地核实会影响他们和合约受益人的因素。 + +#### 时间效率 + +如上所述,智能合约一旦被控制变量或用户调用所触发,就立即开始工作。由于数据是通过区块链和网络中的其它来源即时提供给系统,因此执行不需要任何时间来验证和处理信息并解决交易。例如,转移土地所有权契约,这是一个涉及手工核实大量文书工作并且需要数周时间的过程,可以在几分钟甚至几秒钟内通过智能合约程序来处理文件和相关各方。 + +#### 精度 + +由于平台基本上只是计算机代码和预定义的内容,因此不存在主观错误,所有结果都是精确的,完全没有人为错误。 + +#### 安全 + +区块链的一个固有特征是每个数据块都是安全加密的。这意味着为了实现冗余,即使数据存储在网络上的多个节点上,**也只有数据所有者才能访问以查看和使用数据**。类似地,利用区块链在过程中存储重要变量和结果,所有过程都将是完全安全和防篡改的。同样也通过按时间顺序为审计人员提供原始的、未经更改的和不可否认的数据版本,简化了审计和法规事务。 + +#### 信任 + +这个文章系列开篇说到区块链为互联网及其上运行的服务增加了急需的信任层。智能合约在任何情况下都不会在执行协议时表现出偏见或主观性,这意味着所涉及的各方对结果完全有约束力,并且可以不附带任何条件地信任该系统。这也意味着,在具有重要价值的传统合同中所需的“可信第三方”,在此处不需要。当事人之间的犯规和监督将成为过去的问题。 + +#### 成本效益 + +如示例中所强调的,使用智能合约需要最低的成本。企业通常有专门从事使其交易合法并遵守法规的行政人员。如果交易涉及多方,则重复工作是不可避免的。智能合约基本上使前者无关紧要,并且消除了重复,因为双方可以同时完成尽职调查。 + +### 智能合约的应用 + +基本上,如果两个或多个参与方使用共同的区块链平台,并就一组原则或业务逻辑达成一致,他们可以一起在区块链上创建一个智能合约,并且在没有人为干预的情况下执行。没有人可以篡改所设置的条件,如果原始代码允许,任何更改都会加上时间戳并带有编辑者的指纹,从而增加了问责制。想象一下,在更大的企业级规模上出现类似的情况,你就会明白智能合约的能力是什么,实际上从 2016 年开始的 **Capgemini 研究** 发现智能合约实际上可能是**“未来几年的”** [^8] 商业主流。商业的应用涉及保险、金融市场、物联网、贷款、身份管理系统、托管账户、雇佣合同以及专利和版税合同等用途。像以太坊这样的区块链平台,是一个设计时就考虑了智能合约的系统,它允许个人私人用户免费使用智能合约。 + +通过对处理智能合约的公司的探讨,本系列的下一篇文章中将更全面地概述智能合约在当前技术问题上的应用。 + +### 那么,它有什么缺点呢? + +这并不是说对智能合约的使用没有任何顾虑。这种担忧实际上也减缓了这方面的发展。所有区块链的防篡改性质实质上使得,如果所涉及的各方需要在没有重大改革或法律追索的情况下,几乎不可能修改或添加现有条款的新条款。 + +其次,即使公有链上的活动是开放的,所有人都可以看到和观察。交易中涉及的各方的个人身份并不总是已知的。这种匿名性造成在任何一方违约的情况下法律有罪不罚的问题,特别是因为现行法律和立法者并不完全适应现代技术。 + +第三,区块链和智能合约在很多方面仍然存在安全缺陷,因为对其所以涉及的技术仍处于发展的初期阶段。 对代码和平台的这种缺乏经验最终导致了 2016 年的 DAO 事件。 + +所有这些都可能导致企业或公司在需要调整区块链以供其使用时需要大量的初始投资。然而,这些是最初的一次性投资,并且随之而来的是潜在的节约,这才是人们感兴趣的。 + +### 结论 + +目前的法律框架并没有真正支持一个全面的智能合约的社会,并且由于显然的原因,在不久的将来也不会支持。一个解决方案是选择**“混合”合约**,它将传统的法律文本和文件与在为此目的设计的区块链上运行的智能合约代码相结合。然而,即使是混合合约仍然很大程度上尚未得到探索,因为需要创新的立法机构才能实现这些合约。这里简要提到的应用以及更多内容将在[本系列的下一篇文章][6]中详细探讨。 + +[^1]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. +[^2]: S. C. A. Chamber of Digital Commerce, “Smart contracts – Is the law ready,” no. September, 2018. +[^4]: Cardozo Blockchain Project, “‘Smart Contracts’ & Legal Enforceability,” vol. 2, p. 28, 2018. +[^6]: F. Idelberger, G. Governatori, R. Riveret, and G. Sartor, “Evaluation of Logic-Based Smart Contracts for Blockchain Systems,” 2016, pp. 167–183. +[^8]: B. Cant et al., “Smart Contracts in Financial Services : Getting from Hype to Reality,” Capgemini Consult., pp. 1–24, 2016. + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ + +作者:[ostechnix][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/03/smart-contracts-720x340.png +[2]: https://linux.cn/article-10914-1.html +[3]: https://linux.cn/article-10650-1.html +[4]: http://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html +[5]: https://etherparty.com/ +[6]: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ +[7]: http://www.legal-glossary.org/ +[8]: https://futurism.com/the-dao-heist-undone-97-of-eth-holders-vote-for-the-hard-fork/ +[9]: https://www.everestgrp.com/2016-10-types-smart-contracts-based-applications-market-insights-36573.html/ diff --git a/published/201906/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md b/published/201906/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md new file mode 100644 index 0000000000..587c69b785 --- /dev/null +++ b/published/201906/20190331 How to build a mobile particulate matter sensor with a Raspberry Pi.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10939-1.html) +[#]: subject: (How to build a mobile particulate matter sensor with a Raspberry Pi) +[#]: via: (https://opensource.com/article/19/3/mobile-particulate-matter-sensor) +[#]: author: (Stephan Tetzel https://opensource.com/users/stephan) + +如何用树莓派搭建一个颗粒物传感器 +====== + +> 用树莓派、一个廉价的传感器和一个便宜的屏幕监测空气质量。 + +![](https://img.linux.net.cn/data/attachment/album/201906/05/005121bbveeavwgyc1i1gk.jpg) + +大约一年前,我写了一篇关于如何使用树莓派和廉价传感器测量[空气质量][2]的文章。我们这几年已在学校里和私下使用了这个项目。然而它有一个缺点:由于它基于无线/有线网,因此它不是便携的。如果你的树莓派、你的智能手机和电脑不在同一个网络的话,你甚至都不能访问传感器测量的数据。 + +为了弥补这一缺陷,我们给树莓派添加了一块小屏幕,这样我们就可以直接从该设备上读取数据。以下是我们如何为我们的移动细颗粒物传感器搭建并配置好屏幕。 + +### 为树莓派搭建好屏幕 + +在[亚马逊][3]、阿里巴巴以及其它来源有许多可以买到的树莓派屏幕,从 ePaper 屏幕到可触控 LCD。我们选择了一个便宜的带触控功能且分辨率为 320*480 像素的[3.5英寸 LCD][3],可以直接插进树莓派的 GPIO 引脚。3.5 英寸屏幕和树莓派几乎一样大,这一点不错。 + +当你第一次启动屏幕打开树莓派的时候,会因为缺少驱动屏幕会保持白屏。你得首先为屏幕安装[合适的驱动][5]。通过 SSH 登入并执行以下命令: + +``` +$ rm -rf LCD-show +$ git clone +$ chmod -R 755 LCD-show +$ cd LCD-show/ +``` + +为你的屏幕执行合适的命令以安装驱动。例如这是给我们 MPI3501 型屏幕的命令: + +``` +$ sudo ./LCD35-show +``` + +这行命令会安装合适的驱动并重启树莓派。 + +### 安装 PIXEL 桌面并设置自动启动 + +以下是我们想要我们项目能够做到的事情:如果树莓派启动,我们想要展现一个有我们空气质量测量数据的网站。 + +首先,安装树莓派的[PIXEL 桌面环境][6]: + +``` +$ sudo apt install raspberrypi-ui-mods +``` + +然后安装 Chromium 浏览器以显示网站: + +``` +$ sudo apt install chromium-browser +``` + +需要自动登录以使测量数据在启动后直接显示;否则你将只会看到登录界面。然而树莓派用户并没有默认设置好自动登录。你可以用 `raspi-config` 工具设置自动登录: + +``` +$ sudo raspi-config +``` + +在菜单中,选择:“3 Boot Options → B1 Desktop / CLI → B4 Desktop Autologin”。 + +在启动后用 Chromium 打开我们的网站这块少了一步。创建文件夹 `/home/pi/.config/lxsession/LXDE-pi/`: + +``` +$ mkdir -p /home/pi/config/lxsession/LXDE-pi/ +``` + +然后在该文件夹里创建 `autostart` 文件: + +``` +$ nano /home/pi/.config/lxsession/LXDE-pi/autostart +``` + +并粘贴以下代码: + +``` +#@unclutter +@xset s off +@xset -dpms +@xset s noblank + +# Open Chromium in Full Screen Mode +@chromium-browser --incognito --kiosk +``` + +如果你想要隐藏鼠标指针,你得安装 `unclutter` 包并移除 `autostart` 文件开头的注释。 + +``` +$ sudo apt install unclutter +``` + +![移动颗粒物传感器][7] + +我对去年的代码做了些小修改。因此如果你之前搭建过空气质量项目,确保用[原文章][2]中的指导为 AQI 网站重新下载脚本和文件。 + +通过添加触摸屏,你现在拥有了一个便携的颗粒物传感器!我们在学校用它来检查教室里的空气质量或者进行比较测量。使用这种配置,你无需再依赖网络连接或 WLAN。你可以在任何地方使用这个小型测量站——你甚至可以使用移动电源以摆脱电网。 + +* * * + +这篇文章原来在[开源学校解决方案][8]Open Scool Solutions上发表,获得许可重新发布。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/mobile-particulate-matter-sensor + +作者:[Stephan Tetzel][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stephan +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://linux.cn/article-9620-1.html +[3]: https://www.amazon.com/gp/search/ref=as_li_qf_sp_sr_tl?ie=UTF8&tag=openschoolsol-20&keywords=lcd%20raspberry&index=aps&camp=1789&creative=9325&linkCode=ur2&linkId=51d6d7676e10d6c7db203c4a8b3b529a +[4]: https://amzn.to/2CcvgpC +[5]: https://github.com/goodtft/LCD-show +[6]: https://linux.cn/article-8459-1.html +[7]: https://opensource.com/sites/default/files/uploads/mobile-aqi-sensor.jpg (Mobile particulate matter sensor) +[8]: https://openschoolsolutions.org/mobile-particulate-matter-sensor/ + diff --git a/published/201906/20190404 Running LEDs in reverse could cool computers.md b/published/201906/20190404 Running LEDs in reverse could cool computers.md new file mode 100644 index 0000000000..b3ebbed273 --- /dev/null +++ b/published/201906/20190404 Running LEDs in reverse could cool computers.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10984-1.html) +[#]: subject: (Running LEDs in reverse could cool computers) +[#]: via: (https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +反向运行 LED 能够冷却计算机 +====== + +> 电子产品的小型化正在触及其极限,部分原因在于热量管理。许多人现在都在积极地尝试解决这个问题。其中一种正在探索的途径是反向运行的 LED。 + +![monsitj / Getty Images][1] + +寻找更有效的冷却计算机的方法,几乎与渴望发现更好的电池化学成分一样,在科学家的研究日程中也处于重要位置。 + +更多的冷却手段对于降低成本至关重要。冷却技术也使得在较小的空间中可以进行更强大的处理,其有限的处理能力应该是进行计算而不是浪费热量。冷却技术可以阻止热量引起的故障,从而延长部件的使用寿命,并且可以促进环保的数据中心 —— 更少的热量意味着对环境的影响更小。 + +如何从微处理器中消除热量是科学家们一直在探索的一个方向,他们认为他们已经提出了一个简单而不寻常、且反直觉的解决方案。他们说可以运行一个发光二极管(LED)的变体,其电极反转可以迫使该元件表现得像处于异常低温下工作一样。如果将其置于较热的电子设备旁边,然后引入纳米级间隙,可以使 LED 吸收热量。 + +“一旦 LED 反向偏置,它就会像一个非常低温的物体一样,吸收光子,”密歇根大学机械工程教授埃德加·梅霍夫在宣布了这一突破的[新闻稿][4]中说。 “与此同时,该间隙可防止热量返回,从而产生冷却效果。” + +研究人员表示,LED 和相邻的电子设备(在这种情况下是热量计,通常用于测量热能)必须非常接近。他们说他们已经能够证明达到了每平方米 6 瓦的冷却功率。他们解释说,这是差不多是地球表面所接受到的阳光的能量。 + +物联网(IoT)设备和智能手机可能是最终将受益于这种 LED 改造的电子产品。这两种设备都需要在更小的空间中容纳更多的计算功率。 + +“从微处理器中可以移除的热量开始限制在给定空间内容纳的功率,”密歇根大学的公告说。 + +### 材料科学和冷却计算机 + +[我之前写过关于新形式的计算机冷却的文章][5]。源自材料科学的外来材料是正在探索的想法之一。美国能源部劳伦斯伯克利国家实验室表示,钠铋(Na3Bi)可用于晶体管设计。这种新物质带电荷,重要的是具有可调节性;但是,它不需要像超导体那样进行冷却。 + +事实上,这是超导体的一个问题。不幸的是,它们比大多数电子设备需要更多的冷却 —— 通过极端冷却消除电阻。 + +另外,[康斯坦茨大学的德国研究人员][6]表示他们很快将拥有超导体驱动的计算机,没有废热。他们计划使用电子自旋 —— 一种新的电子物理维度,可以提高效率。该大学去年在一份新闻稿中表示,这种方法“显著降低了计算中心的能耗”。 + +另一种减少热量的方法可能是用嵌入在微处理器上的[螺旋和回路来取代传统的散热器][7]。宾汉姆顿大学的科学家们表示,印在芯片上的微小通道可以为冷却剂提供单独的通道。 + +康斯坦茨大学说:“半导体技术的小型化正在接近其物理极限。”热管理现在被科学家提上了议事日程。这是“小型化的一大挑战”。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386876/running-leds-in-reverse-could-cool-computers.html#tk.rss_all + +作者:[Patrick Nelson][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/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-944444446_3x2-100787357-large.jpg +[2]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[3]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[4]: https://news.umich.edu/running-an-led-in-reverse-could-cool-future-computers/ +[5]: https://www.networkworld.com/article/3326831/computers-could-soon-run-cold-no-heat-generated.html +[6]: https://www.uni-konstanz.de/en/university/news-and-media/current-announcements/news/news-in-detail/Supercomputer-ohne-Abwaerme/ +[7]: https://www.networkworld.com/article/3322956/chip-cooling-breakthrough-will-reduce-data-center-power-costs.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md b/published/201906/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md new file mode 100644 index 0000000000..dbc3c03306 --- /dev/null +++ b/published/201906/20190405 Blockchain 2.0 - Ongoing Projects (The State Of Smart Contracts Now) -Part 6.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11013-1.html) +[#]: subject: (Blockchain 2.0 – Ongoing Projects (The State Of Smart Contracts Now) [Part 6]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +区块链 2.0:智能合约如今的发展(六) +====== + +![The State Of Smart Contracts Now][1] + +继续我们的[前面的关于智能合约的文章][2],这篇文章旨在讨论智能合约的发展形势,重点介绍目前正在该领域进行开发的一些项目和公司。如本系列前一篇文章中讨论的,智能合约是在区块链网络上存在并执行的程序。我们探讨了智能合约的工作原理以及它们优于传统数字平台的原因。这里描述的公司分布于各种各样的行业中,但是大多涉及到身份管理系统、金融服务、众筹系统等,因为这些是被认为最适合切换到基于区块链的数据库系统的领域。 + +### 开放平台 + +诸如 [Counterparty][8] 和 Solidity(以太坊)等平台是完全公用的构建模块,开发者可以以之创建自己的智能合约。大量的开发人员参与此类项目使这些项目成为开发智能合约、设计自己的加密货币令牌系统,以及创建区块链运行协议的事实标准。许多值得称赞的项目都来源于它们。摩根大通派生自以太坊的 [Quorum][9],就是一个例子。而瑞波是另一个例子。 + +### 管理金融交易 + +通过互联网转账加密货币被吹捧为在未来几年会成为常态。与此相关的不足之处是: + +* 身份和钱包地址是匿名的。如果接收方不履行交易,则付款人没有任何第一追索权。 +* 错误交易(如果无法追踪任何交易)。 +* 密码生成的哈希密钥很难用于人类,人为错误是主要关注点。 + +在这种情况下,可以让其他人暂时接受该交易并在接受尽职调查后与接收方结算。 + +[EscrowMyEther][10] 和 [PAYFAIR][11] 是两个这样的托管平台。基本上,托管公司采用商定的金额并向接收方发送令牌。一旦接收方通过相同的托管平台提供付款人想要的内容,两者都会确认并最终付款。 这些得到了自由职业者和业余爱好者收藏家广泛在线使用。 + +### 金融服务 + +小额融资和小额保险项目的发展将改善世界上大多数贫穷或没有银行账户的人的银行金融服务。据估计,社会中较贫穷的“无银行账户”人群可以为银行和机构的增加 3800 亿美元收入 [^5]。这一金额要远远超过银行切换到区块链分布式账本技术(DLT)预期可以节省的运营费用。 + +位于美国中西部的 BankQu Inc. 的口号是“通过身份而尊严”。他们的平台允许个人建立他们自己的数字身份记录,其中所有交易将在区块链上实时审查和处理。在底层代码上记录并为其用户构建唯一的在线标识,从而实现超快速的交易和结算。BankQu 案例研究探讨了他们如何以这种方式帮助个人和公司,可以在[这里][3]看到。 + +[Stratumn][12] 正在帮助保险公司通过自动化早期由人类微观管理的任务来提供更好的保险服务。通过自动化、端到端可追溯性和高效的数据隐私方法,他们彻底改变了保险索赔的结算方式。改善客户体验以及显著降低成本为客户和相关的公司带来双赢局面。 + +法国保险公司 [AXA][14] 目前正在试行类似的努力。其产品 [fizzy][13] 允许用户以少量费用订阅其服务并输入他们的航班详细信息。如果航班延误或遇到其他问题,该程序会自动搜索在线数据库,检查保险条款并将保险金额记入用户的帐户。这样就用户或客户无需在手动检查条款后提出索赔,并且就长期而言,一旦这样的系统成为主流,就增加了航空公司的责任心。 + +### 跟踪所有权 + +理论上可以利用 DLT 中的带时间戳的数据块来跟踪媒体的创建到最终用户消费。Peertracks 公司和 Mycelia 公司目前正在帮助音乐家发布内容,而不必担心其内容被盗或被滥用。他们帮助艺术家直接向粉丝和客户销售,同时获得工作报酬,而无需通过权利和唱片公司 [^9]。 + +### 身份管理平台 + +基于区块链的身份管理平台可以将你的身份存储在分布式分类帐本中。设置帐户后,会对其进行安全加密,然后将其发送给所有参与节点。但是,作为数据块的所有者,只有该用户才能访问该数据。一旦你在网络上建立身份并开始交易,网络中的自动程序将验证与你的帐户关联的先前所有的交易,在检查要求后将其发送给监管备案,并在程序认为交易合法时自动执行结算。这里的好处是,由于区块链上的数据是防篡改的,而智能合约以零偏差(或主观性)检查输入,如前所述,交易不需要任何人的监督或批准,并且需要小心是即刻生效的。 + +像 [ShoCard][15] 、[Credits][16] 和 [OneName][17] 这样的初创公司目前正在推出类似的服务,目前正在与政府和社会机构进行谈判,以便将它们整合到主流用途中。 + +开发商的其他独立项目如 Chris Ellis 和 David Duccini 分别开发或提出了替代的身份管理系统,分别是 “[世界公民][4]”和 [IDCoin][5]。Ellis 先生甚至通过在区块链网络上创建护照来证明他的工作能力。 + +### 资源共享 + +[Share & Charge][18] ([Slock.It][19]) 是一家欧洲的区块链初创公司。他们的移动应用程序允许房主和其他个人投入资金建立充电站与其他正在寻找快速充电的人分享他们的资源。这不仅使业主能够收回他们的一些投资,而且还允许 EV 司机在其近地域获得更多的充电点,从而允许供应商以方便的方式满足需求。一旦“客户”完成对其车辆的充电,相关的硬件就会创建一个由数据组成的安全时间戳块,并且在该平台上工作的智能合约会自动将相应的金额记入所有者账户。记录所有此类交易的跟踪并保持适当的安全验证。有兴趣的读者可以看一下[这里][6],了解他们产品背后的技术角度。该公司的平台将逐步使用户能够与有需要的个人分享其他产品和服务,并从中获得被动收入。 + +我们在这里看到的公司,以及一个很短的正在进行中的项目的清单,这些项目利用智能合约和区块链数据库系统。诸如此类的平台有助于构建一个安全的“盒子”,其中包含仅由用户自己、其上的代码或智能合约访问的信息。基于触发器对信息进行实时审查、检查,并且算法由系统执行。这样的平台人为监督最小化,这是在安全数字自动化方面朝着正确方向迈出的急需的一步,这在以前从未被考虑过如此规模。 + +下一篇文章将阐述不同类型的区块链。单击以下链接以了解有关此主题的更多信息。 + +* [区块链 2.0:公有链与私有链的比较][7] + + +[^5]: B. Pani, “Blockchain Powered Financial Inclusion,” 2016. +[^9]: M. Gates, “Blockchain. Ultimate guide to understanding blockchain bitcoin cryptocurrencies smart-contracts and the future of money.pdf.” 2017. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-ongoing-projects-the-state-of-smart-contracts-now/ + +作者:[ostechnix][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/State-Of-Smart-Contracts-720x340.png +[2]: https://linux.cn/article-10956-1.html +[3]: https://banqu.co/case-study/ +[4]: https://github.com/MrChrisJ/World-Citizenship +[5]: https://github.com/IDCoin/IDCoin +[6]: https://blog.slock.it/share-charge-smart-contracts-the-technical-angle-58b93ce80f15 +[7]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[8]: https://counterparty.io/platform/ +[9]: https://www.jpmorgan.com/global/Quorum +[10]: http://escrowmyether.com/ +[11]: https://payfair.io/ +[12]: https://stratumn.com/business-case/insurance-claim-automation-across-europe/ +[13]: https://fizzy.axa/en-gb/ +[14]: https://group.axa.com/en/newsroom/news/axa-goes-blockchain-with-fizzy +[15]: https://techcrunch.com/2015/05/05/shocard-is-a-digital-identity-card-on-the-blockchain/ +[16]: https://techcrunch.com/2014/10/31/your-next-passport-could-be-on-the-blockchain/ +[17]: https://wiki.namecoin.org/index.php?title=OneName +[18]: https://blog.slock.it/share-charge-launches-its-app-on-boards-over-1-000-charging-stations-on-the-blockchain-ba8275390309 +[19]: https://slock.it/ diff --git a/published/201906/20190409 5 Linux rookie mistakes.md b/published/201906/20190409 5 Linux rookie mistakes.md new file mode 100644 index 0000000000..dadd5807a8 --- /dev/null +++ b/published/201906/20190409 5 Linux rookie mistakes.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10952-1.html) +[#]: subject: (5 Linux rookie mistakes) +[#]: via: (https://opensource.com/article/19/4/linux-rookie-mistakes) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p) + +5 个 Linux 新手会犯的失误 +====== + +> Linux 爱好者们分享了他们犯下的一些最大错误。 + +![](https://img.linux.net.cn/data/attachment/album/201906/09/103635akfkghwh5mp58g68.jpg) + +终身学习是明智的 —— 它可以让你的思维敏捷,让你在就业市场上更具竞争力。但是有些技能比其他技能更难学,尤其是那些小菜鸟错误,当你尝试修复它们时可能会花费你很多时间,给你带来很大困扰。 + +以学习 [Linux][2] 为例。如果你习惯于在 Windows 或 MacOS 图形界面中工作,那么转移到 Linux,要将不熟悉的命令输入到终端中,可能会有很大的学习曲线。但是,其回报是值得的,因为已经有数以百万计的人们已经证明了这一点。 + +也就是说,这趟学习之旅并不是一帆风顺的。我们让一些 Linux 爱好者回想了一下他们刚开始使用 Linux 的时候,并告诉我们他们犯下的最大错误。 + +“不要进入[任何类型的命令行界面(CLI)工作]时就期望命令会以合理或一致的方式工作,因为这可能会导致你感到挫折。这不是因为设计选择不当 —— 虽然当你在键盘上敲击时就像在敲在你的脑袋上一样 —— 而是反映了这些系统是历经了几代的软件和操作系统的发展而陆续添加完成的事实。顺其自然,写下或记住你需要的命令,并且(尽量不要)在[事情不是你所期望的][3]时感到沮丧。” —— [Gina Likins] [4] + +“尽可能简单地复制和粘贴命令以使事情顺利进行,首先阅读命令,至少对将要执行的操作有一个大致的了解,特别是如果有管道命令时,如果有多个管道更要特别注意。有很多破坏性的命令看起来无害 —— 直到你意识到它们能做什么(例如 `rm`、`dd`),而你不会想要意外破坏什么东西(别问我怎么知道)。” —— [Katie McLaughlin] [5] + +“在我的 Linux 之旅的早期,我并不知道我所处在文件系统中的位置的重要性。我正在删除一些我认为是我的主目录的文件,我输入了 `sudo rm -rf *`,然后就删除了我系统上的所有启动文件。现在,我经常使用 `pwd` 来确保我在发出这样的命令之前确认我在哪里。幸运的是,我能够使用 USB 驱动器启动被搞坏的笔记本电脑并恢复我的文件。” —— [Don Watkins] [6] + +“不要因为你认为‘权限很难理解’而你希望应用程序可以访问某些内容时就将整个文件系统的权限重置为 [777][7]。”—— [Matthew Helmke] [8] + +“我从我的系统中删除一个软件包,而我没有检查它依赖的其他软件包。我只是让它删除它想删除要的东西,最终导致我的一些重要程序崩溃并变得不可用。” —— [Kedar Vijay Kulkarni] [9] + +你在学习使用 Linux 时犯过什么错误?请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-rookie-mistakes + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/bcotton/users/petercheer/users/greg-p/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/mistake_bug_fix_find_error.png?itok=PZaz3dga (magnifying glass on computer screen, finding a bug in the code) +[2]: https://opensource.com/resources/linux +[3]: https://lintqueen.com/2017/07/02/learning-while-frustrated/ +[4]: https://opensource.com/users/lintqueen +[5]: https://opensource.com/users/glasnt +[6]: https://opensource.com/users/don-watkins +[7]: https://www.maketecheasier.com/file-permissions-what-does-chmod-777-means/ +[8]: https://twitter.com/matthewhelmke +[9]: https://opensource.com/users/kkulkarn diff --git a/published/201906/20190409 5 open source mobile apps.md b/published/201906/20190409 5 open source mobile apps.md new file mode 100644 index 0000000000..e51f6dbc93 --- /dev/null +++ b/published/201906/20190409 5 open source mobile apps.md @@ -0,0 +1,108 @@ +[#]: collector: "lujun9972" +[#]: translator: "fuzheng1998" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10931-1.html" +[#]: subject: "5 open source mobile apps" +[#]: via: "https://opensource.com/article/19/4/mobile-apps" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen" + +5 个可以满足你的生产力、沟通和娱乐需求的开源手机应用 +====== + +> 你可以依靠这些应用来满足你的生产力、沟通和娱乐需求。 + +![](https://img.linux.net.cn/data/attachment/album/201906/03/001949brnq19j5qeqn3onv.jpg) + +像世界上大多数人一样,我的手似乎就没有离开过手机。多亏了我从 Google Play 和 F-Droid 安装的开源移动应用程序,让我的 Android 设备好像提供了无限的沟通、生产力和娱乐服务一样。 + +在我的手机上的许多开源应用程序中,当想听音乐、与朋友/家人和同事联系、或者在旅途中完成工作时,以下五个是我一直使用的。 + +### MPDroid + +一个音乐播放器进程 (MPD)的 Android 控制器。 + +![MPDroid][2] + +MPD 是将音乐从小型音乐服务器电脑传输到大型的黑色立体声音箱的好方法。它直连 ALSA,因此可以通过 ALSA 硬件接口与数模转换器(DAC)对话,它可以通过我的网络进行控制——但是用什么东西控制呢?好吧,事实证明 MPDroid 是一个很棒的 MPD 控制器。它可以管理我的音乐数据库,显示专辑封面,处理播放列表,并支持互联网广播。而且它是开源的,所以如果某些东西不好用的话…… + +MPDroid 可在 [Google Play][4] 和 [F-Droid][5] 上找到。 + +### RadioDroid + +一台能单独使用及与 Chromecast 搭配使用的 Android 网络收音机。 + +![RadioDroid][6] + +RadioDroid 是一个网络收音机,而 MPDroid 则管理我音乐的数据库;从本质上讲,RadioDroid 是 [Internet-Radio.com][7] 的一个前端。此外,通过将耳机插入 Android 设备,通过耳机插孔或 USB 将 Android 设备直接连接到立体声系统,或通过兼容设备使用其 Chromecast 功能,可以享受 RadioDroid。这是一个查看芬兰天气情况,听取排名前 40 的西班牙语音乐,或收到到最新新闻消息的好方法。 + +RadioDroid 可在 [Google Play][8] 和 [F-Droid][9] 上找到。 + +### Signal + +一个支持 Android、iOS,还有桌面系统的安全即时消息客户端。 + +![Signal][10] + +如果你喜欢 WhatsApp,但是因为它与 Facebook [日益密切][11]的关系而感到困扰,那么 Signal 应该是你的下一个产品。Signal 的唯一问题是说服你的朋友们最好用 Signal 取代 WhatsApp。但除此之外,它有一个与 WhatsApp 类似的界面;很棒的语音和视频通话;很好的加密;恰到好处的匿名;并且它受到了一个不打算通过使用软件来获利的基金会的支持。为什么不喜欢它呢? + +Signal 可用于 [Android][12]、[iOS][13] 和 [桌面][14]。 + +### ConnectBot + +Android SSH 客户端。 + +![ConnectBot][15] + +有时我离电脑很远,但我需要登录服务器才能办事。[ConnectBot][16] 是将 SSH 会话搬到手机上的绝佳解决方案。 + +ConnectBot 可在 [Google Play][17] 上找到。 + +### Termux + +有多种熟悉的功能的安卓终端模拟器。 + +![Termux][18] + +你是否需要在手机上运行 `awk` 脚本?[Termux][19] 是个解决方案。如果你需要做终端类的工作,而且你不想一直保持与远程计算机的 SSH 连接,请使用 ConnectBot 将文件放到手机上,然后退出会话,在 Termux 中执行你的操作,用 ConnectBot 发回结果。 + +Termux 可在 [Google Play][20] 和 [F-Droid][21] 上找到。 + +* * * + +你最喜欢用于工作或娱乐的开源移动应用是什么呢?请在评论中分享它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/mobile-apps + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[fuzheng1998](https://github.com/fuzheng1998) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen/users/bcotton/users/clhermansen/users/bcotton/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://opensource.com/sites/default/files/uploads/mpdroid.jpg "MPDroid" +[3]: https://opensource.com/article/17/4/fun-new-gadget +[4]: https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid&hl=en_US +[5]: https://f-droid.org/en/packages/com.namelessdev.mpdroid/ +[6]: https://opensource.com/sites/default/files/uploads/radiodroid.png "RadioDroid" +[7]: https://www.internet-radio.com/ +[8]: https://play.google.com/store/apps/details?id=net.programmierecke.radiodroid2 +[9]: https://f-droid.org/en/packages/net.programmierecke.radiodroid2/ +[10]: https://opensource.com/sites/default/files/uploads/signal.png "Signal" +[11]: https://opensource.com/article/19/3/open-messenger-client +[12]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms +[13]: https://itunes.apple.com/us/app/signal-private-messenger/id874139669?mt=8 +[14]: https://signal.org/download/ +[15]: https://opensource.com/sites/default/files/uploads/connectbot.png "ConnectBot" +[16]: https://connectbot.org/ +[17]: https://play.google.com/store/apps/details?id=org.connectbot +[18]: https://opensource.com/sites/default/files/uploads/termux.jpg "Termux" +[19]: https://termux.com/ +[20]: https://play.google.com/store/apps/details?id=com.termux +[21]: https://f-droid.org/packages/com.termux/ diff --git a/published/201906/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md b/published/201906/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md new file mode 100644 index 0000000000..1038abc8c2 --- /dev/null +++ b/published/201906/20190409 VSCodium- 100- Open Source Version of Microsoft VS Code.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11023-1.html) +[#]: subject: (VSCodium: 100% Open Source Version of Microsoft VS Code) +[#]: via: (https://itsfoss.com/vscodium/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +VSCodium:100% 开源的 VS Code +====== + +> VSCodium 是微软流行的 Visual Studio Code 编辑器的一个分支。它与 VS Code 完全相同,唯一不同的是,VSCodium 不跟踪你的使用数据。 + +微软的 [Visual Studio Code][1] 是一个出色的编辑器,不仅对于 Web 开发人员,也适合其他程序员。由于它的功能,它被认为是最好的开源代码编辑器之一。 + +是的,它是微软众多开源产品之一。因为有 DEB、RPM 和 Snap 包形式的二进制文件,你可以[在 Linux 中轻松安装 Visual Studio Code][2]。 + +但它存在一个问题,对于普通用户而言可能不是问题,但对于纯粹开源主义者而言是重要的。 + +Microsoft 说提供的二进制文件是不开源的。 + +感到困惑么?让我解释下。 + +VS Code 的源码是在 MIT 许可下开源的。你可以在 [GitHub][3] 上访问它。但是,[Microsoft 创建的安装包含专有的跟踪程序][4]。 + +此跟踪基本上用来收集使用数据并将其发送给 Microsoft 以“帮助改进其产品和服务”。如今,远程报告在软件产品中很常见。即使 [Ubuntu 也这样做,但它透明度更高][5]。 + +你可以[在 VS Code 中禁用远程报告][6],但是你能完全信任微软吗?如果答案是否定的,那你有什么选择? + +你可以从源代码构建它,从而保持全都是开源的。但是如今[从源代码安装][7]并不总是最好的选择,因为我们习惯于使用二进制文件。 + +另一种选择是使用 VSCodium ! + +### VSCodium:100% 开源形式的 Visual Studio Code + +![][8] + +[VSCodium][9] 是微软 Visual Studio Code 的一个分支。该项目的唯一目的是为你提供现成的二进制文件,而没有 Microsoft 的远程收集代码。 + +这解决了你想在去掉 Microsoft 的专有代码的情况下使用 VS Code ,而你又不习惯从源代码构建它的问题。 + +由于 [VSCodium 是 VS Code 的一个分支][11],它的外观和功能与 VS Code 完全相同。 + +这是 Ubuntu 中第一次运行 VS Code 和 VSCodium 的截图。你能分辨出来吗? + +![Can you guess which is VSCode and VSCodium?][12] + +如果你无法区分这两者,请看下面。 + +![That’s Microsoft][13] + +除此之外,还有两个应用的 logo,没有其他明显的区别。 + +![VSCodium and VS Code in GNOME Menu][14] + +#### 在 Linux 上安装 VSCodium + +虽然 VSCodium 存在于某些发行版(如 Parrot OS)中,但你必须在其他 Linux 发行版中添加额外的仓库。 + +在基于 Ubuntu 和 Debian 的发行版上,你可以使用以下命令安装 VSCodium。 + +首先,添加仓库的 GPG 密钥: + +``` +wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add - +``` + +然后添加仓库: + +``` +echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list +``` + +现在更新你的系统并安装 VSCodium: + +``` +sudo apt update && sudo apt install codium +``` + +你可以在它的页面上找到[其他发行版的安装说明][15]。你还应该阅读[有关从 VS Code 迁移到 VSCodium 的说明][16]。 + +### 你如何看待 VSCodium? + +就个人而言,我喜欢 VSCodium 的概念。说的老套一点,它的初心是好的。我认为,致力于开源的 Linux 发行版甚至可能开始将其包含在官方仓库中。 + +你怎么看?是否值得切换到 VSCodium 或者你选择关闭远程报告并继续使用 VS Code? + +请不要出现“我使用 Vim” 的评论 :D + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vscodium/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://code.visualstudio.com/ +[2]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[3]: https://github.com/Microsoft/vscode +[4]: https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 +[5]: https://itsfoss.com/ubuntu-data-collection-stats/ +[6]: https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting +[7]: https://itsfoss.com/install-software-from-source-code/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium.png?resize=800%2C450&ssl=1 +[9]: https://vscodium.com/ +[11]: https://github.com/VSCodium/vscodium +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-vs-vscode.png?resize=800%2C450&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-vscode-tracking.png?resize=800%2C259&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/vscodium-and-vscode.jpg?resize=800%2C220&ssl=1 +[15]: https://vscodium.com/#install +[16]: https://vscodium.com/#migrate diff --git a/published/201906/20190410 How we built a Linux desktop app with Electron.md b/published/201906/20190410 How we built a Linux desktop app with Electron.md new file mode 100644 index 0000000000..2afe6f57d6 --- /dev/null +++ b/published/201906/20190410 How we built a Linux desktop app with Electron.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10957-1.html) +[#]: subject: (How we built a Linux desktop app with Electron) +[#]: via: (https://opensource.com/article/19/4/linux-desktop-electron) +[#]: author: (Nils Ganther https://opensource.com/users/nils-ganther) + +我们是如何使用 Electron 构建 Linux 桌面应用程序的 +====== + +> 这是借助 Electron 框架,构建一个在 Linux 桌面上原生运行的开源电子邮件服务的故事。 + +![document sending](https://img.linux.net.cn/data/attachment/album/201906/10/123114abz0lvbllktkulx7.jpg) + +[Tutanota][2] 是一种安全的开源电子邮件服务,它可通过浏览器使用,也有 iOS 和 Android 应用。其客户端代码在 GPLv3 下发布,Android 应用程序可在 [F-Droid][3] 上找到,以便每个人都可以使用完全与 Google 无关的版本。 + +由于 Tutanota 关注开源和 Linux 客户端开发,因此我们希望为 Linux 和其他平台发布一个桌面应用程序。作为一个小团队,我们很快就排除了为 Linux、Windows 和 MacOS 构建原生应用程序的可能性,并决定使用 [Electron][4] 来构建我们的应用程序。 + +对于任何想要快速交付视觉一致的跨平台应用程序的人来说,Electron 是最适合的选择,尤其是如果你已经有一个 Web 应用程序,想要从浏览器 API 的束缚中摆脱出来时。Tutanota 就是这样一个案例。 + +Tutanota 基于 [SystemJS][5] 和 [Mithril][6],旨在为每个人提供简单、安全的电子邮件通信。 因此,它必须提供很多用户期望从电子邮件客户端获得的标准功能。 + +由于采用了现代 API 和标准,其中一些功能(如基本的推送通知、搜索文本和联系人以及支持双因素身份验证)很容易在浏览器中提供。其它功能(例如自动备份或无需我们的服务器中转的 IMAP 支持)需要对系统资源的限制性访问,而这正是 Electron 框架提供的功能。 + +虽然有人批评 Electron “只是一个基本的包装”,但它有明显的好处: + +* Electron 可以使你能够快速地为 Linux、Windows 和 MacOS 桌面构造 Web 应用。事实上,大多数 Linux 桌面应用都是使用 Electron 构建的。 +* Electron 可以轻松地将桌面客户端与 Web 应用程序达到同样的功能水准。 +* 发布桌面应用程序后,你可以自由使用开发功能添加桌面端特定的功能,从而增强可用性和安全性。 +* 最后但同样重要的是,这是让应用程序具备原生的感觉、融入用户系统,而同时保持其识别度的好方法。 +   +### 满足用户的需求 + +Tutanota 不依靠于大笔的投资资金,而是依靠社区驱动的项目。基于越来越多的用户升级到我们的免费服务的付费计划,我们有机地发展我们的团队。倾听用户的需求不仅对我们很重要,而且对我们的成功至关重要。 + +提供桌面客户端是 Tutanota 用户[最想要的功能][7],我们感到自豪的是,我们现在可以为所有用户提供免费的桌面客户端测试版。(我们还实现了另一个高度要求的功能 —— [搜索加密数据][8] —— 但这是另一个主题了。) + +我们喜欢为用户提供签名版本的 Tutanota 并支持浏览器中无法实现的功能,例如通过后台进程推送通知。 现在,我们计划添加更多特定于桌面的功能,例如 IMAP 支持(而不依赖于我们的服务器充当代理),自动备份和离线可用性。 + +我们选择 Electron 是因为它的 Chromium 和 Node.js 的组合最适合我们的小型开发团队,因为它只需要对我们的 Web 应用程序进行最小的更改。在我们开始使用时,可以将浏览器 API 用于所有功能特别有用,随着我们的进展,慢慢地用更多原生版本替换这些组件。这种方法对附件下载和通知特别方便。 + +### 调整安全性 + +我们知道有些人关注 Electron 的安全问题,但我们发现 Electron 在 Web 应用程序中微调访问的选项非常令人满意。你可以使用 Electron 的[安全文档][9]和 Luca Carettoni 的[Electron 安全清单][10]等资源,来帮助防止 Web 应用程序中不受信任的内容发生灾难性事故。 + +### 实现特定功能 + +Tutanota Web 客户端从一开始就构建了一个用于进程间通信的可靠协议。我们利用 Web 线程在加密和请求数据时保持用户界面(UI)响应性。当我们开始实现我们的移动应用时,这就派上用场,这些应用程序使用相同的协议在原生部分和 Web 视图之间进行通信。 + +这就是为什么当我们开始构建桌面客户端时,很多用于本机推送通知、打开邮箱和使用文件系统的部分等已经存在,因此只需要实现原生端(Node.js)。 + +另一个便利是我们的构建过程使用 [Babel 转译器][11],它允许我们以现代 ES6 JavaScript 编写整个代码库,并在不同环境之间混合和匹配功能模块。这使我们能够快速调整基于 Electron 的桌面应用程序的代码。但是,我们也遇到了一些挑战。 + +### 克服挑战 + +虽然 Electron 允许我们很容易地与不同平台的桌面环境集成,但你不能低估投入的时间!最后,正是这些小事情占用了比我们预期更多的时间,但对完成桌面客户端项目也至关重要。 + +特定于平台的代码导致了大部分阻碍: + +* 例如,窗口管理和托盘仍然在三个平台上以略有不同的方式处理。 +* 注册 Tutanota 作为默认邮件程序并设置自动启动需要深入 Windows 注册表,同时确保以 [UAC] [12] 兼容的方式提示用户进行管理员访问。 +* 我们需要使用 Electron 的 API 作为快捷方式和菜单,以提供复制、粘贴、撤消和重做等标准功能。 + +由于用户对不同平台上的应用程序的某些(有时不直接兼容)行为的期望,此过程有点复杂。使三个版本感觉像原生的需要一些迭代,甚至需要对 Web 应用程序进行一些适度的补充,以提供类似于浏览器中的文本搜索的功能。 + +### 总结 + +我们在 Electron 方面的经验基本上是积极的,我们在不到四个月的时间内完成了该项目。尽管有一些相当耗时的功能,但我们感到惊讶的是,我们可以轻松地为 Linux 提供一个测试版的 [Tutanota 桌面客户端][13]。如果你有兴趣,可以深入了解 [GitHub][14] 上的源代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/linux-desktop-electron + +作者:[Nils Ganther][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/nils-ganther +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ (document sending) +[2]: https://tutanota.com/ +[3]: https://f-droid.org/en/packages/de.tutao.tutanota/ +[4]: https://electronjs.org/ +[5]: https://github.com/systemjs/systemjs +[6]: https://mithril.js.org/ +[7]: https://tutanota.uservoice.com/forums/237921-general/filters/top?status_id=1177482 +[8]: https://tutanota.com/blog/posts/first-search-encrypted-data/ +[9]: https://electronjs.org/docs/tutorial/security +[10]: https://www.blackhat.com/docs/us-17/thursday/us-17-Carettoni-Electronegativity-A-Study-Of-Electron-Security-wp.pdf +[11]: https://babeljs.io/ +[12]: https://en.wikipedia.org/wiki/User_Account_Control +[13]: https://tutanota.com/blog/posts/desktop-clients/ +[14]: https://www.github.com/tutao/tutanota diff --git a/published/201906/20190411 Be your own certificate authority.md b/published/201906/20190411 Be your own certificate authority.md new file mode 100644 index 0000000000..e5f09b6935 --- /dev/null +++ b/published/201906/20190411 Be your own certificate authority.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10921-1.html) +[#]: subject: (Be your own certificate authority) +[#]: via: (https://opensource.com/article/19/4/certificate-authority) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez/users/elenajon123) + + +自己成为一个证书颁发机构(CA) +====== + +> 为你的微服务架构或者集成测试创建一个简单的内部 CA。 + +![](https://img.linux.net.cn/data/attachment/album/201905/31/091023sg9s0ss11rsoseqg.jpg) + +传输层安全([TLS][2])模型(有时也称它的旧名称 SSL)基于[证书颁发机构][3]certificate authoritie(CA)的概念。这些机构受到浏览器和操作系统的信任,从而*签名*服务器的的证书以用于验证其所有权。 + +但是,对于内部网络,微服务架构或集成测试,有时候*本地 CA*更有用:一个只在内部受信任的 CA,然后签名本地服务器的证书。 + +这对集成测试特别有意义。获取证书可能会带来负担,因为这会占用服务器几分钟。但是在代码中使用“忽略证书”可能会被引入到生产环境,从而导致安全灾难。 + +CA 证书与常规服务器证书没有太大区别。重要的是它被本地代码信任。例如,在 Python `requests` 库中,可以通过将 `REQUESTS_CA_BUNDLE` 变量设置为包含此证书的目录来完成。 + +在为集成测试创建证书的例子中,不需要*长期的*证书:如果你的集成测试需要超过一天,那么你应该已经测试失败了。 + +因此,计算**昨天**和**明天**作为有效期间隔: + +``` +>>> import datetime +>>> one_day = datetime.timedelta(days=1) +>>> today = datetime.date.today() +>>> yesterday = today - one_day +>>> tomorrow = today - one_day +``` + +现在你已准备好创建一个简单的 CA 证书。你需要生成私钥,创建公钥,设置 CA 的“参数”,然后自签名证书:CA 证书*总是*自签名的。最后,导出证书文件以及私钥文件。 + +``` +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives import hashes, serialization +from cryptography import x509 +from cryptography.x509.oid import NameOID + + +private_key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, + backend=default_backend() +) +public_key = private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.issuer_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'Simple Test CA'), +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.serial_number(x509.random_serial_number()) +builder = builder.public_key(public_key) +builder = builder.add_extension( + x509.BasicConstraints(ca=True, path_length=None), + critical=True) +certificate = builder.sign( + private_key=private_key, algorithm=hashes.SHA256(), + backend=default_backend() +) +private_bytes = private_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( + encoding=serialization.Encoding.PEM) +with open("ca.pem", "wb") as fout: + fout.write(private_bytes + public_bytes) +with open("ca.crt", "wb") as fout: + fout.write(public_bytes) +``` + +通常,真正的 CA 会需要[证书签名请求][4](CSR)来签名证书。但是,当你是自己的 CA 时,你可以制定自己的规则!可以径直签名你想要的内容。 + +继续集成测试的例子,你可以创建私钥并立即签名相应的公钥。注意 `COMMON_NAME` 需要是 `https` URL 中的“服务器名称”。如果你已配置名称查询,你需要服务器能响应对 `service.test.local` 的请求。 + +``` +service_private_key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, + backend=default_backend() +) +service_public_key = service_private_key.public_key() +builder = x509.CertificateBuilder() +builder = builder.subject_name(x509.Name([ + x509.NameAttribute(NameOID.COMMON_NAME, 'service.test.local') +])) +builder = builder.not_valid_before(yesterday) +builder = builder.not_valid_after(tomorrow) +builder = builder.public_key(public_key) +certificate = builder.sign( + private_key=private_key, algorithm=hashes.SHA256(), + backend=default_backend() +) +private_bytes = service_private_key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.TraditionalOpenSSL, + encryption_algorithm=serialization.NoEncrption()) +public_bytes = certificate.public_bytes( + encoding=serialization.Encoding.PEM) +with open("service.pem", "wb") as fout: + fout.write(private_bytes + public_bytes) +``` + +现在 `service.pem` 文件有一个私钥和一个“有效”的证书:它已由本地的 CA 签名。该文件的格式可以给 Nginx、HAProxy 或大多数其他 HTTPS 服务器使用。 + +通过将此逻辑用在测试脚本中,只要客户端配置信任该 CA,那么就可以轻松创建看起来真实的 HTTPS 服务器。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/certificate-authority + +作者:[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/users/elenajon123 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_commun_4604_02_mech_connections_rhcz0.5x.png?itok=YPPU4dMj +[2]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[3]: https://en.wikipedia.org/wiki/Certificate_authority +[4]: https://en.wikipedia.org/wiki/Certificate_signing_request diff --git a/published/201906/20190417 Inter-process communication in Linux- Sockets and signals.md b/published/201906/20190417 Inter-process communication in Linux- Sockets and signals.md new file mode 100644 index 0000000000..7a4c304246 --- /dev/null +++ b/published/201906/20190417 Inter-process communication in Linux- Sockets and signals.md @@ -0,0 +1,374 @@ +[#]: collector: "lujun9972" +[#]: translator: "FSSlc" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10930-1.html" +[#]: subject: "Inter-process communication in Linux: Sockets and signals" +[#]: via: "https://opensource.com/article/19/4/interprocess-communication-linux-networking" +[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" + +Linux 下的进程间通信:套接字和信号 +====== + +> 学习在 Linux 中进程是如何与其他进程进行同步的。 + +![](https://img.linux.net.cn/data/attachment/album/201906/02/234437y6gig4tg4yy94356.jpg) + +本篇是 Linux 下[进程间通信][1](IPC)系列的第三篇同时也是最后一篇文章。[第一篇文章][2]聚焦在通过共享存储(文件和共享内存段)来进行 IPC,[第二篇文章][3]则通过管道(无名的或者命名的)及消息队列来达到相同的目的。这篇文章将目光从高处(套接字)然后到低处(信号)来关注 IPC。代码示例将用力地充实下面的解释细节。 + +### 套接字 + +正如管道有两种类型(命名和无名)一样,套接字也有两种类型。IPC 套接字(即 Unix 套接字)给予进程在相同设备(主机)上基于通道的通信能力;而网络套接字给予进程运行在不同主机的能力,因此也带来了网络通信的能力。网络套接字需要底层协议的支持,例如 TCP(传输控制协议)或 UDP(用户数据报协议)。 + +与之相反,IPC 套接字依赖于本地系统内核的支持来进行通信;特别的,IPC 通信使用一个本地的文件作为套接字地址。尽管这两种套接字的实现有所不同,但在本质上,IPC 套接字和网络套接字的 API 是一致的。接下来的例子将包含网络套接字的内容,但示例服务器和客户端程序可以在相同的机器上运行,因为服务器使用了 `localhost`(127.0.0.1)这个网络地址,该地址表示的是本地机器上的本地机器地址。 + +套接字以流的形式(下面将会讨论到)被配置为双向的,并且其控制遵循 C/S(客户端/服务器端)模式:客户端通过尝试连接一个服务器来初始化对话,而服务器端将尝试接受该连接。假如万事顺利,来自客户端的请求和来自服务器端的响应将通过管道进行传输,直到其中任意一方关闭该通道,从而断开这个连接。 + +一个迭代服务器(只适用于开发)将一直和连接它的客户端打交道:从最开始服务第一个客户端,然后到这个连接关闭,然后服务第二个客户端,循环往复。这种方式的一个缺点是处理一个特定的客户端可能会挂起,使得其他的客户端一直在后面等待。生产级别的服务器将是并发的,通常使用了多进程或者多线程的混合。例如,我台式机上的 Nginx 网络服务器有一个 4 个工人worker的进程池,它们可以并发地处理客户端的请求。在下面的代码示例中,我们将使用迭代服务器,使得我们将要处理的问题保持在一个很小的规模,只关注基本的 API,而不去关心并发的问题。 + +最后,随着各种 POSIX 改进的出现,套接字 API 随着时间的推移而发生了显著的变化。当前针对服务器端和客户端的示例代码特意写的比较简单,但是它着重强调了基于流的套接字中连接的双方。下面是关于流控制的一个总结,其中服务器端在一个终端中开启,而客户端在另一个不同的终端中开启: + + * 服务器端等待客户端的连接,对于给定的一个成功连接,它就读取来自客户端的数据。 + * 为了强调是双方的会话,服务器端会对接收自客户端的数据做回应。这些数据都是 ASCII 字符代码,它们组成了一些书的标题。 + * 客户端将书的标题写给服务器端的进程,并从服务器端的回应中读取到相同的标题。然后客户端和服务器端都在屏幕上打印出标题。下面是服务器端的输出,客户端的输出也和它完全一样: + +``` +Listening on port 9876 for clients... +War and Peace +Pride and Prejudice +The Sound and the Fury +``` + +#### 示例 1. 使用套接字的客户端程序 + +```c +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +void report(const char* msg, int terminate) { + perror(msg); + if (terminate) exit(-1); /* failure */ +} + +int main() { + int fd = socket(AF_INET, /* network versus AF_LOCAL */ + SOCK_STREAM, /* reliable, bidirectional: TCP */ + 0); /* system picks underlying protocol */ + if (fd < 0) report("socket", 1); /* terminate */ + + /* bind the server's local address in memory */ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); /* clear the bytes */ + saddr.sin_family = AF_INET; /* versus AF_LOCAL */ + saddr.sin_addr.s_addr = htonl(INADDR_ANY); /* host-to-network endian */ + saddr.sin_port = htons(PortNumber); /* for listening */ + + if (bind(fd, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) + report("bind", 1); /* terminate */ + + /* listen to the socket */ + if (listen(fd, MaxConnects) < 0) /* listen for clients, up to MaxConnects */ + report("listen", 1); /* terminate */ + + fprintf(stderr, "Listening on port %i for clients...\n", PortNumber); + /* a server traditionally listens indefinitely */ + while (1) { + struct sockaddr_in caddr; /* client address */ + int len = sizeof(caddr); /* address length could change */ + + int client_fd = accept(fd, (struct sockaddr*) &caddr, &len); /* accept blocks */ + if (client_fd < 0) { + report("accept", 0); /* don't terminated, though there's a problem */ + continue; + } + + /* read from client */ + int i; + for (i = 0; i < ConversationLen; i++) { + char buffer[BuffSize + 1]; + memset(buffer, '\0', sizeof(buffer)); + int count = read(client_fd, buffer, sizeof(buffer)); + if (count > 0) { + puts(buffer); + write(client_fd, buffer, sizeof(buffer)); /* echo as confirmation */ + } + } + close(client_fd); /* break connection */ + } /* while(1) */ + return 0; +} +``` + +上面的服务器端程序执行典型的 4 个步骤来准备回应客户端的请求,然后接受其他的独立请求。这里每一个步骤都以服务器端程序调用的系统函数来命名。 + + 1. `socket(…)`:为套接字连接获取一个文件描述符 + 2. `bind(…)`:将套接字和服务器主机上的一个地址进行绑定 + 3. `listen(…)`:监听客户端请求 + 4. `accept(…)`:接受一个特定的客户端请求 + +上面的 `socket` 调用的完整形式为: + +``` +int sockfd = socket(AF_INET,      /* versus AF_LOCAL */ +                    SOCK_STREAM,  /* reliable, bidirectional */ +                    0);           /* system picks protocol (TCP) */ +``` + +第一个参数特别指定了使用的是一个网络套接字,而不是 IPC 套接字。对于第二个参数有多种选项,但 `SOCK_STREAM` 和 `SOCK_DGRAM`(数据报)是最为常用的。基于流的套接字支持可信通道,在这种通道中如果发生了信息的丢失或者更改,都将会被报告。这种通道是双向的,并且从一端到另外一端的有效载荷在大小上可以是任意的。相反的,基于数据报的套接字大多是不可信的,没有方向性,并且需要固定大小的载荷。`socket` 的第三个参数特别指定了协议。对于这里展示的基于流的套接字,只有一种协议选择:TCP,在这里表示的 `0`。因为对 `socket` 的一次成功调用将返回相似的文件描述符,套接字可以被读写,对应的语法和读写一个本地文件是类似的。 + +对 `bind` 的调用是最为复杂的,因为它反映出了在套接字 API 方面上的各种改进。我们感兴趣的点是这个调用将一个套接字和服务器端所在机器中的一个内存地址进行绑定。但对 `listen` 的调用就非常直接了: + +``` +if (listen(fd, MaxConnects) < 0) +``` + +第一个参数是套接字的文件描述符,第二个参数则指定了在服务器端处理一个拒绝连接错误之前,有多少个客户端连接被允许连接。(在头文件 `sock.h` 中 `MaxConnects` 的值被设置为 `8`。) + +`accept` 调用默认将是一个阻塞等待:服务器端将不做任何事情直到一个客户端尝试连接它,然后进行处理。`accept` 函数返回的值如果是 `-1` 则暗示有错误发生。假如这个调用是成功的,则它将返回另一个文件描述符,这个文件描述符被用来指代另一个可读可写的套接字,它与 `accept` 调用中的第一个参数对应的接收套接字有所不同。服务器端使用这个可读可写的套接字来从客户端读取请求然后写回它的回应。接收套接字只被用于接受客户端的连接。 + +在设计上,服务器端可以一直运行下去。当然服务器端可以通过在命令行中使用 `Ctrl+C` 来终止它。 + +#### 示例 2. 使用套接字的客户端 + +```c +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sock.h" + +const char* books[] = {"War and Peace", + "Pride and Prejudice", + "The Sound and the Fury"}; + +void report(const char* msg, int terminate) { + perror(msg); + if (terminate) exit(-1); /* failure */ +} + +int main() { + /* fd for the socket */ + int sockfd = socket(AF_INET, /* versus AF_LOCAL */ + SOCK_STREAM, /* reliable, bidirectional */ + 0); /* system picks protocol (TCP) */ + if (sockfd < 0) report("socket", 1); /* terminate */ + + /* get the address of the host */ + struct hostent* hptr = gethostbyname(Host); /* localhost: 127.0.0.1 */ + if (!hptr) report("gethostbyname", 1); /* is hptr NULL? */ + if (hptr->h_addrtype != AF_INET) /* versus AF_LOCAL */ + report("bad address family", 1); + + /* connect to the server: configure server's address 1st */ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = + ((struct in_addr*) hptr->h_addr_list[0])->s_addr; + saddr.sin_port = htons(PortNumber); /* port number in big-endian */ + + if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) + report("connect", 1); + + /* Write some stuff and read the echoes. */ + puts("Connect to server, about to write some stuff..."); + int i; + for (i = 0; i < ConversationLen; i++) { + if (write(sockfd, books[i], strlen(books[i])) > 0) { + /* get confirmation echoed from server and print */ + char buffer[BuffSize + 1]; + memset(buffer, '\0', sizeof(buffer)); + if (read(sockfd, buffer, sizeof(buffer)) > 0) + puts(buffer); + } + } + puts("Client done, about to exit..."); + close(sockfd); /* close the connection */ + return 0; +} +``` + +客户端程序的设置代码和服务器端类似。两者主要的区别既不是在于监听也不在于接收,而是连接: + +``` +if (connect(sockfd, (struct sockaddr*) &saddr, sizeof(saddr)) < 0) +``` + +对 `connect` 的调用可能因为多种原因而导致失败,例如客户端拥有错误的服务器端地址或者已经有太多的客户端连接上了服务器端。假如 `connect` 操作成功,客户端将在一个 `for` 循环中,写入它的请求然后读取返回的响应。在会话后,服务器端和客户端都将调用 `close` 去关闭这个可读可写套接字,尽管任何一边的关闭操作就足以关闭它们之间的连接。此后客户端可以退出了,但正如前面提到的那样,服务器端可以一直保持开放以处理其他事务。 + +从上面的套接字示例中,我们看到了请求信息被回显给客户端,这使得客户端和服务器端之间拥有进行丰富对话的可能性。也许这就是套接字的主要魅力。在现代系统中,客户端应用(例如一个数据库客户端)和服务器端通过套接字进行通信非常常见。正如先前提及的那样,本地 IPC 套接字和网络套接字只在某些实现细节上面有所不同,一般来说,IPC 套接字有着更低的消耗和更好的性能。它们的通信 API 基本是一样的。 + +### 信号 + +信号会中断一个正在执行的程序,在这种意义下,就是用信号与这个程序进行通信。大多数的信号要么可以被忽略(阻塞)或者被处理(通过特别设计的代码)。`SIGSTOP` (暂停)和 `SIGKILL`(立即停止)是最应该提及的两种信号。这种符号常量有整数类型的值,例如 `SIGKILL` 对应的值为 `9`。 + +信号可以在与用户交互的情况下发生。例如,一个用户从命令行中敲了 `Ctrl+C` 来终止一个从命令行中启动的程序;`Ctrl+C` 将产生一个 `SIGTERM` 信号。`SIGTERM` 意即终止,它可以被阻塞或者被处理,而不像 `SIGKILL` 信号那样。一个进程也可以通过信号和另一个进程通信,这样使得信号也可以作为一种 IPC 机制。 + +考虑一下一个多进程应用,例如 Nginx 网络服务器是如何被另一个进程优雅地关闭的。`kill` 函数: + +``` +int kill(pid_t pid, int signum); /* declaration */ +``` + +可以被一个进程用来终止另一个进程或者一组进程。假如 `kill` 函数的第一个参数是大于 `0` 的,那么这个参数将会被认为是目标进程的 `pid`(进程 ID),假如这个参数是 `0`,则这个参数将会被视作信号发送者所属的那组进程。 + +`kill` 的第二个参数要么是一个标准的信号数字(例如 `SIGTERM` 或 `SIGKILL`),要么是 `0` ,这将会对信号做一次询问,确认第一个参数中的 `pid` 是否是有效的。这样优雅地关闭一个多进程应用就可以通过向组成该应用的一组进程发送一个终止信号来完成,具体来说就是调用一个 `kill` 函数,使得这个调用的第二个参数是 `SIGTERM` 。(Nginx 主进程可以通过调用 `kill` 函数来终止其他工人进程,然后再停止自己。)就像许多库函数一样,`kill` 函数通过一个简单的可变语法拥有更多的能力和灵活性。 + +#### 示例 3. 一个多进程系统的优雅停止 + +```c +#include +#include +#include +#include +#include + +void graceful(int signum) { +  printf("\tChild confirming received signal: %i\n", signum); +  puts("\tChild about to terminate gracefully..."); +  sleep(1); +  puts("\tChild terminating now..."); +  _exit(0); /* fast-track notification of parent */ +} + +void set_handler() { +  struct sigaction current; +  sigemptyset(¤t.sa_mask);         /* clear the signal set */ +  current.sa_flags = 0;                  /* enables setting sa_handler, not sa_action */ +  current.sa_handler = graceful;         /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);    /* register the handler */ +} + +void child_code() { +  set_handler(); + +  while (1) {   /` loop until interrupted `/ +    sleep(1); +    puts("\tChild just woke up, but going back to sleep."); +  } +} + +void parent_code(pid_t cpid) { +  puts("Parent sleeping for a time..."); +  sleep(5); + +  /* Try to terminate child. */ +  if (-1 == kill(cpid, SIGTERM)) { +    perror("kill"); +    exit(-1); +  } +  wait(NULL); /` wait for child to terminate `/ +  puts("My child terminated, about to exit myself..."); +} + +int main() { +  pid_t pid = fork(); +  if (pid < 0) { +    perror("fork"); +    return -1; /* error */ +  } +  if (0 == pid) +    child_code(); +  else +    parent_code(pid); +  return 0;  /* normal */ +} +``` + +上面的停止程序模拟了一个多进程系统的优雅退出,在这个例子中,这个系统由一个父进程和一个子进程组成。这次模拟的工作流程如下: + + * 父进程尝试去 `fork` 一个子进程。假如这个 `fork` 操作成功了,每个进程就执行它自己的代码:子进程就执行函数 `child_code`,而父进程就执行函数 `parent_code`。 + * 子进程将会进入一个潜在的无限循环,在这个循环中子进程将睡眠一秒,然后打印一个信息,接着再次进入睡眠状态,以此循环往复。来自父进程的一个 `SIGTERM` 信号将引起子进程去执行一个信号处理回调函数 `graceful`。这样这个信号就使得子进程可以跳出循环,然后进行子进程和父进程之间的优雅终止。在终止之前,进程将打印一个信息。 + * 在 `fork` 一个子进程后,父进程将睡眠 5 秒,使得子进程可以执行一会儿;当然在这个模拟中,子进程大多数时间都在睡眠。然后父进程调用 `SIGTERM` 作为第二个参数的 `kill` 函数,等待子进程的终止,然后自己再终止。 + +下面是一次运行的输出: + +``` +% ./shutdown +Parent sleeping for a time... +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child just woke up, but going back to sleep. +        Child confirming received signal: 15  ## SIGTERM is 15 +        Child about to terminate gracefully... +        Child terminating now... +My child terminated, about to exit myself... +``` + +对于信号的处理,上面的示例使用了 `sigaction` 库函数(POSIX 推荐的用法)而不是传统的 `signal` 函数,`signal` 函数有移植性问题。下面是我们主要关心的代码片段: + +* 假如对 `fork` 的调用成功了,父进程将执行 `parent_code` 函数,而子进程将执行 `child_code` 函数。在给子进程发送信号之前,父进程将会等待 5 秒: + + ``` +puts("Parent sleeping for a time..."); +sleep(5); +if (-1 == kill(cpid, SIGTERM)) { +...sleepkillcpidSIGTERM... +``` + + 假如 `kill` 调用成功了,父进程将在子进程终止时做等待,使得子进程不会变成一个僵尸进程。在等待完成后,父进程再退出。 + +* `child_code` 函数首先调用 `set_handler` 然后进入它的可能永久睡眠的循环。下面是我们将要查看的 `set_handler` 函数: + + ``` +void set_handler() { +  struct sigaction current;            /* current setup */ +  sigemptyset(¤t.sa_mask);       /* clear the signal set */ +  current.sa_flags = 0;                /* for setting sa_handler, not sa_action */ +  current.sa_handler = graceful;       /* specify a handler */ +  sigaction(SIGTERM, ¤t, NULL);  /* register the handler */ +} +``` + + 上面代码的前三行在做相关的准备。第四个语句将为 `graceful` 设定为句柄,它将在调用 `_exit` 来停止之前打印一些信息。第 5 行和最后一行的语句将通过调用 `sigaction` 来向系统注册上面的句柄。`sigaction` 的第一个参数是 `SIGTERM` ,用作终止;第二个参数是当前的 `sigaction` 设定,而最后的参数(在这个例子中是 `NULL` )可被用来保存前面的 `sigaction` 设定,以备后面的可能使用。 + +使用信号来作为 IPC 的确是一个很轻量的方法,但确实值得尝试。通过信号来做 IPC 显然可以被归入 IPC 工具箱中。 + +### 这个系列的总结 + +在这个系列中,我们通过三篇有关 IPC 的文章,用示例代码介绍了如下机制: + + * 共享文件 + * 共享内存(通过信号量) + * 管道(命名和无名) + * 消息队列 + * 套接字 + * 信号 + +甚至在今天,在以线程为中心的语言,例如 Java、C# 和 Go 等变得越来越流行的情况下,IPC 仍然很受欢迎,因为相比于使用多线程,通过多进程来实现并发有着一个明显的优势:默认情况下,每个进程都有它自己的地址空间,除非使用了基于共享内存的 IPC 机制(为了达到安全的并发,竞争条件在多线程和多进程的时候必须被加上锁),在多进程中可以排除掉基于内存的竞争条件。对于任何一个写过即使是基本的通过共享变量来通信的多线程程序的人来说,他都会知道想要写一个清晰、高效、线程安全的代码是多么具有挑战性。使用单线程的多进程的确是很有吸引力的,这是一个切实可行的方式,使用它可以利用好今天多处理器的机器,而不需要面临基于内存的竞争条件的风险。 + +当然,没有一个简单的答案能够回答上述 IPC 机制中的哪一个更好。在编程中每一种 IPC 机制都会涉及到一个取舍问题:是追求简洁,还是追求功能强大。以信号来举例,它是一个相对简单的 IPC 机制,但并不支持多个进程之间的丰富对话。假如确实需要这样的对话,另外的选择可能会更合适一些。带有锁的共享文件则相对直接,但是当要处理大量共享的数据流时,共享文件并不能很高效地工作。管道,甚至是套接字,有着更复杂的 API,可能是更好的选择。让具体的问题去指导我们的选择吧。 + +尽管所有的示例代码(可以在[我的网站][4]上获取到)都是使用 C 写的,其他的编程语言也经常提供这些 IPC 机制的轻量包装。这些代码示例都足够短小简单,希望这样能够鼓励你去进行实验。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/interprocess-communication-linux-networking + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[FSSlc](https://github.com/FSSlc) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Inter-process_communication +[2]: https://linux.cn/article-10826-1.html +[3]: https://linux.cn/article-10845-1.html +[4]: http://condor.depaul.edu/mkalin diff --git a/published/201906/20190422 4 open source apps for plant-based diets.md b/published/201906/20190422 4 open source apps for plant-based diets.md new file mode 100644 index 0000000000..7399627ee1 --- /dev/null +++ b/published/201906/20190422 4 open source apps for plant-based diets.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10926-1.html) +[#]: subject: (4 open source apps for plant-based diets) +[#]: via: (https://opensource.com/article/19/4/apps-plant-based-diets) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +4 款“吃草”的开源应用 +====== + +> 这些应用使素食者、纯素食主义者和那些想吃得更健康的杂食者找到可以吃的食物。 + +![](https://img.linux.net.cn/data/attachment/album/201906/01/193302nompumppxnmnxirz.jpg) + +减少对肉类、乳制品和加工食品的消费对地球来说更好,也对你的健康更有益。改变你的饮食习惯可能很困难,但是一些开源的 Android 应用可以让你吃的更清淡。无论你是参加[无肉星期一][2]、践行 Mark Bittman 的 [6:00 前的素食][3]指南,还是完全切换到[植物全食饮食][4]whole-food, plant-based diet(WFPB),这些应用能帮助你找出要吃什么、发现素食和素食友好的餐馆,并轻松地将你的饮食偏好传达给他人,来助你更好地走这条路。所有这些应用都是开源的,可从 [F-Droid 仓库][5]下载。 + +### Daily Dozen + +![Daily Dozen app][6] + +[Daily Dozen][7] 提供了医学博士、美国法医学会院士(FACLM) Michael Greger 推荐的项目清单作为健康饮食和生活方式的一部分。Greger 博士建议食用由多种食物组成的基于植物的全食饮食,并坚持日常锻炼。该应用可以让你跟踪你吃的每种食物的份数,你喝了多少份水(或其他获准的饮料,如茶),以及你是否每天锻炼。每类食物都提供食物分量和属于该类别的食物清单。例如,十字花科蔬菜类包括白菜、花椰菜、抱子甘蓝等许多其他建议。 + +### Food Restrictions + +![Food Restrictions app][8] + +[Food Restrictions][9] 是一个简单的应用,它可以帮助你将你的饮食限制传达给他人,即使这些人不会说你的语言。用户可以输入七种不同类别的食物限制:鸡肉、牛肉、猪肉、鱼、奶酪、牛奶和辣椒。每种类别都有“我不吃”和“我过敏”选项。“不吃”选项会显示带有红色 X 的图标。“过敏” 选项显示 “X” 和小骷髅图标。可以使用文本而不是图标显示相同的信息,但文本仅提供英语和葡萄牙语。还有一个选项可以显示一条文字信息,说明用户是素食主义者或纯素食主义者,它比选择选项更简洁、更准确地总结了这些饮食限制。纯素食主义者的文本清楚地提到不吃鸡蛋和蜂蜜,这在选择选项中是没有的。但是,就像选择选项方式的文字版本一样,这些句子仅提供英语和葡萄牙语。 + +### OpenFoodFacts + +![Open Food Facts app][10] + +购买杂货时避免买入不必要的成分可能令人沮丧,但 [OpenFoodFacts][11] 可以帮助简化流程。该应用可让你扫描产品上的条形码,以获得有关产品成分和是否健康的报告。即使产品符合纯素产品的标准,产品仍然可能非常不健康。拥有成分列表和营养成分可让你在购物时做出明智的选择。此应用的唯一缺点是数据是用户贡献的,因此并非每个产品都可有数据,但如果你想回馈项目,你可以贡献新数据。 + +### OpenVegeMap + +![OpenVegeMap app][12] + +使用 [OpenVegeMap][13] 查找你附近的纯素食或素食主义餐厅。此应用可以通过手机的当前位置或者输入地址来搜索。餐厅分类为仅限纯素食者、适合纯素食者,仅限素食主义者,适合素食者,非素食和未知。该应用使用来自 [OpenStreetMap][14] 的数据和用户提供的有关餐馆的信息,因此请务必仔细检查以确保所提供的信息是最新且准确的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/apps-plant-based-diets + +作者:[Joshua Allen Holm][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/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_041x_0.png?itok=tfg6_I78 +[2]: https://www.meatlessmonday.com/ +[3]: https://www.amazon.com/dp/0385344740/ +[4]: https://nutritionstudies.org/whole-food-plant-based-diet-guide/ +[5]: https://f-droid.org/ +[6]: https://opensource.com/sites/default/files/uploads/daily_dozen.png (Daily Dozen app) +[7]: https://f-droid.org/en/packages/org.nutritionfacts.dailydozen/ +[8]: https://opensource.com/sites/default/files/uploads/food_restrictions.png (Food Restrictions app) +[9]: https://f-droid.org/en/packages/br.com.frs.foodrestrictions/ +[10]: https://opensource.com/sites/default/files/uploads/openfoodfacts.png (Open Food Facts app) +[11]: https://f-droid.org/en/packages/openfoodfacts.github.scrachx.openfood/ +[12]: https://opensource.com/sites/default/files/uploads/openvegmap.png (OpenVegeMap app) +[13]: https://f-droid.org/en/packages/pro.rudloff.openvegemap/ +[14]: https://www.openstreetmap.org/ diff --git a/published/201906/20190423 Edge computing is in most industries- future.md b/published/201906/20190423 Edge computing is in most industries- future.md new file mode 100644 index 0000000000..c27a689af9 --- /dev/null +++ b/published/201906/20190423 Edge computing is in most industries- future.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: (ninifly) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11009-1.html) +[#]: subject: (Edge computing is in most industries’ future) +[#]: via: (https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +边缘计算是大多数行业的未来 +====== + +> 几乎每个行业都可以利用边缘计算来加速数字化转型。 + +![](https://img.linux.net.cn/data/attachment/album/201906/23/231224cdl3kwedn0hw2lie.jpg) + +边缘计算的发展将取得一次巨大的飞跃。[据 Gartner 数据][2],现在公司有 10% 的数据是在传统数据中心或云之外生成的。但在未来六年内,这一比例将升至 75%。 + +这很大程度上取决于处理来自设备数据的需要,比如物联网(IoT)数据传感器。早期采用这一方法的包括: + +* **制造商**:设备与传感器似乎是这个行业特有的,因此需要为产生的数据找到更快速的方法也就不足为奇。一份 [Automation World][3] 最近的研究发现 43% 的制造商已经部署了边缘计算项目。最常用用途包括生产/制造数据分析与设备数据分析。 +* **零售商**:与大多数深受数字化运营需求影响的产业一样,零售商也不得不革新了其客户体验。为此,这些组织“正在积极投资贴近于买家的计算能力”,施耐德电气公司 IT 部门执行副总裁 [Dave Johnson][4] 如是说。他列举了一些例子,例如在试衣间的增强现实(AR)镜子,提供了不同的服装选择,而不用顾客试用这些服装。又如用于显示店内导航的基于信标的热图。 +* **医疗保健机构**:随着医疗保健成本的不断上升,这一行业已经具备了提高生产能力与成本效率方面的创新能力。管理咨询公司[麦肯锡已经确定][5],至少有 11 个有益于患者、医疗机构或两者的医疗保健用例。举两个例子:提高护理效率并有助于优化设备的跟踪移动医疗设备;跟踪用户锻炼并提供健康建议的可穿戴设备。 + +虽然以上这些是明显的用例,随着边缘计算市场的扩大,采用它的行业也会增加。 + +### 数字化转型的优势 + +随着边缘计算的快速处理能力完全符合数字化转型的目标:提高效率、生产能力和加速产品上市和客户体验。以下是一些有潜力的应用及将被边缘计算改变的行业: + +**农业**:农民和组织已经使用无人机将农田和气候环境传给灌溉设备。其他的应用可能包括了对工人、牲畜和设备的监测与位置跟踪,从而改善生产能力、效率和成本。 + +**能源**:在这一领域有许多的潜在的应用,可以使消费者与供应商都受益。例如,智能电表有助于业主更好地管理能源使用,同时减少电网运营商对手动抄表的需求。同样的,水管上的传感器能够监测到漏水,同时提供实时漏水数据。 + +**金融服务**:银行正在采取交互式 ATM 机,这种交互式 ATM 机能够快速地处理数据以提供更好的用户体验。在管理层次,可以更快速地分析交易数据中的欺诈行为。 + +**物流**:由于消费者需要更快速地交付商品和服务,物流公司将需要转换其地图和寻路功能以获取实时数据,尤其在最后一公里计划和跟踪方面。这可能涉及到基于街道、包裹及汽车的传感器数据传输处理过程。 + +得益于边缘计算,所有行业都有转型的潜力。但是,这将取决于他们如何处理计算基础设施。可以在 [APC.com][6] 找到如何克服任何 IT 阻碍的解决方案。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html + +作者:[Anne Taylor][a] +选题:[lujun9972][b] +译者:[ninifly](https://github.com/ninifly) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-1019389496-100794424-large.jpg +[2]: https://www.gartner.com/smarterwithgartner/what-edge-computing-means-for-infrastructure-and-operations-leaders/ +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://blog.schneider-electric.com/datacenter/2018/07/10/why-brick-and-mortar-retail-quickly-establishing-leadership-edge-computing/ +[5]: https://www.mckinsey.com/industries/high-tech/our-insights/new-demand-new-markets-what-edge-computing-means-for-hardware-companies +[6]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/published/201906/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md b/published/201906/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md new file mode 100644 index 0000000000..419ad7303b --- /dev/null +++ b/published/201906/20190423 Epic Games Store is Now Available on Linux Thanks to Lutris.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10968-1.html) +[#]: subject: (Epic Games Store is Now Available on Linux Thanks to Lutris) +[#]: via: (https://itsfoss.com/epic-games-lutris-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +有了 Lutris,Linux 现在也可以启动 Epic 游戏商城 +====== + +> 开源游戏平台 Lutris 现在使你能够在 Linux 上使用 Epic 游戏商城。我们使用 Ubuntu 19.04 版本进行了测试,以下是我们的使用体验。 + +[在 Linux 上玩游戏][1] 正变得越来越容易。Steam [正在开发中的][3] 特性可以帮助你实现 [在 Linux 上玩 Windows 游戏][2]。 + +如果说 Steam 在 Linux 运行 Windows 游戏领域还是新玩家,而 Lutris 却已从事多年。 + +[Lutris][4] 是一款为 Linux 开发的开源游戏平台,提供诸如 Origin、Steam、战网等平台的游戏安装器。它使用 Wine 来运行 Linux 不能支持的程序。 + +Lutris 近期宣布你可以通过它来运行 Epic 游戏商店。 + +### Lutris 为 Linux 带来了 Epic 游戏 + +![Epic Games Store Lutris Linux][5] + +[Epic 游戏商城][6] 是一个类似 Steam 的电子游戏分销平台。它目前只支持 Windows 和 macOS。 + +Lutris 团队付出了大量努力使 Linux 用户可以通过 Lutris 使用 Epic 游戏商城。虽然我不用 Epic 商城,但可以通过 Lutris 在 Linux 上运行 Epic 商城终归是个好消息。 + +> 好消息! 你现在可以通过 Lutris 安装获得 [@EpicGames][7] 商城在 Linux 下的全功能支持!没有发现任何问题。 [@TimSweeneyEpic][8] 可能会很喜欢 😊 +> +> ![pic.twitter.com/7mt9fXt7TH][9] +> +> — Lutris Gaming (@LutrisGaming) [April 17, 2019][10] + +作为一名狂热的游戏玩家和 Linux 用户,我立即得到了这个消息,并安装了 Lutris 来运行 Epic 游戏。 + +**备注:** 我使用 [Ubuntu 19.04][11] 来测试 Linux 环境下的游戏运行情况。 + +### 通过 Lutris 在 Linux 下使用 Epic 游戏商城 + +为了在你的 Linux 系统中安装 Epic 游戏商城,请确保你已经安装了 Wine 和 Python 3。接下来,[在 Ubuntu 中安装 Wine][12] ,或任何你正在使用的 Linux 发行版本也都可以。然后, [从官方网站下载 Lutris][13]. + +#### 安装 Epic 游戏商城 + +Lutris 安装成功后,直接启动它。 + +当我尝试时,我遇到了一个问题(当我用 GUI 启动时却没有遇到)。当我尝试在命令行输入 `lutris` 来启动时,我发现了下图所示的错误: + +![][15] + +感谢 Abhishek,我了解到了这是一个常见问题 (你可以在 [GitHub][16] 上查看这个问题)。 + +总之,为了解决这个问题,我需要在命令行中输入以下命令: + +``` +export LC_ALL=C +``` + +当你遇到同样的问题时,只要你输入这个命令,就能正常启动 Lutris 了。 + +**注意**:每次启动 Lutris 时都必须输入这个命令。因此,最好将其添加到 `.bashrc` 文件或环境变量列表中。 + +上述操作完成后,只要启动并搜索 “Epic Games Store” 会显示以下图片中的内容: + +![Epic Games Store in Lutris][17] + +在这里,我已经安装过了,所以你将会看到“安装”选项,它会自动询问你是否需要安装需要的包。只需要继续操作就可以成功安装。就是这样,不需要任何黑科技。 + +#### 玩一款 Epic 游戏商城中的游戏 + +![Epic Games Store][18] + +现在我们已经通过 Lutris 在 Linux 上安装了 Epic 游戏商城,启动它并登录你的账号就可以开始了。 + +但这真会奏效吗? + +*是的,Epic 游戏商城可以运行。* **但是所有游戏都不能玩。**(LCTT 译注:莫生气,请看文末的进一步解释!) + +好吧,我并没有尝试过所有内容,但是我拿了一个免费的游戏(Transistor —— 一款回合制 ARPG 游戏)来检查它是否工作。 + +![Transistor – Epic Games Store][19] + +很不幸,游戏没有启动。当我运行时界面显示了 “Running” 不过什么都没有发生。 + +到目前为止,我还不知道有什么解决方案 —— 所以如果我找到解决方案,我会尽力让你们知道最新情况。 + +### 总结 + +通过 Lutris 这样的工具使 Linux 的游戏场景得到了改善,这终归是个好消息 。不过,仍有许多工作要做。 + +对于在 Linux 上运行的游戏来说,无障碍运行仍然是一个挑战。其中可能就会有我遇到的这种问题,或者其它类似的。但它正朝着正确的方向发展 —— 即使还存在着一些问题。 + +你有什么看法吗?你是否也尝试用 Lutris 在 Linux 上启动 Epic 游戏商城?在下方评论让我们看看你的意见。 + +### 补充 + +Transistor 实际上有一个原生的 Linux 移植版。到目前为止,我从 Epic 获得的所有游戏都是如此。所以我会试着压下我的郁闷,而因为 Epic 只让你玩你通过他们的商店/启动器购买的游戏,所以在 Linux 机器上用 Lutris 玩这个原生的 Linux 游戏是不可能的。这简直愚蠢极了。Steam 有一个原生的 Linux 启动器,虽然不是很理想,但它可以工作。GOG 允许你从网站下载购买的内容,可以在你喜欢的任何平台上玩这些游戏。他们的启动器完全是可选的。 + +我对此非常恼火,因为我在我的 Epic 库中的游戏都是可以在我的笔记本电脑上运行得很好的游戏,当我坐在桌面前时,玩起来很有趣。但是因为那台桌面机是我唯一拥有的 Windows 机器…… + +我选择使用 Linux 时已经知道会存在兼容性问题,并且我有一个专门用于游戏的 Windows 机器,而我通过 Epic 获得的游戏都是免费的,所以我在这里只是表示一下不满。但是,他们两个作为最著名的竞争对手,Epic 应该有在我的 Linux 机器上玩原生 Linux 移植版的机制。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/epic-games-lutris-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-7316-1.html +[2]: https://linux.cn/article-10061-1.html +[3]: https://linux.cn/article-10054-1.html +[4]: https://lutris.net/ +[5]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-lutris-linux-800x450.png +[6]: https://www.epicgames.com/store/en-US/ +[7]: https://twitter.com/EpicGames?ref_src=twsrc%5Etfw +[8]: https://twitter.com/TimSweeneyEpic?ref_src=twsrc%5Etfw +[9]: https://pbs.twimg.com/media/D4XkXafX4AARDkW?format=jpg&name=medium +[10]: https://twitter.com/LutrisGaming/status/1118552969816018948?ref_src=twsrc%5Etfw +[11]: https://itsfoss.com/ubuntu-19-04-release-features/ +[12]: https://itsfoss.com/install-latest-wine/ +[13]: https://lutris.net/downloads/ +[14]: https://itsfoss.com/ubuntu-mate-entroware/ +[15]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-error.jpg +[16]: https://github.com/lutris/lutris/issues/660 +[17]: https://itsfoss.com/wp-content/uploads/2019/04/lutris-epic-games-store-800x520.jpg +[18]: https://itsfoss.com/wp-content/uploads/2019/04/epic-games-store-800x450.jpg +[19]: https://itsfoss.com/wp-content/uploads/2019/04/transistor-game-epic-games-store-800x410.jpg +[20]: https://itsfoss.com/skpe-alpha-linux/ diff --git a/published/201906/20190423 How to identify same-content files on Linux.md b/published/201906/20190423 How to identify same-content files on Linux.md new file mode 100644 index 0000000000..6353fe86b3 --- /dev/null +++ b/published/201906/20190423 How to identify same-content files on Linux.md @@ -0,0 +1,256 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10955-1.html) +[#]: subject: (How to identify same-content files on Linux) +[#]: via: (https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何在 Linux 上识别同样内容的文件 +====== +> 有时文件副本相当于对硬盘空间的巨大浪费,并会在你想要更新文件时造成困扰。以下是用来识别这些文件的六个命令。 + +![Vinoth Chandar \(CC BY 2.0\)][1] + +在最近的帖子中,我们看了[如何识别并定位硬链接的文件][2](即,指向同一硬盘内容并共享 inode)。在本文中,我们将查看能找到具有相同*内容*,却不相链接的文件的命令。 + +硬链接很有用是因为它们能够使文件存放在文件系统内的多个地方却不会占用额外的硬盘空间。另一方面,有时文件副本相当于对硬盘空间的巨大浪费,在你想要更新文件时也会有造成困扰之虞。在本文中,我们将看一下多种识别这些文件的方式。 + +### 用 diff 命令比较文件 + +可能比较两个文件最简单的方法是使用 `diff` 命令。输出会显示你文件的不同之处。`<` 和 `>` 符号代表在当参数传过来的第一个(`<`)或第二个(`>`)文件中是否有额外的文字行。在这个例子中,在 `backup.html` 中有额外的文字行。 + +``` +$ diff index.html backup.html +2438a2439,2441 +>
    +> That's all there is to report.
    +> 
    +``` + +如果 `diff` 没有输出那代表两个文件相同。 + +``` +$ diff home.html index.html +$ +``` + +`diff` 的唯一缺点是它一次只能比较两个文件并且你必须指定用来比较的文件,这篇帖子中的一些命令可以为你找到多个重复文件。 + +### 使用校验和 + +`cksum`(checksum) 命令计算文件的校验和。校验和是一种将文字内容转化成一个长数字(例如2819078353 228029)的数学简化。虽然校验和并不是完全独有的,但是文件内容不同校验和却相同的概率微乎其微。 + +``` +$ cksum *.html +2819078353 228029 backup.html +4073570409 227985 home.html +4073570409 227985 index.html +``` + +在上述示例中,你可以看到产生同样校验和的第二个和第三个文件是如何可以被默认为相同的。 + +### 使用 find 命令 + +虽然 `find` 命令并没有寻找重复文件的选项,它依然可以被用来通过名字或类型寻找文件并运行 `cksum` 命令。例如: + +``` +$ find . -name "*.html" -exec cksum {} \; +4073570409 227985 ./home.html +2819078353 228029 ./backup.html +4073570409 227985 ./index.html +``` + +### 使用 fslint 命令 + +`fslint` 命令可以被特地用来寻找重复文件。注意我们给了它一个起始位置。如果它需要遍历相当多的文件,这就需要花点时间来完成。注意它是如何列出重复文件并寻找其它问题的,比如空目录和坏 ID。 + +``` +$ fslint . +-----------------------------------file name lint +-------------------------------Invalid utf8 names +-----------------------------------file case lint +----------------------------------DUPlicate files <== +home.html +index.html +-----------------------------------Dangling links +--------------------redundant characters in links +------------------------------------suspect links +--------------------------------Empty Directories +./.gnupg +----------------------------------Temporary Files +----------------------duplicate/conflicting Names +------------------------------------------Bad ids +-------------------------Non Stripped executables +``` + +你可能需要在你的系统上安装 `fslint`。你可能也需要将它加入你的命令搜索路径: + +``` +$ export PATH=$PATH:/usr/share/fslint/fslint +``` + +### 使用 rdfind 命令 + +`rdfind` 命令也会寻找重复(相同内容的)文件。它的名字意即“重复数据搜寻”,并且它能够基于文件日期判断哪个文件是原件——这在你选择删除副本时很有用因为它会移除较新的文件。 + +``` +$ rdfind ~ +Now scanning "/home/shark", found 12 files. +Now have 12 files in total. +Removed 1 files due to nonunique device and inode. +Total size is 699498 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +It seems like you have 2 files that are not unique +Totally, 223 KiB can be reduced. +Now making results file results.txt +``` + +你可以在 `dryrun` 模式中运行这个命令 (换句话说,仅仅汇报可能会另外被做出的改动)。 + +``` +$ rdfind -dryrun true ~ +(DRYRUN MODE) Now scanning "/home/shark", found 12 files. +(DRYRUN MODE) Now have 12 files in total. +(DRYRUN MODE) Removed 1 files due to nonunique device and inode. +(DRYRUN MODE) Total size is 699352 bytes or 683 KiB +Removed 9 files due to unique sizes from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on first bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on last bytes:removed 0 files from list.2 files left. +(DRYRUN MODE) Now eliminating candidates based on sha1 checksum:removed 0 files from list.2 files left. +(DRYRUN MODE) It seems like you have 2 files that are not unique +(DRYRUN MODE) Totally, 223 KiB can be reduced. +(DRYRUN MODE) Now making results file results.txt +``` + +`rdfind` 命令同样提供了类似忽略空文档(`-ignoreempty`)和跟踪符号链接(`-followsymlinks`)的功能。查看 man 页面获取解释。 + +``` +-ignoreempty ignore empty files +-minsize ignore files smaller than speficied size +-followsymlinks follow symbolic links +-removeidentinode remove files referring to identical inode +-checksum identify checksum type to be used +-deterministic determiness how to sort files +-makesymlinks turn duplicate files into symbolic links +-makehardlinks replace duplicate files with hard links +-makeresultsfile create a results file in the current directory +-outputname provide name for results file +-deleteduplicates delete/unlink duplicate files +-sleep set sleep time between reading files (milliseconds) +-n, -dryrun display what would have been done, but don't do it +``` + +注意 `rdfind` 命令提供了 `-deleteduplicates true` 的设置选项以删除副本。希望这个命令语法上的小问题不会惹恼你。;-) + +``` +$ rdfind -deleteduplicates true . +... +Deleted 1 files. <== +``` + +你将可能需要在你的系统上安装 `rdfind` 命令。试验它以熟悉如何使用它可能是一个好主意。 + +### 使用 fdupes 命令 + +`fdupes` 命令同样使得识别重复文件变得简单。它同时提供了大量有用的选项——例如用来迭代的 `-r`。在这个例子中,它像这样将重复文件分组到一起: + +``` +$ fdupes ~ +/home/shs/UPGRADE +/home/shs/mytwin + +/home/shs/lp.txt +/home/shs/lp.man + +/home/shs/penguin.png +/home/shs/penguin0.png +/home/shs/hideme.png +``` + +这是使用迭代的一个例子,注意许多重复文件是重要的(用户的 `.bashrc` 和 `.profile` 文件)并且不应被删除。 + +``` +# fdupes -r /home +/home/shark/home.html +/home/shark/index.html + +/home/dory/.bashrc +/home/eel/.bashrc + +/home/nemo/.profile +/home/dory/.profile +/home/shark/.profile + +/home/nemo/tryme +/home/shs/tryme + +/home/shs/arrow.png +/home/shs/PNGs/arrow.png + +/home/shs/11/files_11.zip +/home/shs/ERIC/file_11.zip + +/home/shs/penguin0.jpg +/home/shs/PNGs/penguin.jpg +/home/shs/PNGs/penguin0.jpg + +/home/shs/Sandra_rotated.png +/home/shs/PNGs/Sandra_rotated.png +``` + +`fdupe` 命令的许多选项列如下。使用 `fdupes -h` 命令或者阅读 man 页面获取详情。 + +``` +-r --recurse recurse +-R --recurse: recurse through specified directories +-s --symlinks follow symlinked directories +-H --hardlinks treat hard links as duplicates +-n --noempty ignore empty files +-f --omitfirst omit the first file in each set of matches +-A --nohidden ignore hidden files +-1 --sameline list matches on a single line +-S --size show size of duplicate files +-m --summarize summarize duplicate files information +-q --quiet hide progress indicator +-d --delete prompt user for files to preserve +-N --noprompt when used with --delete, preserve the first file in set +-I --immediate delete duplicates as they are encountered +-p --permissions don't soncider files with different owner/group or + permission bits as duplicates +-o --order=WORD order files according to specification +-i --reverse reverse order while sorting +-v --version display fdupes version +-h --help displays help +``` + +`fdupes` 命令是另一个你可能需要安装并使用一段时间才能熟悉其众多选项的命令。 + +### 总结 + +Linux 系统提供能够定位并(潜在地)能移除重复文件的一系列的好工具,以及能让你指定搜索区域及当对你所发现的重复文件时的处理方式的选项。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3390204/how-to-identify-same-content-files-on-linux.html#tk.rss_all + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/chairs-100794266-large.jpg +[2]: https://www.networkworld.com/article/3387961/how-to-identify-duplicate-files-on-linux.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world + diff --git a/published/201906/20190427 Monitoring CPU and GPU Temperatures on Linux.md b/published/201906/20190427 Monitoring CPU and GPU Temperatures on Linux.md new file mode 100644 index 0000000000..1ba2cb1a9b --- /dev/null +++ b/published/201906/20190427 Monitoring CPU and GPU Temperatures on Linux.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (cycoe) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10929-1.html) +[#]: subject: (Monitoring CPU and GPU Temperatures on Linux) +[#]: via: (https://itsfoss.com/monitor-cpu-gpu-temp-linux/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +在 Linux 上监控 CPU 和 GPU 温度 +====== + +> 本篇文章讨论了在 Linux 命令行中监控 CPU 和 GPU 温度的两种简单方式。 + +由于 [Steam][1](包括 [Steam Play][2],即 Proton)和一些其他的发展,GNU/Linux 正在成为越来越多计算机用户的日常游戏平台的选择。也有相当一部分用户在遇到像[视频编辑][3]或图形设计等(Kdenlive 和 [Blender][4] 是这类应用程序中很好的例子)资源消耗型计算任务时,也会使用 GNU/Linux。 + +不管你是否是这些用户中的一员或其他用户,你也一定想知道你的电脑 CPU 和 GPU 能有多热(如果你想要超频的话更会如此)。如果是这样,那么继续读下去。我们会介绍两个非常简单的命令来监控 CPU 和 GPU 温度。 + +我的装置包括一台 [Slimbook Kymera][5] 和两台显示器(一台 TV 和一台 PC 监视器),使得我可以用一台来玩游戏,另一台来留意监控温度。另外,因为我使用 [Zorin OS][6],我会将关注点放在 Ubuntu 和 Ubuntu 的衍生发行版上。 + +为了监控 CPU 和 GPU 的行为,我们将利用实用的 `watch` 命令在每几秒钟之后动态地得到读数。 + +![][7] + +### 在 Linux 中监控 CPU 温度 + +对于 CPU 温度,我们将结合使用 `watch` 与 `sensors` 命令。一篇关于[此工具的图形用户界面版本][8]的有趣文章已经在 It's FOSS 中介绍过了。然而,我们将在此处使用命令行版本: + +``` +watch -n 2 sensors +``` + +`watch` 保证了读数会在每 2 秒钟更新一次(当然,这个周期值能够根据你的需要去更改): + +``` +Every 2,0s: sensors + +iwlwifi-virtual-0 +Adapter: Virtual device +temp1: +39.0°C + +acpitz-virtual-0 +Adapter: Virtual device +temp1: +27.8°C (crit = +119.0°C) +temp2: +29.8°C (crit = +119.0°C) + +coretemp-isa-0000 +Adapter: ISA adapter +Package id 0: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 0: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 1: +35.0°C (high = +82.0°C, crit = +100.0°C) +Core 2: +33.0°C (high = +82.0°C, crit = +100.0°C) +Core 3: +36.0°C (high = +82.0°C, crit = +100.0°C) +Core 4: +37.0°C (high = +82.0°C, crit = +100.0°C) +Core 5: +35.0°C (high = +82.0°C, crit = +100.0°C) +``` + +除此之外,我们还能得到如下信息: + + * 我们有 5 个核心正在被使用(并且当前的最高温度为 37.0℃)。 + * 温度超过 82.0℃ 会被认为是过热。 + * 超过 100.0℃ 的温度会被认为是超过临界值。 + +根据以上的温度值我们可以得出结论,我的电脑目前的工作负载非常小。 + +### 在 Linux 中监控 GPU 温度 + +现在让我们来看看显卡。我从来没使用过 AMD 的显卡,因此我会将重点放在 Nvidia 的显卡上。我们需要做的第一件事是从 [Ubuntu 的附加驱动][10] 中下载合适的最新驱动。 + +在 Ubuntu(Zorin 或 Linux Mint 也是相同的)中,进入“软件和更新 > 附加驱动”选项,选择最新的可用驱动。另外,你可以添加或启用显示卡的官方 ppa(通过命令行或通过“软件和更新 > 其他软件”来实现)。安装驱动程序后,你将可以使用 “Nvidia X Server” 的 GUI 程序以及命令行工具 `nvidia-smi`(Nvidia 系统管理界面)。因此我们将使用 `watch` 和 `nvidia-smi`: + +``` +watch -n 2 nvidia-smi +``` + +与 CPU 的情况一样,我们会在每两秒得到一次更新的读数: + +``` +Every 2,0s: nvidia-smi + +Fri Apr 19 20:45:30 2019 ++-----------------------------------------------------------------------------+ +| Nvidia-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 106... Off | 00000000:01:00.0 On | N/A | +| 0% 54C P8 10W / 120W | 433MiB / 6077MiB | 4% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| +| 0 1557 G /usr/lib/xorg/Xorg 190MiB | +| 0 1820 G /usr/bin/gnome-shell 174MiB | +| 0 7820 G ...equest-channel-token=303407235874180773 65MiB | ++-----------------------------------------------------------------------------+ +``` + +从这个表格中我们得到了关于显示卡的如下信息: + + * 它正在使用版本号为 418.56 的开源驱动。 + * 显示卡的当前温度为 54.0℃,并且风扇的使用量为 0%。 + * 电量的消耗非常低:仅仅 10W。 + * 总量为 6GB 的 vram(视频随机存取存储器),只使用了 433MB。 + * vram 正在被 3 个进程使用,他们的 ID 分别为 1557、1820 和 7820。 + +大部分这些事实或数值都清晰地表明,我们没有在玩任何消耗系统资源的游戏或处理大负载的任务。当我们开始玩游戏、处理视频或其他类似任务时,这些值就会开始上升。 + +#### 结论 + +即便我们有 GUI 工具,但我还是发现这两个命令对于实时监控硬件非常的顺手。 + +你将如何去使用它们呢?你可以通过阅读他们的 man 手册来学习更多关于这些工具的使用技巧。 + +你有其他偏爱的工具吗?在评论里分享给我们吧 ;)。 + +玩得开心! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/monitor-cpu-gpu-temp-linux/ + +作者:[Alejandro Egea-Abellán][a] +选题:[lujun9972][b] +译者:[cycoe](https://github.com/cycoe) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-steam-ubuntu-linux/ +[2]: https://itsfoss.com/steam-play-proton/ +[3]: https://itsfoss.com/best-video-editing-software-linux/ +[4]: https://www.blender.org/ +[5]: https://slimbook.es/ +[6]: https://zorinos.com/ +[7]: https://itsfoss.com/wp-content/uploads/2019/04/monitor-cpu-gpu-temperature-linux-800x450.png +[8]: https://itsfoss.com/check-laptop-cpu-temperature-ubuntu/ +[9]: https://itsfoss.com/best-command-line-games-linux/ +[10]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[11]: https://itsfoss.com/review-googler-linux/ +[12]: https://itsfoss.com/wp-content/uploads/2019/04/EGEA-ABELLAN-Alejandro.jpg diff --git a/published/201906/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md b/published/201906/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md new file mode 100644 index 0000000000..457caaa69a --- /dev/null +++ b/published/201906/20190428 Installing Budgie Desktop on Ubuntu -Quick Guide.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10919-1.html) +[#]: subject: (Installing Budgie Desktop on Ubuntu [Quick Guide]) +[#]: via: (https://itsfoss.com/install-budgie-ubuntu/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +在 Ubuntu 上安装 Budgie 桌面 +====== + +> 在这个逐步的教程中学习如何在 Ubuntu 上安装 Budgie 桌面。 + +在所有[各种 Ubuntu 版本][1]中,[Ubuntu Budgie][2] 是最被低估的版本。它外观优雅,而且需要的资源也不多。 + +阅读这篇 《[Ubuntu Budgie 点评][3]》或观看下面的视频,了解 Ubuntu Budgie 18.04 的外观如何。 + +- [Ubuntu 18.04 Budgie Desktop Tour [It's Elegant]](https://youtu.be/KXgreWOK33k) + +如果你喜欢 [Budgie 桌面][5]但你正在使用其他版本的 Ubuntu,例如默认 Ubuntu 带有 GNOME 桌面,我有个好消息。你可以在当前的 Ubuntu 系统上安装 Budgie 并切换桌面环境。 + +在这篇文章中,我将告诉你到底该怎么做。但首先,对那些不了解 Budgie 的人进行一点介绍。 + +Budgie 桌面环境主要由 [Solus Linux 团队开发][6]。它的设计注重优雅和现代使用。Budgie 适用于所有主流 Linux 发行版,可以让用户在其上尝试体验这种新的桌面环境。Budgie 现在非常成熟,并提供了出色的桌面体验。 + +> 警告 +> +> 在同一系统上安装多个桌面可能会导致冲突,你可能会遇到一些问题,如面板中缺少图标或同一程序的多个图标。 +> +> 你也许不会遇到任何问题。是否要尝试不同桌面由你决定。 + +### 在 Ubuntu 上安装 Budgie + +此方法未在 Linux Mint 上进行测试,因此我建议你 Mint 上不要按照此指南进行操作。 + +对于正在使用 Ubuntu 的人,Budgie 现在默认是 Ubuntu 仓库的一部分。因此,我们不需要添加任何 PPA 来下载 Budgie。 + +要安装 Budgie,只需在终端中运行此命令即可。我们首先要确保系统已完全更新。 + +``` +sudo apt update && sudo apt upgrade +sudo apt install ubuntu-budgie-desktop +``` + +下载完成后,你将看到选择显示管理器的提示。选择 “lightdm” 以获得完整的 Budgie 体验。 + +![Select lightdm][7] + +安装完成后,重启计算机。然后,你会看到 Budgie 的登录页面。输入你的密码进入主屏幕。 + +![Budgie Desktop Home][8] + +### 切换到其他桌面环境 + +![Budgie login screen][9] + +你可以单击登录名旁边的 Budgie 图标获取登录选项。在那里,你可以在已安装的桌面环境(DE)之间进行选择。就我而言,我看到了 Budgie 和默认的 Ubuntu(GNOME)桌面。 + +![Select your DE][10] + +因此,无论何时你想登录 GNOME,都可以使用此菜单执行此操作。 + +### 如何删除 Budgie + +如果你不喜欢 Budgie 或只是想回到常规的以前的 Ubuntu,你可以如上节所述切换回常规桌面。 + +但是,如果你真的想要删除 Budgie 及其组件,你可以按照以下命令回到之前的状态。 + +**在使用这些命令之前先切换到其他桌面环境:** + +``` +sudo apt remove ubuntu-budgie-desktop ubuntu-budgie* lightdm +sudo apt autoremove +sudo apt install --reinstall gdm3 +``` + +成功运行所有命令后,重启计算机。 + +现在,你将回到 GNOME 或其他你有的桌面。 + +### 你对 Budgie 有什么看法? + +Budgie 是[最佳 Linux 桌面环境][12]之一。希望这个简短的指南帮助你在 Ubuntu 上安装了很棒的 Budgie 桌面。 + +如果你安装了 Budgie,你最喜欢它的什么?请在下面的评论中告诉我们。像往常一样,欢迎任何问题或建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-budgie-ubuntu/ + +作者:[Atharva Lele][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://ubuntubudgie.org/ +[3]: https://itsfoss.com/ubuntu-budgie-18-review/ +[4]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[5]: https://github.com/solus-project/budgie-desktop +[6]: https://getsol.us/home/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_select_dm.png?fit=800%2C559&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_homescreen.jpg?fit=800%2C500&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen.png?fit=800%2C403&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/budgie_install_lockscreen_select_de.png?fit=800%2C403&ssl=1 +[11]: https://itsfoss.com/snapd-error-ubuntu/ +[12]: https://itsfoss.com/best-linux-desktop-environments/ diff --git a/published/201906/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md b/published/201906/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md new file mode 100644 index 0000000000..4960672f5a --- /dev/null +++ b/published/201906/20190505 How To Install-Uninstall Listed Packages From A File In Linux.md @@ -0,0 +1,331 @@ +[#]: collector: (lujun9972) +[#]: translator: (way-ww) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10923-1.html) +[#]: subject: (How To Install/Uninstall Listed Packages From A File In Linux?) +[#]: via: (https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 上安装/卸载一个文件中列出的软件包? +====== + +在某些情况下,你可能想要将一个服务器上的软件包列表安装到另一个服务器上。例如,你已经在服务器 A 上安装了 15 个软件包并且这些软件包也需要被安装到服务器 B、服务器 C 上等等。 + +我们可以手动去安装这些软件但是这将花费大量的时间。你可以手动安装一俩个服务器,但是试想如果你有大概十个服务器呢。在这种情况下你无法手动完成工作,那么怎样才能解决问题呢? + +不要担心我们可以帮你摆脱这样的情况和场景。我们在这篇文章中增加了四种方法来克服困难。 + +我希望这可以帮你解决问题。我已经在 Centos7 和 Ubuntu 18.04 上测试了这些命令。 + +我也希望这可以在其他发行版上工作。这仅仅需要使用该发行版的官方包管理器命令替代本文中的包管理器命令就行了。 + +如果想要 [检查 Linux 系统上已安装的软件包列表][1],请点击链接。 + +例如,如果你想要在基于 RHEL 系统上创建软件包列表请使用以下步骤。其他发行版也一样。 + +``` +# rpm -qa --last | head -15 | awk '{print $1}' > /tmp/pack1.txt + +# cat /tmp/pack1.txt +mariadb-server-5.5.60-1.el7_5.x86_64 +perl-DBI-1.627-4.el7.x86_64 +perl-DBD-MySQL-4.023-6.el7.x86_64 +perl-PlRPC-0.2020-14.el7.noarch +perl-Net-Daemon-0.48-5.el7.noarch +perl-IO-Compress-2.061-2.el7.noarch +perl-Compress-Raw-Zlib-2.061-4.el7.x86_64 +mariadb-5.5.60-1.el7_5.x86_64 +perl-Data-Dumper-2.145-3.el7.x86_64 +perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64 +httpd-2.4.6-88.el7.centos.x86_64 +mailcap-2.1.41-2.el7.noarch +httpd-tools-2.4.6-88.el7.centos.x86_64 +apr-util-1.5.2-6.el7.x86_64 +apr-1.4.8-3.el7_4.1.x86_64 +``` + +### 方法一:如何在 Linux 上使用 cat 命令安装文件中列出的包? + +为实现这个目标,我将使用简单明了的第一种方法。为此,创建一个文件并添加上你想要安装的包列表。 + +出于测试的目的,我们将只添加以下的三个软件包名到文件中。 + +``` +# cat /tmp/pack1.txt + +apache2 +mariadb-server +nano +``` + +只要简单的运行 [apt 命令][2] 就能在 Ubuntu/Debian 系统上一次性安装所有的软件包。 + +``` +# apt -y install $(cat /tmp/pack1.txt) + +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + libopts25 sntp +Use 'sudo apt autoremove' to remove them. +Suggested packages: + apache2-doc apache2-suexec-pristine | apache2-suexec-custom spell +The following NEW packages will be installed: + apache2 mariadb-server nano +0 upgraded, 3 newly installed, 0 to remove and 24 not upgraded. +Need to get 339 kB of archives. +After this operation, 1,377 kB of additional disk space will be used. +Get:1 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 apache2 amd64 2.4.29-1ubuntu4.6 [95.1 kB] +Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 nano amd64 2.9.3-2 [231 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mariadb-server all 1:10.1.38-0ubuntu0.18.04.1 [12.9 kB] +Fetched 339 kB in 19s (18.0 kB/s) +Selecting previously unselected package apache2. +(Reading database ... 290926 files and directories currently installed.) +Preparing to unpack .../apache2_2.4.29-1ubuntu4.6_amd64.deb ... +Unpacking apache2 (2.4.29-1ubuntu4.6) ... +Selecting previously unselected package nano. +Preparing to unpack .../nano_2.9.3-2_amd64.deb ... +Unpacking nano (2.9.3-2) ... +Selecting previously unselected package mariadb-server. +Preparing to unpack .../mariadb-server_1%3a10.1.38-0ubuntu0.18.04.1_all.deb ... +Unpacking mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Setting up apache2 (2.4.29-1ubuntu4.6) ... +Processing triggers for ureadahead (0.100.0-20) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Setting up nano (2.9.3-2) ... +update-alternatives: using /bin/nano to provide /usr/bin/editor (editor) in auto mode +update-alternatives: using /bin/nano to provide /usr/bin/pico (pico) in auto mode +Processing triggers for systemd (237-3ubuntu10.20) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +Setting up mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +``` + +至于删除,需要使用相同的命令格式和适当的选项。 + +``` +# apt -y remove $(cat /tmp/pack1.txt) +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages were automatically installed and are no longer required: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl libdbi-perl libjemalloc1 liblua5.2-0 + libmysqlclient20 libopts25 libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +Use 'apt autoremove' to remove them. +The following packages will be REMOVED: + apache2 mariadb-server nano +0 upgraded, 0 newly installed, 3 to remove and 24 not upgraded. +After this operation, 1,377 kB disk space will be freed. +(Reading database ... 291046 files and directories currently installed.) +Removing apache2 (2.4.29-1ubuntu4.6) ... +Removing mariadb-server (1:10.1.38-0ubuntu0.18.04.1) ... +Removing nano (2.9.3-2) ... +update-alternatives: using /usr/bin/vim.tiny to provide /usr/bin/editor (editor) in auto mode +Processing triggers for ufw (0.36-0ubuntu0.18.04.1) ... +Processing triggers for install-info (6.5.0.dfsg.1-2) ... +Processing triggers for man-db (2.8.3-2ubuntu0.1) ... +``` + +使用 [yum 命令][3] 在基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + +``` +# yum -y install $(cat /tmp/pack1.txt) +``` + +使用以命令在基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# yum -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 [dnf 命令][4] 在 Fedora 系统上安装文件中列出的软件包。 + +``` +# dnf -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令在 Fedora 系统上卸载文件中列出的软件包。 + +``` +# dnf -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 [zypper 命令][5] 在 openSUSE 系统上安装文件中列出的软件包。 + +``` +# zypper -y install $(cat /tmp/pack1.txt) +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# zypper -y remove $(cat /tmp/pack1.txt) +``` + +使用以下 [pacman 命令][6] 在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# pacman -S $(cat /tmp/pack1.txt) +``` + +使用以下命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统中卸载文件中列出的软件包。 + + +``` +# pacman -Rs $(cat /tmp/pack1.txt) +``` + +### 方法二:如何使用 cat 和 xargs 命令在 Linux 中安装文件中列出的软件包。 + +甚至,我更喜欢使用这种方法,因为这是一种非常简单直接的方法。 + +使用以下 `apt` 命令在基于 Debian 的系统 (如 Debian、Ubuntu 和 Linux Mint) 上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs apt -y install +``` + +使用以下 `apt` 命令 从基于 Debian 的系统 (如 Debian、Ubuntu 和 Linux Mint) 上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs apt -y remove +``` + +使用以下 `yum` 命令在基于 RHEL (如 Centos,RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y install +``` + +使用以命令从基于 RHEL (如 Centos、RHEL (Redhat) 和 OEL (Oracle Enterprise Linux)) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs yum -y remove +``` + +使用以下 `dnf` 命令在 Fedora 系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y install +``` + +使用以下命令从 Fedora 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs dnf -y remove +``` + +使用以下 `zypper` 命令在 openSUSE 系统上安装文件中列出的软件包。 + + +``` +# cat /tmp/pack1.txt | xargs zypper -y install +``` + +使用以下命令从 openSUSE 系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs zypper -y remove +``` + +使用以下 `pacman` 命令在基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上安装文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -S +``` + +使用下以命令从基于 Arch Linux (如 Manjaro 和 Antergos) 的系统上卸载文件中列出的软件包。 + +``` +# cat /tmp/pack1.txt | xargs pacman -Rs +``` + +### 方法三 : 如何使用 For 循环在 Linux 上安装文件中列出的软件包 + +我们也可以使用 `for` 循环命令来实现此目的。 + +安装批量包可以使用以下一条 `for` 循环的命令。 + +``` +# for pack in `cat /tmp/pack1.txt` ; do apt -y install $i; done +``` + +要使用 shell 脚本安装批量包,请使用以下 `for` 循环。 + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +for pack in `cat /tmp/pack1.txt` +do apt -y remove $pack +done +``` + +为 `bulk-package-install.sh` 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +### 方法四:如何使用 While 循环在 Linux 上安装文件中列出的软件包 + +我们也可以使用 `while` 循环命令来实现目的。 + +安装批量包可以使用以下一条 `while` 循环的命令。 + +``` +# file="/tmp/pack1.txt"; while read -r pack; do apt -y install $pack; done < "$file" +``` + +要使用 shell 脚本安装批量包,请使用以下 `while` 循环。 + +``` +# vi /opt/scripts/bulk-package-install.sh + +#!/bin/bash +file="/tmp/pack1.txt" +while read -r pack +do apt -y remove $pack +done < "$file" +``` + +为 `bulk-package-install.sh` 设置可执行权限。 + +``` +# chmod + bulk-package-install.sh +``` + +最后运行这个脚本。 + +``` +# sh bulk-package-install.sh +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-uninstall-listed-packages-from-a-file-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[way-ww](https://github.com/way-ww) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10116-1.html +[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[5]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[6]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ + diff --git a/published/201906/20190508 Why startups should release their code as open source.md b/published/201906/20190508 Why startups should release their code as open source.md new file mode 100644 index 0000000000..ff12c65320 --- /dev/null +++ b/published/201906/20190508 Why startups should release their code as open source.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11000-1.html) +[#]: subject: (Why startups should release their code as open source) +[#]: via: (https://opensource.com/article/19/5/startups-release-code) +[#]: author: (Clément Flipo https://opensource.com/users/cl%C3%A9ment-flipo) + +为什么初创公司应该将代码开源 +====== + +> Dokit 曾经怀疑将自己的知识开源可能是一个失败的商业决策,然而正是这个选择奠定了它的成功。 + +![open source button on keyboard][1] + +回想一个项目开展最初期的细节并不是一件容易的事情,但这有时候可以帮助你更清晰地理解这个项目。如果让我来说,关于 [Dokit][2] 这个用来创建用户手册和文档的平台的最早的想法来自我的童年。小时候我家里都是 Meccano(LCTT 译注:一种类似乐高的拼装玩具)和飞机模型之类的玩具,对于我来说,游戏中很重要的一部分就是动手制作,把独立的零件组装在一起来创造一个新的东西。我父亲在一家 DIY 公司工作,所以家里到处都建筑、修理,以及使用说明书。小的时候父母还让我参加了童子军,在那里我们制作桌子和帐篷,还有泥巴做的烧烤炉,这些事情都培养了我在共同学习中感受到的乐趣,就像我在开源活动中感受到的一样。 + +在童年学到的修理东西和回收产品的本领成为了我工作的一部分。后来我决心要用线上的方式,还原这种在家里或者小组里学习如何制作和修理东西时的那种非常棒的感觉。Dokit 就从这个想法中诞生了。 + +### 创业初期 + +事情并非一帆风顺,在我们的公司于 2017 年成立之后,我很快就意识到那些最庞大、最值得奋斗的目标一般来说也总是最困难的。如果想要实现我们的计划 —— 彻底改变 [老式的说明书和用户手册的编写和发行方式][3],并且在这个细分市场(我们非常清楚这一点)里取得最大的影响力 —— 那么确立一个主导任务就十分关键,它关乎项目的组织方式。我们据此做出了第一个重要决策:首先 [在短时间内使用一个已有的开源框架 MediaWiki 制作产品原型来验证我们的想法][4],然后将我们的全部代码都作为开源项目发布。 + +当时 [MediaWiki][5] 已经在正常运作了,事后看来,这一点让我们的决策变得容易了许多。这个平台已经拥有我们设想的最小可用产品(MVP)所需要的 90% 的功能,并且在全世界范围内有 15000 名活跃的开发者。MediaWiki 因为是维基百科的驱动引擎而小有名气,如果没有来自它的支持,事情对我们来说无疑会困难很多。还有一个许多公司都在使用的文档平台 Confluence 也有一些不错的功能,但是最终在这两者之间做出选择还是很容易的。 + +出于对社区的信赖,我们把自己平台的初始版本完全放在了 GitHub 上。我们甚至还没有真正开始进行推广,就已经可以看到世界各地的创客们开始使用我们的平台,这种令人激动的感觉似乎说明我们的选择是正确的。尽管 [创客以及 Fablab 运动][6](LCTT 译注:Fablab 是一种向个人提供包括 3D 打印在内的电子化制造服务的小型工坊)都在鼓励用户积极分享说明材料,并且在 [Fablab 章程][7] 中也写明了这一点,但现实中像模像样的文档还是不太多见。 + +人们喜欢使用我们这个平台的首要原因是它可以解决一个非常实在的问题:一个本来还不错的项目,却使用了非常糟糕的文档 —— 其实这个项目本来可以变得更好的。对我们来说,这有点儿像是在修复创客及 DIY 社区里的一个裂缝。在我们的平台发布后的一年之内,Fablabs、[Wikifab][8]、[Open Source Ecology][9]、[Les Petits Debrouillards][10]、[Ademe][11] 以及 [Low-Tech Lab][12] 都在他们的服务器上安装了我们的工具,用来制作逐步引导的教程。 + +甚至在我们还没有发新闻稿之前,我们的其中一个用户 Wikifab 就开始在全国性媒体上收到“DIY 界的维基百科”这样的称赞了。短短两年之内,我们看到有数百的社区都在他们自己的 Dokits 上开展了项目,从有意思的、搞笑的,到那种很正式的产品手册都有。这种社区的力量正是我们想要驾驭的,并且有这么多的项目 —— 从风力涡轮机到宠物喂食器 —— 都在使用我们创建的平台编写非常有吸引力的产品手册,这件事情真的令我们赞叹不已。 + +### 项目开源 + +回头看看前两年的成功,很明显选择开源是我们能迅速取得成果的关键因素。最有价值的事情就是在开源项目中获得反馈的能力了。如果一段代码无法正常运行,[会有人立刻告诉我们][14]。如果可以从这些已经在使用你提供的服务的人那里学到这么多东西,为什么还要需要等着和顾问们开会呢? + +社区对我们这个项目的关注程度也反映出了这个市场的潜力(包括利润上的潜力)。[巴黎有一个非常好的、成长迅速的开发者社区][15](LCTT 译注:Dokit 是一家设立在巴黎的公司),但是开源将我们从一个只有数千当地人的小池子里带到了全世界数百万的开发者身边,他们都将成为我们的创作中的一部分。与此同时,代码的开放性也让我们的用户和客户更加放心,因为即使我们这个公司不在了,代码仍然会存续下去。 + +如果说上面这些都是在我们之前对开源的预期之中的话,其实这一路上也有不少惊喜。因为开源,我们获得了更多的客户、声望以及精准推广,这种推广本来以我们有限的预算是负担不起的,现在却不需要我们支付费用。我们发现开源代码还改善了我们的招聘流程,因为在雇佣之前就可以通过我们的代码来测试候选人,并且被雇佣之后的入职过程也会更加顺利。 + +开发者在完全公开的情况下写代码,既有一点尴尬,同时也很团结,这对我们提升产品质量很有帮助。人们可以互相发表意见和反馈,并且因为工作都是完全公开的,人们似乎会尽可能地想做到最好。为了不断优化、不断重构 Dokit 的运行方式,我们明白未来应该在对社区的支持上做得更好。 + +### 下一步是什么? + +尽管我们对正在做的事情一直都很有信念,并且看到很多出色的产品说明书都是用我们的软件制作出来的,我们还是会对这个项目的成长不断地感到兴奋,并且非常确信未来一定会很好。 + +在创业初期,我们对将自己的知识免费分发出去这件事还是非常担心的。事实证明正好相反 —— 正是开源让我们能够迅速构建起一个可持续的初创企业。Dokit 平台的设计初衷是通过社区的支持,让它的用户有信心去构建、组装、修理和创造全新的发明。事后看来,我们用开源的方式去构建了 Dokit 这个平台,这和 Dokit 本身想做的其实正好是同一件事情。 + +如同修理或者组装一件实体产品一样,只有当你对自己的方法有信心的时候,事情才会越来越顺利。现在,在我们创业的第三个年头,我们开始注意到全世界对这个领域的兴趣在增加,因为它迎合了出于不断变化的居家和生活方式的需求而 [想要使用或重复利用以及组装产品的新一代客户][16]。我们正是在通过线上社区的支持,创造一个让大家能够在自己动手做东西的时候感到更加有信心的平台。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/startups-release-code + +作者:[Clément Flipo][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cl%C3%A9ment-flipo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://dokit.io/ +[3]: https://dokit.io/9-reasons-to-stop-writing-your-user-manuals-or-work-instructions-with-word-processors/ +[4]: https://medium.com/@gofloaters/5-cheap-ways-to-build-your-mvp-71d6170d5250 +[5]: https://en.wikipedia.org/wiki/MediaWiki +[6]: https://en.wikipedia.org/wiki/Maker_culture +[7]: http://fab.cba.mit.edu/about/charter/ +[8]: https://wikifab.org/ +[9]: https://www.opensourceecology.org/ +[10]: http://www.lespetitsdebrouillards.org/ +[11]: https://www.ademe.fr/en +[12]: http://lowtechlab.org/ +[13]: https://www.20minutes.fr/magazine/economie-collaborative-mag/2428995-20160919-pour-construire-leurs-meubles-eux-memes-ils-creent-le-wikipedia-du-bricolage +[14]: https://opensource.guide/how-to-contribute/ +[15]: https://www.rudebaguette.com/2013/03/here-are-the-details-on-the-new-developer-school-that-xavier-niel-is-launching-tomorrow/?lang=en +[16]: https://www.inc.com/ari-zoldan/why-now-is-the-best-time-to-start-a-diy-home-based.html diff --git a/published/201906/20190509 5 essential values for the DevOps mindset.md b/published/201906/20190509 5 essential values for the DevOps mindset.md new file mode 100644 index 0000000000..f3193a3d95 --- /dev/null +++ b/published/201906/20190509 5 essential values for the DevOps mindset.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (arrowfeng) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10992-1.html) +[#]: subject: (5 essential values for the DevOps mindset) +[#]: via: (https://opensource.com/article/19/5/values-devops-mindset) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed) + +DevOps 思维模式的 5 个基本价值观 +====== + +> 人和流程比在解决的业务问题的任何技术“银弹”更重要,且需要花更多的时间。 + +![human head, brain outlined with computer hardware background][1] + +今天的许多 IT 专业人士都在努力适应变化和扰动。这么说吧,你是否正在努力适应变化?你觉得不堪重负吗?这并不罕见。今天,IT 的现状还不够好,所以需要不断尝试重新自我演进。 + +凭借 30 多年的IT综合经验,我们见证了人员与关系对于 IT 企业提高效率和帮助企业蓬勃发展的重要性。但是,在大多数情况下,我们关于 IT 解决方案的对话始于技术,而不是从人员和流程开始。寻找“银弹”来解决业务和 IT 挑战的倾向过于普遍。但你不能想着可以买到创新、DevOps 或有效的团队和工作方式;他们需要得到培养,支持和引导。 + +由于扰动如此普遍,并且对变革速度存在如此迫切的需求,我们需要纪律和围栏。下面描述的 DevOps 思维模式的五个基本价值观将支持将我们的实践。这些价值观不是新观念;正如我们从经验中学到的那样,它们被重构了。一些价值观可以互换的,它们是灵活的,并且它们如支柱一样导向了支持这五个价值观的整体原则。 + +![5 essential values for the DevOps mindset][2] + +### 1、利益相关方的反馈至关重要 + +我们如何知道我们是否为我们创造了比利益相关方更多的价值?我们需要持久的质量数据来分析、通知并推动更好的决策。来自可靠来源的相关信息对于任何业务的蓬勃发展至关重要。我们需要倾听并理解我们的利益相关方所说的,而不是说我们需要以一种方式实施变革,使我们能够调整我们的思维、流程和技术,并根据需要对其进行调整以使我们的利益相关者满意。由于信息(数据)不正确,我们常常看到的变化过少,或者由于错误的原因而发生了很多变化。因此,将变更与利益相关方的反馈结合起来是一项基本价值观,并有助我们专注于使公司成功最重要的事情。 + +> 关注我们的利益相关方及其反馈,而不仅仅是为了改变而改变。 + +### 2、超越当今流程的极限进行改进 + +我们希望我们的产品和服务能够不断让客户满意,他们是我们最重要的利益相关方。因此,我们需要不断改进。这不仅仅是关系到质量;它还可能意味着成本、可用性、相关性以及许多其他目标和因素。创建可重复的流程或使用通用框架是非常棒的,它们可以改善治理和许多其他问题。但是,这不应该是我们的最终目标。在寻找改进方法时,我们必须调整我们的流程,并辅以正确的技术和工具。可能有理由抛出一个“所谓的”框架,因为不这样做可能会增加浪费,更糟糕的是只是“货物结果”(做一些没有价值或目的的东西)。 + +> 力争始终创新并改进可重复的流程和框架。 + +### 3、不要用新的孤岛来打破旧的孤岛 + +孤岛和 DevOps 是不兼容的。我们经常能看到:IT 主管带来了所谓的“专家”来实施敏捷和 DevOps,他们做了什么?这些“专家”在现有问题的基础上创建了一个新问题,这是 IT 部门和业务中又增加了一个孤岛。创造“DevOps”职位违背了敏捷和 DevOps 基于打破孤岛的原则。在敏捷和 DevOps 中,团队合作是必不可少的,如果你不在自组织团队中工作,那么你就不会做任何事情。 + +> 相互激励和共享,而不是成为英雄或创建一个孤岛。 + +### 4、了解你的客户意味着跨组织协作 + +企业的任何一个部分都不是一个独立的实体,因为它们都有利益相关方,主要利益相关方始终是客户。“客户永远是对的”(或国王,我喜欢这样说)。关键是,没有客户就真的没有业务,而且为了保持业务,如今我们需要与竞争对手“区别对待”。我们还需要了解客户对我们的看法以及他们对我们的期望。了解客户的需求势在必行,需要及时反馈,以确保业务能够快速、负责地满足这些主要利益相关者的需求和关注。 + +![Minimize time spent with build-measure-learn process][3] + +无论是想法、概念、假设还是直接利益相关方的反馈,我们都需要通过使用探索、构建、测试和交付生命周期来识别和衡量我们的产品提供的功能或服务。从根本上说,这意味着我们需要在整个组织中“插入”我们的组织。在持续创新、学习和 DevOps 方面没有任何边界。因此,当我们在整个企业中进行衡量时,我们可以理解整体并采取可行的、有意义的步骤来改进。 + +> 衡量整个组织的绩效,而不仅仅是在业务范围内。 + +### 5、通过热情鼓励采纳 + +不是每个人都要被驱使去学习、适应和改变;然而,就像微笑可能具有传染性一样,学习和意愿成为变革文化的一部分也是如此。在学习文化中适应和演化为一群人提供了学习和传递信息(即文化传播)的自然机制。学习风格、态度、方法和过程不断演化,因此我们可以改进它们。下一步是应用所学和改进的内容并与同事分享信息。学习不会自动发生;它需要努力、评估、纪律、意识,特别是沟通;遗憾的是,这些都是工具和自动化无法提供的。检查你的流程、自动化、工具策略和实施工作,使其透明化,并与你的同事协作重复使用和改进。 + +> 通过精益交付促进学习文化,而不仅仅是工具和自动化。 + +### 总结 + +![Continuous goals of DevOps mindset][4] + +随着我们的公司采用 DevOps,我们继续在各种书籍、网站或自动化软件上倡导这五个价值观。采用这种思维方式需要时间,这与我们以前作为系统管理员所做的完全不同。这是一种全新的工作方式,需要很多年才能成熟。这些原则是否与你自己的原则一致?在评论或我们的网站 [Agents of chaos][5] 上分享。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/values-devops-mindset + +作者:[Brent Aaron Reed][a] +选题:[lujun9972][b] +译者:[arrowfeng](https://github.com/arrowfeng) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brentaaronreed/users/wpschaub/users/wpschaub/users/wpschaub/users/cobiacomm/users/marcobravo/users/brentaaronreed +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X (human head, brain outlined with computer hardware background) +[2]: https://opensource.com/sites/default/files/uploads/devops_mindset_values.png (5 essential values for the DevOps mindset) +[3]: https://opensource.com/sites/default/files/uploads/devops_mindset_minimze-time.jpg (Minimize time spent with build-measure-learn process) +[4]: https://opensource.com/sites/default/files/uploads/devops_mindset_continuous.png (Continuous goals of DevOps mindset) +[5]: http://agents-of-chaos.org diff --git a/published/201906/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md b/published/201906/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md new file mode 100644 index 0000000000..a0f55d4b7b --- /dev/null +++ b/published/201906/20190513 How To Check Whether The Given Package Is Installed Or Not On Debian-Ubuntu System.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (yizhuoyan) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11010-1.html) +[#]: subject: (How To Check Whether The Given Package Is Installed Or Not On Debian/Ubuntu System?) +[#]: via: (https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + + +如何在 Debian/Ubuntu 系统中检查程序包是否安装? +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/23/235541yl41p73z5jv78y8p.jpg) + +我们近期发布了一篇关于批量程序包安装的文章。在此同时,关于如何获取系统上已安装了的程序包信息,我也做了些调查然后找到了些方法。我会把这些方法分享在我们的网站上,希望能帮助到其他人。 + +有很多种方法可以检查程序包是否已安装,我找到了 7 种命令,你可以从中选择你喜欢的使用。 + +如下: + + * `apt-cache`:可用于查询 APT 缓存或程序包的元数据。 + * `apt`:是基于 Debian 的系统中的安装、下载、删除、搜索和管理包的强有力的工具。 + * `dpkg-query`:一个查询 dpkg 数据库的工具。 + * `dpkg`:基于 Debian 的系统的包管理工具。 + * `which`:返回在终端中输入命令时执行的可执行文件的全路径。 + * `whereis`:可用于搜索指定命令的二进制文件、源码文件和帮助文件。 + * `locate`:比 `find` 命令快,因为其使用 `updatedb` 数据库搜索,而 `find`命令在实际系统中搜索。 + +### 方法一、使用 apt-cache 命令 + +`apt-cache` 命令用于从 APT 内部数据库中查询**APT 缓存**和**包的元数据**,将会搜索和显示指定包的信息,包括是否安装、程序包版本、源码仓库信息等。 + +下面的示例清楚的显示 `nano` 包已经在系统中安装了以及对应安装的版本号。 + +``` +# apt-cache policy nano +nano: + Installed: 2.9.3-2 + Candidate: 2.9.3-2 + Version table: + *** 2.9.3-2 500 + 500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages + 100 /var/lib/dpkg/status +``` + +### 方法二、使用 apt 命令 + +`apt` 是一个功能强大的命令行工具,可用于安装、下载、删除、搜索、管理程序包以及查询关于程序包的信息,类似对于 `libapt-pkg` 库的所有功能的底层访问。其包含一些与包管理相关的但很少用到的命令行功能。 + +``` +# apt -qq list nano +nano/bionic,now 2.9.3-2 amd64 [installed] +``` + +### 方法三、使用 dpkg-query 命令 + +`dpkg-query` 是显示 `dpkg` 数据库中程序包信息列表的一个工具。 + +下面示例中的输出的第一列 `ii`,表示查询的程序包已安装了。 + +``` +# dpkg-query --list | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### 方法四、使用 dpkg 命令 + +`dpkg`(**d**ebian **p**ac**k**a**g**e)是一个安装、构建、删除和管理 Debian 包的工具,但和其他包管理系统不同的是,其不能自动下载和安装包或包依赖。 + +下面示例中的输出的第一列 `ii`,表示查询的包已安装了。 + +``` +# dpkg -l | grep -i nano +ii nano 2.9.3-2 amd64 small, friendly text editor inspired by Pico +``` + +### 方法五、使用 which 命令 + +`which` 命令返回在终端中输入命令时执行的可执行文件的全路径。这对于你想要给可执行文件创建桌面快捷方式或符号链接时非常有用。 + +`which` 命令仅在当前用户 `PATH` 环境变量配置的目录列表中搜索,而不是在所有用户的目录中搜索。这意思是当你登入你自己账号时,其不会在 `root` 用户文件或目录中搜索。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# which nano +/bin/nano +``` + +### 方法六、使用 whereis 命令 + +`whereis` 命令用于针对指定命令搜索对应的程序二进制文件、源码文件以及帮助文件等。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# whereis nano +nano: /bin/nano /usr/share/nano /usr/share/man/man1/nano.1.gz /usr/share/info/nano.info.gz +``` + +### 方法七、使用 locate 命令 + +`locate` 命令比 `find` 命令快,因为其在 `updatedb` 数据库中搜索,而 `find` 命令在实际系统中进行搜索。 + +对于获取指定文件,其使用数据库而不是在特定目录路径中搜索。 + +`locate` 命令不会预安装在大多数系统中,需要手动安装。 + +`locate` 使用的数据库会根据定时任务定期更新。当然,我们也可以手动更新。 + +如果对于指定的程序包或可执行文件路径有如下输出,则表示已安装了,否则没有。 + +``` +# locate --basename '\nano' +/usr/bin/nano +/usr/share/nano +/usr/share/doc/nano +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-check-whether-the-given-package-is-installed-or-not-on-ubuntu-debian-system/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[yizhuoyan](https://github.com/yizhuoyan) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 diff --git a/published/201906/20190517 10 Places Where You Can Buy Linux Computers.md b/published/201906/20190517 10 Places Where You Can Buy Linux Computers.md new file mode 100644 index 0000000000..92a334f37d --- /dev/null +++ b/published/201906/20190517 10 Places Where You Can Buy Linux Computers.md @@ -0,0 +1,299 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10982-1.html) +[#]: subject: (10 Places Where You Can Buy Linux Computers) +[#]: via: (https://itsfoss.com/get-linux-laptops/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +可以买到 Linux 电脑的 10 个地方 +====== + +> 你在找 Linux 笔记本吗? 这里列出一些出售 Linux 电脑或者是专注于 Linux 系统的电商。 + +如今市面上几乎所有的电脑(苹果除外)都预装了 Windows 系统。Linux 使用者的惯常做法就是买一台这样的电脑,然后要么删除 Windows 系统并安装 Linux,要么[安装 Linux 和 Windows 的双系统][1]。 + +但 Windows 系统并非无法避免。你其实也可以买到 Linux 电脑。 + +不过,既然可以轻松地在任何一台电脑上安装 Linux,为什么还要买一台预装了 Linux 的电脑呢?下面列举几个原因: + + * 预装 Windows 系统意味着你额外支付了 Windows 许可证的费用。你可以节省这笔开销。 + * 预装 Linux 的电脑都经过了硬件适配测试。你不需要担心系统无法正常运行 WiFi 或者蓝牙,也不再需要亲自去搞定这些事情了。 + * 购买 Linux 电脑相当于间接地支持了 Linux。更多的销售额可以反应出对 Linux 产品的需求,也就可能会有更多商家提供 Linux 作为一种可以选择的操作系统。 + +如果你正想买一台 Linux 的笔记本,不妨考虑一下我的建议。下面这些制造商或者商家都提供开箱即用的 Linux 系统。 + +![][2] + +### 可以买到 Linux 笔记本或者台式机的 10 个地方 + +在揭晓这个提供预装 Linux 电脑的商家的清单之前,需要先声明一下。 + +请根据你的独立决策购买。我在这里只是简单地列出一些售卖 Linux 电脑的商家,并不保证他们的产品质量、售后服务等等这些事情。 + +这也并不是一个排行榜。清单并不是按照某个特定次序排列的,每一项前面的数字只是为了方便计数,而并不代表名次。 + +让我们看看你可以在哪儿买到预装 Linux 的台式机或者笔记本吧。 + +#### 1、戴尔 + +![戴尔 XPS Ubuntu | 图片所有权: Lifehacker][3] + +戴尔提供 Ubuntu 笔记本已经有好几年了。他们的旗舰产品 XPS 系列的亮点之一就是预装了 Ubuntu 的开发者版本系列产品。 + +如果你读过我的 [戴尔 XPS Ubuntu 版本评测][4]就知道我是很喜欢这款笔记本的。两年多过去了,这个笔记本依然状况良好,没有性能恶化的迹象。 + +戴尔 XPS 是售价超过 1000 美元的昂贵设备。如果你的预算没有这么多,可以考虑戴尔更加亲民的 Inspiron 系列笔记本。 + +值得一提的是,戴尔并没有在它的官网上展示 Ubuntu 或者 Linux 笔记本产品。除非你知道戴尔提供 Linux 笔记本,你是不会找到它们的。 + +所以,去戴尔的官网上搜索关键字 “Ubuntu” 来获取预装 Ubuntu 的产品的信息吧。 + +**支持范围**:世界上大部分地区。 + +- [戴尔][5] + +#### 2、System76 + +[System76][6] 是 Linux 计算机世界里的一个响亮的名字。这家总部设在美国的企业专注于运行 Linux 的高端技术设备。他们的目标用户群体是软件开发者。 + +最初,System76 在自己的机器上提供的是 Ubuntu 系统。2017 年,他们发布了属于自己的 Linux 发行版,基于 Ubuntu 的 [Pop!\_OS][7]。从此以后,Pop!\_OS 就是他们机器上的默认操作系统了,但是仍然保留了 Ubuntu 这个选择。 + +除了性能之外,System76 还格外重视设计。他们的 [Thelio 系列台式机][8] 采用纯手工木制设计。 + +![System76 Thelio 台式机][9] + +你可以在 [这里][10] 查看他们提供的 Linux 笔记本。他们同时也提供 [基于 Linux 的迷你电脑][11] 和 [服务器][12]。 + +值得一提的是,System76 在美国制造他们的电脑,而没有使用中国大陆或者台湾这种常规的选择。也许是出于这个原因,他们产品的售价较为高昂。 + +**支持范围**:美国以及其它 60 个国家。在美国境外可能会有额外的关税。更多信息见[这里][13]. + +- [System76][6] + +#### 3、Purism + +Purism 是一个总部设在美国的企业,以提供确保数据安全和隐私的产品和服务为荣。这就是为什么 Purism 称自己为 “效力社会的公司”。 + +Purism 是从一个众筹项目开始的,该项目旨在创造一个几乎没有任何专有软件的高端开源笔记本。2015年,从这个 [成功的 25 万美元的众筹项目][15] 中诞生了 [Librem 15][16] 笔记本。 + +![Purism Librem 13][17] + +后来 Purism 发布了一个 13 英寸的版本 [Librem 13][18]。Purism 还开发了一个自己的 Linux 发行版 [Pure OS][19],该发行版非常注重隐私和安全问题。 + +[Pure OS 在台式设备和移动设备上都可以运行][20],并且是 Librem 笔记本和[Librem 5 Linux 手机][21] 的默认操纵系统。 + +Purism 的零部件来自中国大陆、台湾、日本以及美国,并在美国完成组装。他们的所有设备都有可以直接关闭的硬件开关,用来关闭麦克风、摄像头、无线连接或者是蓝牙。 + +**支持范围**:全世界范围国际免邮。可能需要支付额外的关税。 + +- [Purism][22] + +#### 4、Slimbook + +Slimbook 是一个总部设在西班牙的 Linux 电脑销售商。Slimbook 在发行了 [第一款 KDE 品牌笔记本][23]之后成为了人们关注的焦点。 + +他们的产品不仅限于 KDE Neon。他们还提供 Ubuntu、Kubuntu、Ubuntu MATE、Linux Mint 以及包括 [Lliurex][24] 和 [Max][25] 这样的西班牙发行版。你也可以选择 Windows(需要额外付费)或者不预装任何操作系统。 + +Slimbook 有众多 Linux 笔记本、台式机和迷你电脑可供选择。他们另外一个非常不错的产品是一个类似于 iMac 的 24 英寸 [拥有内置 CPU 的曲面显示屏][26]。 + +![Slimbook Kymera Aqua 水冷 Linux 电脑][27] + +想要一台水冷 Linux 电脑吗?Slimbook 的 [Kymera Aqua][28] 是合适之选。 + +**支持范围**:全世界范围,不过在邮费和关税上都可能产生额外费用。 + +- [Slimbook][29] + +#### 5、TUXEDO + +作为这个 Linux 电脑销售商清单里的另一个欧洲成员,[TUXEDO][30] 总部设在德国,主要服务德国用户,其次是欧洲用户。 + +TUXEDO 只使用 Linux 系统,产品都是“德国制造”,并且提供 5 年保修和终生售后支持。 + +TUXEDO 在 Linux 系统的硬件适配上下了很大功夫。并且如果你遇到了麻烦或者是想从头开始,可以通过系统恢复选项,自动恢复出厂设置。 + +![Tuxedo 电脑支持众多发行版][31] + +TUXEDO 有许多 Linux 笔记本、台式机和迷你电脑产品可供选择。他们还同时支持 Intel 和 AMD 的处理器。除了电脑,TUXEDO 还提供一系列 Linux 支持的附件,比如扩展坞、DVD 和蓝光刻录机、移动电源以及其它外围设备。 + +**支持范围**:150 欧元以上的订单在德国和欧洲范围内免邮。欧洲外国家会有额外的运费和关税。更多信息见 [这里][32]. + +- [TUXEDO][33] + +#### 6、Vikings + +[Vikings][34] 的总部设在德国(而不是斯堪的纳维亚半岛,哈哈)。Vikings 拥有[自由软件基金会][35]的认证,专注于自由友好的硬件。 + +![Vikings 的产品经过了自由软件基金会认证][36] + +Vikings 的 Linux 笔记本和台式机使用的是 [coreboot][37] 或者 [Libreboot][38],而不是像 BIOS 和 UEFI 这样的专有启动系统。你还可以购买不运行任何专有软件的 [硬件服务器][39]。 + +Vikings 还有包括路由器、扩展坞等在内的其它配件。他们的产品都是在德国组装完成的。 + +**支持范围**:全世界(除了朝鲜)。非欧洲国家可能会有额外关税费用。更多信息见[这里][40]。 + +- [Vikings][41] + +#### 7、Ubuntushop.be + +不不!尽管名字里有 Ubuntu,但这不是官方的 Ubuntu 商店。Ubuntushop 总部位于比利时,最初是销售安装了 Ubuntu 的电脑。 + +如今,你可以买到预装了包括 Mint、Manjaro、elementrayOS 在内的 Linux 发行版的笔记本电脑。你还可以要求所购买的设备上安装你所选择的发行版。 + +![][42] + +Ubuntushop 的一个独特之处在于,它的所有电脑都带有默认的 Tails OS live 选项。即使你安装了某个其它的 Linux 发行版作为日常使用的系统,也随时可以选择启动到 Tails OS(不需要使用 live USB)。[Tails OS][43] 是一个基于 Debian 的发行版,它在用户注销后会删除所有使用痕迹,并且在默认情况下使用 Tor 网络。 + +和此列表中的许多其他重要玩家不同,我觉得 Ubuntushop 所提供的更像是一种“家庭工艺”。商家手动组装一个电脑,安装 Linux 然后卖给你。不过他们也在一些可选项上下了功夫,比如说轻松的重装系统,拥有自己的云服务器等等。 + +你可以找一台旧电脑快递给他们,就可以变成一台新安装 Linux 的电脑,他们就会在你的旧电脑上安装 [轻量级 Linux][45] 系统然后快递回来,这样你这台旧电脑就可以重新投入使用了。 + +**支持范围**:比利时以及欧洲的其它地区。 + +- [Ubuntushop.be][46] + +#### 8、Minifree + +[Minifree][47],是自由部门Ministry of Freedom的缩写,他们是一家注册在英格兰的公司。 + +你可以猜到 Minifree 非常注重自由。他们提供安全以及注重隐私的电脑,预装 [Libreboot][38] 而不是 BIOS 或者 UEFI。 + +Minifree 的设备经过了 [自由软件基金会][48] 的认证,所以你可以放心买到的电脑都遵循了自由开源软件的指导规则。 + +![][49] + +和这个清单中许多其它 Linux 笔记本销售商不同,Minifree 的电脑并不是特别贵。花 200 欧元就可以买到一台预装了 Libreboot 和 [Trisquel GNU/Linux][50] 的 Linux 电脑。 + +除了笔记本以外,Minifree 还有一系列的配件,比如 Libre 路由器、平板电脑、扩展坞、电池、键盘、鼠标等等。 + +如果你和 [Richard Stallman][51] 一样,希望只运行 100% 自由的软件的话,Minifree 就再适合不过了。 + +**支持范围**:全世界。运费信息见 [这里][52]。 + +- [Minifree][47] + +#### 9、Entroware + +[Entroware][53] 是另一个总部设在英国的销售商,专注基于 Linux 系统的笔记本、台式机和服务器。 + +和这个清单里的很多其它商家一样,Entroware 也选择 Ubuntu 作为 Linux 发行版。[Ubuntu MATE 也是 Entroware Linux 笔记本的一种可选系统][54]. + +![][55] + +除了笔记本、台式机和服务器之外,Entroware 还拥有自己的 [迷你电脑 Aura][56],以及一个 iMac 风格的[内置 CPU 的显示器 Ares][57]. + +支持范围: 英国、爱尔兰、法国、德国、意大利、西班牙。 + +- [Entroware][58] + +#### 10、Juno + +这是我们清单上的一个新的 Linux 笔记本销售商。Juno 的总部同样设在英国,提供预装 Linux 的电脑。可选择的 Linux 发行版包括 elementary OS、Ubuntu 和 Solus OS。 + +Juno 提供一系列的笔记本,以及一款叫做 Olympia 迷你电脑。和列表里其它商家提供的大多数迷你电脑一样,Olympia 也基本上相当于一个 [Intel NUC][59]。 + +Juno 的主要特色是 Juve,一款售价 299 美元的 Chromebook 的低成本替代品。它运行一个双系统,包括 Solus 或者 elementray,以及一个基于安卓的电脑操作系统 [Prime OS][60]。 + +![Juve With Android-based Prime Os][61] + +支持范围:英国、美国、加拿大、墨西哥、南美和欧洲的大部分地区、新西兰、亚洲和非洲的某些地区。更多信息见 [这里][62]。 + +- [Juno Computers][63] + +#### 荣誉奖 + +我列举了 10 个可以买到 Linux 电脑的地方,但其实还有一些其它类似的商店。清单里放不下这么多,并且它们其中的几个似乎大多数商品都缺货。不过我还是要在这里稍微提一下它们,方便你自己查找相关信息: + + * [ZaReason][64] + * [Libiquity][65] + * [StationX][66] + * [Linux Certified][67] + * [Think Penguin][68] + +包括宏碁和联想在内的其它主流电脑生产商可能也有基于 Linux 系统的产品,所以你不妨也查看一下他们的产品目录吧。 + +你有没有买过 Linux 电脑?在哪儿买的?使用体验怎么样?Linux 笔记本值不值得买?分享一下你的想法吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/get-linux-laptops/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/buy-linux-laptops.jpeg?resize=800%2C450&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/dell-xps-ubuntu.jpg?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/dell-xps-13-ubuntu-review/ +[5]: https://www.dell.com +[6]: https://system76.com/ +[7]: https://itsfoss.com/pop-os-linux-review/ +[8]: https://system76.com/desktops +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/system76-thelio-desktop.jpg?ssl=1 +[10]: https://system76.com/laptops +[11]: https://itsfoss.com/4-linux-based-mini-pc-buy-2015/ +[12]: https://system76.com/servers +[13]: https://system76.com/shipping +[14]: https://itsfoss.com/use-google-drive-linux/ +[15]: https://www.crowdsupply.com/purism/librem-15 +[16]: https://puri.sm/products/librem-15/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/purism-librem-13.jpg?resize=800%2C471&ssl=1 +[18]: https://puri.sm/products/librem-13/ +[19]: https://www.pureos.net/ +[20]: https://itsfoss.com/pureos-convergence/ +[21]: https://itsfoss.com/librem-linux-phone/ +[22]: https://puri.sm/ +[23]: https://itsfoss.com/slimbook-kde/ +[24]: https://distrowatch.com/table.php?distribution=lliurex +[25]: https://en.wikipedia.org/wiki/MAX_(operating_system) +[26]: https://slimbook.es/en/aio-curve-all-in-one-for-gnu-linux +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Slimbook-Kymera-Aqua-Liquid-Cool-Linux-Computer.jpg?ssl=1 +[28]: https://slimbook.es/en/kymera-aqua-the-gnu-linux-computer-with-custom-water-cooling +[29]: https://slimbook.es/en/ +[30]: https://www.tuxedocomputers.com/ +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/tuxedo-computers.jpeg?resize=800%2C400&ssl=1 +[32]: https://www.tuxedocomputers.com/en/Shipping-Returns.tuxedo +[33]: https://www.tuxedocomputers.com/en# +[34]: https://store.vikings.net/index.php?route=common/home +[35]: https://www.fsf.org +[36]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/vikings-computer.jpeg?resize=800%2C450&ssl=1 +[37]: https://www.coreboot.org/ +[38]: https://libreboot.org/ +[39]: https://store.vikings.net/libre-friendly-hardware/the-server-1u +[40]: https://store.vikings.net/index.php?route=information/information&information_id=8 +[41]: https://store.vikings.net/libre-friendly-hardware +[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/manjarobook-by-ubuntushop.jpeg?ssl=1 +[43]: https://tails.boum.org/ +[44]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ +[45]: https://itsfoss.com/lightweight-linux-beginners/ +[46]: https://www.ubuntushop.be/index.php/en/ +[47]: https://minifree.org/ +[48]: https://www.fsf.org/ +[49]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/minifree.jpg?resize=800%2C550&ssl=1 +[50]: https://trisquel.info/ +[51]: https://en.wikipedia.org/wiki/Richard_Stallman +[52]: https://minifree.org/shipping-costs/ +[53]: https://www.entroware.com/ +[54]: https://itsfoss.com/ubuntu-mate-entroware/ +[55]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/entroware.jpg?resize=800%2C450&ssl=1 +[56]: https://itsfoss.com/ubuntu-entroware-aura-mini-pc/ +[57]: https://www.entroware.com/store/ares +[58]: https://www.entroware.com/store/index.php?route=common/home +[59]: https://www.amazon.com/Intel-NUC-Mainstream-Kit-NUC8i3BEH/dp/B07GX4X4PW?psc=1&SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07GX4X4PW (Intel NUC) +[60]: https://primeos.in/ +[61]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/juve-with-prime-os.jpeg?ssl=1 +[62]: https://junocomputers.com/shipping +[63]: https://junocomputers.com/ +[64]: https://zareason.com/ +[65]: https://libiquity.com/ +[66]: https://stationx.rocks/ +[67]: https://www.linuxcertified.com/linux_laptops.html +[68]: https://www.thinkpenguin.com/ diff --git a/published/201906/20190517 Using Testinfra with Ansible to verify server state.md b/published/201906/20190517 Using Testinfra with Ansible to verify server state.md new file mode 100644 index 0000000000..9b2dc01e26 --- /dev/null +++ b/published/201906/20190517 Using Testinfra with Ansible to verify server state.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10943-1.html) +[#]: subject: (Using Testinfra with Ansible to verify server state) +[#]: via: (https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state) +[#]: author: (Clement Verna https://opensource.com/users/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert) + +使用 Testinfra 和 Ansible 验证服务器状态 +====== + +> Testinfra 是一个功能强大的库,可用于编写测试来验证基础设施的状态。另外它与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 + +![Terminal command prompt on orange background][1] + +根据设计,[Ansible][2] 传递机器的期望状态,以确保 Ansible 剧本或角色的内容部署到目标机器上。但是,如果你需要确保所有基础架构更改都在 Ansible 中,该怎么办?或者想随时验证服务器的状态? + +[Testinfra][3] 是一个基础架构测试框架,它可以轻松编写单元测试来验证服务器的状态。它是一个 Python 库,使用强大的 [pytest][4] 测试引擎。 + +### 开始使用 Testinfra + +可以使用 Python 包管理器(`pip`)和 Python 虚拟环境轻松安装 Testinfra。 + +``` +$ python3 -m venv venv +$ source venv/bin/activate +(venv) $ pip install testinfra +``` + +Testinfra 也可以通过 Fedora 和 CentOS 的 EPEL 仓库中使用。例如,在 CentOS 7 上,你可以使用以下命令安装它: + +``` +$ yum install -y epel-release +$ yum install -y python-testinfra +``` + +#### 一个简单的测试脚本 + +在 Testinfra 中编写测试很容易。使用你选择的代码编辑器,将以下内容添加到名为 `test_simple.py` 的文件中: + +``` +import testinfra + +def test_os_release(host): + assert host.file("/etc/os-release").contains("Fedora") + +def test_sshd_inactive(host): + assert host.service("sshd").is_running is False +``` + +默认情况下,Testinfra 为测试用例提供了一个 `host` 对象,该对象能访问不同的辅助模块。例如,第一个测试使用 `file` 模块来验证主机上文件的内容,第二个测试用例使用 `service` 模块来检查 systemd 服务的状态。 + +要在本机运行这些测试,请执行以下命令: + +``` +(venv)$ pytest test_simple.py +================================ test session starts ================================ +platform linux -- Python 3.7.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0 +rootdir: /home/cverna/Documents/Python/testinfra +plugins: testinfra-3.0.0 +collected 2 items +test_simple.py .. + +================================ 2 passed in 0.05 seconds ================================ +``` + +有关 Testinfra API 的完整列表,你可以参考[文档][5]。 + +### Testinfra 和 Ansible + +Testinfra 支持的后端之一是 Ansible,这意味着 Testinfra 可以直接使用 Ansible 的清单文件和清单中定义的一组机器来对它们进行测试。 + +我们使用以下清单文件作为示例: + +``` +[web] +app-frontend01 +app-frontend02 + +[database] +db-backend01 +``` + +我们希望确保我们的 Apache Web 服务器在 `app-frontend01` 和 `app-frontend02` 上运行。让我们在名为 `test_web.py` 的文件中编写测试: + +``` +def check_httpd_service(host): + """Check that the httpd service is running on the host""" + assert host.service("httpd").is_running +``` + +要使用 Testinfra 和 Ansible 运行此测试,请使用以下命令: + + +``` +(venv) $ pip install ansible +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible test_web.py +``` + +在调用测试时,我们使用 Ansible 清单文件的 `[web]` 组作为目标计算机,并指定我们要使用 Ansible 作为连接后端。 + +#### 使用 Ansible 模块 + +Testinfra 还为 Ansible 提供了一个很好的可用于测试的 API。该 Ansible 模块能够在测试中运行 Ansible 动作,并且能够轻松检查动作的状态。 + +``` +def check_ansible_play(host): + """ + Verify that a package is installed using Ansible + package module + """ + assert not host.ansible("package", "name=httpd state=present")["changed"] +``` + +默认情况下,Ansible 的[检查模式][6]已启用,这意味着 Ansible 将报告在远程主机上执行动作时会发生的变化。 + +### Testinfra 和 Nagios + +现在我们可以轻松地运行测试来验证机器的状态,我们可以使用这些测试来触发监控系统上的警报。这是捕获意外的更改的好方法。 + +Testinfra 提供了与 [Nagios][7] 的集成,它是一种流行的监控解决方案。默认情况下,Nagios 使用 [NRPE][8] 插件对远程主机进行检查,但使用 Testinfra 可以直接从 Nagios 主控节点上运行测试。 + +要使 Testinfra 输出与 Nagios 兼容,我们必须在触发测试时使用 `--nagios` 标志。我们还使用 `-qq` 这个 pytest 标志来启用 pytest 的静默模式,这样就不会显示所有测试细节。 + +``` +(venv) $ py.test --hosts=web --ansible-inventory=inventory --connection=ansible --nagios -qq line test.py +TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 2.55 seconds +``` + +Testinfra 是一个功能强大的库,可用于编写测试以验证基础架构的状态。 另外与 Ansible 和 Nagios 相结合,提供了一个用于架构即代码 (IaC) 的简单解决方案。 它也是使用 [Molecule][9] 开发 Ansible 角色过程中添加测试的关键组件。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state + +作者:[Clement Verna][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/cverna/users/paulbischoff/users/dcritch/users/cobiacomm/users/wgarry155/users/kadinroob/users/koreyhilpert +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://www.ansible.com/ +[3]: https://testinfra.readthedocs.io/en/latest/ +[4]: https://pytest.org/ +[5]: https://testinfra.readthedocs.io/en/latest/modules.html#modules +[6]: https://docs.ansible.com/ansible/playbooks_checkmode.html +[7]: https://www.nagios.org/ +[8]: https://en.wikipedia.org/wiki/Nagios#NRPE +[9]: https://github.com/ansible/molecule diff --git a/published/201906/20190520 Getting Started With Docker.md b/published/201906/20190520 Getting Started With Docker.md new file mode 100644 index 0000000000..2349664ad9 --- /dev/null +++ b/published/201906/20190520 Getting Started With Docker.md @@ -0,0 +1,471 @@ +[#]: collector: "lujun9972" +[#]: translator: "zhang5788" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10940-1.html" +[#]: subject: "Getting Started With Docker" +[#]: via: "https://www.ostechnix.com/getting-started-with-docker/" +[#]: author: "sk https://www.ostechnix.com/author/sk/" + +Docker 入门指南 +====== + +![Getting Started With Docker][1] + +在我们的上一个教程中,我们已经了解[如何在 Ubuntu 上安装 Docker][1],和如何在 [CentOS 上安装 Docker][2]。今天,我们将会了解 Docker 的一些基础用法。该教程包含了如何创建一个新的 Docker 容器,如何运行该容器,如何从现有的 Docker 容器中创建自己的 Docker 镜像等 Docker 的一些基础知识、操作。所有步骤均在 Ubuntu 18.04 LTS server 版本下测试通过。 + +### 入门指南 + +在开始指南之前,不要混淆 Docker 镜像和 Docker 容器这两个概念。在之前的教程中,我就解释过,Docker 镜像是决定 Docker 容器行为的一个文件,Docker 容器则是 Docker 镜像的运行态或停止态。(LCTT 译注:在 macOS 下使用 Docker 终端时,不需要加 `sudo`) + +#### 1、搜索 Docker 镜像 + +我们可以从 Docker 仓库中获取镜像,例如 [Docker hub][3],或者自己创建镜像。这里解释一下,Docker hub 是一个云服务器,用来提供给 Docker 的用户们创建、测试,和保存他们的镜像。 + +Docker hub 拥有成千上万个 Docker 镜像文件。你可以通过 `docker search`命令在这里搜索任何你想要的镜像。 + +例如,搜索一个基于 Ubuntu 的镜像文件,只需要运行: + +```shell +$ sudo docker search ubuntu +``` + +示例输出: + +![][5] + +搜索基于 CentOS 的镜像,运行: + +```shell +$ sudo docker search centos +``` + +搜索 AWS 的镜像,运行: + +```shell +$ sudo docker search aws +``` + +搜索 WordPress 的镜像: + +```shell +$ sudo docker search wordpress +``` + +Docker hub 拥有几乎所有种类的镜像,包含操作系统、程序和其他任意的类型,这些你都能在 Docker hub 上找到已经构建完的镜像。如果你在搜索时,无法找到你想要的镜像文件,你也可以自己构建一个,将其发布出去,或者仅供你自己使用。 + +#### 2、下载 Docker 镜像 + +下载 Ubuntu 的镜像,你需要在终端运行以下命令: + +```shell +$ sudo docker pull ubuntu +``` + +这条命令将会从 Docker hub 下载最近一个版本的 Ubuntu 镜像文件。 + +示例输出: + +``` +Using default tag: latest +latest: Pulling from library/ubuntu +6abc03819f3e: Pull complete +05731e63f211: Pull complete +0bd67c50d6be: Pull complete +Digest: sha256:f08638ec7ddc90065187e7eabdfac3c96e5ff0f6b2f1762cf31a4f49b53000a5 +Status: Downloaded newer image for ubuntu:latest +``` + +![下载 Docker 镜像][6] + +你也可以下载指定版本的 Ubuntu 镜像。运行以下命令: + +```shell +$ docker pull ubuntu:18.04 +``` + +Docker 允许在任意的宿主机操作系统下,下载任意的镜像文件,并运行。 + +例如,下载 CentOS 镜像: + +```shell +$ sudo docker pull centos +``` + +所有下载的镜像文件,都被保存在 `/var/lib/docker` 文件夹下。(LCTT 译注:不同操作系统存放的文件夹并不是一致的,具体存放位置请在官方查询) + +查看已经下载的镜像列表,可以使用以下命令: + +```shell +$ sudo docker images +``` + +示例输出: + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ubuntu latest 7698f282e524 14 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +正如你看到的那样,我已经下载了三个镜像文件:`ubuntu`、`centos` 和 `hello-world`。 + +现在,让我们继续,来看一下如何运行我们刚刚下载的镜像。 + +#### 3、运行 Docker 镜像 + +运行一个容器有两种方法。我们可以使用标签或者是镜像 ID。标签指的是特定的镜像快照。镜像 ID 是指镜像的唯一标识。 + +正如上面结果中显示,`latest` 是所有镜像的一个标签。`7698f282e524` 是 Ubuntu Docker 镜像的镜像 ID,`9f38484d220f`是 CentOS 镜像的镜像 ID,`fce289e99eb9` 是 hello_world 镜像的 镜像 ID。 + +下载完 Docker 镜像之后,你可以通过下面的命令来使用其标签来启动: + +```shell +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +在这条语句中: + +* `-t`:在该容器中启动一个新的终端 +* `-i`:通过容器中的标准输入流建立交互式连接 +* `ubuntu:latest`:带有标签 `latest` 的 Ubuntu 容器 +* `/bin/bash`:在新的容器中启动 BASH Shell + +或者,你可以通过镜像 ID 来启动新的容器: + +```shell +$ sudo docker run -t -i 7698f282e524 /bin/bash +``` + +在这条语句里: + +* `7698f282e524` — 镜像 ID + +在启动容器之后,将会自动进入容器的 shell 中(注意看命令行的提示符)。 + +![][7] + +*Docker 容器的 Shell* + +如果想要退回到宿主机的终端(在这个例子中,对我来说,就是退回到 18.04 LTS),并且不中断该容器的执行,你可以按下 `CTRL+P`,再按下 `CTRL+Q`。现在,你就安全的返回到了你的宿主机系统中。需要注意的是,Docker 容器仍然在后台运行,我们并没有中断它。 + +可以通过下面的命令来查看正在运行的容器: + +```shell +$ sudo docker ps +``` + +示例输出: + +```shell +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +32fc32ad0d54 ubuntu:latest "/bin/bash" 7 minutes ago Up 7 minutes modest_jones +``` + +![][8] + +*列出正在运行的容器* + +可以看到: + +* `32fc32ad0d54` – 容器 ID +* `ubuntu:latest` – Docker 镜像 + +需要注意的是,容器 ID 和 Docker 的镜像 ID是不同的。 + +可以通过以下命令查看所有正在运行和停止运行的容器: + +```shell +$ sudo docker ps -a +``` + +在宿主机中断容器的执行: + +```shell +$ sudo docker stop +``` + +例如: + +```shell +$ sudo docker stop 32fc32ad0d54 +``` + +如果想要进入正在运行的容器中,你只需要运行: + +```shell +$ sudo docker attach 32fc32ad0d54 +``` + +正如你看到的,`32fc32ad0d54` 是一个容器的 ID。当你在容器中想要退出时,只需要在容器内的终端中输入命令: + +```shell +# exit +``` + +你可以使用这个命令查看后台正在运行的容器: + +```shell +$ sudo docker ps +``` + +#### 4、构建自己的 Docker 镜像 + +Docker 不仅仅可以下载运行在线的容器,你也可以创建你的自己的容器。 + +想要创建自己的 Docker 镜像,你需要先运行一个你已经下载完的容器: + +```shell +$ sudo docker run -t -i ubuntu:latest /bin/bash +``` + +现在,你运行了一个容器,并且进入了该容器。然后,在该容器安装任意一个软件或做任何你想做的事情。 + +例如,我们在容器中安装一个 Apache web 服务器。 + +当你完成所有的操作,安装完所有的软件之后,你可以执行以下的命令来构建你自己的 Docker 镜像: + +```shell +# apt update +# apt install apache2 +``` + +同样的,在容器中安装和测试你想要安装的所有软件。 + +当你安装完毕之后,返回的宿主机的终端。记住,不要关闭容器。想要返回到宿主机而不中断容器。请按下`CTRL+P`,再按下 `CTRL+Q`。 + +从你的宿主机的终端中,运行以下命令如寻找容器的 ID: + +```shell +$ sudo docker ps +``` + +最后,从一个正在运行的容器中创建 Docker 镜像: + +```shell +$ sudo docker commit 3d24b3de0bfc ostechnix/ubuntu_apache +``` + +示例输出: + +```shell +sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +``` + +在这里: + +* `3d24b3de0bfc` — 指 Ubuntu 容器的 ID。 +* `ostechnix` — 我们创建的容器的用户名称 +* `ubuntu_apache` — 我们创建的镜像 + +让我们检查一下我们新创建的 Docker 镜像: + +```shell +$ sudo docker images +``` + +示例输出: + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 About a minute ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +![][9] + +*列出所有的 Docker 镜像* + +正如你看到的,这个新的镜像就是我们刚刚在本地系统上从运行的容器上创建的。 + +现在,你可以从这个镜像创建一个新的容器。 + +```shell +$ sudo docker run -t -i ostechnix/ubuntu_apache /bin/bash +``` + +#### 5、删除容器 + +如果你在 Docker 上的工作已经全部完成,你就可以删除那些你不需要的容器。 + +想要删除一个容器,首先,你需要停止该容器。 + +我们先来看一下正在运行的容器有哪些 + +```shell +$ sudo docker ps +``` + +示例输出: + +```shell +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +3d24b3de0bfc ubuntu:latest "/bin/bash" 28 minutes ago Up 28 minutes goofy_easley +``` + +使用容器 ID 来停止该容器: + +```shell +$ sudo docker stop 3d24b3de0bfc +``` + +现在,就可以删除该容器了。 + +```shell +$ sudo docker rm 3d24b3de0bfc +``` + +你就可以按照这样的方法来删除那些你不需要的容器了。 + +当需要删除的容器数量很多时,一个一个删除也是很麻烦的,我们可以直接删除所有的已经停止的容器。只需要运行: + +```shell +$ sudo docker container prune +``` + +按下 `Y`,来确认你的操作: + +```sehll +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +32fc32ad0d5445f2dfd0d46121251c7b5a2aea06bb22588fb2594ddbe46e6564 +5ec614e0302061469ece212f0dba303c8fe99889389749e6220fe891997f38d0 + +Total reclaimed space: 5B +``` + +这个命令仅支持最新的 Docker。(LCTT 译注:仅支持 1.25 及以上版本的 Docker) + +#### 6、删除 Docker 镜像 + +当你删除了不要的 Docker 容器后,你也可以删除你不需要的 Docker 镜像。 + +列出已经下载的镜像: + +```shell +$ sudo docker images +``` + +示例输出: + +```shell +REPOSITORY TAG IMAGE ID CREATED SIZE +ostechnix/ubuntu_apache latest ce5aa74a48f1 5 minutes ago 191MB +ubuntu latest 7698f282e524 15 hours ago 69.9MB +centos latest 9f38484d220f 2 months ago 202MB +hello-world latest fce289e99eb9 4 months ago 1.84kB +``` + +由上面的命令可以知道,在本地的系统中存在三个镜像。 + +使用镜像 ID 来删除镜像。 + +```shell +$ sudo docekr rmi ce5aa74a48f1 +``` + +示例输出: + +```shell +Untagged: ostechnix/ubuntu_apache:latest +Deleted: sha256:ce5aa74a48f1e01ea312165887d30691a59caa0d99a2a4aa5116ae124f02f962 +Deleted: sha256:d21c926f11a64b811dc75391bbe0191b50b8fe142419f7616b3cee70229f14cd +``` + +#### 解决问题 + +Docker 禁止我们删除一个还在被容器使用的镜像。 + +例如,当我试图删除 Docker 镜像 `b72889fa879c` 时,我只能获得一个错误提示: + +```shell +Error response from daemon: conflict: unable to delete b72889fa879c (must be forced) - image is being used by stopped container dde4dd285377 +``` + +这是因为这个 Docker 镜像正在被一个容器使用。 + +所以,我们来检查一个正在运行的容器: + +```shell +$ sudo docker ps +``` + +示例输出: + +![][10] + +注意,现在并没有正在运行的容器!!! + +查看一下所有的容器(包含所有的正在运行和已经停止的容器): + +```shell +$ sudo docker pa -a +``` + +示例输出: + +![][11] + +可以看到,仍然有一些已经停止的容器在使用这些镜像。 + +让我们把这些容器删除: + +```shell +$ sudo docker rm 12e892156219 +``` + +我们仍然使用容器 ID 来删除这些容器。 + +当我们删除了所有使用该镜像的容器之后,我们就可以删除 Docker 的镜像了。 + +例如: + +```shell +$ sudo docekr rmi b72889fa879c +``` + +我们再来检查一下本机存在的镜像: + +```shell +$ sudo docker images +``` + +想要知道更多的细节,请参阅本指南末尾给出的官方资源的链接或者在评论区进行留言。 + +这就是全部的教程了,希望你可以了解 Docker 的一些基础用法。 + +更多的教程马上就会到来,敬请关注。 + +--- + +via: https://www.ostechnix.com/getting-started-with-docker/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[zhang5788](https://github.com/zhang5788) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2016/04/docker-basics-720x340.png +[2]: http://www.ostechnix.com/install-docker-ubuntu/ +[3]: https://www.ostechnix.com/install-docker-centos/ +[4]: https://hub.docker.com/ +[5]: http://www.ostechnix.com/wp-content/uploads/2016/04/Search-Docker-images.png +[6]: http://www.ostechnix.com/wp-content/uploads/2016/04/Download-docker-images.png +[7]: http://www.ostechnix.com/wp-content/uploads/2016/04/Docker-containers-shell.png +[8]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-running-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2016/04/List-docker-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_005-1-1.jpg +[11]: http://www.ostechnix.com/wp-content/uploads/2016/04/sk@sk-_006-1.jpg +[12]: https://ostechnix.tradepub.com/free/w_java39/prgm.cgi?a=1 +[13]: https://ostechnix.tradepub.com/free/w_pacb32/prgm.cgi?a=1 +[14]: https://ostechnix.tradepub.com/free/w_pacb31/prgm.cgi?a=1 +[15]: https://ostechnix.tradepub.com/free/w_pacb29/prgm.cgi?a=1 +[16]: https://ostechnix.tradepub.com/free/w_pacb28/prgm.cgi?a=1 diff --git a/published/201906/20190520 When IoT systems fail- The risk of having bad IoT data.md b/published/201906/20190520 When IoT systems fail- The risk of having bad IoT data.md new file mode 100644 index 0000000000..6d8ee2c96a --- /dev/null +++ b/published/201906/20190520 When IoT systems fail- The risk of having bad IoT data.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10961-1.html) +[#]: subject: (When IoT systems fail: The risk of having bad IoT data) +[#]: via: (https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +当物联网系统出现故障:使用低质量物联网数据的风险 +====== + +> 伴随着物联网设备使用量的增长,这些设备产生的数据可以让消费者节约巨大的开支,也给商家带来新的机遇。但是当故障不可避免地出现的时候,会发生什么呢? + +![Oonal / Getty Images][1] + +不管你看的是什么统计数字,很明显物联网正在走进个人和私人生活的方方面面。这种增长虽然有不少好处,但是也带来了新的风险。一个很重要的问题是,出现问题的时候谁来负责呢? + +也许最大的问题出在基于物联网数据进行的个性化营销以及定价策略上。[保险公司长期以来致力于寻找利用物联网数据的最佳方式][2],我去年写过家庭财产保险公司是如何开始利用物联网传感器减少水灾带来的损失的。一些公司正在研究保险公司竞购消费者的可能性:这种业务基于智能家居数据所揭示的风险的高低。 + +但是最大的进步出现在汽车保险领域。许多汽车保险公司已经可以让客户在车辆上安装追踪设备,如果数据证明他们的驾驶习惯良好就可以获取保险折扣。 + +- 延伸阅读:[保险公司终于有了一个利用智能家居物联网的好办法][3] + +### UBI 车险的崛起 + +UBI(基于使用的保险usage-based insurance)车险是一种“按需付费”的业务,可以通过追踪速度、位置,以及其他因素来评估风险并计算车险保费。到 2020 年,预计有 [5000 万美国司机][4]会加入到 UBI 车险的项目中。 + +不出所料,保险公司对 UBI 车险青睐有加,因为 UBI 车险可以帮助他们更加精确地计算风险。事实上,[AIG 爱尔兰已经在尝试让国家向 25 岁以下的司机强制推行 UBI 车险][5]。并且,被认定为驾驶习惯良好的司机自然也很乐意节省一笔费用。当然也有反对的声音了,大多数是来自于隐私权倡导者,以及会因此支付更多费用的群体。 + +### 出了故障会发生什么? + +但是还有一个更加令人担忧的潜在问题:当物联网设备提供的数据有错误,或者在传输过程中出了问题会发生什么?因为尽管有自动化程序、错误检查等等,还是不可避免地会偶尔发生一些故障。 + +不幸的是,这并不是一个理论上某天会给细心的司机不小心多扣几块钱保费的问题。这已经是一个会带来严重后果的现实问题。就像[保险行业仍然没有想清楚谁应该“拥有”面向客户的物联网设备产生的数据][6]一样,我们也不清楚谁将对这些数据所带来的问题负责。 + +计算机“故障”据说曾导致赫兹的出租车辆被误报为被盗(虽然在这个例子中这并不是一个严格意义上的物联网问题),并且导致无辜的租车人被逮捕并扣留。结果呢?刑事指控,多年的诉讼官司,以及舆论的指责。非常强烈的舆论指责。 + +我们非常容易想象一些类似的情况,比如说一个物联网传感器出了故障,然后报告说某辆车超速了,然而事实上并没有超速。想想为这件事打官司的麻烦吧,或者想想和你的保险公司如何争执不下。 + +(当然,这个问题还有另外一面:消费者可能会想办法篡改他们的物联网设备上的数据,以获得更低的费率或者转移事故责任。我们同样也没有可行的办法来应对*这个问题*。) + +### 政府监管是否有必要 + +考虑到这些问题的潜在影响,以及所涉及公司对处理这些问题的无动于衷,我们似乎有理由猜想政府干预的必要性。 + +这可能是美国众议员 Bob Latta(俄亥俄州,共和党)[重新引入 SMART IOT(物联网现代应用、研究及趋势的现状)法案][7]背后的一个动机。这项由 Latta 和美国众议员 Peter Welch(佛蒙特州,民主党)领导的两党合作物联网工作组提出的[法案][8],于去年秋天通过美国众议院,但被美国参议院驳回了。美国商务部需要研究物联网行业的状况,并在两年后向美国众议院能源与商业部和美国参议院商务委员会报告。 + +Latta 在一份声明中表示,“由于预计会有数万亿美元的经济影响,我们需要考虑物联网所带来的的政策,机遇和挑战。SMART IoT 法案会让人们更容易理解美国政府在物联网政策上的做法、可以改进的地方,以及美国联邦政策如何影响尖端技术的研究和发明。” + +这项研究受到了欢迎,但该法案甚至可能不会被通过。即便通过了,物联网在两年的等待时间里也可能会翻天覆地,让美国政府还是无法跟上。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396230/when-iot-systems-fail-the-risk-of-having-bad-iot-data.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/cloud_connected_smart_cars_by_oonal_gettyimages-692819426_1200x800-100767788-large.jpg +[2]: https://www.networkworld.com/article/3264655/most-insurance-carriers-not-ready-to-use-iot-data.html +[3]: https://www.networkworld.com/article/3296706/finally-a-smart-way-for-insurers-to-leverage-iot-in-smart-homes.html +[4]: https://www.businessinsider.com/iot-is-changing-the-auto-insurance-industry-2015-8 +[5]: https://www.iotforall.com/iot-data-is-disrupting-the-insurance-industry/ +[6]: https://www.sas.com/en_us/insights/articles/big-data/5-challenges-for-iot-in-insurance-industry.html +[7]: https://www.multichannel.com/news/latta-re-ups-smart-iot-act +[8]: https://latta.house.gov/uploadedfiles/smart_iot_116th.pdf +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190520 Zettlr - Markdown Editor for Writers and Researchers.md b/published/201906/20190520 Zettlr - Markdown Editor for Writers and Researchers.md new file mode 100644 index 0000000000..487c0f0fe3 --- /dev/null +++ b/published/201906/20190520 Zettlr - Markdown Editor for Writers and Researchers.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10922-1.html) +[#]: subject: (Zettlr – Markdown Editor for Writers and Researchers) +[#]: via: (https://itsfoss.com/zettlr-markdown-editor/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Zettlr:适合写作者和研究人员的 Markdown 编辑器 +====== + +有很多[适用于 Linux 的 Markdown 编辑器][1],并且还在继续增加。问题是,像 [Boostnote][2] 一样,大多数是为编码人员设计的,可能不会受到非技术人员的欢迎。让我们看一个想要替代 Word 和昂贵的文字处理器,适用于非技术人员的 Markdown 编辑器。我们来看看 Zettlr 吧。 + +### Zettlr Markdown 编辑器 + +![Zettlr Light Mode][3] + +我可能在网站上提到过一两次,我更喜欢用 [Markdown][4] 写下我的所有文档。它易于学习,不会让你受困于专有文档格式。我还在我的[适合作者的开源工具列表][5]中提到了 Markdown 编辑器。 + +我用过许多 Markdown 编辑器,但是我一直有兴趣尝试新的。最近,我遇到了 Zettlr,一个开源 Markdown 编辑器。 + +[Zettlr][6] 是一位名叫 [Hendrik Erz][7] 的德国社会学家/政治理论家创建的。Hendrik 创建了 Zettlr,因为他对目前的文字处理器感到不满意。他想要可以让他“专注于写作和阅读”的编辑器。 + +在发现 Markdown 之后,他在不同的操作系统上尝试了几个 Markdown 编辑器。但它们都没有他想要的东西。[根据 Hendrik 的说法][8],“但我不得不意识到没有为高效组织大量文本而写的编辑器。大多数编辑都是由编码人员编写的,因此可以满足工程师和数学家的需求。没有为我这样的社会科学、历史或政治学的学生的编辑器。“ + +所以他决定创造自己的。2017 年 11 月,他开始编写 Zettlr。 + +![Zettlr About][9] + +#### Zettlr 功能 + +Zettlr 有许多简洁的功能,包括: + + * 从 [Zotero 数据库][10]导入源并在文档中引用它们 +  * 使用可选的行屏蔽,让你无打扰地专注于写作 +  * 支持代码高亮 +  * 使用标签对信息进行排序 +  * 能够为该任务设定写作目标 +  * 查看一段时间的写作统计 +  * 番茄钟计时器 +  * 浅色/深色主题 +  * 使用 [reveal.js][11] 创建演示文稿 +  * 快速预览文档 +  * 可以在一个项目文件夹中搜索 Markdown 文档,并用热图展示文字搜索密度。 +  * 将文件导出为 HTML、PDF、ODT、DOC、reStructuredText、LaTex、TXT、Emacs ORG、[TextBundle][12] 和 Textpack +  * 将自定义 CSS 添加到你的文档 + +当我写这篇文章时,一个对话框弹出来告诉我最近发布了 [1.3.0 beta][14]。此测试版将包括几个新的主题,以及一大堆修复,新功能和改进。 + +![Zettlr Night Mode][15] + +#### 安装 Zettlr + +目前,唯一可安装 Zettlr 的 Linux 存储库是 [AUR][16]。如果你的 Linux 发行版不是基于 Arch 的,你可以从网站上下载 macOS、Windows、Debian 和 Fedora 的[安装程序][17]。 + +#### 对 Zettlr 的最后一点想法 + +注意:为了测试 Zettlr,我用它来写这篇文章。 + +Zettlr 有许多我希望我之前选择的编辑器 (ghostwriter) 有的简洁的功能,例如为文档设置字数目标。我也喜欢在不打开文档的情况下预览文档的功能。 + +![Zettlr Settings][18] + +我也遇到了几个问题,但这些更多的是因为 Zettlr 与 ghostwriter 的工作方式略有不同。例如,当我尝试从网站复制引用或名称时,它会将内嵌样式粘贴到 Zettlr 中。幸运的是,它有一个“不带样式粘贴”的选项。有几次我在打字时有轻微的延迟。但那可能是因为它是一个 Electron 程序。 + +总的来说,我认为 Zettlr 是第一次使用 Markdown 用户的好选择。它有许多 Markdown 编辑器已有的功能,并为那些只使用过文字处理器的用户增加了一些功能。 + +正如 Hendrik 在 [Zettlr 网站][8]中所说的那样,“让自己摆脱文字处理器的束缚,看看你的写作过程如何通过身边的技术得到改善!” + +如果你觉得 Zettlr 有用,请考虑支持 [Hendrik][19]。正如他在网站上所说,“它是免费的,因为我不相信激烈竞争、早逝的创业文化。我只是想帮忙。” + +你有没有用过 Zettlr?你最喜欢的 Markdown 编辑器是什么?请在下面的评论中告诉我们。 + +如果你觉得这篇文章有趣,请在社交媒体,Hacker News 或 [Reddit][21] 上分享它。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zettlr-markdown-editor/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-markdown-editors-linux/ +[2]: https://itsfoss.com/boostnote-linux-review/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-light-mode.png?fit=800%2C462&ssl=1 +[4]: https://daringfireball.net/projects/markdown/ +[5]: https://itsfoss.com/open-source-tools-writers/ +[6]: https://www.zettlr.com/ +[7]: https://github.com/nathanlesage +[8]: https://www.zettlr.com/about +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-about.png?fit=800%2C528&ssl=1 +[10]: https://www.zotero.org/ +[11]: https://revealjs.com/#/ +[12]: http://textbundle.org/ +[13]: https://itsfoss.com/great-little-book-shelf-review/ +[14]: https://github.com/Zettlr/Zettlr/releases/tag/v1.3.0-beta +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Zettlr-night-mode.png?fit=800%2C469&ssl=1 +[16]: https://aur.archlinux.org/packages/zettlr-bin/ +[17]: https://www.zettlr.com/download +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/zettlr-settings.png?fit=800%2C353&ssl=1 +[19]: https://www.zettlr.com/supporters +[21]: http://reddit.com/r/linuxusersgroup diff --git a/published/201906/20190522 French IT giant Atos enters the edge-computing business.md b/published/201906/20190522 French IT giant Atos enters the edge-computing business.md new file mode 100644 index 0000000000..1be6353555 --- /dev/null +++ b/published/201906/20190522 French IT giant Atos enters the edge-computing business.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10934-1.html) +[#]: subject: (French IT giant Atos enters the edge-computing business) +[#]: via: (https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +法国 IT 巨头 Atos 进军边缘计算 +====== + +> Atos 另辟蹊径,通过一种只有行李箱大小的设备 BullSequana Edge 进军边缘计算。 + +![iStock][1] + +法国 IT 巨头 Atos 是最近才开展边缘计算业务的,他们的产品是一个叫做 BullSequana Edge 的小型设备。和竞争对手们的集装箱大小的设备不同(比如说 Vapor IO 和 Schneider Electronics 的产品),Atos 的边缘设备完全可以被放进衣柜里。 + +Atos 表示,他们的这个设备使用人工智能应用提供快速响应,适合需要快速响应的领域比如生产 4.0、自动驾驶汽车、健康管理,以及零售业和机场的安保系统。在这些领域,数据需要在边缘进行实时处理和分析。 + +[延伸阅读:[什么是边缘计算?][2] 以及 [边缘网络和物联网如何重新定义数据中心][3]] + +BullSequana Edge 可以作为独立的基础设施单独采购,也可以和 Atos 的边缘软件捆绑采购,并且这个软件还是非常出色的。Atos 表示 BullSequana Edge 主要支持三种使用场景: + + * AI(人工智能):Atos 的边缘计算机视觉软件为监控摄像头提供先进的特征抽取和分析技术,包括人像、人脸、行为等特征。这些分析可以支持系统做出自动化响应。 + * 大数据:Atos 边缘数据分析系统通过预测性和规范性的解决方案,帮助机构优化商业模型。它使用数据湖的功能,确保数据的可信度和可用性。 + * 容器:Atos 边缘数据容器(EDC)是一种一体化容器解决方案。它可以作为一个去中心化的 IT 系统在边缘运行,并且可以在没有数据中心的环境下自动运行,而不需要现场操作。 + +由于体积小,BullSequana Edge 并不具备很强的处理能力。它装载一个 16 核的 Intel Xeon 中央处理器,可以装备最多两枚英伟达 Tesla T4 图形处理器或者是 FPGA(现场可编程门阵列)。Atos 表示,这就足够让复杂的 AI 模型在边缘进行低延迟的运行了。 + +考虑到数据的敏感性,BullSequana Edge 同时装备了一个入侵感应器,用来在遭遇物理入侵的时候禁用机器。 + +虽然大多数边缘设备都被安放在信号塔附近,但是考虑到边缘系统可能被安放在任何地方,BullSequana Edge 还支持通过无线电、全球移动通信系统(GSM),或者 Wi-Fi 来进行通信。 + +Atos 在美国也许不是一个家喻户晓的名字,但是在欧洲它可以和 IBM 相提并论,并且在过去的十年里已经收购了诸如 Bull SA、施乐 IT 外包以及西门子 IT 等 IT 巨头们。 + +关于边缘网络的延伸阅读: + + * [边缘网络和物联网如何重新定义数据中心][3] + * [边缘计算的最佳实践][4] + * [边缘计算如何提升物联网安全][5] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397139/atos-is-the-latest-to-enter-the-edge-computing-business.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.idgesg.net/images/article/2019/01/huawei-18501-edge-gartner-100786331-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190522 Securing telnet connections with stunnel.md b/published/201906/20190522 Securing telnet connections with stunnel.md new file mode 100644 index 0000000000..644d288c41 --- /dev/null +++ b/published/201906/20190522 Securing telnet connections with stunnel.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10945-1.html) +[#]: subject: (Securing telnet connections with stunnel) +[#]: via: (https://fedoramagazine.org/securing-telnet-connections-with-stunnel/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +使用 stunnel 保护 telnet 连接 +====== + +![][1] + +Telnet 是一种客户端-服务端协议,通过 TCP 的 23 端口连接到远程服务器。Telnet 并不加密数据,因此它被认为是不安全的,因为数据是以明文形式发送的,所以密码很容易被嗅探。但是,仍有老旧系统需要使用它。这就是用到 **stunnel** 的地方。 + +stunnel 旨在为使用不安全连接协议的程序增加 SSL 加密。本文将以 telnet 为例介绍如何使用它。 + +### 服务端安装 + +[使用 sudo][2] 安装 stunnel 以及 telnet 的服务端和客户端: + +``` +sudo dnf -y install stunnel telnet-server telnet +``` + +添加防火墙规则,在提示时输入你的密码: + +``` +firewall-cmd --add-service=telnet --perm +firewall-cmd --reload +``` + +接下来,生成 RSA 私钥和 SSL 证书: + +``` +openssl genrsa 2048 > stunnel.key +openssl req -new -key stunnel.key -x509 -days 90 -out stunnel.crt +``` + +系统将一次提示你输入以下信息。当询问 `Common Name` 时,你必须输入正确的主机名或 IP 地址,但是你可以按回车键跳过其他所有内容。 + +``` +You are about to be asked to enter information that will be +incorporated into your certificate request. +What you are about to enter is what is called a Distinguished Name or a DN. +There are quite a few fields but you can leave some blank +For some fields there will be a default value, +If you enter '.', the field will be left blank. +----- +Country Name (2 letter code) [XX]: +State or Province Name (full name) []: +Locality Name (eg, city) [Default City]: +Organization Name (eg, company) [Default Company Ltd]: +Organizational Unit Name (eg, section) []: +Common Name (eg, your name or your server's hostname) []: +Email Address [] +``` + +将 RSA 密钥和 SSL 证书合并到单个 `.pem` 文件中,并将其复制到 SSL 证书目录: + +``` +cat stunnel.crt stunnel.key > stunnel.pem +sudo cp stunnel.pem /etc/pki/tls/certs/ +``` + +现在可以定义服务和用于加密连接的端口了。选择尚未使用的端口。此例使用 450 端口进行隧道传输 telnet。编辑或创建 `/etc/stunnel/telnet.conf`: + +``` +cert = /etc/pki/tls/certs/stunnel.pem +sslVersion = TLSv1 +chroot = /var/run/stunnel +setuid = nobody +setgid = nobody +pid = /stunnel.pid +socket = l:TCP_NODELAY=1 +socket = r:TCP_NODELAY=1 +[telnet] +accept = 450 +connect = 23 +``` + +`accept` 选项是服务器将监听传入 telnet 请求的接口。`connect` 选项是 telnet 服务器的内部监听接口。 + +接下来,创建一个 systemd 单元文件的副本来覆盖原来的版本: + +``` +sudo cp /usr/lib/systemd/system/stunnel.service /etc/systemd/system +``` + +编辑 `/etc/systemd/system/stunnel.service` 来添加两行。这些行在启动时为服务创建 chroot 监狱。 + +``` +[Unit] +Description=TLS tunnel for network daemons +After=syslog.target network.target + +[Service] +ExecStart=/usr/bin/stunnel +Type=forking +PrivateTmp=true +ExecStartPre=-/usr/bin/mkdir /var/run/stunnel +ExecStartPre=/usr/bin/chown -R nobody:nobody /var/run/stunnel + +[Install] +WantedBy=multi-user.target +``` + +接下来,配置 SELinux 以在你刚刚指定的新端口上监听 telnet: + +``` +sudo semanage port -a -t telnetd_port_t -p tcp 450 +``` + +最后,添加新的防火墙规则: + +``` +firewall-cmd --add-port=450/tcp --perm +firewall-cmd --reload +``` + +现在你可以启用并启动 telnet 和 stunnel。 + +``` +systemctl enable telnet.socket stunnel@telnet.service --now +``` + +要注意 `systemctl` 命令是有顺序的。systemd 和 stunnel 包默认提供额外的[模板单元文件][3]。该模板允许你将 stunnel 的多个配置文件放到 `/etc/stunnel` 中,并使用文件名启动该服务。例如,如果你有一个 `foobar.conf` 文件,那么可以使用 `systemctl start stunnel@foobar.service` 启动该 stunnel 实例,而无需自己编写任何单元文件。 + +如果需要,可以将此 stunnel 模板服务设置为在启动时启动: + +``` +systemctl enable stunnel@telnet.service +``` + +### 客户端安装 + +本文的这部分假设你在客户端系统上以普通用户([拥有 sudo 权限][2])身份登录。安装 stunnel 和 telnet 客户端: + +``` +dnf -y install stunnel telnet +``` + +将 `stunnel.pem` 从远程服务器复制到客户端的 `/etc/pki/tls/certs` 目录。在此例中,远程 telnet 服务器的 IP 地址为 `192.168.1.143`。 + +``` +sudo scp myuser@192.168.1.143:/etc/pki/tls/certs/stunnel.pem +/etc/pki/tls/certs/ +``` + +创建 `/etc/stunnel/telnet.conf`: + +``` +cert = /etc/pki/tls/certs/stunnel.pem +client=yes +[telnet] +accept=450 +connect=192.168.1.143:450 +``` + +`accept` 选项是用于 telnet 会话的端口。`connect` 选项是你远程服务器的 IP 地址以及监听的端口。 + +接下来,启用并启动 stunnel: + +``` +systemctl enable stunnel@telnet.service --now +``` + +测试你的连接。由于有一条已建立的连接,你会 `telnet` 到 `localhost` 而不是远程 telnet 服务器的主机名或者 IP 地址。 + +``` +[user@client ~]$ telnet localhost 450 +Trying ::1... +telnet: connect to address ::1: Connection refused +Trying 127.0.0.1... +Connected to localhost. +Escape character is '^]'. + +Kernel 5.0.9-301.fc30.x86_64 on an x86_64 (0) +server login: myuser +Password: XXXXXXX +Last login: Sun May 5 14:28:22 from localhost +[myuser@server ~]$ +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/securing-telnet-connections-with-stunnel/ + +作者:[Curt Warfield][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://fedoramagazine.org/author/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/stunnel-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://fedoramagazine.org/systemd-template-unit-files/ diff --git a/published/201906/20190525 4 Ways to Run Linux Commands in Windows.md b/published/201906/20190525 4 Ways to Run Linux Commands in Windows.md new file mode 100644 index 0000000000..88944d79af --- /dev/null +++ b/published/201906/20190525 4 Ways to Run Linux Commands in Windows.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10935-1.html) +[#]: subject: (4 Ways to Run Linux Commands in Windows) +[#]: via: (https://itsfoss.com/run-linux-commands-in-windows/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 Windows 中运行 Linux 命令的 4 种方法 +====== + +> 想要使用 Linux 命令,但又不想离开 Windows ?以下是在 Windows 中运行 Linux bash 命令的几种方法。 + +如果你正在课程中正在学习 shell 脚本,那么需要使用 Linux 命令来练习命令和脚本。 + +你的学校实验室可能安装了 Linux,但是你自己没有安装了 [Linux 的笔记本电脑][1],而是像其他人一样的 Windows 计算机。你的作业需要运行 Linux 命令,你或许想知道如何在 Windows 上运行 Bash 命令和脚本。 + +你可以[在双启动模式下同时安装 Windows 和 Linux][2]。此方法能让你在启动计算机时选择 Linux 或 Windows。但是,为了运行 Linux 命令而使用单独分区的麻烦可能不适合所有人。 + +你也可以[使用在线 Linux 终端][3],但你的作业无法保存。 + +好消息是,有几种方法可以在 Windows 中运行 Linux 命令,就像其他常规应用一样。不是很酷吗? + +### 在 Windows 中使用 Linux 命令 + +![](https://img.linux.net.cn/data/attachment/album/201906/04/093809hlz2tblfzt7mbwwl.jpg) + +作为一个热心的 Linux 用户和推广者,我希望看到越来越多的人使用“真正的” Linux,但我知道有时候,这不是优先考虑的问题。如果你只是想练习 Linux 来通过考试,可以使用这些方法之一在 Windows 上运行 Bash 命令。 + +#### 1、在 Windows 10 上使用 Linux Bash Shell + +你是否知道可以在 Windows 10 中运行 Linux 发行版? [Windows 的 Linux 子系统 (WSL)][5] 能让你在 Windows 中运行 Linux。即将推出的 WSL 版本将在 Windows 内部使用真正 Linux 内核。 + +此 WSL 也称为 Bash on Windows,它作为一个常规的 Windows 应用运行,并提供了一个命令行模式的 Linux 发行版。不要害怕命令行模式,因为你的目的是运行 Linux 命令。这就是你所需要的。 + +![Ubuntu Linux inside Windows][6] + +你可以在 Windows 应用商店中找到一些流行的 Linux 发行版,如 Ubuntu、Kali Linux、openSUSE 等。你只需像任何其他 Windows 应用一样下载和安装它。安装后,你可以运行所需的所有 Linux 命令。 + +![Linux distributions in Windows 10 Store][8] + +请参考教程:[在 Windows 上安装 Linux bash shell][9]。 + +#### 2、使用 Git Bash 在 Windows 上运行 Bash 命令 + +你可能知道 [Git][10] 是什么。它是由 [Linux 创建者 Linus Torvalds][11] 开发的版本控制系统。 + +[Git for Windows][12] 是一组工具,能让你在命令行和图形界面中使用 Git。Git for Windows 中包含的工具之一是 Git Bash。 + +Git Bash 为 Git 命令行提供了仿真层。除了 Git 命令,Git Bash 还支持许多 Bash 程序,如 `ssh`、`scp`、`cat`、`find` 等。 + +![Git Bash][13] + +换句话说,你可以使用 Git Bash 运行许多常见的 Linux/Bash 命令。 + +你可以从其网站免费下载和安装 Git for Windows 工具来在 Windows 中安装 Git Bash。 + +- [下载 Git for Windows][12] + +#### 3、使用 Cygwin 在 Windows 中使用 Linux 命令 + +如果要在 Windows 中运行 Linux 命令,那么 Cygwin 是一个推荐的工具。Cygwin 创建于 1995 年,旨在提供一个原生运行于 Windows 中的 POSIX 兼容环境。Cygwin 是由 Red Hat 员工和许多其他志愿者维护的自由开源软件。 + +二十年来,Windows 用户使用 Cygwin 来运行和练习 Linux/Bash 命令。十多年前,我甚至用 Cygwin 来学习 Linux 命令。 + +![Cygwin][14] + +你可以从下面的官方网站下载 Cygwin。我还建议你参考这个 [Cygwin 备忘录][15]来开始使用。 + +- [下载 Cygwin][16] + +#### 4、在虚拟机中使用 Linux + +另一种方法是使用虚拟化软件并在其中安装 Linux。这样,你可以在 Windows 中安装 Linux 发行版(带有图形界面)并像常规 Windows 应用一样运行它。 + +这种方法要求你的系统有大的内存,至少 4GB ,但如果你有超过 8GB 的内存那么更好。这里的好处是你可以真实地使用桌面 Linux。如果你喜欢这个界面,那么你可能会在以后决定[切换到 Linux][17]。 + +![Ubuntu Running in Virtual Machine Inside Windows][18] + +有两种流行的工具可在 Windows 上创建虚拟机,它们是 Oracle VirtualBox 和 VMware Workstation Player。你可以使用两者中的任何一个。就个人而言,我更喜欢 VirtualBox。 + +你可以按照[本教程学习如何在 VirtualBox 中安装 Linux][20]。 + +### 总结 + +运行 Linux 命令的最佳方法是使用 Linux。当选择不安装 Linux 时,这些工具能让你在 Windows 上运行 Linux 命令。都试试看,看哪种适合你。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-linux-commands-in-windows/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/get-linux-laptops/ +[2]: https://itsfoss.com/guide-install-linux-mint-16-dual-boot-windows/ +[3]: https://itsfoss.com/online-linux-terminals/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/run-linux-commands-in-windows.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/bash-on-windows/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-10.jpeg?resize=800%2C268&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/08/install-ubuntu-windows-10-linux-subsystem-4.jpeg?resize=800%2C632&ssl=1 +[9]: https://itsfoss.com/install-bash-on-windows/ +[10]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[11]: https://itsfoss.com/linus-torvalds-facts/ +[12]: https://gitforwindows.org/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/git-bash.png?ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/cygwin-shell.jpg?ssl=1 +[15]: http://www.voxforge.org/home/docs/cygwin-cheat-sheet +[16]: https://www.cygwin.com/ +[17]: https://itsfoss.com/reasons-switch-linux-windows-xp/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ubuntu-running-in-virtual-machine-inside-windows.jpeg?resize=800%2C450&ssl=1 +[20]: https://itsfoss.com/install-linux-in-virtualbox/ diff --git a/published/201906/20190527 20- FFmpeg Commands For Beginners.md b/published/201906/20190527 20- FFmpeg Commands For Beginners.md new file mode 100644 index 0000000000..2a646c6d89 --- /dev/null +++ b/published/201906/20190527 20- FFmpeg Commands For Beginners.md @@ -0,0 +1,471 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10932-1.html) +[#]: subject: (20+ FFmpeg Commands For Beginners) +[#]: via: (https://www.ostechnix.com/20-ffmpeg-commands-beginners/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +给初学者的 20 多个 FFmpeg 命令示例 +====== + +![FFmpeg Commands](https://img.linux.net.cn/data/attachment/album/201906/03/011553xu323dzu40pb03bx.jpg) + +在这个指南中,我将用示例来阐明如何使用 FFmpeg 媒体框架来做各种各样的音频、视频转码和转换的操作。我已经为初学者汇集了最常用的 20 多个 FFmpeg 命令,我将不时地添加更多的示例来保持更新这个指南。请给这个指南加书签,以后回来检查更新。让我们开始吧,如果你还没有在你的 Linux 系统中安装 FFmpeg,参考下面的指南。 + +* [在 Linux 中安装 FFmpeg][2] + +### 针对初学者的 20 多个 FFmpeg 命令 + +FFmpeg 命令的典型语法是: + +``` +ffmpeg [全局选项] {[输入文件选项] -i 输入_url_地址} ... + {[输出文件选项] 输出_url_地址} ... +``` + +现在我们将查看一些重要的和有用的 FFmpeg 命令。 + +#### 1、获取音频/视频文件信息 + +为显示你的媒体文件细节,运行: + +``` +$ ffmpeg -i video.mp4 +``` + +样本输出: + +``` +ffmpeg version n4.1.3 Copyright (c) 2000-2019 the FFmpeg developers +built with gcc 8.2.1 (GCC) 20181127 +configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 +libavutil 56. 22.100 / 56. 22.100 +libavcodec 58. 35.100 / 58. 35.100 +libavformat 58. 20.100 / 58. 20.100 +libavdevice 58. 5.100 / 58. 5.100 +libavfilter 7. 40.101 / 7. 40.101 +libswscale 5. 3.100 / 5. 3.100 +libswresample 3. 3.100 / 3. 3.100 +libpostproc 55. 3.100 / 55. 3.100 +Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4': +Metadata: +major_brand : isom +minor_version : 512 +compatible_brands: isomiso2avc1mp41 +encoder : Lavf58.20.100 +Duration: 00:00:28.79, start: 0.000000, bitrate: 454 kb/s +Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1920x1080 [SAR 1:1 DAR 16:9], 318 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) +Metadata: +handler_name : ISO Media file produced by Google Inc. Created on: 04/08/2019. +At least one output file must be specified +``` + +如你在上面的输出中看到的,FFmpeg 显示该媒体文件信息,以及 FFmpeg 细节,例如版本、配置细节、版权标记、构建参数和库选项等等。 + +如果你不想看 FFmpeg 标语和其它细节,而仅仅想看媒体文件信息,使用 `-hide_banner` 标志,像下面。 + +``` +$ ffmpeg -i video.mp4 -hide_banner +``` + +样本输出: + +![][3] + +*使用 FFMpeg 查看音频、视频文件信息。* + +看见了吗?现在,它仅显示媒体文件细节。 + + +#### 2、转换视频文件到不同的格式 + +FFmpeg 是强有力的音频和视频转换器,因此,它能在不同格式之间转换媒体文件。举个例子,要转换 mp4 文件到 avi 文件,运行: + +``` +$ ffmpeg -i video.mp4 video.avi +``` + +类似地,你可以转换媒体文件到你选择的任何格式。 + +例如,为转换 YouTube flv 格式视频为 mpeg 格式,运行: + +``` +$ ffmpeg -i video.flv video.mpeg +``` + +如果你想维持你的源视频文件的质量,使用 `-qscale 0` 参数: + +``` +$ ffmpeg -i input.webm -qscale 0 output.mp4 +``` + +为检查 FFmpeg 的支持格式的列表,运行: + +``` +$ ffmpeg -formats +``` + +#### 3、转换视频文件到音频文件 + +我转换一个视频文件到音频文件,只需具体指明输出格式,像 .mp3,或 .ogg,或其它任意音频格式。 + +上面的命令将转换 input.mp4 视频文件到 output.mp3 音频文件。 + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +此外,你也可以对输出文件使用各种各样的音频转换编码选项,像下面演示。 + +``` +$ ffmpeg -i input.mp4 -vn -ar 44100 -ac 2 -ab 320 -f mp3 output.mp3 +``` + +在这里, + + * `-vn` – 表明我们已经在输出文件中禁用视频录制。 + * `-ar` – 设置输出文件的音频频率。通常使用的值是22050 Hz、44100 Hz、48000 Hz。 + * `-ac` – 设置音频通道的数目。 + * `-ab` – 表明音频比特率。 + * `-f` – 输出文件格式。在我们的实例中,它是 mp3 格式。 + +#### 4、更改视频文件的分辨率 + +如果你想设置一个视频文件为指定的分辨率,你可以使用下面的命令: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=1280:720 -c:a copy output.mp4 +``` + +或, + +``` +$ ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4 +``` + +上面的命令将设置所给定视频文件的分辨率到 1280×720。 + +类似地,为转换上面的文件到 640×480 大小,运行: + +``` +$ ffmpeg -i input.mp4 -filter:v scale=640:480 -c:a copy output.mp4 +``` + +或者, + +``` +$ ffmpeg -i input.mp4 -s 640x480 -c:a copy output.mp4 +``` + +这个技巧将帮助你缩放你的视频文件到较小的显示设备上,例如平板电脑和手机。 + +#### 5、压缩视频文件 + +减小媒体文件的大小到较小来节省硬件的空间总是一个好主意. + +下面的命令将压缩并减少输出文件的大小。 + +``` +$ ffmpeg -i input.mp4 -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 output.mp4 +``` + +请注意,如果你尝试减小视频文件的大小,你将损失视频质量。如果 24 太有侵略性,你可以降低 `-crf` 值到或更低值。 + +你也可以通过下面的选项来转换编码音频降低比特率,使其有立体声感,从而减小大小。 + +``` +-ac 2 -c:a aac -strict -2 -b:a 128k +``` + +#### 6、压缩音频文件 + +正像压缩视频文件一样,为节省一些磁盘空间,你也可以使用 `-ab` 标志压缩音频文件。 + +例如,你有一个 320 kbps 比特率的音频文件。你想通过更改比特率到任意较低的值来压缩它,像下面。 + +``` +$ ffmpeg -i input.mp3 -ab 128 output.mp3 +``` + +各种各样可用的音频比特率列表是: + + 1. 96kbps + 2. 112kbps + 3. 128kbps + 4. 160kbps + 5. 192kbps + 6. 256kbps + 7. 320kbps + +#### 7、从一个视频文件移除音频流 + +如果你不想要一个视频文件中的音频,使用 `-an` 标志。 + +``` +$ ffmpeg -i input.mp4 -an output.mp4 +``` + +在这里,`-an` 表示没有音频录制。 + +上面的命令会撤销所有音频相关的标志,因为我们不要来自 input.mp4 的音频。 + +#### 8、从一个媒体文件移除视频流 + +类似地,如果你不想要视频流,你可以使用 `-vn` 标志从媒体文件中简单地移除它。`-vn` 代表没有视频录制。换句话说,这个命令转换所给定媒体文件为音频文件。 + +下面的命令将从所给定媒体文件中移除视频。 + +``` +$ ffmpeg -i input.mp4 -vn output.mp3 +``` + +你也可以使用 `-ab` 标志来指出输出文件的比特率,如下面的示例所示。 + +``` +$ ffmpeg -i input.mp4 -vn -ab 320 output.mp3 +``` + +#### 9、从视频中提取图像 + +FFmpeg 的另一个有用的特色是我们可以从一个视频文件中轻松地提取图像。如果你想从一个视频文件中创建一个相册,这可能是非常有用的。 + +为从一个视频文件中提取图像,使用下面的命令: + +``` +$ ffmpeg -i input.mp4 -r 1 -f image2 image-%2d.png +``` + +在这里, + + * `-r` – 设置帧速度。即,每秒提取帧到图像的数字。默认值是 25。 + * `-f` – 表示输出格式,即,在我们的实例中是图像。 + * `image-%2d.png` – 表明我们如何想命名提取的图像。在这个实例中,命名应该像这样image-01.png、image-02.png、image-03.png 等等开始。如果你使用 `%3d`,那么图像的命名像 image-001.png、image-002.png 等等开始。 + +#### 10、裁剪视频 + +FFMpeg 允许以我们选择的任何范围裁剪一个给定的媒体文件。 + +裁剪一个视频文件的语法如下给定: + +``` +ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4 +``` + +在这里, + + * `input.mp4` – 源视频文件。 + * `-filter:v` – 表示视频过滤器。 + * `crop` – 表示裁剪过滤器。 + * `w` – 我们想自源视频中裁剪的矩形的宽度。 + * `h` – 矩形的高度。 + * `x` – 我们想自源视频中裁剪的矩形的 x 坐标 。 + * `y` – 矩形的 y 坐标。 + +比如说你想要一个来自视频的位置 (200,150),且具有 640 像素宽度和 480 像素高度的视频,命令应该是: + +``` +$ ffmpeg -i input.mp4 -filter:v "crop=640:480:200:150" output.mp4 +``` + +请注意,剪切视频将影响质量。除非必要,请勿剪切。 + +#### 11、转换一个视频的具体的部分 + +有时,你可能想仅转换视频文件的一个具体的部分到不同的格式。以示例说明,下面的命令将转换所给定视频input.mp4 文件的开始 10 秒到视频 .avi 格式。 + +``` +$ ffmpeg -i input.mp4 -t 10 output.avi +``` + +在这里,我们以秒具体说明时间。此外,以 `hh.mm.ss` 格式具体说明时间也是可以的。 + +#### 12、设置视频的屏幕高宽比 + +你可以使用 `-aspect` 标志设置一个视频文件的屏幕高宽比,像下面。 + +``` +$ ffmpeg -i input.mp4 -aspect 16:9 output.mp4 +``` + +通常使用的高宽比是: + + * 16:9 + * 4:3 + * 16:10 + * 5:4 + * 2:21:1 + * 2:35:1 + * 2:39:1 + +#### 13、添加海报图像到音频文件 + +你可以添加海报图像到你的文件,以便图像将在播放音频文件时显示。这对托管在视频托管主机或共享网站中的音频文件是有用的。 + +``` +$ ffmpeg -loop 1 -i inputimage.jpg -i inputaudio.mp3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest output.mp4 +``` + +#### 14、使用开始和停止时间剪下一段媒体文件 + +可以使用开始和停止时间来剪下一段视频为小段剪辑,我们可以使用下面的命令。 + +``` +$ ffmpeg -i input.mp4 -ss 00:00:50 -codec copy -t 50 output.mp4 +``` + +在这里, + + * `–s` – 表示视频剪辑的开始时间。在我们的示例中,开始时间是第 50 秒。 + * `-t` – 表示总的持续时间。 + +当你想使用开始和结束时间从一个音频或视频文件剪切一部分时,它是非常有用的。 + +类似地,我们可以像下面剪下音频。 + +``` +$ ffmpeg -i audio.mp3 -ss 00:01:54 -to 00:06:53 -c copy output.mp3 +``` + +#### 15、切分视频文件为多个部分 + +一些网站将仅允许你上传具体指定大小的视频。在这样的情况下,你可以切分大的视频文件到多个较小的部分,像下面。 + +``` +$ ffmpeg -i input.mp4 -t 00:00:30 -c copy part1.mp4 -ss 00:00:30 -codec copy part2.mp4 +``` + +在这里, + + * `-t 00:00:30` 表示从视频的开始到视频的第 30 秒创建一部分视频。 + * `-ss 00:00:30` 为视频的下一部分显示开始时间戳。它意味着第 2 部分将从第 30 秒开始,并将持续到原始视频文件的结尾。 + +#### 16、接合或合并多个视频部分到一个 + +FFmpeg 也可以接合多个视频部分,并创建一个单个视频文件。 + +创建包含你想接合文件的准确的路径的 `join.txt`。所有的文件都应该是相同的格式(相同的编码格式)。所有文件的路径应该逐个列出,像下面。 + +``` +file /home/sk/myvideos/part1.mp4 +file /home/sk/myvideos/part2.mp4 +file /home/sk/myvideos/part3.mp4 +file /home/sk/myvideos/part4.mp4 +``` + +现在,接合所有文件,使用命令: + +``` +$ ffmpeg -f concat -i join.txt -c copy output.mp4 +``` + +如果你得到一些像下面的错误; + +``` +[concat @ 0x555fed174cc0] Unsafe file name '/path/to/mp4' +join.txt: Operation not permitted +``` + +添加 `-safe 0` : + +``` +$ ffmpeg -f concat -safe 0 -i join.txt -c copy output.mp4 +``` + +上面的命令将接合 part1.mp4、part2.mp4、part3.mp4 和 part4.mp4 文件到一个称为 output.mp4 的单个文件中。 + +#### 17、添加字幕到一个视频文件 + +我们可以使用 FFmpeg 来添加字幕到视频文件。为你的视频下载正确的字幕,并如下所示添加它到你的视频。 + +``` +$ fmpeg -i input.mp4 -i subtitle.srt -map 0 -map 1 -c copy -c:v libx264 -crf 23 -preset veryfast output.mp4 +``` + +#### 18、预览或测试视频或音频文件 + +你可能希望通过预览来验证或测试输出的文件是否已经被恰当地转码编码。为完成预览,你可以从你的终端播放它,用命令: + +``` +$ ffplay video.mp4 +``` + +![][7] + +类似地,你可以测试音频文件,像下面所示。 + +``` +$ ffplay audio.mp3 +``` + +![][8] + +#### 19、增加/减少视频播放速度 + +FFmpeg 允许你调整视频播放速度。 + +为增加视频播放速度,运行: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=0.5*PTS" output.mp4 +``` + +该命令将双倍视频的速度。 + +为降低你的视频速度,你需要使用一个大于 1 的倍数。为减少播放速度,运行: + +``` +$ ffmpeg -i input.mp4 -vf "setpts=4.0*PTS" output.mp4 +``` + +#### 20、创建动画的 GIF + +出于各种目的,我们在几乎所有的社交和专业网络上使用 GIF 图像。使用 FFmpeg,我们可以简单地和快速地创建动画的视频文件。下面的指南阐释了如何在类 Unix 系统中使用 FFmpeg 和 ImageMagick 创建一个动画的 GIF 文件。 + + * [在 Linux 中如何创建动画的 GIF][9] + +#### 21、从 PDF 文件中创建视频 + +我长年累月的收集了很多 PDF 文件,大多数是 Linux 教程,保存在我的平板电脑中。有时我懒得从平板电脑中阅读它们。因此,我决定从 PDF 文件中创建一个视频,在一个大屏幕设备(像一台电视机或一台电脑)中观看它们。如果你想知道如何从一批 PDF 文件中制作一个电影,下面的指南将帮助你。 + + * [在 Linux 中如何从 PDF 文件中创建一个视频][10] + +#### 22、获取帮助 + +在这个指南中,我已经覆盖大多数常常使用的 FFmpeg 命令。它有很多不同的选项来做各种各样的高级功能。要学习更多用法,请参考手册页。 + +``` +$ man ffmpeg +``` + +这就是全部了。我希望这个指南将帮助你入门 FFmpeg。如果你发现这个指南有用,请在你的社交和专业网络上分享它。更多好东西将要来。敬请期待! + +谢谢! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/20-ffmpeg-commands-beginners/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2017/05/FFmpeg-Commands-720x340.png +[2]: https://www.ostechnix.com/install-ffmpeg-linux/ +[3]: http://www.ostechnix.com/wp-content/uploads/2017/05/sk@sk_001.png +[4]: https://ostechnix.tradepub.com/free/w_make141/prgm.cgi +[5]: https://ostechnix.tradepub.com/free/w_make75/prgm.cgi +[6]: https://ostechnix.tradepub.com/free/w_make235/prgm.cgi +[7]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_004.png +[8]: http://www.ostechnix.com/wp-content/uploads/2017/05/Menu_005-3.png +[9]: https://www.ostechnix.com/create-animated-gif-ubuntu-16-04/ +[10]: https://www.ostechnix.com/create-video-pdf-files-linux/ diff --git a/published/201906/20190527 5 GNOME keyboard shortcuts to be more productive.md b/published/201906/20190527 5 GNOME keyboard shortcuts to be more productive.md new file mode 100644 index 0000000000..9ba4bc2d57 --- /dev/null +++ b/published/201906/20190527 5 GNOME keyboard shortcuts to be more productive.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10997-1.html) +[#]: subject: (5 GNOME keyboard shortcuts to be more productive) +[#]: via: (https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +5 个提高效率的 GNOME 快捷键 +====== + +![][1] + +对于某些人来说,使用 GNOME Shell 作为传统的桌面管理器可能会感觉沮丧,因为它通常需要更多的鼠标操作。事实上,GNOME Shell 也是一个专为键盘操作而设计的[桌面管理器][2]。通过这五种使用键盘而不是鼠标的方法,了解如何使用 GNOME Shell 提高效率。 + +### GNOME 活动概述 + +可以使用键盘上的 `Super` 键轻松打开活动概述。(`Super` 键通常有一个标识——比如 Windows 徽标……)这在启动应用程序时非常有用。例如,使用以下键序列 `Super + f i r + Enter` 可以轻松启动 Firefox Web 浏览器 + +![][3] + +### 消息托盘 + +在 GNOME 中,消息托盘中提供了通知。这也是日历和世界时钟出现的地方。要使用键盘打开信息托盘,请使用 `Super + m` 快捷键。要关闭消息托盘,只需再次使用相同的快捷方式。 + +![][4] + +### 在 GNOME 中管理工作空间 + +GNOME Shell 使用动态工作空间,这意味着它可以根据需要创建更多工作空间。使用 GNOME 提高工作效率的一个好方法是为每个应用程序或每个专用活动使用一个工作区,然后使用键盘在这些工作区之间导航。 + +让我们看一个实际的例子。要在当前工作区中打开终端,请按以下键:`Super + t e r + Enter`。然后,要打开新工作区,请按 `Super + PgDn`。 打开 Firefox( `Super + f i r + Enter`)。 要返回终端(所在的工作空间),请使用 `Super + PgUp`。 + +![][5] + +### 管理应用窗口 + +使用键盘也可以轻松管理应用程序窗口的大小。最小化、最大化和将应用程序移动到屏幕的左侧或右侧只需几个击键即可完成。使用 `Super + ↑` 最大化、`Super + ↓` 最小化、`Super + ←` 和 `Super + →` 左右移动窗口。 + +![][6] + +### 同一个应用的多个窗口 + +使用活动概述启动应用程序非常有效。但是,尝试从已经运行的应用程序打开一个新窗口只能将焦点转移到已经打开的窗口。要创建一个新窗口,就不是简单地按 `Enter` 启动应用程序,请使用 `Ctrl + Enter`。 + +因此,例如,使用应用程序概述启动终端的第二个实例,`Super + t e r + (Ctrl + Enter)`。 + +![][7] + +然后你可以使用 `Super` + ` 在同一个应用程序的窗口之间切换。 + +![][8] + +如图所示,当用键盘控制时,GNOME Shell 是一个非常强大的桌面环境。学习使用这些快捷方式并训练你的肌肉记忆以不使用鼠标将为你提供更好的用户体验,并在使用 GNOME 时提高你的工作效率。有关其他有用的快捷方式,请查看 [GNOME wiki 上的此页面][9]。 + +*图片来自 [1AmFcS][10],[Unsplash][11]* + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/5-gnome-keyboard-shortcuts-to-be-more-productive/ + +作者:[Clément Verna][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/5-gnome-keycombos-816x345.jpg +[2]: https://fedoramagazine.org/gnome-3-32-released-coming-to-fedora-30/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-10-50.gif +[4]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-11-01.gif +[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-12-57.gif +[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-06.gif +[7]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-19.gif +[8]: https://fedoramagazine.org/wp-content/uploads/2019/05/Peek-2019-05-23-13-22.gif +[9]: https://wiki.gnome.org/Design/OS/KeyboardShortcuts +[10]: https://unsplash.com/photos/MuTWth_RnEs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[11]: https://unsplash.com/search/photos/keyboard?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201906/20190527 A deeper dive into Linux permissions.md b/published/201906/20190527 A deeper dive into Linux permissions.md new file mode 100644 index 0000000000..a4bba97507 --- /dev/null +++ b/published/201906/20190527 A deeper dive into Linux permissions.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10947-1.html) +[#]: subject: (A deeper dive into Linux permissions) +[#]: via: (https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +更深入地了解 Linux 权限 +====== +> 在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 r、w、x 和 -。如何更清晰地了解这些字符试图告诉你什么以及这些权限如何工作? + +![Sandra Henry-Stocker](https://img.linux.net.cn/data/attachment/album/201906/07/150718q09wnve6ne6v9063.jpg) + +在 Linux 上查看文件权限时,有时你会看到的不仅仅是普通的 `r`、`w`、`x` 和 `-`。除了在所有者、组和其他中看到 `rwx` 之外,你可能会看到 `s` 或者 `t`,如下例所示: + +``` +drwxrwsrwt +``` + +要进一步明确的方法之一是使用 `stat` 命令查看权限。`stat` 的第四行输出以八进制和字符串格式显示文件权限: + +``` +$ stat /var/mail + File: /var/mail + Size: 4096 Blocks: 8 IO Block: 4096 directory +Device: 801h/2049d Inode: 1048833 Links: 2 +Access: (3777/drwxrwsrwt) Uid: ( 0/ root) Gid: ( 8/ mail) +Access: 2019-05-21 19:23:15.769746004 -0400 +Modify: 2019-05-21 19:03:48.226656344 -0400 +Change: 2019-05-21 19:03:48.226656344 -0400 + Birth: - +``` + +这个输出提示我们,分配给文件权限的位数超过 9 位。事实上,有 12 位。这些额外的三位提供了一种分配超出通常的读、写和执行权限的方法 - 例如,`3777`(二进制 `011111111111`)表示使用了两个额外的设置。 + +该值的第一个 `1` (第二位)表示 SGID(设置 GID),为运行文件而赋予临时权限,或以该关联组的权限来使用目录。 + +``` +011111111111 + ^ +``` + +SGID 将正在使用该文件的用户作为该组成员之一而分配临时权限。 + +第二个 `1`(第三位)是“粘连”位。它确保*只有*文件的所有者能够删除或重命名该文件或目录。 + +``` +011111111111 + ^ +``` + +如果权限是 `7777` 而不是 `3777`,我们知道 SUID(设置 UID)字段也已设置。 + +``` +111111111111 +^ +``` + +SUID 将正在使用该文件的用户作为文件拥有者分配临时权限。 + +至于我们上面看到的 `/var/mail` 目录,所有用户都需要访问,因此需要一些特殊值来提供它。 + +但现在让我们更进一步。 + +特殊权限位的一个常见用法是使用 `passwd` 之类的命令。如果查看 `/usr/bin/passwd` 文件,你会注意到 SUID 位已设置,它允许你更改密码(以及 `/etc/shadow` 文件的内容),即使你是以普通(非特权)用户身份运行,并且对此文件没有读取或写入权限。当然,`passwd` 命令很聪明,不允许你更改其他人的密码,除非你是以 root 身份运行或使用 `sudo`。 + +``` +$ ls -l /usr/bin/passwd +-rwsr-xr-x 1 root root 63736 Mar 22 14:32 /usr/bin/passwd +$ ls -l /etc/shadow +-rw-r----- 1 root shadow 2195 Apr 22 10:46 /etc/shadow +``` + +现在,让我们看一下使用这些特殊权限可以做些什么。 + +### 如何分配特殊文件权限 + +与 Linux 命令行中的许多东西一样,你可以有不同的方法设置。 `chmod` 命令允许你以数字方式或使用字符表达式更改权限。 + +要以数字方式更改文件权限,你可以使用这样的命令来设置 SUID 和 SGID 位: + +``` +$ chmod 6775 tryme +``` + +或者你可以使用这样的命令: + +``` +$ chmod ug+s tryme <== 用于 SUID 和 SGID 权限 +``` + +如果你要添加特殊权限的文件是脚本,你可能会对它不符合你的期望感到惊讶。这是一个非常简单的例子: + +``` +$ cat tryme +#!/bin/bash + +echo I am $USER +``` + +即使设置了 SUID 和 SGID 位,并且 root 是文件所有者,运行脚本也不会产生你可能期望的 “I am root”。为什么?因为 Linux 会忽略脚本的 SUID 和 SGID 位。 + +``` +$ ls -l tryme +-rwsrwsrwt 1 root root 29 May 26 12:22 tryme +$ ./tryme +I am jdoe +``` + +另一方面,如果你对一个编译的程序之类进行类似的尝试,就像下面这个简单的 C 程序一样,你会看到不同的效果。在此示例程序中,我们提示用户输入文件名并创建它,并给文件写入权限。 + +``` +#include + +int main() +{ + FILE *fp; /* file pointer*/ + char fName[20]; + + printf("Enter the name of file to be created: "); + scanf("%s",fName); + + /* create the file with write permission */ + fp=fopen(fName,"w"); + /* check if file was created */ + if(fp==NULL) + { + printf("File not created"); + exit(0); + } + + printf("File created successfully\n"); + return 0; +} +``` + +编译程序并运行该命令以使 root 用户成为所有者并设置所需权限后,你将看到它以预期的 root 权限运行 - 留下新创建的 root 为所有者的文件。当然,你必须具有 `sudo` 权限才能运行一些需要的命令。 + +``` +$ cc -o mkfile mkfile.c <== 编译程序 +$ sudo chown root:root mkfile <== 更改所有者和组为 “root” +$ sudo chmod ug+s mkfile <== 添加 SUID and SGID 权限 +$ ./mkfile <== 运行程序 +Enter name of file to be create: empty +File created successfully +$ ls -l empty +-rw-rw-r-- 1 root root 0 May 26 13:15 empty +``` + +请注意,文件所有者是 root - 如果程序未以 root 权限运行,则不会发生这种情况。 + +权限字符串中不常见设置的位置(例如,rw**s**rw**s**rw**t**)可以帮助提醒我们每个位的含义。至少第一个 “s”(SUID) 位于所有者权限区域中,第二个 (SGID) 位于组权限区域中。为什么粘连位是 “t” 而不是 “s” 超出了我的理解。也许创造者想把它称为 “tacky bit”,但由于这个词的不太令人喜欢的第二个定义而改变了他们的想法。无论如何,额外的权限设置为 Linux 和其他 Unix 系统提供了许多额外的功能。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397790/a-deeper-dive-into-linux-permissions.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/shs_rwsr-100797564-large.jpg +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190527 Dockly - Manage Docker Containers From Terminal.md b/published/201906/20190527 Dockly - Manage Docker Containers From Terminal.md new file mode 100644 index 0000000000..44e9dc2c21 --- /dev/null +++ b/published/201906/20190527 Dockly - Manage Docker Containers From Terminal.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10925-1.html) +[#]: subject: (Dockly – Manage Docker Containers From Terminal) +[#]: via: (https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Dockly:从终端管理 Docker 容器 +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/01/144422bfwx1e7fqx1ee11x.jpg) + +几天前,我们发布了一篇指南,其中涵盖了[开始使用 Docker][2] 时需要了解的几乎所有细节。在该指南中,我们向你展示了如何详细创建和管理 Docker 容器。还有一些可用于管理 Docker 容器的非官方工具。如果你看过我们以前的文章,你可能会看到两个基于 Web 的工具,[Portainer][3] 和 [PiCluster][4]。它们都使得 Docker 管理任务在 Web 浏览器中变得更加容易和简单。今天,我遇到了另一个名为 Dockly 的 Docker 管理工具。 + +与上面的工具不同,Dockly 是一个 TUI(文本界面)程序,用于在类 Unix 系统中从终端管理 Docker 容器和服务。它是使用 NodeJS 编写的自由开源工具。在本简要指南中,我们将了解如何安装 Dockly 以及如何从命令行管理 Docker 容器。 + +### 安装 Dockly + +确保已在 Linux 上安装了 NodeJS。如果尚未安装,请参阅以下指南。 + +* [如何在 Linux 上安装 NodeJS][5] + +安装 NodeJS 后,运行以下命令安装 Dockly: + +``` +# npm install -g dockly +``` + +### 使用 Dockly 在终端管理 Docker 容器 + +使用 Dockly 管理 Docker 容器非常简单!你所要做的就是打开终端并运行以下命令: + +``` +# dockly +``` + +Dockly 将通过 unix 套接字自动连接到你的本机 docker 守护进程,并在终端中显示正在运行的容器列表,如下所示。 + +![][6] + +*使用 Dockly 管理 Docker 容器* + +正如你在上面的截图中看到的,Dockly 在顶部显示了运行容器的以下信息: + +* 容器 ID, +* 容器名称, +* Docker 镜像, +* 命令, +* 运行中容器的状态, +* 状态。 + +在右上角,你将看到容器的 CPU 和内存利用率。使用向上/向下箭头键在容器之间移动。 + +在底部,有少量的键盘快捷键来执行各种 Docker 管理任务。以下是目前可用的键盘快捷键列表: + +* `=` - 刷新 Dockly 界面, +* `/` - 搜索容器列表视图, +* `i` - 显示有关当前所选容器或服务的信息, +* `回车` - 显示当前容器或服务的日志, +* `v` - 在容器和服务视图之间切换, +* `l` - 在选定的容器上启动 `/bin/bash` 会话, +* `r` - 重启选定的容器, +* `s` - 停止选定的容器, +* `h` - 显示帮助窗口, +* `q` - 退出 Dockly。 + +#### 查看容器的信息 + +使用向上/向下箭头选择一个容器,然后按 `i` 以显示所选容器的信息。 + +![][7] + +*查看容器的信息* + +#### 重启容器 + +如果你想随时重启容器,只需选择它并按 `r` 即可重新启动。 + +![][8] + +*重启 Docker 容器* + +#### 停止/删除容器和镜像 + +如果不再需要容器,我们可以立即停止和/或删除一个或所有容器。为此,请按 `m` 打开菜单。 + +![][9] + +*停止,删除 Docker 容器和镜像* + +在这里,你可以执行以下操作。 + +* 停止所有 Docker 容器, +* 删除选定的容器, +* 删除所有容器, +* 删除所有 Docker 镜像等。 + +#### 显示 Dockly 帮助部分 + +如果你有任何疑问,只需按 `h` 即可打开帮助部分。 + +![][10] + +*Dockly 帮助* + +有关更多详细信息,请参考最后给出的官方 GitHub 页面。 + +就是这些了。希望这篇文章有用。如果你一直在使用 Docker 容器,请试试 Dockly,看它是否有帮助。 + +建议阅读: + + * [如何自动更新正在运行的 Docker 容器][11] + * [ctop:一个 Linux 容器的命令行监控工具][12] + +资源: + + * [Dockly 的 GitHub 仓库][13] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/dockly-manage-docker-containers-from-terminal/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Dockly-720x340.png +[2]: https://www.ostechnix.com/getting-started-with-docker/ +[3]: https://www.ostechnix.com/portainer-an-easiest-way-to-manage-docker/ +[4]: https://www.ostechnix.com/picluster-simple-web-based-docker-management-application/ +[5]: https://www.ostechnix.com/install-node-js-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2019/05/Manage-Docker-Containers-Using-Dockly.png +[7]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-containers-information.png +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Restart-containers.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/stop-remove-containers-and-images.png +[10]: http://www.ostechnix.com/wp-content/uploads/2019/05/Dockly-Help.png +[11]: https://www.ostechnix.com/automatically-update-running-docker-containers/ +[12]: https://www.ostechnix.com/ctop-commandline-monitoring-tool-linux-containers/ +[13]: https://github.com/lirantal/dockly diff --git a/published/201906/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md b/published/201906/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md new file mode 100644 index 0000000000..e853c92615 --- /dev/null +++ b/published/201906/20190527 How To Check Available Security Updates On Red Hat (RHEL) And CentOS System.md @@ -0,0 +1,312 @@ +[#]: collector: (lujun9972) +[#]: translator: (jdh8383) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10938-1.html) +[#]: subject: (How To Check Available Security Updates On Red Hat (RHEL) And CentOS System?) +[#]: via: (https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 CentOS 或 RHEL 系统上检查可用的安全更新? +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/05/003907tljfmy4bnn4qj1tp.jpg) + +当你更新系统时,根据你所在公司的安全策略,有时候可能只需要打上与安全相关的补丁。大多数情况下,这应该是出于程序兼容性方面的考量。那该怎样实践呢?有没有办法让 `yum` 只安装安全补丁呢? + +答案是肯定的,可以用 `yum` 包管理器轻松实现。 + +在这篇文章中,我们不但会提供所需的信息。而且,我们会介绍一些额外的命令,可以帮你获取指定安全更新的详实信息。 + +希望这样可以启发你去了解并修复你列表上的那些漏洞。一旦有安全漏洞被公布,就必须更新受影响的软件,这样可以降低系统中的安全风险。 + +对于 RHEL 或 CentOS 6 系统,运行下面的 [Yum 命令][1] 来安装 yum 安全插件。 + +``` +# yum -y install yum-plugin-security +``` + +在 RHEL 7&8 或是 CentOS 7&8 上面,这个插件已经是 `yum` 的一部分了,不用单独安装。 + +要列出全部可用的补丁(包括安全、Bug 修复以及产品改进),但不安装它们: + +``` +# yum updateinfo list available +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 +RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 +RHBA-2015:0626 bugfix 389-ds-base-1.3.3.1-15.el7_1.x86_64 +RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 +RHBA-2015:1554 bugfix 389-ds-base-1.3.3.1-20.el7_1.x86_64 +RHBA-2015:1960 bugfix 389-ds-base-1.3.3.1-23.el7_1.x86_64 +RHBA-2015:2351 bugfix 389-ds-base-1.3.4.0-19.el7.x86_64 +RHBA-2015:2572 bugfix 389-ds-base-1.3.4.0-21.el7_2.x86_64 +RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 +RHBA-2016:0550 bugfix 389-ds-base-1.3.4.0-29.el7_2.x86_64 +RHBA-2016:1048 bugfix 389-ds-base-1.3.4.0-30.el7_2.x86_64 +RHBA-2016:1298 bugfix 389-ds-base-1.3.4.0-32.el7_2.x86_64 +``` + +要统计补丁的大约数量,运行下面的命令: + +``` +# yum updateinfo list available | wc -l +11269 +``` + +想列出全部可用的安全补丁但不安装,以下命令用来展示你系统里已安装和待安装的推荐补丁: + +``` +# yum updateinfo list security all +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock + RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 + RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 + RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 + RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 + RHSA-2016:2594 Moderate/Sec. 389-ds-base-1.3.5.10-11.el7.x86_64 + RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64 + RHSA-2017:2569 Moderate/Sec. 389-ds-base-1.3.6.1-19.el7_4.x86_64 + RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64 + RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64 + RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 + RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 + RHSA-2018:3127 Moderate/Sec. 389-ds-base-1.3.8.4-15.el7.x86_64 + RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64 +``` + +要显示所有待安装的安全补丁: + +``` +# yum updateinfo list security all | grep -v "i" + + RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64 + RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64 + RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64 + RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64 + RHSA-2016:2594 Moderate/Sec. 389-ds-base-1.3.5.10-11.el7.x86_64 + RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64 + RHSA-2017:2569 Moderate/Sec. 389-ds-base-1.3.6.1-19.el7_4.x86_64 + RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64 + RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64 + RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64 + RHSA-2018:2757 Moderate/Sec. 389-ds-base-1.3.7.5-28.el7_5.x86_64 +``` + +要统计全部安全补丁的大致数量,运行下面的命令: + +``` +# yum updateinfo list security all | wc -l +3522 +``` + +下面根据已装软件列出可更新的安全补丁。这包括 bugzilla(bug 修复)、CVE(知名漏洞数据库)、安全更新等: + +``` +# yum updateinfo list security + +或者 + +# yum updateinfo list sec + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock + +RHSA-2018:3665 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarch +RHSA-2018:3665 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-tui-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-wifi-1:1.12.0-8.el7_6.x86_64 +RHSA-2018:3665 Important/Sec. NetworkManager-wwan-1:1.12.0-8.el7_6.x86_64 +``` + +显示所有与安全相关的更新,并且返回一个结果来告诉你是否有可用的补丁: + +``` +# yum --security check-update +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +--> policycoreutils-devel-2.2.5-20.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> smc-raghumalayalam-fonts-6.0-7.el7.noarch from rhel-7-server-rpms excluded (updateinfo) +--> amanda-server-3.3.3-17.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> 389-ds-base-libs-1.3.4.0-26.el7_2.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> 1:cups-devel-1.6.3-26.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> openwsman-client-2.6.3-3.git4391e5c.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> 1:emacs-24.3-18.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +--> augeas-libs-1.4.0-2.el7_4.2.i686 from rhel-7-server-rpms excluded (updateinfo) +--> samba-winbind-modules-4.2.3-10.el7.i686 from rhel-7-server-rpms excluded (updateinfo) +--> tftp-5.2-11.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo) +. +. +35 package(s) needed for security, out of 115 available +NetworkManager.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-adsl.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-bluetooth.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-config-server.noarch 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-glib.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-libnm.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +NetworkManager-ppp.x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms +``` + +列出所有可用的安全补丁,并且显示其详细信息: + +``` +# yum info-sec +. +. +=============================================================================== + tzdata bug fix and enhancement update +=============================================================================== + Update ID : RHBA-2019:0689 + Release : 0 + Type : bugfix + Status : final + Issued : 2019-03-28 19:27:44 UTC +Description : The tzdata packages contain data files with rules for various + : time zones. + : + : The tzdata packages have been updated to version + : 2019a, which addresses recent time zone changes. + : Notably: + : + : * The Asia/Hebron and Asia/Gaza zones will start + : DST on 2019-03-30, rather than 2019-03-23 as + : previously predicted. + : * Metlakatla rejoined Alaska time on 2019-01-20, + : ending its observances of Pacific standard time. + : + : (BZ#1692616, BZ#1692615, BZ#1692816) + : + : Users of tzdata are advised to upgrade to these + : updated packages. + Severity : None +``` + +如果你想要知道某个更新的具体内容,可以运行下面这个命令: + +``` +# yum updateinfo RHSA-2019:0163 + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +=============================================================================== + Important: kernel security, bug fix, and enhancement update +=============================================================================== + Update ID : RHSA-2019:0163 + Release : 0 + Type : security + Status : final + Issued : 2019-01-29 15:21:23 UTC + Updated : 2019-01-29 15:23:47 UTC Bugs : 1641548 - CVE-2018-18397 kernel: userfaultfd bypasses tmpfs file permissions + : 1641878 - CVE-2018-18559 kernel: Use-after-free due to race condition in AF_PACKET implementation + CVEs : CVE-2018-18397 + : CVE-2018-18559 +Description : The kernel packages contain the Linux kernel, the core of any + : Linux operating system. + : + : Security Fix(es): + : + : * kernel: Use-after-free due to race condition in + : AF_PACKET implementation (CVE-2018-18559) + : + : * kernel: userfaultfd bypasses tmpfs file + : permissions (CVE-2018-18397) + : + : For more details about the security issue(s), + : including the impact, a CVSS score, and other + : related information, refer to the CVE page(s) + : listed in the References section. + : + : Bug Fix(es): + : + : These updated kernel packages include also + : numerous bug fixes and enhancements. Space + : precludes documenting all of the bug fixes in this + : advisory. See the descriptions in the related + : Knowledge Article: + : https://access.redhat.com/articles/3827321 + Severity : Important +updateinfo info done +``` + +跟之前类似,你可以只查询那些通过 CVE 释出的系统漏洞: + +``` +# yum updateinfo list cves + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +CVE-2018-15688 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarch +CVE-2018-15688 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64 +CVE-2018-15688 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64 +``` + +你也可以查看那些跟 bug 修复相关的更新,运行下面的命令: + +``` +# yum updateinfo list bugfix | less + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHBA-2018:3349 bugfix NetworkManager-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-adsl-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-adsl-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-bluetooth-1:1.12.0-7.el7_6.x86_64 +RHBA-2019:0519 bugfix NetworkManager-bluetooth-1:1.12.0-10.el7_6.x86_64 +RHBA-2018:3349 bugfix NetworkManager-config-server-1:1.12.0-7.el7_6.noarch +RHBA-2019:0519 bugfix NetworkManager-config-server-1:1.12.0-10.el7_6.noarch +``` + +要想得到待安装更新的摘要信息,运行这个: + +``` +# yum updateinfo summary +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +Updates Information Summary: updates + 13 Security notice(s) + 9 Important Security notice(s) + 3 Moderate Security notice(s) + 1 Low Security notice(s) + 35 Bugfix notice(s) + 1 Enhancement notice(s) +updateinfo summary done +``` + +如果只想打印出低级别的安全更新,运行下面这个命令。类似的,你也可以只查询重要级别和中等级别的安全更新。 + +``` +# yum updateinfo list sec | grep -i "Low" + +RHSA-2019:0201 Low/Sec. libgudev1-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-libs-219-62.el7_6.3.x86_64 +RHSA-2019:0201 Low/Sec. systemd-sysv-219-62.el7_6.3.x86_64 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[jdh8383](https://github.com/jdh8383) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ diff --git a/published/201906/20190527 How to write a good C main function.md b/published/201906/20190527 How to write a good C main function.md new file mode 100644 index 0000000000..4f993ee777 --- /dev/null +++ b/published/201906/20190527 How to write a good C main function.md @@ -0,0 +1,474 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10949-1.html) +[#]: subject: (How to write a good C main function) +[#]: via: (https://opensource.com/article/19/5/how-write-good-c-main-function) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +如何写好 C main 函数 +====== + +> 学习如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 + +![Hand drawing out the word "code"](https://img.linux.net.cn/data/attachment/album/201906/08/211422umrzznnvmapcwuc3.jpg) + +我知道,现在孩子们用 Python 和 JavaScript 编写他们的疯狂“应用程序”。但是不要这么快就否定 C 语言 —— 它能够提供很多东西,并且简洁。如果你需要速度,用 C 语言编写可能就是你的答案。如果你正在寻找稳定的职业或者想学习如何捕获[空指针解引用][2],C 语言也可能是你的答案!在本文中,我将解释如何构造一个 C 文件并编写一个 C main 函数来成功地处理命令行参数。 + +我:一个顽固的 Unix 系统程序员。 + +你:一个有编辑器、C 编译器,并有时间打发的人。 + +让我们开工吧。 + +### 一个无聊但正确的 C 程序 + +![Parody O'Reilly book cover, "Hating Other People's Code"][3] + +C 程序以 `main()` 函数开头,通常保存在名为 `main.c` 的文件中。 + +``` +/* main.c */ +int main(int argc, char *argv[]) { + +} +``` + +这个程序可以*编译*但不*干*任何事。 + +``` +$ gcc main.c +$ ./a.out -o foo -vv +$ +``` + +正确但无聊。 + +### main 函数是唯一的。 + +`main()` 函数是开始执行时所执行的程序的第一个函数,但不是第一个执行的函数。*第一个*函数是 `_start()`,它通常由 C 运行库提供,在编译程序时自动链入。此细节高度依赖于操作系统和编译器工具链,所以我假装没有提到它。 + +`main()` 函数有两个参数,通常称为 `argc` 和 `argv`,并返回一个有符号整数。大多数 Unix 环境都希望程序在成功时返回 `0`(零),失败时返回 `-1`(负一)。 + +参数 | 名称 | 描述 +---|---|--- +`argc` | 参数个数 | 参数向量的个数 +`argv` | 参数向量 | 字符指针数组 + +参数向量 `argv` 是调用你的程序的命令行的标记化表示形式。在上面的例子中,`argv` 将是以下字符串的列表: + +``` +argv = [ "/path/to/a.out", "-o", "foo", "-vv" ]; +``` + +参数向量在其第一个索引 `argv[0]` 中确保至少会有一个字符串,这是执行程序的完整路径。 + +### main.c 文件的剖析 + +当我从头开始编写 `main.c` 时,它的结构通常如下: + +``` +/* main.c */ +/* 0 版权/许可证 */ +/* 1 包含 */ +/* 2 定义 */ +/* 3 外部声明 */ +/* 4 类型定义 */ +/* 5 全局变量声明 */ +/* 6 函数原型 */ + +int main(int argc, char *argv[]) { +/* 7 命令行解析 */ +} + +/* 8 函数声明 */ +``` + +下面我将讨论这些编号的各个部分,除了编号为 0 的那部分。如果你必须把版权或许可文本放在源代码中,那就放在那里。 + +另一件我不想讨论的事情是注释。 + +``` +“评论谎言。” +- 一个愤世嫉俗但聪明又好看的程序员。 +``` + +与其使用注释,不如使用有意义的函数名和变量名。 + +鉴于程序员固有的惰性,一旦添加了注释,维护负担就会增加一倍。如果更改或重构代码,则需要更新或扩充注释。随着时间的推移,代码会变得面目全非,与注释所描述的内容完全不同。 + +如果你必须写注释,不要写关于代码正在做*什么*,相反,写下代码*为什么*要这样写。写一些你将要在五年后读到的注释,那时你已经将这段代码忘得一干二净。世界的命运取决于你。*不要有压力。* + +#### 1、包含 + +我添加到 `main.c` 文件的第一个东西是包含文件,它们为程序提供大量标准 C 标准库函数和变量。C 标准库做了很多事情。浏览 `/usr/include` 中的头文件,你可以了解到它们可以做些什么。 + +`#include` 字符串是 [C 预处理程序][4](cpp)指令,它会将引用的文件完整地包含在当前文件中。C 中的头文件通常以 `.h` 扩展名命名,且不应包含任何可执行代码。它只有宏、定义、类型定义、外部变量和函数原型。字符串 `` 告诉 cpp 在系统定义的头文件路径中查找名为 `header.h` 的文件,它通常在 `/usr/include` 目录中。 + +``` +/* main.c */ +#include +#include +#include +#include +#include +#include +#include +#include +``` + +这是我默认会全局包含的最小包含集合,它将引入: + +\#include 文件 | 提供的东西 +---|--- +stdio | 提供 `FILE`、`stdin`、`stdout`、`stderr` 和 `fprint()` 函数系列 +stdlib | 提供 `malloc()`、`calloc()` 和 `realloc()` +unistd | 提供 `EXIT_FAILURE`、`EXIT_SUCCESS` +libgen | 提供 `basename()` 函数 +errno | 定义外部 `errno` 变量及其可以接受的所有值 +string | 提供 `memcpy()`、`memset()` 和 `strlen()` 函数系列 +getopt | 提供外部 `optarg`、`opterr`、`optind` 和 `getopt()` 函数 +sys/types | 类型定义快捷方式,如 `uint32_t` 和 `uint64_t` + +#### 2、定义 + +``` +/* main.c */ +<...> + +#define OPTSTR "vi:o:f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" +``` + +这在现在没有多大意义,但 `OPTSTR` 定义我这里会说明一下,它是程序推荐的命令行开关。参考 [getopt(3)][5] man 页面,了解 `OPTSTR` 将如何影响 `getopt()` 的行为。 + +`USAGE_FMT` 定义了一个 `printf()` 风格的格式字符串,它用在 `usage()` 函数中。 + +我还喜欢将字符串常量放在文件的 `#define` 这一部分。如果需要,把它们收集在一起可以更容易地修正拼写、重用消息和国际化消息。 + +最后,在命名 `#define` 时全部使用大写字母,以区别变量和函数名。如果需要,可以将单词放连在一起或使用下划线分隔,只要确保它们都是大写的就行。 + +#### 3、外部声明 + +``` +/* main.c */ +<...> + +extern int errno; +extern char *optarg; +extern int opterr, optind; +``` + +`extern` 声明将该名称带入当前编译单元的命名空间(即 “文件”),并允许程序访问该变量。这里我们引入了三个整数变量和一个字符指针的定义。`opt` 前缀的几个变量是由 `getopt()` 函数使用的,C 标准库使用 `errno` 作为带外通信通道来传达函数可能的失败原因。 + +#### 4、类型定义 + +``` +/* main.c */ +<...> + +typedef struct { + int verbose; + uint32_t flags; + FILE *input; + FILE *output; +} options_t; +``` + +在外部声明之后,我喜欢为结构、联合和枚举声明 `typedef`。命名一个 `typedef` 是一种传统习惯。我非常喜欢使用 `_t` 后缀来表示该名称是一种类型。在这个例子中,我将 `options_t` 声明为一个包含 4 个成员的 `struct`。C 是一种空格无关的编程语言,因此我使用空格将字段名排列在同一列中。我只是喜欢它看起来的样子。对于指针声明,我在名称前面加上星号,以明确它是一个指针。 + +#### 5、全局变量声明 + +``` +/* main.c */ +<...> + +int dumb_global_variable = -11; +``` + +全局变量是一个坏主意,你永远不应该使用它们。但如果你必须使用全局变量,请在这里声明,并确保给它们一个默认值。说真的,*不要使用全局变量*。 + +#### 6、函数原型 + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); +``` + +在编写函数时,将它们添加到 `main()` 函数之后而不是之前,在这里放函数原型。早期的 C 编译器使用单遍策略,这意味着你在程序中使用的每个符号(变量或函数名称)必须在使用之前声明。现代编译器几乎都是多遍编译器,它们在生成代码之前构建一个完整的符号表,因此并不严格要求使用函数原型。但是,有时你无法选择代码要使用的编译器,所以请编写函数原型并继续这样做下去。 + +当然,我总是包含一个 `usage()` 函数,当 `main()` 函数不理解你从命令行传入的内容时,它会调用这个函数。 + +#### 7、命令行解析 + +``` +/* main.c */ +<...> + +int main(int argc, char *argv[]) { + int opt; + options_t options = { 0, 0x0, stdin, stdout }; + + opterr = 0; + + while ((opt = getopt(argc, argv, OPTSTR)) != EOF) + switch(opt) { + case 'i': + if (!(options.input = fopen(optarg, "r")) ){ + perror(ERR_FOPEN_INPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'o': + if (!(options.output = fopen(optarg, "w")) ){ + perror(ERR_FOPEN_OUTPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'f': + options.flags = (uint32_t )strtoul(optarg, NULL, 16); + break; + + case 'v': + options.verbose += 1; + break; + + case 'h': + default: + usage(basename(argv[0]), opt); + /* NOTREACHED */ + break; + } + + if (do_the_needful(&options) != EXIT_SUCCESS) { + perror(ERR_DO_THE_NEEDFUL); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + + return EXIT_SUCCESS; +} +``` + +好吧,代码有点多。这个 `main()` 函数的目的是收集用户提供的参数,执行最基本的输入验证,然后将收集到的参数传递给使用它们的函数。这个示例声明一个使用默认值初始化的 `options` 变量,并解析命令行,根据需要更新 `options`。 + +`main()` 函数的核心是一个 `while` 循环,它使用 `getopt()` 来遍历 `argv`,寻找命令行选项及其参数(如果有的话)。文件前面定义的 `OPTSTR` 是驱动 `getopt()` 行为的模板。`opt` 变量接受 `getopt()` 找到的任何命令行选项的字符值,程序对检测命令行选项的响应发生在 `switch` 语句中。 + +如果你注意到了可能会问,为什么 `opt` 被声明为 32 位 `int`,但是预期是 8 位 `char`?事实上 `getopt()` 返回一个 `int`,当它到达 `argv` 末尾时取负值,我会使用 `EOF`(*文件末尾*标记)匹配。`char` 是有符号的,但我喜欢将变量匹配到它们的函数返回值。 + +当检测到一个已知的命令行选项时,会发生特定的行为。在 `OPTSTR` 中指定一个以冒号结尾的参数,这些选项可以有一个参数。当一个选项有一个参数时,`argv` 中的下一个字符串可以通过外部定义的变量 `optarg` 提供给程序。我使用 `optarg` 来打开文件进行读写,或者将命令行参数从字符串转换为整数值。 + +这里有几个关于代码风格的要点: + + * 将 `opterr` 初始化为 `0`,禁止 `getopt` 触发 `?`。 + * 在 `main()` 的中间使用 `exit(EXIT_FAILURE);` 或 `exit(EXIT_SUCCESS);`。 + * `/* NOTREACHED */` 是我喜欢的一个 lint 指令。 + * 在返回 int 类型的函数末尾使用 `return EXIT_SUCCESS;`。 + * 显示强制转换隐式类型。 + +这个程序的命令行格式,经过编译如下所示: + +``` +$ ./a.out -h +a.out [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h] +``` + +事实上,在编译后 `usage()` 就会向 `stderr` 发出这样的内容。 + +#### 8、函数声明 + +``` +/* main.c */ +<...> + +void usage(char *progname, int opt) { + fprintf(stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + + if (!options) { + errno = EINVAL; + return EXIT_FAILURE; + } + + if (!options->input || !options->output) { + errno = ENOENT; + return EXIT_FAILURE; + } + + /* XXX do needful stuff */ + + return EXIT_SUCCESS; +} +``` + +我最后编写的函数不是个样板函数。在本例中,函数 `do_the_needful()` 接受一个指向 `options_t` 结构的指针。我验证 `options` 指针不为 `NULL`,然后继续验证 `input` 和 `output` 结构成员。如果其中一个测试失败,返回 `EXIT_FAILURE`,并且通过将外部全局变量 `errno` 设置为常规错误代码,我可以告知调用者常规的错误原因。调用者可以使用便捷函数 `perror()` 来根据 `errno` 的值发出便于阅读的错误消息。 + +函数几乎总是以某种方式验证它们的输入。如果完全验证代价很大,那么尝试执行一次并将验证后的数据视为不可变。`usage()` 函数使用 `fprintf()` 调用中的条件赋值验证 `progname` 参数。接下来 `usage()` 函数就退出了,所以我不会费心设置 `errno`,也不用操心是否使用正确的程序名。 + +在这里,我要避免的最大错误是解引用 `NULL` 指针。这将导致操作系统向我的进程发送一个名为 `SYSSEGV` 的特殊信号,导致不可避免的死亡。用户最不希望看到的是由 `SYSSEGV` 而导致的崩溃。最好是捕获 `NULL` 指针以发出更合适的错误消息并优雅地关闭程序。 + +有些人抱怨在函数体中有多个 `return` 语句,他们喋喋不休地说些“控制流的连续性”之类的东西。老实说,如果函数中间出现错误,那就应该返回这个错误条件。写一大堆嵌套的 `if` 语句只有一个 `return` 绝不是一个“好主意”™。 + +最后,如果你编写的函数接受四个以上的参数,请考虑将它们绑定到一个结构中,并传递一个指向该结构的指针。这使得函数签名更简单,更容易记住,并且在以后调用时不会出错。它还可以使调用函数速度稍微快一些,因为需要复制到函数堆栈中的东西更少。在实践中,只有在函数被调用数百万或数十亿次时,才会考虑这个问题。如果认为这没有意义,那也无所谓。 + +### 等等,你不是说没有注释吗!?!! + +在 `do_the_needful()` 函数中,我写了一种特殊类型的注释,它被是作为占位符设计的,而不是为了说明代码: + +``` +/* XXX do needful stuff */ +``` + +当你写到这里时,有时你不想停下来编写一些特别复杂的代码,你会之后再写,而不是现在。那就是我留给自己再次回来的地方。我插入一个带有 `XXX` 前缀的注释和一个描述需要做什么的简短注释。之后,当我有更多时间的时候,我会在源代码中寻找 `XXX`。使用什么前缀并不重要,只要确保它不太可能在另一个上下文环境(如函数名或变量)中出现在你代码库里。 + +### 把它们组合在一起 + +好吧,当你编译这个程序后,它*仍然*几乎没有任何作用。但是现在你有了一个坚实的骨架来构建你自己的命令行解析 C 程序。 + +``` +/* main.c - the complete listing */ + +#include +#include +#include +#include +#include +#include +#include + +#define OPTSTR "vi:o:f:h" +#define USAGE_FMT "%s [-v] [-f hexflag] [-i inputfile] [-o outputfile] [-h]" +#define ERR_FOPEN_INPUT "fopen(input, r)" +#define ERR_FOPEN_OUTPUT "fopen(output, w)" +#define ERR_DO_THE_NEEDFUL "do_the_needful blew up" +#define DEFAULT_PROGNAME "george" + +extern int errno; +extern char *optarg; +extern int opterr, optind; + +typedef struct { + int verbose; + uint32_t flags; + FILE *input; + FILE *output; +} options_t; + +int dumb_global_variable = -11; + +void usage(char *progname, int opt); +int do_the_needful(options_t *options); + +int main(int argc, char *argv[]) { + int opt; + options_t options = { 0, 0x0, stdin, stdout }; + + opterr = 0; + + while ((opt = getopt(argc, argv, OPTSTR)) != EOF) + switch(opt) { + case 'i': + if (!(options.input = fopen(optarg, "r")) ){ + perror(ERR_FOPEN_INPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'o': + if (!(options.output = fopen(optarg, "w")) ){ + perror(ERR_FOPEN_OUTPUT); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + break; + + case 'f': + options.flags = (uint32_t )strtoul(optarg, NULL, 16); + break; + + case 'v': + options.verbose += 1; + break; + + case 'h': + default: + usage(basename(argv[0]), opt); + /* NOTREACHED */ + break; + } + + if (do_the_needful(&options) != EXIT_SUCCESS) { + perror(ERR_DO_THE_NEEDFUL); + exit(EXIT_FAILURE); + /* NOTREACHED */ + } + + return EXIT_SUCCESS; +} + +void usage(char *progname, int opt) { + fprintf(stderr, USAGE_FMT, progname?progname:DEFAULT_PROGNAME); + exit(EXIT_FAILURE); + /* NOTREACHED */ +} + +int do_the_needful(options_t *options) { + + if (!options) { + errno = EINVAL; + return EXIT_FAILURE; + } + + if (!options->input || !options->output) { + errno = ENOENT; + return EXIT_FAILURE; + } + + /* XXX do needful stuff */ + + return EXIT_SUCCESS; +} +``` + +现在,你已经准备好编写更易于维护的 C 语言。如果你有任何问题或反馈,请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/how-write-good-c-main-function + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://www.owasp.org/index.php/Null_Dereference +[3]: https://opensource.com/sites/default/files/uploads/hatingotherpeoplescode-big.png (Parody O'Reilly book cover, "Hating Other People's Code") +[4]: https://en.wikipedia.org/wiki/C_preprocessor +[5]: https://linux.die.net/man/3/getopt +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strtoul.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html diff --git a/published/201906/20190529 NVMe on Linux.md b/published/201906/20190529 NVMe on Linux.md new file mode 100644 index 0000000000..374d3ef2f2 --- /dev/null +++ b/published/201906/20190529 NVMe on Linux.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (warmfrog) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10946-1.html) +[#]: subject: (NVMe on Linux) +[#]: via: (https://www.networkworld.com/article/3397006/nvme-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Linux 上的 NVMe +=============== + +> 如果你还没注意到,一些极速的固态磁盘技术已经可以用在 Linux 和其他操作系统上了。 + +![Sandra Henry-Stocker][1] + +NVMe 意即非易失性内存主机控制器接口规范non-volatile memory express,它是一个主机控制器接口和存储协议,用于加速企业和客户端系统以及固态驱动器(SSD)之间的数据传输。它通过电脑的高速 PCIe 总线工作。每当我看到这些名词时,我的感受是“羡慕”。而羡慕的原因很重要。 + +使用 NVMe,数据传输的速度比旋转磁盘快很多。事实上,NVMe 驱动能够比 SATA SSD 快 7 倍。这比我们今天很多人用的固态硬盘快了 7 倍多。这意味着,如果你用一个 NVMe 驱动盘作为启动盘,你的系统能够启动的非常快。事实上,如今任何人买一个新的系统可能都不会考虑那些没有自带 NVMe 的,不管是服务器或者个人电脑。 + +### NVMe 在 Linux 下能工作吗? + +是的!NVMe 自 Linux 内核 3.3 版本就支持了。然而,要升级系统,通常同时需要一个 NVMe 控制器和一个 NVMe 磁盘。一些外置磁盘也行,但是要连接到系统上,需要的可不仅仅是通用的 USB 接口。 + +先使用下列命令检查内核版本: + +``` +$ uname -r +5.0.0-15-generic +``` + +如果你的系统已经用了 NVMe,你将看到一个设备(例如,`/dev/nvme0`),但是只有在你安装了 NVMe 控制器的情况下才显示。如果你没有 NVMe 控制器,你可以用下列命令获取使用 NVMe 的相关信息。 + +``` +$ modinfo nvme | head -6 +filename: /lib/modules/5.0.0-15-generic/kernel/drivers/nvme/host/nvme.ko +version: 1.0 +license: GPL +author: Matthew Wilcox +srcversion: AA383008D5D5895C2E60523 +alias: pci:v0000106Bd00002003sv*sd*bc*sc*i* +``` + +### 了解更多 + +如果你想了解极速的 NVMe 存储的更多细节,可在 [PCWorld][3] 获取。 + +规范、白皮书和其他资源可在 [NVMexpress.org][4] 获取。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397006/nvme-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[warmfrog](https://github.com/warmfrog) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/nvme-100797708-large.jpg +[2]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb +[3]: https://www.pcworld.com/article/2899351/everything-you-need-to-know-about-nvme.html +[4]: https://nvmexpress.org/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190530 A short primer on assemblers, compilers, and interpreters.md b/published/201906/20190530 A short primer on assemblers, compilers, and interpreters.md new file mode 100644 index 0000000000..1c60f1adcc --- /dev/null +++ b/published/201906/20190530 A short primer on assemblers, compilers, and interpreters.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11021-1.html) +[#]: subject: (A short primer on assemblers, compilers, and interpreters) +[#]: via: (https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny) + +浅谈汇编器、编译器和解释器 +====== + +> 简单介绍一下编程方式的历史演变。 + +![](https://img.linux.net.cn/data/attachment/album/201906/26/181309vdouxdfktr344rm4.jpg) + +在计算机诞生不久的早期年代,硬件非常昂贵,而程序员比较廉价。这些廉价程序员甚至都没有“程序员”这个头衔,并且常常是由数学家或者电气工程师来充当这个角色的。早期的计算机被用来快速解决复杂的数学问题,所以数学家天然就适合“编程”工作。 + +### 什么是程序? + +首先来看一点背景知识。计算机自己是做不了任何事情的,它们的任何行为都需要程序来引导。你可以把程序看成是非常精确的菜谱,这种菜谱读取一个输入,然后生成对应的输出。菜谱里的各个步骤由操作数据的指令构成。听上去有点儿复杂,不过你或许知道下面这个语句是什么意思: + +``` +1 + 2 = 3 +``` + +其中的加号是“指令”,而数字 1 和 2 是数据。数学上的等号意味着等式两边的部分是“等价”的,不过在大部分编程语言中对变量使用等号是“赋值”的意思。如果计算机执行上面这个语句,它会把这个加法的结果(也就是“3”)储存在内存中的某个地方。 + +计算机知道如何使用数字进行数学运算,以及如何在内存结构中移动数据。在这里就不对内存进行展开了,你只需要知道内存一般分为两大类:“速度快/空间小”和“速度慢/空间大”。CPU 寄存器的读写速度非常快,但是空间非常小,相当于一个速记便签。主存储器通常有很大的空间,但是读写速度就比寄存器差远了。在程序运行的时候,CPU 不断将它所需要用到的数据从主存储器挪动到寄存器,然后再把结果放回到主存储器。 + +### 汇编器 + +当时的计算机很贵,而人力比较便宜。程序员需要耗费很多时间把手写的数学表达式翻译成计算机可以执行的指令。最初的计算机只有非常糟糕的用户界面,有些甚至只有前面板上的拨动开关。这些开关就代表一个内存“单元”里的一个个 “0” 和 “1”。程序员需要配置一个内存单元,选择好储存位置,然后把这个单元提交到内存里。这是一个既耗时又容易出错的过程。 + +![Programmers operate the ENIAC computer][2] + +*程序员[Betty Jean Jennings][3] (左) 和 [Fran Bilas][4] (右) 在操作 [ENIAC][5] 的主控制面板* + +后来有一名 [电气工程师][6] 认为自己的时间很宝贵,就写了一个程序,能够把人们可以读懂的“菜谱”一样的输入转换成计算机可以读懂的版本。这就是最初的“汇编器”,在当时引起了不小的争议。这些昂贵机器的主人不希望把计算资源浪费在人们已经能做的任务上(虽然又慢又容易出错)。不过随着时间的推移,人们逐渐发现使用汇编器在速度和准确性上都胜于人工编写机器语言,并且计算机完成的“实际工作量”增加了。 + +尽管汇编器相比在机器面板上切换比特的状态已经是很大的进步了,这种编程方式仍然非常专业。上面加法的例子在汇编语言中看起来差不多是这样的: + +``` +01 MOV R0, 1 +02 MOV R1, 2 +03 ADD R0, R1, R2 +04 MOV 64, R0 +05 STO R2, R0 +``` + +每一行都是一个计算机指令,前面是一个指令的简写,后面是指令所操作的数据。这个小小的程序首先会将数值 1 “移动”到寄存器 R0,然后把 2 移动到寄存器 R1。03 行把 R0 和 R1 两个寄存器里的数值相加,然后将结果储存在 R2 寄存器里。最后,04 行和 05 行决定结果应该被放在主存储器里的什么位置(在这里是地址 64)。管理内存中存储数据的位置是编程过程中最耗时也最容易出错的部分之一。 + +### 编译器 + +汇编器已经比手写计算机指令要好太多了,不过早期的程序员还是渴望能够按照他们所习惯的方式,像书写数学公式一样地去写程序。这种需求推动了高级编译语言的发展,其中有一些已经成为历史,另一些如今还在使用。比如 [ALGO][7] 就已经成为历史了,但是像 [Fortran][8] 和 [C][9] 这样的语言仍然在不断解决实际问题。 + +![Genealogy tree of ALGO and Fortran][10] + +*ALGO 和 Fortran 编程语言的谱系树* + +这些“高级”语言使得程序员可以用更简单的方式编写程序。在 C 语言中,我们的加法程序就变成了这样: + +``` +int x; +x = 1 + 2; +``` + +第一个语句描述了该程序将要使用的一块内存。在这个例子中,这块内存应该占一个整数的大小,名字是 `x`。第二个语句是加法,虽然是倒着写的。一个 C 语言的程序员会说这是 “X 被赋值为 1 加 2 的结果”。需要注意的是,程序员并不需要决定在内存的什么位置储存 `x`,这个任务交给编译器了。 + +这种被称为“编译器”的新程序可以把用高级语言写的程序转换成汇编语言,再使用汇编器把汇编语言转换成机器可读的程序。这种程序组合常常被称为“工具链”,因为一个程序的输出就直接成为另一个程序的输入。 + +编译语言相比汇编语言的优势体现在从一台计算机迁移到不同型号或者品牌的另一台计算机上的时候。在计算机的早期岁月里,包括 IBM、DEC、德州仪器、UNIVAC 以及惠普在内的很多公司都在制造除了大量不同类型的计算机硬件。这些计算机除了都需要连接电源之外就没有太多共同点了。它们在内存和 CPU 架构上的差异相当大,当时经常需要人们花费数年来将一台计算机的程序翻译成另一台计算机的程序。 + +有了高级语言,我们只需要把编译器工具链迁移到新的平台就行了。只要有可用的编译器,高级语言写的程序最多只需要经过小幅修改就可以在新的计算机上被重新编译。高级语言的编译是一个真正的革命性成果。 + +![IBM PC XT][11] + +*1983 发布的 IBM PC XT 是硬件价格下降的早期例子。* + +程序员们的生活得到了很好的改善。相比之下,通过高级语言表达他们想要解决的问题让事情变得轻松很多。由于半导体技术的进步以及集成芯片的发明,计算机硬件的价格急剧下降。计算机的速度越来越快,能力也越来越强,并且还便宜了很多。从某个时间点往后(也许是 80 年代末期吧),事情发生了反转,程序员变得比他们所使用的硬件更值钱了。 + +### 解释器 + +随着时间的推移,一种新的编程方式兴起了。一种被称为“解释器”的特殊程序可以直接读取一个程序将其转换成计算机指令以立即执行。和编译器差不多,解释器读取程序并将它转换成一个中间形态。但和编译器不同的是,解释器直接执行程序的这个中间形态。解释型语言在每一次执行的时候都要经历这个过程;而编译程序只需要编译一次,之后计算机每次只需要执行编译好的机器指令就可以了。 + +顺便说一句,这个特性就是导致人们感觉解释型程序运行得比较慢的原因。不过现代计算机的性能出奇地强大,以至于大多数人无法区分编译型程序和解释型程序。 + +解释型程序(有时也被成为“脚本”)甚至更容易被移植到不同的硬件平台上。因为脚本并不包含任何机器特有的指令,同一个版本的程序可以不经过任何修改就直接在很多不同的计算机上运行。不过当然了,解释器必须得先移植到新的机器上才行。 + +一个很流行的解释型语言是 [perl][12]。用 perl 完整地表达我们的加法问题会是这样的: + +``` +$x = 1 + 2 +``` + +虽然这个程序看起来和 C 语言的版本差不多,运行上也没有太大区别,但却缺少了初始化变量的语句。其实还有一些其它的区别(超出这篇文章的范围了),但你应该已经注意到,我们写计算机程序的方式已经和数学家用纸笔手写数学表达式非常接近了。 + +### 虚拟机 + +最新潮的编程方式要数虚拟机(经常简称 VM)了。虚拟机分为两大类:系统虚拟机和进程虚拟机。这两种虚拟机都提供一种对“真实的”计算硬件的不同级别的抽象,不过它们的作用域不同。系统虚拟机是一个提供物理硬件的替代品的软件,而进程虚拟机则被设计用来以一种“系统独立”的方式执行程序。所以在这个例子里,进程虚拟机(往后我所说的虚拟机都是指这个类型)的作用域和解释器的比较类似,因为也是先将程序编译成一个中间形态,然后虚拟机再执行这个中间形态。 + +虚拟机和解释器的主要区别在于,虚拟机创造了一个虚拟的 CPU,以及一套虚拟的指令集。有了这层抽象,我们就可以编写前端工具来把不同语言的程序编译成虚拟机可以接受的程序了。也许最流行也最知名的虚拟机就是 Java 虚拟机(JVM)了。JVM 最初在 1990 年代只支持 Java 语言,但是如今却可以运行 [许多][13] 流行的编程语言,包括 Scala、Jython、JRuby、Clojure,以及 Kotlin 等等。还有其它一些不太常见的例子,在这里就不说了。我也是最近才知道,我最喜欢的语言 Python 并不是一个解释型语言,而是一个 [运行在虚拟机上的语言][15]! + +虚拟机仍然在延续这样一个历史趋势:让程序员在使用特定领域的编程语言解决问题的时候,所需要的对特定计算平台的了解变得越来越少了。 + +### 就是这样了 + +希望你喜欢这篇简单介绍软件背后运行原理的短文。有什么其它话题是你想让我接下来讨论的吗?在评论里告诉我吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/primer-assemblers-compilers-interpreters + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny/users/shawnhcorey/users/jnyjny/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (keyboard with connected dots) +[2]: https://opensource.com/sites/default/files/uploads/two_women_operating_eniac.gif (Programmers operate the ENIAC computer) +[3]: https://en.wikipedia.org/wiki/Jean_Bartik (Jean Bartik) +[4]: https://en.wikipedia.org/wiki/Frances_Spence (Frances Spence) +[5]: https://en.wikipedia.org/wiki/ENIAC +[6]: https://en.wikipedia.org/wiki/Nathaniel_Rochester_%28computer_scientist%29 +[7]: https://en.wikipedia.org/wiki/ALGO +[8]: https://en.wikipedia.org/wiki/Fortran +[9]: https://en.wikipedia.org/wiki/C_(programming_language) +[10]: https://opensource.com/sites/default/files/uploads/algolfortran_family-by-borkowski.png (Genealogy tree of ALGO and Fortran) +[11]: https://opensource.com/sites/default/files/uploads/639px-ibm_px_xt_color.jpg (IBM PC XT) +[12]: www.perl.org +[13]: https://en.wikipedia.org/wiki/List_of_JVM_languages +[14]: /resources/python +[15]: https://opensource.com/article/18/4/introduction-python-bytecode +[16]: https://pybit.es/python-interpreters.html diff --git a/published/201906/20190531 Learn Python with these awesome resources.md b/published/201906/20190531 Learn Python with these awesome resources.md new file mode 100644 index 0000000000..80aaa801f4 --- /dev/null +++ b/published/201906/20190531 Learn Python with these awesome resources.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (tomjlw) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11015-1.html) +[#]: subject: (Learn Python with these awesome resources) +[#]: via: (https://opensource.com/article/19/5/resources-learning-python) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +学习 Python 的精品 PLN 资源 +====== + +> 通过将这些资源加入你自己的私人学习网络以拓展 Python 知识。 + +![](https://img.linux.net.cn/data/attachment/album/201906/25/002706hrx0d3dfrxeid3nj.jpg) + +我使用和教授 Python 已有很长时间了,但我总是乐于增加我对这门实用语言的知识。这就是为什么我一直试着拓展我的 Python [个人学习网络][2]personal learning network(PLN),这是一个描述用于分享信息的非正式的互惠型网络的概念。 + +教育学家 [Kelly Paredes][3] 和 [Sean Tibor][4] 最近在他们的播客 [Teaching Python][5] 上谈到了如何搭建 Python PLN。我在克里夫兰的 [PyCon 2019][6] 遇到他们之后就订阅了这个频道(并把它们加入到我的 Python PLN 当中)。这个播客激发了我对 Python PLN 中的人的思考,包括那些我最近在 PyCon 遇到的人们。 + +我会分享一些我找到 PLN 成员的地方;可能它们也可以变成你的 Python PLN 的一部分。 + +### Young Coders 导师 + +Python 基金会的活动协调者 [Betsy Waliszewski][7] 是我的 Python PLN 中的一员。当我们在 PyCon2019 见到时,因为我是个老师,她推荐我看看为十二岁及以上的孩子打造的 [Young Coders][8] 工作室。在那我遇到了正在负责这个计划的 [Katie Cunningham][9],它会教参与者如何搭建和配置树莓派并使用 Python 项目。年轻学生也会收到两本书 Jason Briggs 的 《[Python for Kids][10]》 和 Craig Richardson 的 《[Learn to Program with Minecraft][11]》。我一直寻找提升我教学水平的新方式,因此我在该会议上的 [NoStarch Press][12] 展台迅速拿到了两本 Minecraft 书。Katie 是一名优秀的教师,也是一名多产作家,拥有一个充满 Python 培训视频的 [YouTube][13] 精彩频道。 + +我把 Kattie 与我在 Young Coders 工作室碰到的另外两个人加入我的 PLN:[Nat Dunn][14] 和 [Sean Valentine][15]。像 Katie 一样,他们自愿花时间把 Python 介绍给青年程序员们。Nat 是 [Webucator][16] 的总裁,这是一家 IT 培训公司,多年来一直是 Python 软件基金会赞助商,并赞助了 PyCon 2018 教育峰会。在将 Python 教他 13 岁的儿子和 14 岁的侄子之后,他决定在 Young Coders 任教。Sean 是 [Hidden Genius 项目][17] 的战略计划总监,这是一个针对黑人男性青年的技术及领导力打造的教导项目。Sean 说许多 Hidden Genius 参与者“用 Python 打造项目因此我们认为 [Young Coders] 是一个很好的合作机会”。了解 Hidden Genius 项目激发了我更深层次地思考编程的未来以及其改变生活的威力。 + +### Open Spaces 聚会 + +我发现 PyCon 的 [Open Spaces][18] —— 这是一个一小时左右的自组织的即兴聚会 —— 跟正式的项目活动一样有用。我的最爱之一是 [Circuit Playground Express][19] 设备,它是我们会议主题包的一部分。我很喜欢这个设备,并且 Open Space 提供了学习它的一条大道。组织者提供了工作表和一个 [Github][20] 仓库,其中包含有我们成功所需要的所有工具,也提供了一个上手实践的机会以及探索这个独特硬件的方向。 + +这次会面激起了了我对学习 Circuit Playground Express 更新信息的兴趣,因此在 PyCon 之后, 我在 Twitter 上接触到了在会议上就该设备编程发表主旨演讲的 [Nina Zakharenko][21]。Nina 自从去年秋天我在 [All Things Open][23] 上听过她的演讲后就在我的 Python PLN 里了。我最近报名参加了她的 [Python 基础][24]课程以加深我的学习。Nina 推荐我将 [Kattni Rembor][25] 加入我的 Python PLN。他的[示例代码][26]正帮助我学习用 CircuitPython 编程。 + +### 我的 PLN 中的其他资源 + +我在 PyCon 2019 也遇见了 [Opensource.com][27] 社区版主 [Moshe Zadka][28],并和他来了场长谈。他分享了几个新的 Python 资源,包括 [如何像电脑科学家一样思考][29]。社区版主 [Seth Kenlon][30] 是我的 PLN 中的另一名成员;他发表了许多优秀的 [Python 文章][31],我也推荐你关注他。 + +我的 Python PLN 每天都在持续扩大。除了我已经提到的,我同样推荐你关注 [Al Sweigart][32]、[Eric Matthes][33] 以及 [Adafruit][34]他们分享的优质内容。我也推荐这本书《[制作:由 Adafruit Circuit Playground Express 开始][35]》和《[Podcast.\_\_init\_\_][36]》,这是一个关于 Python 社区的播客。这两个都是我从我的 PLN 中了解到的。 + +谁在你的 Python PLN 中?请在留言区分享你的最爱。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/resources-learning-python + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[tomjlw](https://github.com/tomjlw) +校对:[wxy](https://github.com/wxy) + +本文由 [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/reading_book_stars_list.png?itok=Iwa1oBOl (Book list, favorites) +[2]: https://en.wikipedia.org/wiki/Personal_learning_network +[3]: https://www.teachingpython.fm/hosts/kellypared +[4]: https://twitter.com/smtibor +[5]: https://www.teachingpython.fm/20 +[6]: https://us.pycon.org/2019/ +[7]: https://www.linkedin.com/in/betsywaliszewski +[8]: https://us.pycon.org/2019/events/letslearnpython/ +[9]: https://www.linkedin.com/in/kcunning/ +[10]: https://nostarch.com/pythonforkids +[11]: https://nostarch.com/programwithminecraft +[12]: https://nostarch.com/ +[13]: https://www.youtube.com/c/KatieCunningham +[14]: https://www.linkedin.com/in/natdunn/ +[15]: https://www.linkedin.com/in/sean-valentine-b370349b/ +[16]: https://www.webucator.com/ +[17]: http://www.hiddengeniusproject.org/ +[18]: https://us.pycon.org/2019/events/open-spaces/ +[19]: https://www.adafruit.com/product/3333 +[20]: https://github.com/adafruit/PyCon2019 +[21]: https://twitter.com/nnja +[22]: https://www.youtube.com/watch?v=35mXD40SvXM +[23]: https://allthingsopen.org/ +[24]: https://frontendmasters.com/courses/python/ +[25]: https://twitter.com/kattni +[26]: https://github.com/kattni/ChiPy_2018 +[27]: http://Opensource.com +[28]: https://opensource.com/users/moshez +[29]: http://openbookproject.net/thinkcs/python/english3e/ +[30]: https://opensource.com/users/seth +[31]: https://www.google.com/search?source=hp&ei=gVToXPq-FYXGsAW-mZ_YAw&q=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&oq=site%3Aopensource.com+%22Seth+Kenlon%22+%2B+Python&gs_l=psy-ab.12...627.15303..15584...1.0..0.176.2802.4j21......0....1..gws-wiz.....0..35i39j0j0i131j0i67j0i20i263.r2SAW3dxlB4 +[32]: http://alsweigart.com/ +[33]: https://twitter.com/ehmatthes?lang=en +[34]: https://twitter.com/adafruit +[35]: https://www.adafruit.com/product/3944 +[36]: https://www.pythonpodcast.com/episodes/ diff --git a/published/201906/20190531 Unity Editor is Now Officially Available for Linux.md b/published/201906/20190531 Unity Editor is Now Officially Available for Linux.md new file mode 100644 index 0000000000..7b579caf06 --- /dev/null +++ b/published/201906/20190531 Unity Editor is Now Officially Available for Linux.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10974-1.html) +[#]: subject: (Unity Editor is Now Officially Available for Linux) +[#]: via: (https://itsfoss.com/unity-editor-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Unity 编辑器现已正式面向 Linux 推出 +====== + +如果你是设计师、开发者或艺术家,你可能一直在使用 Linux 上的实验性 [Unity 编辑器][1]。然而,不能一直用实验性版本 —— 开发者需要一个完整稳定的工作经验。 + +因此,他们最近宣布你可以在 Linux 上使用完整功能的 Unity 编辑器了。 + +虽然这是一个令人兴奋的消息,但它正式支持哪些 Linux 发行版?我们来谈谈更多细节…… + +> 非 FOSS 警告 + +> Linux (或任何其他平台)上的 Unity 编辑器不是开源软件。我们在这里介绍它是因为: + +### 官方支持 Ubuntu 和 CentOS 7 + +![][2] + +无论你拥有个人许可还是专业许可,如果你安装了 Unity 2019.1 或更高版本,都可以使用该编辑器。 + +此外,他们优先支持 Ubuntu 16.04、Ubuntu 18.04 和 CentOS 7。 + +在[公告][3]中,他们还提到了支持的配置: + +* x86-64 架构 +* 运行在 X11 窗口系统之上的 Gnome 桌面环境 +* Nvidia 官方专有显卡驱动和 AMD Mesa 显卡驱动 +* 桌面计算机,在没有仿真或兼容层的设备/硬件上运行 + +你可以尝试其他的 —— 但最好坚持官方要求以获得最佳体验。 + +> 关于第三方工具的说明 + +> 如果你碰巧在某个项目中使用了任何第三方工具,那么必须单独检查它们是否支持。 + +### 如何在 Linux 上安装 Unity 编辑器 + +现在你已经了解了,那么该如何安装? + +要安装 Unity,你需要下载并安装 [Unity Hub][4]。 + +![Unity Hub][5] + +你需要完成以下步骤: + +* 从[官方论坛页面][4]下载适用于 Linux 的 Unity Hub。 +* 它将下载一个 AppImage 文件。简单地说,让它可执行并运行它。如果你不了解,你应该查看关于[如何在 Linux 上使用 AppImage][6] 的指南。 +* 启动 Unity Hub 后,它会要求你使用 Unity ID 登录(或注册)以激活许可证。有关许可证生效的更多信息,请参阅他们的 [FAQ 页面][7]。 +* 使用 Unity ID 登录后,进入 “Installs” 选项(如上图所示)并添加所需的版本/组件。 + +就是这些了。这就是获取并快速安装的最佳方法。 + +### 总结 + +即使这是一个令人兴奋的消息,但官方配置支持似乎并不广泛。如果你在 Linux 上使用它,请在[他们的 Linux 论坛帖子][9]上分享你的反馈和意见。 + +你觉得怎么样?此外,你是使用 Unity Hub 安装它,还是有更好的方法来安装? + +请在下面的评论中告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/unity-editor-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://unity3d.com/unity/editor +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/Unity-Editor-on-Linux.png?resize=800%2C450&ssl=1 +[3]: https://blogs.unity3d.com/2019/05/30/announcing-the-unity-editor-for-linux/ +[4]: https://forum.unity.com/threads/unity-hub-v-1-6-0-is-now-available.640792/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/unity-hub.jpg?fit=800%2C532&ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://support.unity3d.com/hc/en-us/categories/201268913-Licenses +[9]: https://forum.unity.com/forums/linux-editor.93/ diff --git a/published/201906/20190531 Why translation platforms matter.md b/published/201906/20190531 Why translation platforms matter.md new file mode 100644 index 0000000000..92cdbb20b1 --- /dev/null +++ b/published/201906/20190531 Why translation platforms matter.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10953-1.html) +[#]: subject: (Why translation platforms matter) +[#]: via: (https://opensource.com/article/19/5/translation-platforms) +[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/annegentle/users/bcotton) + +什么是翻译平台最重要的地方? +====== + +> 技术上的考虑并不是判断一个好的翻译平台的最佳方式。 + +![](https://img.linux.net.cn/data/attachment/album/201906/09/112224nvvkrv16qv60vwpv.jpg) + +语言翻译可以使开源软件能够被世界各地的人们使用,这是非开发人员参与他们喜欢的(开源)项目的好方法。有许多[翻译工具][2],你可以根据他们处理翻译中涉及的主要功能区域的能力来评估:技术交互能力、团队支持能力和翻译支持能力。 + +技术交互方面包括: + +* 支持的文件格式 +* 与开源存储库的同步 +* 自动化支持工具 +* 接口可能性 + +对团队合作(也可称为“社区活力”)的支持包括该平台如何: + +* 监控变更(按译者、项目等) +* 跟进由项目推动的更新 +* 显示进度状态 +* 是否启用审核和验证步骤 +* 协助(来自同一团队和跨语言的)翻译人员和项目维护人员之间的讨论 +* 平台支持的全球通讯(新闻等) + +翻译协助包括: + +* 清晰、符合人体工程学的界面 +* 简单几步就可以找到项目并开始工作 +* 可以简单地了解到翻译和分发之间流程 +* 可以使用翻译记忆机 +* 词汇表丰富 + +前两个功能区域与源代码管理平台的差别不大,只有一些小的差别。我觉得最后一个区域也主要与源代码有关。但是,它们处理的数据非常不同,翻译平台的用户通常也不如开发人员了解技术,而数量也更多。 + +### 我的推荐 + +在我看来,GNOME 平台提供了最好的翻译平台,原因如下: + +* 其网站包含了团队组织和翻译平台。很容易看出谁在负责以及他们在团队中的角色。一切都集中在几个屏幕之内。 +* 很容易找到要处理的内容,并且你会很快意识到你必须将文件下载到本地计算机并在修改后将其发回。这个流程不是很先进,但逻辑很容易理解。 +* 一旦你发回文件,平台就可以向邮件列表发送通告,以便团队知道后续步骤,并且可以全局轻松讨论翻译(而不是评论特定句子)。 +* 它支持多达 297 种语言。 +* 它显示了基本句子、高级菜单和文档的明确的进度百分比。 +   +再加上可预测的 GNOME 发布计划,社区可以使用一切可以促进社区工作的工具。 + +如果我们看看 Debian 翻译团队,他们多年来一直在为 Debian (LCTT 译注:此处原文是“Fedora”,疑为笔误)翻译了难以想象的大量内容(尤其是新闻),我们看到他们有一个高度以来于规则的翻译流程,完全基于电子邮件,手动推送到存储库。该团队还将所有内容都放在流程中,而不是工具中,尽管这似乎需要相当大的技术能力,但它已成为领先的语言群体之一,已经运作多年。 + +我认为,成功的翻译平台的主要问题不是基于单一的(技术、翻译)工作的能力,而是基于如何构建和支持翻译团队的流程。这就是可持续性的原因。 + +生产过程是构建团队最重要的方式;通过正确地将它们组合在一起,新手很容易理解该过程是如何工作的,采用它们,并将它们解释给下一组新人。 + +要建立一个可持续发展的社区,首先要考虑的是支持协同工作的工具,然后是可用性。 + +这解释了我为什么对 [Zanata][3] 工具沮丧,从技术和界面的角度来看,这是有效的,但在帮助构建社区方面却很差。我认为翻译是一个社区驱动的过程(可能是开源软件开发中最受社区驱动的过程之一),这对我来说是一个关键问题。 + +* * * + +本文改编自“[什么是一个好的翻译平台?][4]”,最初发表在 Jibec 期刊上,并经许可重复使用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/translation-platforms + +作者:[Jean-Baptiste Holcroft][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/jibec/users/annegentle/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel +[2]: https://opensource.com/article/17/6/open-source-localization-tools +[3]: http://zanata.org/ +[4]: https://jibecfed.fedorapeople.org/blog-hugo/en/2016/09/whats-a-good-translation-platform/ diff --git a/published/201906/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md b/published/201906/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md new file mode 100644 index 0000000000..4c28227f63 --- /dev/null +++ b/published/201906/20190604 How To Verify NTP Setup (Sync) is Working or Not In Linux.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10951-1.html) +[#]: subject: (How To Verify NTP Setup (Sync) is Working or Not In Linux?) +[#]: via: (https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +如何在 Linux 下确认 NTP 是否同步? +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/08/215622oqdhiuhocsndijlu.jpg) + +NTP 意即网络时间协议Network Time Protocol,它通过网络同步计算机系统之间的时钟。NTP 服务器可以使组织中的所有服务器保持同步,以准确时间执行基于时间的作业。NTP 客户端会将其时钟与 NTP 服务器同步。 + +我们已经写了一篇关于 NTP 服务器和客户端安装和配置的文章。如果你想查看这些文章,请导航至以下链接。 + + * [如何在 Linux 上安装、配置 NTP 服务器和客户端?][1] + * [如何安装和配置 Chrony 作为 NTP 客户端?][2] + +我假设我你经使用上述链接设置了 NTP 服务器和 NTP 客户端。现在,如何验证 NTP 设置是否正常工作? + +Linux 中有三个命令可用于验证 NTP 同步情况。详情如下。在本文中,我们将告诉您如何使用所有这些命令验证 NTP 同步。 + + * `ntpq`:ntpq 是一个标准的 NTP 查询程序。 + * `ntpstat`:显示网络世界同步状态。 + * `timedatectl`:它控制 systemd 系统中的系统时间和日期。 + +### 方法 1:如何使用 ntpq 命令检查 NTP 状态? + +`ntpq` 实用程序用于监视 NTP 守护程序 `ntpd` 的操作并确定性能。 + +该程序可以以交互模式运行,也可以使用命令行参数进行控制。它通过向服务器发送多个查询来打印出连接的对等项列表。如果 NTP 正常工作,你将获得类似于下面的输出。 + +``` +# ntpq -p + + remote refid st t when poll reach delay offset jitter +============================================================================== +*CentOS7.2daygee 133.243.238.163 2 u 14 64 37 0.686 0.151 16.432 +``` + +细节: + +* `-p`:打印服务器已知的对等项列表以及其状态摘要。 + +### 方法 2:如何使用 ntpstat 命令检查 NTP 状态? + +`ntpstat` 将报告在本地计算机上运行的 NTP 守护程序(`ntpd`)的同步状态。如果发现本地系统与参考时间源保持同步,则 `ntpstat` 将报告大致的时间精度。 + +`ntpstat` 命令根据 NTP 同步状态返回三种状态码。详情如下。 + +* `0`:如果时钟同步则返回 0。 +* `1`:如果时钟不同步则返回 1。 +* `2`:如果时钟状态不确定,则返回 2,例如 ntpd 不可联系时。 + +``` +# ntpstat + +synchronised to NTP server (192.168.1.8) at stratum 3 + time correct to within 508 ms + polling server every 64 s +``` + +### 方法 3:如何使用 timedatectl 命令检查 NTP 状态? + +[timedatectl 命令][3]用于查询和更改系统时钟及其在 systmed 系统中的设置。 + +``` +# timedatectl +或 +# timedatectl status + + Local time: Thu 2019-05-30 05:01:05 CDT + Universal time: Thu 2019-05-30 10:01:05 UTC + RTC time: Thu 2019-05-30 10:01:05 + Time zone: America/Chicago (CDT, -0500) + NTP enabled: yes +NTP synchronized: yes + RTC in local TZ: no + DST active: yes + Last DST change: DST began at + Sun 2019-03-10 01:59:59 CST + Sun 2019-03-10 03:00:00 CDT + Next DST change: DST ends (the clock jumps one hour backwards) at + Sun 2019-11-03 01:59:59 CDT + Sun 2019-11-03 01:00:00 CST +``` + +### 更多技巧 + +Chrony 是一个 NTP 客户端的替代品。它可以更快地同步系统时钟,时间精度更高,对于一直不在线的系统尤其有用。 + +chronyd 较小,它使用较少的内存,只在必要时才唤醒 CPU,这样可以更好地节省电能。即使网络拥塞较长时间,它也能很好地运行。 + +你可以使用以下任何命令来检查 Chrony 状态。 + +检查 Chrony 跟踪状态。 + +``` +# chronyc tracking + +Reference ID : C0A80105 (CentOS7.2daygeek.com) +Stratum : 3 +Ref time (UTC) : Thu Mar 28 05:57:27 2019 +System time : 0.000002545 seconds slow of NTP time +Last offset : +0.001194361 seconds +RMS offset : 0.001194361 seconds +Frequency : 1.650 ppm fast +Residual freq : +184.101 ppm +Skew : 2.962 ppm +Root delay : 0.107966967 seconds +Root dispersion : 1.060455322 seconds +Update interval : 2.0 seconds +Leap status : Normal +``` + +运行 `sources` 命令以显示有关当前时间源的信息。 + +``` +# chronyc sources + +210 Number of sources = 1 +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* CentOS7.2daygeek.com 2 6 17 62 +36us[+1230us] +/- 1111ms +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-verify-ntp-sync-is-working-or-not-in-linux-using-ntpq-ntpstat-timedatectl/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10811-1.html +[2]: https://linux.cn/article-10820-1.html +[3]: https://www.2daygeek.com/change-set-time-date-and-timezone-on-linux/ diff --git a/published/201906/20190604 Kubernetes is a dump truck- Here-s why.md b/published/201906/20190604 Kubernetes is a dump truck- Here-s why.md new file mode 100644 index 0000000000..b8f0930300 --- /dev/null +++ b/published/201906/20190604 Kubernetes is a dump truck- Here-s why.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11011-1.html) +[#]: subject: (Kubernetes is a dump truck: Here's why) +[#]: via: (https://opensource.com/article/19/6/kubernetes-dump-truck) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +为什么说 Kubernetes 是一辆翻斗车 +====== + +> 翻斗车是解决各种基本业务问题的优雅解决方案。 + +![](https://img.linux.net.cn/data/attachment/album/201906/24/012846v737bts00uwk3qd7.jpg) + +这篇文章写于 Kubernetes 的生日(6 月 7 日星期五)前夕。 + +翻斗车很优雅。说真的,不信你听我说。它们以优雅的方式解决了各种各样的技术问题。它们可以搬动泥土、砾石、岩石、煤炭、建筑材料或道路上的障碍。它们甚至可以拉动拖车及它们上面的其他重型设备。你可以给一辆翻斗车装上五吨泥土,然后自驾游遍全国。对于像我这样的电脑极客来说,那就是优雅。 + +但是,它们并不容易使用。驾驶翻斗车需要特殊的驾驶执照。它们也不容易装配和维护。购买翻斗车和各种维护时要做很多选择。但是,它们可以优雅的搬动那些垃圾。 + +你知道搬动垃圾有什么不优雅的地方吗?假如你有一款新型的紧凑型轿车,它们到处可以买到,易于驾驶、更易于维护。但是,用它们来装泥土就很糟糕。这需要跑 200 趟才能运走 5 吨垃圾,而且,之后没人再会想要这辆车了。 + +好吧,你可以买一辆出售的翻斗车,而不是想自己造一辆。但是我不同,我是个极客,我喜欢自己造东西。但…… + +如果你拥有一家建筑公司,你就不会想着自己造一辆翻斗车。你肯定不会维持一条供应链来重构翻斗车(这可是一条很大的供应链)。但你可以学会驾驶一辆。 + +好吧,我的这个比喻很粗糙,但很容易理解。易用性是相对的,易于维护是相对的,易于装配也是相对的。这实际上取决于你想要做什么。[Kubernetes][2] 也不例外。 + +一次性构建 Kubernetes 并不太难。配置好 Kubernetes 呢?好吧,这稍微难一些。你如何看待 KubeCon?它们又宣布了多少新项目?哪些是“真实的”呢?而你应该学习哪些?你对 Harbour、TikV、NATD、Vitess,开放策略代理有多深入的了解?更不用说 Envoy、eBPF 和 Linux 中的一系列底层技术?这就像是 1904 年工业革命爆发时建造翻斗车一样,你要弄清楚使用的螺钉、螺栓、金属和活塞。(有没有蒸汽朋克在这里吗?) + +像翻斗车一样构造和配置 Kubernetes 是一个技术问题,如果你从事金融服务、零售、生物研究、食品服务等等,这可能不是你应该做的事情。但是,学习如何驾驶 Kubernetes 肯定是你应该学习的东西。 + +Kubernetes 就像一辆翻斗车,因其可以解决的各种技术问题(以及它所拖带的生态系统)而优雅。所以,我会给你一句引用的话,这是我的一位计算机科学教授在我大学的第一年告诉我们的,她说,“有一天,你会看到一段代码并对自己说,‘真特么优雅!’” + +Kubernetes 很优雅。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-dump-truck + +作者:[Scott McCarty][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/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dump_truck_car_container_kubernetes.jpg?itok=4BdmyVGd (Dump truck with kids standing in the foreground) +[2]: https://kubernetes.io/ diff --git a/published/201906/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md b/published/201906/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md new file mode 100644 index 0000000000..97cb82380d --- /dev/null +++ b/published/201906/20190604 Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10960-1.html) +[#]: subject: (Two Methods To Check Or List Installed Security Updates on Redhat (RHEL) And CentOS System) +[#]: via: (https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +在 RHEL 和 CentOS 上检查或列出已安装的安全更新的两种方法 +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/11/100735bdnjzkkmjbxbttmm.jpg) + +我们过去曾写过两篇关于这个主题的文章,每篇文章都是根据不同的要求发表的。如果你想在开始之前浏览这些文章。请通过以下链接: + +* [如何检查 RHEL 和 CentOS 上的可用安全更新?][1] +* [在 RHEL 和 CentOS 上安装安全更新的四种方法?][2] + +这些文章与其他文章相互关联,因此,在深入研究之前,最好先阅读这些文章。 + +在本文中,我们将向你展示如何检查已安装的安全更新。我会介绍两种方法,你可以选择最适合你的。 + +此外,我还添加了一个小的 shell 脚本,它为你提供已安装的安全包计数。 + +运行以下命令获取系统上已安装的安全更新的列表。 + +``` +# yum updateinfo list security installed + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, + : subscription-manager, verify, versionlock +RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64 +RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64 +RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64 +RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64 +RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 +RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 +``` + +要计算已安装的安全包的数量,请运行以下命令: + +``` +# yum updateinfo list security installed | wc -l +1046 +``` + +仅打印安装包列表: + +``` +# yum updateinfo list security all | grep -w "i" + +i RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-bluetooth-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-bluetooth-1:1.8.0-9.el7.x86_64 +i RHSA-2015:2315 Moderate/Sec. NetworkManager-config-server-1:1.0.6-27.el7.x86_64 +i RHSA-2016:2581 Low/Sec. NetworkManager-config-server-1:1.4.0-12.el7.x86_64 +i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarch +``` + +要计算已安装的安全包的数量,请运行以下命令: + +``` +# yum updateinfo list security all | grep -w "i" | wc -l +1043 +``` + +或者,你可以检查指定包修复的漏洞列表。 + +在此例中,我们将检查 “openssh” 包中已修复的漏洞列表: + +``` +# rpm -q --changelog openssh | grep -i CVE + +- Fix for CVE-2017-15906 (#1517226) +- CVE-2015-8325: privilege escalation via user's PAM environment and UseLogin=yes (#1329191) +- CVE-2016-1908: possible fallback from untrusted to trusted X11 forwarding (#1298741) +- CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819) +- prevents CVE-2016-0777 and CVE-2016-0778 +- Security fixes released with openssh-6.9 (CVE-2015-5352) (#1247864) +- only query each keyboard-interactive device once (CVE-2015-5600) (#1245971) +- add new option GSSAPIEnablek5users and disable using ~/.k5users by default CVE-2014-9278 +- prevent a server from skipping SSHFP lookup - CVE-2014-2653 (#1081338) +- change default value of MaxStartups - CVE-2010-5107 (#908707) +- CVE-2010-4755 +- merged cve-2007_3102 to audit patch +- fixed audit log injection problem (CVE-2007-3102) +- CVE-2006-5794 - properly detect failed key verify in monitor (#214641) +- CVE-2006-4924 - prevent DoS on deattack detector (#207957) +- CVE-2006-5051 - don't call cleanups from signal handler (#208459) +- use fork+exec instead of system in scp - CVE-2006-0225 (#168167) +``` + +同样,你可以通过运行以下命令来检查相应的包中是否修复了指定的漏洞: + +``` +# rpm -q --changelog openssh | grep -i CVE-2016-3115 + +- CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819) +``` + +### 如何使用 Shell 脚本计算安装的安全包? + +我添加了一个小的 shell 脚本,它可以帮助你计算已安装的安全包列表。 + +``` +# vi /opt/scripts/security-check.sh + +#!/bin/bash +echo "+-------------------------+" +echo "|Security Advisories Count|" +echo "+-------------------------+" +for i in Important Moderate Low +do +sec=$(yum updateinfo list security installed | grep $i | wc -l) +echo "$i: $sec" +done | column -t +echo "+-------------------------+" +``` + +给 `security-check.sh` 文件执行权限。 + +``` +$ chmod +x security-check.sh +``` + +最后执行脚本统计。 + +``` +# sh /opt/scripts/security-check.sh + ++-------------------------+ +|Security Advisories Count| ++-------------------------+ +Important: 480 +Moderate: 410 +Low: 111 ++-------------------------+ +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://linux.cn/article-10938-1.html +[2]: https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/ diff --git a/published/201906/20190605 How to navigate the Kubernetes learning curve.md b/published/201906/20190605 How to navigate the Kubernetes learning curve.md new file mode 100644 index 0000000000..74c3187b50 --- /dev/null +++ b/published/201906/20190605 How to navigate the Kubernetes learning curve.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11026-1.html) +[#]: subject: (How to navigate the Kubernetes learning curve) +[#]: via: (https://opensource.com/article/19/6/kubernetes-learning-curve) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux) + +如何跨越 Kubernetes 学习曲线 +====== + +> Kubernetes 就像一辆翻斗车。它非常适合解决它所针对的问题,但你必须首先掌握其学习曲线。 + +![](https://img.linux.net.cn/data/attachment/album/201906/28/131501h8vydvd4tyx5gz5t.jpg) + +在[为什么说 Kubernetes 是一辆翻斗车][2]中,我谈到了一个工具如何优雅地解决它所设计用来解决的问题 —— 只是你要学会如何使用它。在本系列的第 2 部分中,我将更深入地了解 Kubernetes 的学习曲线。 + +[Kubernetes][3] 的旅程通常从在一台主机上运行一个容器开始。你可以快速了解运行新版本软件的难易程度,与其他人分享该软件的难易程度,以及对于这些用户按照你预期方式运行它的难易程度。 + +但是你需要: + +* 两个容器 +* 两个主机 + +使用容器在端口 80 上启动一个 Web 服务器很容易,但是当你需要在端口 80 上启动第二个容器时会发生什么?当你构建生产环境时,需要容器化 Web 服务器在发生故障时转移到第二个主机时会发生什么?在任何一种情况下,这个答案简单来说就是你必须采用容器编排。 + +当你开始处理两个容器或两个主机问题时,你将不可避免地引入了复杂性,因此,这就是一个学习曲线。这个两个服务(容器的更通用说法)或两个主机的问题已经存在了很长时间,并且由此带来了复杂性。 + +从历史上看,这将涉及负载均衡、集群软件甚至集群文件系统。每个服务的配置逻辑都嵌入在每个系统(负载均衡、集群软件和文件系统)中。在负载平衡器后运行 60 或 70 个集群的服务是复杂的。添加另一个新服务也很复杂。更糟糕的是,撤下服务简直是一场噩梦。回想起我对生产环境中的 MySQL 和 Apache 服务器进行故障排除的日子,这些服务器的逻辑嵌入在三、四个或五个不同的地方,所有这些都采用不同的格式,让我头疼不已。 + +Kubernetes 使用一个软件优雅地解决了所有这些问题: + +1. 两项服务(容器):✅ +2. 两台服务器(高可用性):✅ +3. 单一配置来源:✅ +4. 标准配置格式:✅ +5. 网络:✅ +6. 储存:✅ +7. 依赖关系(什么服务与哪些数据库对应):✅ +8. 易于配置:✅ +9. 轻松取消配置:✅(也许是 Kubernetes **最**强大的部分) + +等等,这样初看起来 Kubernetes 非常优雅、非常强大。 **没错。**你可以在 Kubernetes 中建模一整个微型 IT 世界。 + +![Kubernetes business model][4] + +所以,是的,就像开始使用巨型翻斗车(或任何专业设备)时,有一个学习曲线。使用 Kubernetes 还有一个学习曲线,但它值得,因为你可以用一个工具解决这么多问题。如果你对学习曲线感到担忧,请仔细考虑 IT 基础架构中的所有底层网络、存储和安全问题,并设想一下今天的解决方案 —— 这并不容易。特别是当你越来越快地引入越来越多的服务时。速度是当今的目标,因此要特别考虑配置和取消配置问题。 + +但是,不要混淆了建造或配置 Kubernetes 的学习曲线(为你的翻斗车挑选合适的挡泥板可能很难,LOL)和使用它的学习曲线。学习用如此多的不同层次(容器引擎、日志记录、监控、服务网格、存储、网络)的技术来建立自己的 Kubernetes 有很多不同的选择,还有每六个月维护每个组件的更新选择,这可能不值得投资 —— 但学会使用它绝对是值得的。 + +我每天都与 Kubernetes 和容器泡在一起,即使这样我都很难跟踪几乎每天都在宣布的所有重大新项目。 但是,每一天我都对使用单一工具来模拟整个 IT 多个方面的运营优势感到兴奋。此外,记住 Kubernetes 已经成熟了很多,并将继续发展下去。与之前的 Linux 和 OpenStack 一样,每一层的接口和事实上的项目都将成熟并变得更容易选择。 + +在本系列的第三篇文章中,我将深入挖掘你在驾驶 Kubernetes “卡车”之前需要了解的内容。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-learning-curve + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dumptruck_car_vehicle_storage_container_road.jpg?itok=TWK0CbX_ (Dump truck rounding a turn in the road) +[2]: https://linux.cn/article-11011-1.html +[3]: https://kubernetes.io/ +[4]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional_1.png (Kubernetes business model) diff --git a/published/201906/20190606 Cisco to buy IoT security, management firm Sentryo.md b/published/201906/20190606 Cisco to buy IoT security, management firm Sentryo.md new file mode 100644 index 0000000000..302ea5e3f4 --- /dev/null +++ b/published/201906/20190606 Cisco to buy IoT security, management firm Sentryo.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: (hopefully2333) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11035-1.html) +[#]: subject: (Cisco to buy IoT security, management firm Sentryo) +[#]: via: (https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +思科收购了物联网安全管理公司 Sentryo +====== +> 买下 Sentryo 将给思科在工业物联网的异常和实时威胁检测两方面予以支持。 + +![IDG Worldwide][1] + +为了扩展自己的物联网安全管理产品,思科计划收购 Sentryo,这是一家总部位于法国的公司,Sentryo 为工业物联网提供异常检测和实时威胁检测。 + +Sentryo 成立于 2014 年,产品包括 ICS CyberVision(一种用于资产库存、网络监控和威胁情报的平台)以及 CyberVision 网络边界传感器,这用于分析网络流量。 + +**更多关于物联网的信息:** + + * [什么是物联网?物联网如何运行?][4] + * [什么是边缘计算,这会如何改变我们的网络?][5] + * [最强的物联网公司][6] + * [10 个值得关注的热门物联网创业公司][7] + * [在物联网领域赚钱的六种方法][8] + * [什么是数字双胞胎技术? [以及它为什么重要]][9] + * [区块链,以服务为中心的网络是物联网成功的关键][10] + * [物联网以网络和安全作为基础][11] + * [构建完整的物联网网络必须优先完成][12] + * [什么是工业物联网?[为什么风险如此之高]][13] + +“我们通过思科的 IOx 应用框架将 Sentryo 的边缘传感器和我们的工业网络硬件相结合”,思科企业发展和思科投资的副总裁 Rob Salvagno 在一篇关于计划收购的博客中写道。 + +“我们相信连接是物联网项目的基础,通过释放网络的力量,我们可以大大提高运作的效率并发现新的商业机会。随着 Sentryo 的加入,思科可以为系统控制工程师提供更加深入的资产可见度,以此来对系统进行优化,检测异常并保护他们的网络。” + +Gartner 对 Sentryo 的系统写道:“ICS CyberVision 产品以其所有 OT 用户都能理解的方式提供对其客户 OT 网络的可视性,而不仅仅是 IT 技术人员。随着黑客和监管机构越来越关注工业控制系统,一个组织的 OT 拥有完整的可见性是至关重要的一件事。很多的 OT 网络不仅在地理上位置分散,而且也很复杂,由成千上万的组件组成。” + +Frost & Sullivan 的工业分析师 Nandini Natarajan 表示,Sentryo 的 ICS CyberVision 让企业能够确保其工业运作的连续性、动态弹性和安全性,并以此预防可能的网络攻击。“它将使用标签形式的独特的 ‘通用 OT 语言’ 来自动描述资产和通信流程,以纯文本的方式描述每个资产在做什么。ICS CyberVision 可以让任何人都能立刻查看一台设备的类别和行为;它利用人工智能算法提供很多不同的分析视图,来让用户深入了解到一个典型的工业控制系统可以产生多么庞大的数据。Sentryo 可以轻松查看重要或相关的信息。” + +Natarajan 表示,除此之外,Sentryo 的平台使用深度数据包检测(DPI)从工业设备之间的通信数据包里提取信息。DPI 引擎通过边缘计算架构进行部署,它可以运行在 Sentryo 传感器设备上,也可以在已经安装好的网络设备上运行。因此,Sentryo 可以将可见性和网络安全特性嵌入进工业网络中,而非部署带外监控网络。 + +Sentryo 的技术将扩大思科在物联网上的总体计划。在今年一月,思科推出了一整套的交换机、软件、开发工具和蓝图,这些东西将用于把物联网、基于意图联网的工业网络、传统信息安全、传统信息监控、应用开发支持融为一体。 + +这个新平台可以通过思科的 DNA 中心进行管理,让客户能将他们的物联网、工业网络控制和他们的商业 IT 世界融为一体。 + +DNA 中心是思科用于企业网络的中央管理工具,具有自动化、确保设置、结构配置、基于策略进行分割的功能。它也是该公司 IBN 计划的核心,用于主动向客户提供动态自动化实施网络和策略变更的能力,并在这个过程中确保数据的交付。IoT Field Network Director 是管理思科工业、连接网格路由器和终端的多服务网络的软件。 + +思科物联网业务部的高级副总裁兼总经理 Liz Centoni 表示,公司希望 Sentryo 的技术能以多种方式帮助物联网客户: + +支持网络的被动 DPI 功能,这用于发现 IOT 和 OT 设备,并且在设备和系统之间建立起通信模式。Sentryo 的传感器可以在思科的 IOx 框架里进行本地部署,并且可以内置到这些设备运行的工业网络中,而不是添加额外的硬件。 + +随着设备识别和通信模式的建立,思科将把 DNA 中心和身份识别服务引擎(ISE)集成到一起,以便客户能够很轻松地定义分割策略。这种集成将使 OT 团队能够利用 IT 安全团队的专业知识来保护他们的环境,而不会对运营的流程造成风险。 + +由于这些物联网设备缺乏现代嵌入式软件和安全功能,网络分段将成为允许运作设备向合法系统进行通信的关键技术,并降低像我们看见的 WannaCry 和 Norsk Hydro 那样网络安全事件的风险。 + +据 Crunchbase 称,Sentryo 的每年预计收入为 350 万美元,与 Cymmetria、Team8 和 Indegy 的竞争最为激烈。此次收购预期将在思科 2020 财年的第一季度 - 2019 年 10 月 26 日 - 结束前完成。思科并未详细披露此次收购的财务细节。 + +Sentryo 是思科今年的第二次收购。思科在今年一月收购了 Singularity 公司的网络分析技术。在 2018 年,思科收购了包含 Duo security software 在内的 6 家公司。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400847/cisco-to-buy-iot-security-management-firm-sentryo.html + +作者:[Michael Cooney][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.idgesg.net/images/article/2018/09/nwan_019_iiot-100771131-large.jpg +[2]: https://www.sentryo.net/ +[3]: https://www.networkworld.com/article/3243928/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[4]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[5]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[6]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[7]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[8]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[9]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[10]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[11]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[12]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[13]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[14]: https://blogs.cisco.com/news/cisco-industrial-iot-news +[15]: https://www.globenewswire.com/news-release/2018/06/28/1531119/0/en/Sentryo-Named-a-Cool-Vendor-by-Gartner.html +[16]: https://www.linkedin.com/pulse/industrial-internet-things-iiot-decoded-nandini-natarajan/ +[17]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[18]: https://www.cisco.com/c/dam/en_us/solutions/iot/ihs-report.pdf +[19]: https://www.networkworld.com/article/3336454/cisco-goes-after-industrial-iot.html +[20]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html +[21]: https://blogs.cisco.com/news/securing-the-internet-of-things-cisco-announces-intent-to-acquire-sentryo +[22]: https://blogs.cisco.com/security/talos/wannacry +[23]: https://www.securityweek.com/norsk-hydro-may-have-lost-40m-first-week-after-cyberattack +[24]: https://www.crunchbase.com/organization/sentryo#section-web-traffic-by-similarweb +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190606 How Linux can help with your spelling.md b/published/201906/20190606 How Linux can help with your spelling.md new file mode 100644 index 0000000000..abb26b7f91 --- /dev/null +++ b/published/201906/20190606 How Linux can help with your spelling.md @@ -0,0 +1,262 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10986-1.html) +[#]: subject: (How Linux can help with your spelling) +[#]: via: (https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何用 Linux 帮助你拼写 +====== + +> 无论你是纠结一个难以理解的单词,还是在将报告发给老板之前再检查一遍,Linux 都可以帮助你解决拼写问题。 + +![Sandra Henry-Stocker](https://img.linux.net.cn/data/attachment/album/201906/17/214715jayk1k1kbiatkido.jpg) + +Linux 为数据分析和自动化提供了各种工具,它也帮助我们解决了一个一直都在纠结的问题 —— 拼写!无论在写每周报告时努力拼出一个单词,还是在提交商业计划书之前想要借助计算机的“眼睛”来找出你的拼写错误。现在我们来看一下它是如何帮助你的。 + +### look + +`look` 是其中一款工具。如果你知道一个单词的开头,你就可以用这个命令来获取以这些字母开头的单词列表。除非提供了替代词源,否则 `look` 将使用 `/usr/share/dict/words` 中的内容来为你标识单词。这个文件有数十万个单词,可以满足我们日常使用的大多数英语单词的需要,但是它可能不包含我们计算机领域中的一些人倾向于使用的更加生僻的单词,如 zettabyte。 + +`look` 命令的语法非常简单。输入 `look word` ,它将遍历单词文件中的所有单词并找到匹配项。 + +``` +$ look amelio +ameliorable +ameliorableness +ameliorant +ameliorate +ameliorated +ameliorates +ameliorating +amelioration +ameliorations +ameliorativ +ameliorative +amelioratively +ameliorator +amelioratory +``` + +如果你遇到系统中单词列表中未包含的单词,将无法获得任何输出。 + +``` +$ look zetta +$ +``` + +如果你没有看到你所希望出现的单词,也不要绝望。你可以在你的单词文件中添加单词,甚至引用一个完全不同的单词列表,在网上找一个或者干脆自己创建一个。你甚至不必将添加的单词放在按字母顺序排列的正确位置;只需将其添加到文件的末尾即可。但是,你必须以 root 用户身份执行此操作。例如(要注意 `>>`!): + +``` +# echo “zettabyte” >> /usr/share/dict/words +``` + +当使用不同的单词列表时,例如这个例子中的 “jargon” ,你只需要添加文件的名称。如果不采用默认文件时,请使用完整路径。 + +``` +$ look nybble /usr/share/dict/jargon +nybble +nybbles +``` + +`look` 命令大小写不敏感,因此你不必关心要查找的单词是否应该大写。 + +``` +$ look zet +ZETA +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +``` + +当然,不是所有的单词列表都是一样的。一些 Linux 发行版在单词文件中提供了*多得多*的内容。你的文件中可能有十万或者更多倍的单词。 + +在我的一个 Linux 系统中: + +``` +$ wc -l /usr/share/dict/words +102402 /usr/share/dict/words +``` + +在另一个系统中: + +``` +$ wc -l /usr/share/dict/words +479828 /usr/share/dict/words +``` + +请记住,`look` 命令只适用于通过单词开头查找,但如果你不想从单词的开头查找,还可以使用其他选项。 + +### grep + +我们深爱的 `grep` 命令像其他工具一样可以从一个单词文件中选出单词。如果你正在找以某些字母开头或结尾的单词,使用 `grep` 命令是自然而然的事情。它可以通过单词的开头、结尾或中间部分来匹配单词。系统中的单词文件可以像使用 `look` 命令时在 `grep` 命令中轻松使用。不过唯一的缺点是你需要指定文件,这一点与 `look` 不尽相同。 + +在单词的开头前加上 `^`: + +``` +$ grep ^terra /usr/share/dict/words +terrace +terrace's +terraced +terraces +terracing +terrain +terrain's +terrains +terrapin +terrapin's +terrapins +terraria +terrarium +terrarium's +terrariums +``` + +在单词的结尾后加上 `$`: + +``` +$ grep bytes$ /usr/share/dict/words +bytes +gigabytes +kilobytes +megabytes +terabytes +``` + +使用 `grep` 时,你需要考虑大小写,不过 `grep` 命令也提供了一些选项。 + +``` +$ grep ^[Zz]et /usr/share/dict/words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabyte +``` + +为单词文件添加软连接能使这种搜索方式更加便捷: + +``` +$ ln -s /usr/share/dict/words words +$ grep ^[Zz]et words +Zeta +zeta +zetacism +Zetana +zetas +Zetes +zetetic +Zethar +Zethus +Zetland +Zetta +zettabytye +``` + +### aspell + +`aspell` 命令提供了一种不同的方式。它提供了一种方法来检查你提供给它的任何文件或文本的拼写。你可以通过管道将文本传递给它,然后它会告诉你哪些单词看起来有拼写错误。如果所有单词都拼写正确,则不会有任何输出。 + +``` +$ echo Did I mispell that? | aspell list +mispell +$ echo I can hardly wait to try out aspell | aspell list +aspell +$ echo Did I misspell anything? | aspell list +$ +``` + +`list` 参数告诉 `aspell` 为标准输入单词提供拼写错误的单词列表。 + +你还可以使用 `aspell` 来定位和更正文本文件中的单词。如果它发现一个拼写错误的单词,它将为你提供一个相似(但拼写正确的)单词列表来替换这个单词,你也可以将该单词加入个人词库(`~/.aspell.en.pws`)并忽略拼写错误,或者完全中止进程(使文件保持处理前的状态)。 + +``` +$ aspell -c mytext +``` + +一旦 `aspell` 发现一个单词出现了拼写错误,它将会为不正确的 “mispell” 提供一个选项列表: + +``` +1) mi spell 6) misplay +2) mi-spell 7) spell +3) misspell 8) misapply +4) Ispell 9) Aspell +5) misspells 0) dispel +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +请注意,备选单词和拼写是数字编号的,而其他选项是由字母选项表示的。你可以选择备选拼写中的一项或者自己输入替换项。“Abort” 选项将使文件保持不变,即使你已经为某些单词选择了替换。你选择添加的单词将被插入到本地单词文件中(例如 `~/.aspell.en.pws`)。 + +#### 其他单词列表 + +厌倦了英语? `aspell` 命令可以在其他语言中使用,只要你添加了相关语言的单词列表。例如,在 Debian 系统中添加法语的词库,你可以这样做: + +``` +$ sudo apt install aspell-fr +``` + +这个新的词库文件会被安装为 `/usr/share/dict/French`。为了使用它,你只需要简单地告诉 `aspell` 你想要使用替换的单词列表: + +``` +$ aspell --lang=fr -c mytext +``` + +这种情况下,当 `aspell` 读到单词 “one” 时,你可能会看到下面的情况: + +``` +1) once 6) orné +2) onde 7) ne +3) ondé 8) né +4) onze 9) on +5) orne 0) cône +i) Ignore I) Ignore all +r) Replace R) Replace all +a) Add l) Add Lower +b) Abort x) Exit +``` + +你也可以从 [GNU 官网][3]获取其他语言的词库。 + +### 总结 + +即使你是全国拼字比赛的冠军,你可能偶尔也会需要一点拼写方面的帮助,哪怕只是为了找出你手滑打错的单词。`aspell` 工具,加上 `look` 和 `grep` 命令已经准备来助你一臂之力了。 + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400942/how-linux-can-help-with-your-spelling.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/linux-spelling-100798596-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190606 Kubernetes basics- Learn how to drive first.md b/published/201906/20190606 Kubernetes basics- Learn how to drive first.md new file mode 100644 index 0000000000..2e93d2d5d9 --- /dev/null +++ b/published/201906/20190606 Kubernetes basics- Learn how to drive first.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11036-1.html) +[#]: subject: (Kubernetes basics: Learn how to drive first) +[#]: via: (https://opensource.com/article/19/6/kubernetes-basics) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux) + +Kubernetes 基础:首先学习如何使用 +====== + +> 不要被新项目分心,而是专注于取得你的 Kubernetes 翻斗车驾驶执照。 + +![Truck steering wheel and dash][1] + +在本系列的前两篇文章中,我解释了为何 Kubernetes [像翻斗车][2],并且想要理解像 [Kubernetes][4](和翻斗车,起重机等)这样优雅、专业工具总是有[学习曲线][3]的。本文是下一步:学习如何驾驶。 + +最近,我在 Reddit 上看到了一个关于[重要的 Kubernetes 项目][5]的帖子。人们似乎很想知道他们应该学习如何开始使用 Kubernetes。“驾驶翻斗车的类比”有助于确保这个问题回到轨道上去。在这个帖子中的某个人提到,除非必要,你不应该运行自己的镜像仓库,所以人们开始逐渐接受驾驭 Kubernetes 而不是构建它的想法。 + +API 是 Kubernetes 的引擎和变速器。像翻斗车的方向盘、离合器、汽油和制动踏板一样,用于构建应用程序的 YAML 或 JSON 文件是机器的主要接口。当你第一次学习 Kubernetes 时,这应该是你的主要关注点。了解你的控制部件。不要分心于最新和最大的那些项目。当你刚学会开车时,不要尝试驾驶实验性的翻斗车。相反,请专注于基础知识。 + +### 定义状态和实际状态 + +首先,Kubernetes 遵循定义状态和实际状态的原则。 + +![Defined state and actual state][6] + +人类(开发人员/系统管理员/运维人员)使用他们提交给 Kubernetes API 的 YAML/JSON 文件指定定义的状态。然后,Kubernetes 使用控制器来分析 YAML/JSON 中定义的新状态与集群中的实际状态之间的差异。 + +在上面的例子中,Replication Controller 可以看到用户指定的三个 pod 之间的差异,其中一个 pod 正在运行,并调度另外两个 Pod。如果你登录 Kubernetes 并手动杀死其中一个 Pod,它会不断启动另一个来替换它。在实际状态与定义的状态匹配之前,Kubernetes 不会停止。这是非常强大的。 + +### 原语 + +接下来,你需要了解可以在 Kubernetes 中指定的原语。 + +![Kubernetes primitives][7] + +这些原语不仅仅有 Pod,还有部署Deployment持久化卷声明Persistent Volume Claim服务Service路由route等。使用支持 Kubernetes 的平台 [OpenShift][8],你可以添加构建build和 BuildConfig。你大概需要一天左右的时间来了解这些原语。你可以在你的用例变得更加复杂时再深入了解。 + +### 将原生开发者映射到传统 IT 环境 + +最后,考虑这该如何映射到你在传统 IT 环境中的操作。 + +![Mapping developer-native to traditional IT environments][9] + +尽管是一个技术问题,但用户一直在尝试解决业务问题。从历史上看,我们使用诸如剧本playbook之类的东西将业务逻辑与单一语言的 IT 系统绑定起来。对于运维人员来说,这很不错,但是当你尝试将其扩展到开发人员时,它会变得更加繁琐。 + +直到 Kubernete 出现之前,我们从未能够以原生开发者的方式真正同时指定一组 IT 系统应如何表现和交互。如果你考虑一下,我们正在使用在 Kubernetes 中编写的 YAML/JSON 文件以非常便携和声明的方式扩展了管理存储、网络和计算资源的能力,但它们总会映射到某处的“真实”资源。我们不必以开发者身份担心它。 + +因此,快放弃关注 Kubernetes 生态系统中的新项目,而是专注开始使用它。在下一篇文章中,我将分享一些可以帮助你使用 Kubernetes 的工具和工作流程。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/kubernetes-basics + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/truck_steering_wheel_drive_car_kubernetes.jpg?itok=0TOzve80 (Truck steering wheel and dash) +[2]: https://linux.cn/article-11011-1.html +[3]: https://linux.cn/article-11026-1.html +[4]: https://opensource.com/resources/what-is-kubernetes +[5]: https://www.reddit.com/r/kubernetes/comments/bsoixc/what_are_the_essential_kubernetes_related/ +[6]: https://opensource.com/sites/default/files/uploads/defined_state_-_actual_state.png (Defined state and actual state) +[7]: https://opensource.com/sites/default/files/uploads/new_primitives.png (Kubernetes primatives) +[8]: https://www.openshift.com/ +[9]: https://opensource.com/sites/default/files/uploads/developer_native_experience_-_mapped_to_traditional.png (Mapping developer-native to traditional IT environments) diff --git a/published/201906/20190607 5 reasons to use Kubernetes.md b/published/201906/20190607 5 reasons to use Kubernetes.md new file mode 100644 index 0000000000..8de8d3ad4a --- /dev/null +++ b/published/201906/20190607 5 reasons to use Kubernetes.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10973-1.html) +[#]: subject: (5 reasons to use Kubernetes) +[#]: via: (https://opensource.com/article/19/6/reasons-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) + +使用 Kubernetes 的 5 个理由 +====== + +> Kubernetes 解决了一些开发和运维团队每天关注的的常见问题。 + +![](https://img.linux.net.cn/data/attachment/album/201906/14/110657gk2jz6f6kqff2kk4.jpg) + +[Kubernetes][2](K8S)是面向企业的开源容器编排工具的事实标准。它提供了应用部署、扩展、容器管理和其他功能,使企业能够通过容错能力快速优化硬件资源利用率并延长生产环境运行时间。该项目最初由谷歌开发,并将该项目捐赠给[云原生计算基金会][3](CNCF)。2018 年,它成为第一个从 CNCF [毕业][4]的项目。 + +这一切都很好,但它并不能解释为什么开发者和运维人员应该在 Kubernetes 上投入宝贵的时间和精力。Kubernetes 之所以如此有用,是因为它有助于开发者和运维人员迅速解决他们每天都在努力解决的问题。 + +以下是 Kubernetes 帮助开发者和运维人员解决他们最常见问题的五种能力。 + +### 1、厂商无关 + +许多公有云提供商不仅提供托管 Kubernetes 服务,还提供许多基于这些服务构建的云产品,来用于本地应用容器编排。由于与供应商无关,使运营商能够轻松、安全地设计、构建和管理多云和混合云平台,而不会有供应商锁定的风险。Kubernetes 还消除了运维团队对复杂的多云/混合云战略的担忧。 + +### 2、服务发现 + +为了开发微服务应用,Java 开发人员必须控制服务可用性(就应用是否可以提供服务而言),并确保服务持续存在,以响应客户端的请求,而没有任何例外。Kubernetes 的[服务发现功能][5]意味着开发人员不再需要自己管理这些东西。 + +### 3、触发 + +你的 DevOps 会如何在上千台虚拟机上部署多语言、云原生应用?理想情况下,开发和运维会在 bug 修复、功能增强、新功能、安全更新时触发部署。Kubernetes 的[部署功能][6]会自动化这个日常工作。更重要的时,它支持高级部署策略,例如[蓝绿部署和金丝雀部署][7]。 + +### 4、可伸缩性 + +自动扩展是处理云环境中大量工作负载所需的关键功能。通过构建容器平台,你可以为终端用户提高系统可靠性。[Kubernetes Horizo​​ntal Pod Autoscaler][8](HPA)允许一个集群增加或减少应用程序(或 Pod)的数量,以应对峰值流量或性能峰值,从而减少对意外系统中断的担忧。 + +### 5、容错性 + +在现代应用体系结构中,应考虑故障处理代码来控制意外错误并快速从中恢复。但是开发人员需要花费大量的时间和精力来模拟偶然的错误。Kubernetes 的 [ReplicaSet][9] 通过确保指定数量的 Pod 持续保持活动来帮助开发人员解决此问题。 + +### 结论 + +Kubernetes 使企业能够轻松、快速、安全地解决常见的开发和运维问题。它还提供其他好处,例如构建无缝的多云/混合云战略,节省基础架构成本以及加快产品上市时间。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/reasons-kubernetes + +作者:[Daniel Oh][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/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://www.cncf.io/projects/ +[4]: https://www.cncf.io/blog/2018/03/06/kubernetes-first-cncf-project-graduate/ +[5]: https://kubernetes.io/docs/concepts/services-networking/service/ +[6]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[7]: https://opensource.com/article/17/5/colorful-deployments +[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ +[9]: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ diff --git a/published/201906/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md b/published/201906/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md new file mode 100644 index 0000000000..4df0e7accd --- /dev/null +++ b/published/201906/20190608 An open source bionic leg, Python data pipeline, data breach detection, and more news.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10965-1.html) +[#]: subject: (An open source bionic leg, Python data pipeline, data breach detection, and more news) +[#]: via: (https://opensource.com/article/19/6/news-june-8) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +开源新闻:开源仿生腿、Python 数据管道、数据泄露检测 +====== + +> 了解过去两周来最大的开源头条新闻。 + +![][1] + +在本期开源新闻综述中,我们将介绍一个开源仿生腿、一个新的开源医学影像组织,麦肯锡发布的首个开源软件,以及更多! + +### 使用开源推进仿生学 + +我们这一代人从电视剧《六百万美元人》和《仿生女人》中学到了仿生学一词。让科幻小说(尽管基于事实)正在成为现实的,要归功于[由密歇根大学和 Shirley Ryan AbilityLab 设计][2]的假肢。 + +该腿采用简单、低成本的模块化设计,“旨在通过为仿生学领域的零碎研究工作提供统一的平台,提高患者的生活质量并加速科学进步”。根据首席设计师 Elliot Rouse 的说法,它将“使研究人员能够有效地解决与一系列的实验室和社区活动中控制仿生腿相关的挑战。” + +你可以从[开源腿][3]网站了解有该腿的更多信息并下载该设计。 + +### 麦肯锡发布了一个用于构建产品级数据管道的 Python 库 + +咨询巨头麦肯锡公司最近发布了其[第一个开源工具][4],名为 Kedro,它是一个用于创建机器学习和数据管道的 Python 库。 + +Kedro 使得“管理大型工作流程更加容易,并确保整个项目的代码质量始终如一”,产品经理 Yetunde Dada 说。虽然它最初是作为一种专有的工具,但麦肯锡开源了 Kedro,因此“客户可以在我们离开项目后使用它 —— 这是我们回馈的方式,”工程师 Nikolaos Tsaousis 说。 + +如果你有兴趣了解一下,可以从 GitHub 上获取 [Kedro 的源代码][5]。 + +### 新联盟推进开源医学成像 + +一组专家和患者倡导者聚集在一起组成了[开源成像联盟][6]。该联盟旨在“通过数字成像和机器学习帮助推进特发性肺纤维化和其他间质性肺病的诊断。” + +根据联盟执行董事 Elizabeth Estes 的说法,该项目旨在“协作加速诊断,帮助预后处置,最终让医生更有效地治疗患者”。为此,他们正在组织和分享“来自患者的 15,000 个匿名图像扫描和临床数据,这将作为机器学习程序的输入数据来开发算法。” + +### Mozilla 发布了一种简单易用的方法,以确定你是否遭受过数据泄露 + +向不那么精通软件的人解释安全性始终是一项挑战,无论你的技能水平如何,都很难监控你的风险。Mozilla 发布了 [Firefox Monitor][7],其数据由 [Have I Been Pwned][8] 提供,它是一种查看你的任何电子邮件是否出现在重大数据泄露事件中的简单方式。你可以输入电子邮件逐个搜索,或注册他们的服务以便将来通知你。 + +该网站还提供了大量有用的教程,用于了解黑客如何做的,数据泄露后如何处理以及如何创建强密码。请务必将网站加入书签,以防家人要求你在假日期间提供建议。 + +### 其它新闻 + +* [想要一款去谷歌化的 Android?把你的手机发送给这个人][9] +* [CockroachDB 发行版使用了非 OSI 批准的许可证,但仍然保持开源][10] +* [基础设施自动化公司 Chef 承诺开源][11] +* [俄罗斯的 Windows 替代品将获得安全升级][12] +* [使用此代码在几分钟内从 Medium 切换到你自己的博客][13] +* [开源推进联盟宣布与台湾自由软件协会建立新合作伙伴关系][14] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/news-june-8 + +作者:[Scott Nesbitt][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/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 +[2]: https://news.umich.edu/open-source-bionic-leg-first-of-its-kind-platform-aims-to-rapidly-advance-prosthetics/ +[3]: https://opensourceleg.com/ +[4]: https://www.information-age.com/kedro-mckinseys-open-source-software-tool-123482991/ +[5]: https://github.com/quantumblacklabs/kedro +[6]: https://pulmonaryfibrosisnews.com/2019/05/31/international-open-source-imaging-consortium-osic-launched-to-advance-ipf-diagnosis/ +[7]: https://monitor.firefox.com/ +[8]: https://haveibeenpwned.com/ +[9]: https://fossbytes.com/want-a-google-free-android-send-your-phone-to-this-guy/ +[10]: https://www.cockroachlabs.com/blog/oss-relicensing-cockroachdb/ +[11]: https://www.infoq.com/news/2019/05/chef-open-source/ +[12]: https://www.nextgov.com/cybersecurity/2019/05/russias-would-be-windows-replacement-gets-security-upgrade/157330/ +[13]: https://github.com/mathieudutour/medium-to-own-blog +[14]: https://opensource.org/node/994 diff --git a/published/201906/20190610 Applications for writing Markdown.md b/published/201906/20190610 Applications for writing Markdown.md new file mode 100644 index 0000000000..0c7477e7fb --- /dev/null +++ b/published/201906/20190610 Applications for writing Markdown.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (murphyzhao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11027-1.html) +[#]: subject: (Applications for writing Markdown) +[#]: via: (https://fedoramagazine.org/applications-for-writing-markdown/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +三个在 Fedora 平台上撰写 Markdown 的软件 +====== + +![][1] + +Markdown 是一种轻量级标记语言,可以在添加格式后以纯文本格式查看时依然保持可读性。Markdown(和 Markdown 衍生物)被广泛用作 GitHub 和 pagure 等服务上格式化文档的主要形式。根据其设计,可以在文本编辑器中轻松创建和编辑 Markdown,但是,有许多编辑器可以提供 Markdown 标记的格式化预览,或提供 Markdown 语法高亮显示。 + +本文介绍了针对 Fedora 平台的 3 个桌面应用程序,以帮助编辑 Markdown。 + +### UberWriter + +[UberWriter][2] 是一个小巧的 Markdown 编辑器和预览器,允许你以文本方式编辑,并预览渲染的文档。 + +![][3] + +该编辑器本身具有内置的内联预览,因此标记为粗体的文本以粗体显示。编辑器还提供图像、公式、脚注等标记的内联预览。按住 `Ctrl` 键单击其中的一个标记可以即时预览要显示的元素。 + +除了编辑器功能外,UberWriter 还具有全屏模式和聚焦模式,有助于最大限度地减少干扰。焦点模式将以灰色显示除当前段落以外的所有内容,以帮助你专注于文档中当前元素。 + +从第三方 Flathub 存储库安装 UberWriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +### Marker + +Marker 是一个 Markdown 编辑器,它提供了一个简单的文本编辑器来编写 Markdown,并提供渲染文档的实时预览。界面采用分屏设计,左侧为编辑器,右侧为实时预览。 + +![][5] + +此外,Marker 允许你以各种格式导出文档,包括 HTML、PDF 和开放文档格式(ODF)。 + +从第三方 Flathub 存储库安装 Marker 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +### Ghostwriter + +以前的编辑更专注于最小的用户体验,Ghostwriter 提供了更多的功能和选项。Ghostwriter 提供了一个文本编辑器,当你以 Markdown 格式书写时,编辑器将 Markdown 部分样式化。粗体标记文本显示为粗体,标题标记显示为较大的字体,以帮助编写 Markdown 标记。 + +![][6] + +它还提供了一个分屏,包含渲染文档的实时更新预览。 + +![][7] + +Ghostwriter 还包括一系列其他功能,包括能够选择渲染预览的 Markdown 风格,以及用于渲染预览的样式表。 + +此外,它还提供了一个格式菜单(和键盘快捷键)来插入一些频繁的 Markdown 标记,如粗体、项目符号和斜体。 + +从第三方 Flathub 存储库安装 Ghostwriter 到 Fedora 平台。在将系统[设置为从 Flathub 安装][4]后,可以直接从 Software 应用程序中安装它。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/applications-for-writing-markdown/ + +作者:[Ryan Lerch][a] +选题:[lujun9972][b] +译者:[murphyzhao](https://github.com/murphyzhao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/markdownapps.png-816x345.jpg +[2]: https://uberwriter.github.io/uberwriter/#1 +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/uberwriter-editor-1.png +[4]: https://fedoramagazine.org/install-flathub-apps-fedora/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/marker-screenshot-1024x500.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter-1024x732.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/ghostwriter2-1024x566.png diff --git a/published/201906/20190610 Expand And Unexpand Commands Tutorial With Examples.md b/published/201906/20190610 Expand And Unexpand Commands Tutorial With Examples.md new file mode 100644 index 0000000000..38d9c91ba4 --- /dev/null +++ b/published/201906/20190610 Expand And Unexpand Commands Tutorial With Examples.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10983-1.html) +[#]: subject: (Expand And Unexpand Commands Tutorial With Examples) +[#]: via: (https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +expand 与 unexpand 命令实例教程 +====== + +![Expand And Unexpand Commands Explained][1] + +本指南通过实际的例子解释两个 Linux 命令,即 `expand` 和 `unexpand`。对于好奇的人,`expand` 和 `unexpand` 命令用于将文件中的 `TAB` 字符替换为空格,反之亦然。在 MS-DOS 中也有一个名为 `expand` 的命令,它用于解压压缩文件。但 Linux 的 `expand` 命令只是将 `TAB` 转换为空格。这两个命令是 GNU coreutils 包的一部分,由 David MacKenzie 编写。 + +为了演示,我将在本文使用名为 `ostechnix.txt` 的文本文件。下面给出的所有命令都在 Arch Linux 中进行测试。 + +### expand 命令示例 + +与我之前提到的一样,`expand` 命令使用空格替换文件中的 `TAB` 字符。 + +现在,让我们将 `ostechnix.txt` 中的 `TAB` 转换为空格,并将结果写入标准输出: + +``` +$ expand ostechnix.txt +``` + +如果你不想在标准输出中显示结果,只需将其写入另一个文件,如下所示。 + +``` +$ expand ostechnix.txt>output.txt +``` + +我们还可以将标准输入中的 `TAB` 转换为空格。为此,只需运行 `expand` 命令而不带文件名: + +``` +$ expand +``` + +只需输入文本并按回车键就能将 `TAB` 转换为空格。按 `CTRL+C` 退出。 + +如果你不想转换非空白字符后的 `TAB`,请使用 `-i` 标记,如下所示。 + +``` +$ expand -i ostechnix.txt +``` + +我们还可以设置每个 `TAB` 为指定数字的宽度,而不是 `8`(默认值)。 + +``` +$ expand -t=5 ostechnix.txt +``` + +我们甚至可以使用逗号分隔指定多个 `TAB` 位置,如下所示。 + +``` +$ expand -t 5,10,15 ostechnix.txt +``` + +或者, + +``` +$ expand -t "5 10 15" ostechnix.txt +``` + +有关更多详细信息,请参阅手册页。 + +``` +$ man expand +``` + +### unexpand 命令示例 + +正如你可能已经猜到的那样,`unexpand` 命令将执行与 `expand` 命令相反的操作。即它会将空格转换为 `TAB`。让我向你展示一些例子,以了解如何使用 `unexpand` 命令。 + +要将文件中的空白(当然是空格)转换为 `TAB` 并将输出写入标准输出,请执行以下操作: + +``` +$ unexpand ostechnix.txt +``` + +如果要将输出写入文件而不是仅将其显示到标准输出,请使用以下命令: + +``` +$ unexpand ostechnix.txt>output.txt +``` + +从标准输出读取内容,将空格转换为制表符: + +``` +$ unexpand +``` + +默认情况下,`unexpand` 命令仅转换初始的空格。如果你想转换所有空格而不是只是一行开头的空格,请使用 `-a` 标志: + +``` +$ unexpand -a ostechnix.txt +``` + +仅转换一行开头的空格(请注意它会覆盖 `-a`): + +``` +$ unexpand --first-only ostechnix.txt +``` + +使多少个空格替换成一个 `TAB`,而不是 `8`(会启用 `-a`): + +``` +$ unexpand -t 5 ostechnix.txt +``` + +相似地,我们可以使用逗号分隔指定多个 `TAB` 的位置。 + +``` +$ unexpand -t 5,10,15 ostechnix.txt +``` + +或者, + +``` +$ unexpand -t "5 10 15" ostechnix.txt +``` + +有关更多详细信息,请参阅手册页。 + +``` +$ man unexpand +``` + +在处理大量文件时,`expand` 和 `unexpand` 命令对于用空格替换不需要的 `TAB` 时非常有用,反之亦然。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/expand-and-unexpand-commands-tutorial-with-examples/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Expand-And-Unexpand-Commands-720x340.png diff --git a/published/201906/20190610 Graviton- A Minimalist Open Source Code Editor.md b/published/201906/20190610 Graviton- A Minimalist Open Source Code Editor.md new file mode 100644 index 0000000000..395f0f5687 --- /dev/null +++ b/published/201906/20190610 Graviton- A Minimalist Open Source Code Editor.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10988-1.html) +[#]: subject: (Graviton: A Minimalist Open Source Code Editor) +[#]: via: (https://itsfoss.com/graviton-code-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Graviton:极简的开源代码编辑器 +====== + +[Graviton][1]是一款开发中的自由开源的跨平台代码编辑器。他的开发者 16 岁的 Marc Espin 强调说,它是一个“极简”的代码编辑器。我不确定这点,但它确实有一个清爽的用户界面,就像其他的[现代代码编辑器,如 Atom][2]。 + +![Graviton Code Editor Interface][3] + +开发者还将其称为轻量级代码编辑器,尽管 Graviton 基于 [Electron][4]。 + +Graviton 拥有你在任何标准代码编辑器中所期望的功能,如语法高亮、自动补全等。由于 Graviton 仍处于测试阶段,因此未来版本中将添加更多功能。 + +![Graviton Code Editor with Syntax Highlighting][5] + +### Graviton 代码编辑器的特性 + +Graviton 一些值得一说的特性有: + + * 使用 [CodeMirrorJS][6] 为多种编程语言提供语法高亮 +  * 自动补全 +  * 支持插件和主题。 +  * 提供英语、西班牙语和一些其他欧洲语言。 +  * 适用于 Linux、Windows 和 macOS。 + +我快速看来一下 Graviton,它可能不像 [VS Code][7] 或 [Brackets][8] 那样功能丰富,但对于一些简单的代码编辑来说,它还算不错的工具。 + +### 下载并安装 Graviton + +![Graviton Code Editor][9] + +如上所述,Graviton 是一个可用于 Linux、Windows 和 macOS 的跨平台代码编辑器。它仍处于测试阶段,这意味着将来会添加更多功能,并且你可能会遇到一些 bug。 + +你可以在其发布页面上找到最新版本的 Graviton。Debian 和 [Ubuntu 用户可以使用 .deb 安装][10]。它已提供 [AppImage][11],以便可以在其他发行版中使用它。DMG 和 EXE 文件也分别可用于 macOS 和 Windows。 + +- [下载 Graviton][12] + +如果你有兴趣,你可以在 GitHub 仓库中找到 Graviton 的源代码: + +- [GitHub 中 Graviton 的源码][13] + +如果你决定使用 Graviton 并发现了一些问题,请在[此处][14]写一份错误报告。如果你使用 GitHub,你可能想为 Graviton 项目加星。这可以提高开发者的士气,因为他知道有更多的用户欣赏他的努力。 + +如果你看到现在,我相信你了解[如何从源码安装软件][16] + +### 写在最后 + +有时,简单本身就成了一个特性,而 Graviton 专注于极简可以帮助它在已经拥挤的代码编辑器世界中获取一席之地。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/graviton-code-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://graviton.ml/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface.jpg?resize=800%2C571&ssl=1 +[4]: https://electronjs.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-interface-2.jpg?resize=800%2C522&ssl=1 +[6]: https://codemirror.net/ +[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[8]: https://itsfoss.com/install-brackets-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/graviton-code-editor-800x473.jpg?resize=800%2C473&ssl=1 +[10]: https://itsfoss.com/install-deb-files-ubuntu/ +[11]: https://itsfoss.com/use-appimage-linux/ +[12]: https://github.com/Graviton-Code-Editor/Graviton-App/releases +[13]: https://github.com/Graviton-Code-Editor/Graviton-App +[14]: https://github.com/Graviton-Code-Editor/Graviton-App/issues +[16]: https://itsfoss.com/install-software-from-source-code/ +[17]: https://itsfoss.com/contact-us/ diff --git a/published/201906/20190610 Neofetch - Display Linux system Information In Terminal.md b/published/201906/20190610 Neofetch - Display Linux system Information In Terminal.md new file mode 100644 index 0000000000..006ca80113 --- /dev/null +++ b/published/201906/20190610 Neofetch - Display Linux system Information In Terminal.md @@ -0,0 +1,216 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10991-1.html) +[#]: subject: (Neofetch – Display Linux system Information In Terminal) +[#]: via: (https://www.ostechnix.com/neofetch-display-linux-systems-information/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Neofetch:在终端中显示 Linux 系统信息 +====== + +![Display Linux system information using Neofetch][1] + +Neofetch 是一个简单但有用的命令行系统信息工具,它用 Bash 编写。它会收集有关系统软硬件的信息,并在终端中显示结果。默认情况下,系统信息将与操作系统的 logo 一起显示。但是,你可以进一步地自定义使用 ascii 图像或其他任何图片。你还可以配置 Neofetch 显示的信息、信息的显示位置和时间。Neofetch 主要用于系统信息的截图。它支持 Linux、BSD、Mac OS X、iOS 和 Windows 操作系统。在这个简短的教程中,让我们看看如何使用 Neofetch 显示 Linux 系统信息。 + +### 安装 Neofetch + +Neofetch 可在大多数 Linux 发行版的默认仓库中找到。 + +在 Arch Linux 及其衍生版上,使用这个命令安装它: + +``` +$ sudo pacman -S netofetch +``` + +在 Debian(Stretch / Sid)上: + +``` +$ sudo apt-get install neofetch +``` + +在 Fedora 27 上: + +``` +$ sudo dnf install neofetch +``` + +在 RHEL、CentOS 上: + +启用 EPEL 仓库: + +``` +# yum install epel-relase +``` + +获取 neofetch 仓库: + +``` +# curl -o /etc/yum.repos.d/konimex-neofetch-epel-7.repo +https://copr.fedorainfracloud.org/coprs/konimex/neofetch/repo/epel-7/konimex-neofetch-epel-7.repo +``` + +然后,安装 Neofetch: + +``` +# yum install neofetch +``` + +在 Ubuntu 17.10 和更新版本上: + +``` +$ sudo apt-get install neofetch +``` + +在 Ubuntu 16.10 和更低版本上: + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch + +$ sudo apt update + +$ sudo apt install neofetch +``` + +在 NixOS 上: + +``` +$ nix-env -i neofetch +``` + +### 使用 Neofetch 显示 Linux 系统信息 + +Neofetch 非常简单直接。让我们看一些例子。 + +打开终端,然后运行以下命令: + +``` +$ neofetch +``` + +示例输出: + +![][2] + +*使用 Neofetch 显示 Linux 系统信息* + +正如你在上面的输出中所看到的,Neofetch 显示了我的 Arch Linux 系统的以下详细信息: + +* 已安装操作系统的名称, +* 笔记本型号, +* 内核详细信息, +* 系统运行时间, +* 默认和其他软件包管理器安装的软件数量 +* 默认 shell, +* 屏幕分辨率, +* 桌面环境, +* 窗口管理器, +* 窗口管理器的主题, +* 系统主题, +* 系统图标, +* 默认终端, +* CPU 类型, +* GPU 类型, +* 已安装的内存。 + +Neofetch 还有很多其他选项。我们会看到其中一些。 + +### 如何在 Neofetch 输出中使用自定义图像? + +默认情况下,Neofetch 将显示你的操作系统 logo 以及系统信息。当然,你可以根据需要更改图像。 + +要显示图像,Linux 系统应该安装以下依赖项: + +1. w3m-img(用于显示图像。w3m-img 有时与 w3m 包捆绑在一起), +2. Imagemagick(用于创建缩略图), +3. 支持 `\033[14t` 或者 xdotool 或者 xwininfo + xprop 或者 xwininfo + xdpyinfo 的终端。 + +大多数 Linux 发行版的默认仓库中都提供了 W3m-img 和 ImageMagick 包。因此,你可以使用你的发行版的默认包管理器来安装它们。 + +例如,运行以下命令在 Debian、Ubuntu、Linux Mint 上安装 w3m-img 和 ImageMagick: + +``` +$ sudo apt install w3m-img imagemagick +``` + +以下是带 w3m-img 支持的终端列表: + + 1. Gnome-terminal, + 2. Konsole, + 3. st, + 4. Terminator, + 5. Termite, + 6. URxvt, + 7. Xfce4-Terminal, + 8. Xterm + +如果你的系统上已经有了 kitty、Terminology 和 iTerm,那么就无需安装 w3m-img。 + +现在,运行以下命令以使用自定义图像显示系统信息: + +``` +$ neofetch --w3m /home/sk/Pictures/image.png +``` + +或者, + +``` +$ neofetch --w3m --source /home/sk/Pictures/image.png +``` + +示例输出: + +![][3] + +*使用自定义 logo 的 Neofetch 输出* + +使用你自己的图片替换上面图片的路径。 + +或者,你可以指向包含以下图像的目录。 + +``` +$ neofetch --w3m +``` + +### 配置 Neofetch + +当我们第一次运行 Neofetch 时,它默认会为每个用户在 `$HOME/.config/neofetch/config.conf` 中创建一个配置文件。它还会在 `$HOME/.config/neofetch/config` 中创建一个全局的 neofetch 配置文件。你可以调整此文件来告诉 neofetch 该显示、删除和/或修改哪些详细信息。 + +还可以在不同版本中保留此配置文件。这意味着你只需根据自己的喜好自定义一次,并在升级到更新版本后使用相同的设置。你甚至可以将此文件共享给你的朋友和同事,使他拥有与你相同的设置。 + +要查看 Neofetch 帮助部分,请运行: + +``` +$ neofetch --help +``` + +就我测试的 Neofetch 而言,它在我的 Arch Linux 系统中完美地工作。它是一个非常方便的工具,可以在终端中轻松快速地打印系统的详细信息。 + +相关阅读: + + * [如何使用 inxi 查看 Linux 系统详细信息][4] + +资源: + + * [Neofetch 的 GitHub 页面][5] + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/neofetch-display-linux-systems-information/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2016/06/neofetch-1-720x340.png +[2]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-1.png +[3]: http://www.ostechnix.com/wp-content/uploads/2016/06/Neofetch-with-custom-logo.png +[4]: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ +[5]: https://github.com/dylanaraps/neofetch diff --git a/published/201906/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md b/published/201906/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..936974a5d2 --- /dev/null +++ b/published/201906/20190610 Screen Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,282 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10962-1.html) +[#]: subject: (Screen Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +screen 命令示例:管理多个终端会话 +====== + +![Screen Command Examples To Manage Multiple Terminal Sessions](https://img.linux.net.cn/data/attachment/album/201906/11/124801th0uy0hti3y211ha.jpg) + +GNU Screen 是一个终端多路复用器(窗口管理器)。顾名思义,Screen 可以在多个交互式 shell 之间复用物理终端,因此我们可以在每个终端会话中执行不同的任务。所有的 Screen 会话都完全独立地运行程序。因此,即使会话意外关闭或断开连接,在 Screen 会话内运行的程序或进程也将继续运行。例如,当通过 SSH [升级 Ubuntu][2] 服务器时,`screen` 命令将继续运行升级过程,以防万一 SSH 会话因任何原因而终止。 + +GNU Screen 允许我们轻松创建多个 Screen 会话,在不同会话之间切换,在会话之间复制文本,随时连上或脱离会话等等。它是每个 Linux 管理员应该在必要时学习和使用的重要命令行工具之一。在本简要指南中,我们将看到 `screen` 命令的基本用法以及在 Linux 中的示例。 + +### 安装 GNU Screen + +GNU Screen 在大多数 Linux 操作系统的默认存储库中都可用。 + +要在 Arch Linux 上安装 GNU Screen,请运行: + +``` +$ sudo pacman -S screen +``` + +在 Debian、Ubuntu、Linux Mint 上: + +``` +$ sudo apt-get install screen +``` + +在 Fedora 上: + +``` +$ sudo dnf install screen +``` + +在 RHEL、CentOS 上: + +``` +$ sudo yum install screen +``` + +在 SUSE/openSUSE 上: + +``` +$ sudo zypper install screen +``` + +让我们继续看一些 `screen` 命令示例。 + +### 管理多个终端会话的 Screen 命令示例 + +在 Screen 中所有命令的默认前缀快捷方式是 `Ctrl + a`。使用 Screen 时,你需要经常使用此快捷方式。所以,要记住这个键盘快捷键。 + +#### 创建新的 Screen 会话 + +让我们创建一个新的 Screen 会话并连上它。为此,请在终端中键入以下命令: + +``` +screen +``` + +现在,在此会话中运行任何程序或进程,即使你与此会话断开连接,正在运行的进程或程序也将继续运行。 + +#### 从 Screen 会话脱离 + +要从屏幕会话中脱离,请按 `Ctrl + a` 和 `d`。你无需同时按下两个组合键。首先按 `Ctrl + a` 然后按 `d`。从会话中脱离后,你将看到类似下面的输出。 + +``` +[detached from 29149.pts-0.sk] +``` + +这里,`29149` 是 Screen ID,`pts-0.sk` 是屏幕会话的名称。你可以使用 Screen ID 或相应的会话名称来连上、脱离和终止屏幕会话。 + +#### 创建命名会话 + +你还可以用你选择的任何自定义名称创建一个 Screen 会话,而不是默认用户名,如下所示。 + +``` +screen -S ostechnix +``` + +上面的命令将创建一个名为 `xxxxx.ostechnix` 的新 Screen 会话,并立即连上它。要从当前会话中脱离,请按 `Ctrl + a`,然后按 `d`。 + +当你想要查找哪些进程在哪些会话上运行时,命名会话会很有用。例如,当在会话中设置 LAMP 系统时,你可以简单地将其命名为如下所示。 + +``` +screen -S lampstack +``` + +#### 创建脱离的会话 + +有时,你可能想要创建一个会话,但不希望自动连上该会话。在这种情况下,运行以下命令来创建名为`senthil` 的已脱离会话: + +``` +screen -S senthil -d -m +``` + +也可以缩短为: + +``` +screen -dmS senthil +``` + +上面的命令将创建一个名为 `senthil` 的会话,但不会连上它。 + +#### 列出屏幕会话 + +要列出所有正在运行的会话(连上的或脱离的),请运行: + +``` +screen -ls +``` + +示例输出: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Detached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +如你所见,我有三个正在运行的会话,并且所有会话都已脱离。 + +#### 连上 Screen 会话 + +如果你想连上会话,例如 `29415.ostechnix`,只需运行: + +``` +screen -r 29415.ostechnix +``` + +或: + +``` +screen -r ostechnix +``` + +或使用 Screen ID: + +``` +screen -r 29415 +``` + +要验证我们是否连上到上述会话,只需列出打开的会话并检查。 + +``` +screen -ls +``` + +示例输出: + +``` +There are screens on: + 29700.senthil (Detached) + 29415.ostechnix (Attached) + 29149.pts-0.sk (Detached) +3 Sockets in /run/screens/S-sk. +``` + +如你所见,在上面的输出中,我们目前已连上到 `29415.ostechnix` 会话。要退出当前会话,请按 `ctrl + a d`。 + +#### 创建嵌套会话 + +当我们运行 `screen` 命令时,它将为我们创建一个会话。但是,我们可以创建嵌套会话(会话内的会话)。 + +首先,创建一个新会话或连上已打开的会话。然后我将创建一个名为 `nested` 的新会话。 + +``` +screen -S nested +``` + +现在,在会话中按 `Ctrl + a` 和 `c` 创建另一个会话。只需重复此操作即可创建任意数量的嵌套 Screen 会话。每个会话都将分配一个号码。号码将从 `0` 开始。 + +你可以按 `Ctrl + n` 移动到下一个会话,然后按 `Ctrl + p` 移动到上一个会话。 + +以下是管理嵌套会话的重要键盘快捷键列表。 + +* `Ctrl + a "` - 列出所有会话 +* `Ctrl + a 0` - 切换到会话号 0 +* `Ctrl + a n` - 切换到下一个会话 +* `Ctrl + a p` - 切换到上一个会话 +* `Ctrl + a S` - 将当前区域水平分割为两个区域 +* `Ctrl + a l` - 将当前区域垂直分割为两个区域 +* `Ctrl + a Q` - 关闭除当前会话之外的所有会话 +* `Ctrl + a X` - 关闭当前会话 +* `Ctrl + a \` - 终止所有会话并终止 Screen +* `Ctrl + a ?` - 显示键绑定。要退出,请按回车 +   +#### 锁定会话 + +Screen 有一个锁定会话的选项。为此,请按 `Ctrl + a` 和 `x`。 输入你的 Linux 密码以锁定。 + +``` +Screen used by sk on ubuntuserver. +Password: +``` + +#### 记录会话 + +你可能希望记录 Screen 会话中的所有内容。为此,只需按 `Ctrl + a` 和 `H` 即可。 + +或者,你也可以使用 `-L` 参数启动新会话来启用日志记录。 + +``` +screen -L +``` + +从现在开始,你在会话中做的所有活动都将记录并存储在 `$HOME` 目录中名为 `screenlog.x` 的文件中。这里,`x` 是一个数字。 + +你可以使用 `cat` 命令或任何文本查看器查看日志文件的内容。 + +![][3] + +*记录 Screen 会话* + +#### 终止 Screen 会话 + +如果不再需要会话,只需杀死它。要杀死名为 `senthil` 的脱离会话: + +``` +screen -r senthil -X quit +``` + +或: + +``` +screen -X -S senthil quit +``` + +或: + +``` +screen -X -S 29415 quit +``` + +如果没有打开的会话,你将看到以下输出: + +``` +$ screen -ls +No Sockets found in /run/screens/S-sk. +``` + +更多细节请参照 man 手册页: + +``` +$ man screen +``` + +还有一个名为 Tmux 的类似的命令行实用程序,它与 GNU Screen 执行相同的工作。要了解更多信息,请参阅以下指南。 + +* [Tmux 命令示例:管理多个终端会话][5] + +### 资源 + + * [GNU Screen 主页][6] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Screen-Command-Examples-720x340.jpg +[2]: https://www.ostechnix.com/how-to-upgrade-to-ubuntu-18-04-lts-desktop-and-server/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Log-screen-sessions.png +[4]: https://www.ostechnix.com/record-everything-terminal/ +[5]: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ +[6]: https://www.gnu.org/software/screen/ diff --git a/published/201906/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md b/published/201906/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md new file mode 100644 index 0000000000..0ba4d3469b --- /dev/null +++ b/published/201906/20190610 Search Linux Applications On AppImage, Flathub And Snapcraft Platforms.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10994-1.html) +[#]: subject: (Search Linux Applications On AppImage, Flathub And Snapcraft Platforms) +[#]: via: (https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用 +====== + +![Search Linux Applications On AppImage, Flathub And Snapcraft][1] + +Linux 一直在发展。过去,开发人员必须分别为不同的 Linux 发行版构建应用。由于存在多种 Linux 变体,因此为所有发行版构建应用变得很繁琐,而且非常耗时。后来一些开发人员发明了包转换器和构建器,如 [Checkinstall][2]、[Debtap][3] 和 [Fpm][4]。但他们也没有完全解决问题。所有这些工具都只是将一种包格式转换为另一种包格式。我们仍然需要找到应用并安装运行所需的依赖项。 + +好吧,时代已经变了。我们现在有了通用的 Linux 应用。这意味着我们可以在大多数 Linux 发行版上安装这些应用。无论是 Arch Linux、Debian、CentOS、Redhat、Ubuntu 还是任何流行的 Linux 发行版,通用应用都可以正常使用。这些应用与所有必需的库和依赖项打包在一个包中。我们所要做的就是在我们使用的任何 Linux 发行版上下载并运行它们。流行的通用应用格式有 AppImage、[Flatpak][5] 和 [Snap][6]。 + +AppImage 由 Simon peter 创建和维护。许多流行的应用,如 Gimp、Firefox、Krita 等等,都有这些格式,并可直接在下载页面下载。只需下载它们,使其可执行并立即运行它。你甚至无需 root 权限来运行 AppImage。 + +Flatpak 的开发人员是 Alexander Larsson(RedHat 员工)。Flatpak 应用托管在名为 “Flathub” 的中央仓库(商店)中。如果你是开发人员,建议你使用 Flatpak 格式构建应用,并通过 Flathub 将其分发给用户。 + +Snap 由 Canonical 而建,主要用于 Ubuntu。但是,其他 Linux 发行版的开发人员开始为 Snap 打包格式做出贡献。因此,Snap 也开始适用于其他 Linux 发行版。Snap 可以直接从应用的下载页面下载,也可以从 Snapcraft 商店下载。 + +许多受欢迎的公司和开发人员已经发布了 AppImage、Flatpak 和 Snap 格式的应用。如果你在寻找一款应用,只需进入相应的商店并获取你选择的应用并运行它,而不用管你使用何种 Linux 发行版。 + +还有一个名为 “Chob” 的命令行通用应用搜索工具可在 AppImage、Flathub 和 Snapcraft 平台上轻松搜索 Linux 应用。此工具仅搜索给定的应用并在默认浏览器中显示官方链接。它不会安装它们。本指南将解释如何安装 Chob 并使用它来搜索 Linux 上的 AppImage、Flatpak 和 Snap。 + +### 使用 Chob 在 AppImage、Flathub 和 Snapcraft 平台上搜索 Linux 应用 + +从[发布页面][7]下载最新的 Chob 二进制文件。在编写本指南时,最新版本为 0.3.5。 + +``` +$ wget https://github.com/MuhammedKpln/chob/releases/download/0.3.5/chob-linux +``` + +使其可执行: + +``` +$ chmod +x chob-linux +``` + +最后,搜索你想要的应用。例如,我将搜索与 Vim 相关的应用。 + +``` +$ ./chob-linux vim +``` + +Chob 将在 AppImage、Flathub 和 Snapcraft 平台上搜索给定的应用(和相关应用)并显示结果。 + +![][8] + +*使用 Chob 搜索 Linux 应用* + +只需要输入你想要应用前面的数字就可在默认浏览器中打开它的官方链接,并可在其中阅读应用的详细信息。 + +![][9] + +在浏览器中查看 Linux 应用的详细信息 + +有关更多详细信息,请查看下面的 Chob 官方 GitHub 页面。 + +资源: + + * [Chob 的 GitHub 仓库][10] + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/chob-720x340.png +[2]: https://www.ostechnix.com/build-packages-source-using-checkinstall/ +[3]: https://www.ostechnix.com/convert-deb-packages-arch-linux-packages/ +[4]: https://www.ostechnix.com/build-linux-packages-multiple-platforms-easily/ +[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ +[6]: https://www.ostechnix.com/introduction-ubuntus-snap-packages/ +[7]: https://github.com/MuhammedKpln/chob/releases +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Search-Linux-applications-Using-Chob.png +[9]: http://www.ostechnix.com/wp-content/uploads/2019/05/View-Linux-applications-Details.png +[10]: https://github.com/MuhammedKpln/chob diff --git a/published/201906/20190610 Try a new game on Free RPG Day.md b/published/201906/20190610 Try a new game on Free RPG Day.md new file mode 100644 index 0000000000..64e95e2ac3 --- /dev/null +++ b/published/201906/20190610 Try a new game on Free RPG Day.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10976-1.html) +[#]: subject: (Try a new game on Free RPG Day) +[#]: via: (https://opensource.com/article/19/5/free-rpg-day) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/erez/users/seth) + +在免费 RPG 日试玩一下新游戏 +====== + +> 6 月 15 日,你可以在当地的游戏商家庆祝桌面角色扮演游戏并获得免费的 RPG 资料。 + +![plastic game pieces on a board](https://img.linux.net.cn/data/attachment/album/201906/15/103929zqshc08df49dv0c2.jpg) + +(LCTT 译注:“免费 RPG 日Free RPG Day”是受“免费漫画书日Free Comic Book Day”启发而发起的庆祝活动,从 2007 年开始已经举办多次。这里的 RPG 游戏并非我们通常所指的电脑 RPG 游戏,而是指使用纸和笔的桌面游戏,是一种西方传统游戏形式。) + +你有没有想过尝试一下《龙与地下城Dungeons & Dragons》,但不知道如何开始?你是否在年轻时玩过《开拓者Pathfinder》并一直在考虑重返快乐时光?你是否对角色扮演游戏(RPG)感到好奇,但不确定你是否想玩一个?你是否对桌面游戏的概念完全陌生,直到现在才听说过这种 RPG 游戏?无论是哪一个并不重要,因为[免费 RPG 日] [2]适合所有人! + +第一个免费 RPG 日活动发生在 2007 年,是由世界各地的桌面游戏商家举办的。这个想法是以 0 美元的价格为新手和有经验的游戏玩家带来新的、独家的 RPG 快速入门规则和冒险体验。在这样的一天里,你可以走进当地的桌面游戏商家,得到一本小册子,其中包含桌面 RPG 的简单的初学者规则,你可以在商家里与那里的人或者回家与朋友一起玩。这本小册子是给你的,应该一直留着的。 + +这一活动如此的受欢迎,此后该传统一直延续至今。今年,免费 RPG 日定于 6 月 15 日星期六举行。 + +### 有什么收获? + +显然,免费 RPG 日背后的想法是让你沉迷于桌面 RPG 游戏。但在你本能的犬儒主义开始之前,考虑到它会慢慢上瘾,爱上一个鼓励你阅读规则和知识的游戏并不太糟,这样你和你的家人、朋友就有了共度时光的借口了。桌面 RPG 是一个功能强大、富有想象力和有趣的媒介,而免费 RPG 日则是对这种游戏很好的介绍。 + +![FreeRPG Day logo][3] + +### 开源游戏 + +像许多其他行业一样,开源现象影响了桌面游戏。回到世纪之交,《Magic:The Gathering and Dungeons&Dragons》 的提供者[威世智公司][4]Wizards of the Coast决定通过开发[开源游戏许可证][5]Open Game License(OGL)来采用开源方法。他们将此许可证用于世界上第一个 RPG(《龙与地下城Dungeons & Dragons》,D&D)的版本 3 和 3.5。几年后,当他们在第四版上(对开源)产生了动摇时,《Dragon》杂志的出版商复刻了 D&D 3.5 的“代码”,将其混制版本发布为《开拓者Pathfinder》 RPG,从而保持了创新和整个第三方游戏开发者产业的健康发展。最近,威世智公司在 D&D 5e 版本中才又重回了 OGL。 + +OGL 允许开发人员至少可以在他们自己产品中使用该游戏的机制。不管你可以不可以使用自定义怪物、武器、王国或流行角色的名称,但你可以随时使用 OGL 游戏的规则和数学计算。事实上,OGL 游戏的规则通常作为[系统参考文档][6](SRD)免费发布的,因此,无论你是否购买了规则书的副本,你都可以了解游戏的玩法。 + +如果你之前从未玩过桌面 RPG,那么使用笔和纸玩的游戏也可以拥有游戏引擎似乎很奇怪,但计算就是计算,不管是数字的还是模拟的。作为一个简单的例子:假设游戏引擎规定玩家角色有一个代表其力量的数字。当那个玩家角色与一个有其两倍力量的巨人战斗时,在玩家掷骰子以增加她的角色的力量攻击时,真的会感到紧张。如果没有掷出一个很好的点数的话,她的力量将无法与巨人相匹敌。知道了这一点,第三方或独立开发者就可以为这个游戏引擎设计一个怪物,同时了解骰子滚动可能对玩家的能力得分产生的影响。这意味着他们可以根据游戏引擎的优先级进行数学计算。他们可以设计一系列用来杀死的怪物,在游戏引擎的环境中它们具有有意义的能力和技能,并且他们可以宣称与该引擎的兼容性。 + +此外,OGL 允许出版商为其材料定义产品标识。产品标识可以是出版物的商业外观(图形元素和布局)、徽标、术语、传说、专有名称等。未经出版商同意,任何定义为产品标识的内容都可能**无法**重复使用。例如,假设一个出版商发行了一本武器手册,其中包括一个名为 Sigint 的魔法砍刀,它对所有针对僵尸的攻击都给予 +2 魔法附加攻击值。这个特性来自一个故事,该砍刀是一个具有潜伏的僵尸基因的科学家锻造的。但是,该出版物在 OGL 第 1e 节中列出的所有武器的正确名称都被保留为产品标识。这意味着你可以在自己的出版物中使用该数字(武器的持久性、它所造成的伤害,+2 魔法奖励等等)以及与该武器相关的传说(它由一个潜伏的僵尸锻造),但是你不能使用该武器的名称(Sigint)。 + +OGL 是一个非常灵活的许可证,因此开发人员必须仔细阅读其第 1e 节。 一些出版商只保留出版物本身的布局,而其他出版商保留除数字和最通用术语之外的所有内容。 + +当卓越的 RPG 特许经营权拥抱开源时,至今仍能感受到的它给整个行业掀起的波澜。第三方开发人员可以为 5e 和《开拓者》系统创建内容。由威世智公司创建的整个 [DungeonMastersGuild.com][7] 网站为 D&D 5e 制作了独立内容,旨在促进独立出版。[Starfinder][8]、[OpenD6][9]、[战士,盗贼和法师][10]、[剑与巫师][11] 等及很多其它游戏都采用了 OGL。其他系统,如 Brent Newhall 的 《[Dungeon Delvers][12]》、《[Fate][13]》、《[Dungeon World][14]》 等等,都是根据[知识共享许可][15]授权的的。 + +### 获取你的 RPG + +在免费 RPG 日,你可以前往当地游戏商铺,玩 RPG 以及获取与朋友将来一起玩的 RPG 游戏材料。就像[Linux 安装节][16]Linux installfest[软件自由日][17]Software Freedom Day一样,该活动的定义很松散。每个商家举办的自由 RPG 日都有所不同,每个商家都可以玩他们选择的任何游戏。但是,游戏发行商捐赠的免费内容每年都是相同的。显然,免费的东西视情况而定,但是当你参加免费 RPG 日活动时,请注意有多少游戏采用了开源许可证(如果是 OGL 游戏,OGL 会打印在书背面)。《开拓者》、《Starfinder》 和 D&D 的任何内容肯定都会带有 OGL 的一些优势。许多其他系统的内容使用知识共享许可。有些则像 90 年代复活的 [Dead Earth][18] RPG 一样,使用 [GNU 自由文档许可证] [19]。 + +有大量的游戏资源是通过开源许可证开发的。你可能需要也可能不需要关心游戏的许可证;毕竟,许可证与你是否可以与朋友一起玩无关。但是如果你喜欢支持[自由文化][20]而不仅仅是你运行的软件,那么试试一些 OGL 或知识共享游戏吧。如果你不熟悉游戏,请在免费 RPG 日在当地游戏商家试玩桌面 RPG 游戏! + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/free-rpg-day + +作者:[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/users/erez/users/seth +[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]: https://www.freerpgday.com/ +[3]: https://opensource.com/sites/default/files/uploads/freerpgday-logoblank.jpg (FreeRPG Day logo) +[4]: https://company.wizards.com/ +[5]: http://www.opengamingfoundation.org/licenses.html +[6]: https://www.d20pfsrd.com/ +[7]: https://www.dmsguild.com/ +[8]: https://paizo.com/starfinder +[9]: https://ogc.rpglibrary.org/index.php?title=OpenD6 +[10]: http://www.stargazergames.eu/games/warrior-rogue-mage/ +[11]: https://froggodgames.com/frogs/product/swords-wizardry-complete-rulebook/ +[12]: http://brentnewhall.com/games/doku.php?id=games:dungeon_delvers +[13]: http://www.faterpg.com/licensing/licensing-fate-cc-by/ +[14]: http://dungeon-world.com/ +[15]: https://creativecommons.org/ +[16]: https://www.tldp.org/HOWTO/Installfest-HOWTO/introduction.html +[17]: https://www.softwarefreedomday.org/ +[18]: https://mixedsignals.ml/games/blog/blog_dead-earth +[19]: https://www.gnu.org/licenses/fdl-1.3.en.html +[20]: https://opensource.com/article/18/1/creative-commons-real-world diff --git a/published/201906/20190610 Welcoming Blockchain 3.0.md b/published/201906/20190610 Welcoming Blockchain 3.0.md new file mode 100644 index 0000000000..0bd9086504 --- /dev/null +++ b/published/201906/20190610 Welcoming Blockchain 3.0.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (murphyzhao) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10987-1.html) +[#]: subject: (Welcoming Blockchain 3.0) +[#]: via: (https://www.ostechnix.com/welcoming-blockchain-3-0/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +迎接区块链 3.0 +====== + +![欢迎区块链 3.0][1] + +“[区块链 2.0][2]” 系列文章讨论了自 2008 年比特币等加密货币问世以来区块链技术的发展。本文将探讨区块链的未来发展。**区块链 3.0** 这一新的 DLT(分布式分类帐本技术Distributed Ledger Technology)演进浪潮将回答当前区块链所面临的问题(每一个问题都会在这里总结)。下一版本的技术标准也将带来全新的应用和使用案例。在本文的最后,我们也会看一些当前使用这些原则的案例。 + +以下是现有区块链平台的几个缺点,并针对这些缺点给出了建议的解决方案。 + +### 问题 1:可扩展性 + +这个问题 [^1]被视为普遍采用该技术的第一个主要障碍。正如之前所讨论的,很多因素限制了区块链同时处理大量交易的能力。诸如 [以太坊][3] 之类的现有网络每秒能够进行 10-15 次交易(TPS),而像 Visa 所使用的主流网络每秒能够进行超过 2000 次交易。**可扩展性**是困扰所有现代数据库系统的问题。正如我们在这里看到的那样,改进的共识算法和更好的区块链架构设计正在改进它。 + +#### 解决可扩展性 + +已经提出了更精简、更有效的一致性算法来解决可扩展性问题,并且不会影响区块链的主要结构。虽然大多数加密货币和区块链平台使用资源密集型的 PoW 算法(例如,比特币和以太坊)来生成区块,但是存在更新的 DPoS 和 PoET 算法来解决这个问题。DPoS 和 PoET 算法(还有一些正在开发中)需要更少的资源来维持区块链,并且已显示具有高达 1000 TPS 的吞吐量,可与流行的非区块链系统相媲美。 + +可扩展性问题的第二个解决方案是完全改变区块链结构和功能。我们不会详细介绍这一点,但已经提出了诸如有向无环图Directed Acyclic Graph(DAG)之类的替代架构来处理这个问题。从本质上讲,这项工作假设并非所有网络节点都需要整个区块链的副本才能使区块链正常工作,或者并非所有的参与者需要从 DLT 系统获得好处。系统不要求所有参与者验证交易,只需要交易发生在共同的参考框架中并相互链接。 + +在比特币系统中使用[闪电网络][11]Lightning network来实现 DAG,而以太坊使用他们的[切片][12]Sharding 协议来实现 DAG。本质上,从技术上来看 DAG 实现并不是区块链。它更像是一个错综复杂的迷宫,只是仍然保留了区块链的点对点和分布式数据库属性。稍后我们将在另一篇文章中探讨 DAG 和 Tangle 网络。 + +### 问题 2:互通性 + +**互通性**[^4] [^5] 被称为跨链访问,基本上就是指不同区块链之间彼此相互通信以交换指标和信息。由于目前有数不清的众多平台,不同公司为各种应用提供了各种专有系统,平台之间的互操作性就至关重要。例如,目前在一个平台上拥有数字身份的人无法利用其他平台提供的功能,因为各个区块链彼此之间互不了解、不能沟通。这是由于缺乏可靠的验证、令牌交换等有关的问题仍然存在。如果平台之间不能够相互通信,面向全球推出[智能合约][4]也是不可行的。 + +#### 解决互通性 + +有一些协议和平台专为实现互操作性而设计。这些平台实现了原子交换协议,并向不同的区块链系统提供开放场景,以便在它们之间进行通信和交换信息。**“0x (ZRX)”** 就是其中的一个例子,稍后将对进行描述。 + +### 问题 3:治理 + +公有链中的治理 [^6] 本身不是限制,而是需要像社区道德指南针一样,在区块链的运作中考虑每个人的意见。结合起来并规模性地看,能预见这样一个问题,即要么协议更改太频繁,要么协议被拥有最多令牌的“中央”权威一时冲动下修改。不过这不是大多数公共区块链目前正在努力避免的问题,因为其运营规模和运营性质不需要更严格的监管。 + +#### 解决治理问题 + +上面提到的复杂的框架或 DAG 几乎可以消除对全球(平台范围)治理法规的需要和使用。相反,程序可以自动监督事务和用户类型,并决定需要执行的法律。 + +### 问题 4:可持续性 + +可持续性再次建立在可扩展性问题的基础上。当前的区块链和加密货币因不可长期持续而倍遭批评,这是由于仍然需要大量的监督,并且需要大量资源保持系统运行。如果你读过最近“挖掘加密货币”已经没有这么大利润的相关报道,你就知道“挖矿”图利就是它的本来面目。保持现有平台运行所需的资源量在全球范围和主流使用方面根本不实用。 + +#### 解决不可持续性问题 + +从资源或经济角度来看,可持续性的答案与可扩展性的答案类似。但是,要在全球范围内实施这一制度,法律和法规必须予以认可。然而,这取决于世界各国政府。来自美国和欧洲政府的有利举措重新燃起了对这方面的希望。 + +### 问题 5:用户采用 + +目前,阻止消费者广泛采用 [^7] 基于区块链的应用程序的一个障碍是消费者对平台及其底层的技术不熟悉。事实上,大多数应用程序都需要某种技术和计算背景来弄清楚它们是如何工作的,这在这方面也没有帮助。区块链开发的第三次浪潮旨在缩小消费者知识与平台可用性之间的差距。 + +#### 解决用户采用问题 + +互联网花了很长的时间才发展成现在的样子。多年来,人们在开发标准化互联网技术栈方面做了大量的工作,使 Web 能够像现在这样运作。开发人员正在开发面向用户的前端分布式应用程序,这些应用程序应作为现有 Web 3.0 技术之上的一层,同时由下面的区块链和开放协议的支持。这样的[分布式应用][5]将使用户更熟悉底层技术,从而增加主流采用。 + +### 在当前场景中的应用 + +我们已经从理论上讨论了上述问题的解决方法,现在我们将继续展示这些方法在当前场景中的应用。 + +- [0x][6] – 是一种去中心化的令牌交换,不同平台的用户可以在不需要中央权威机构审查的情况下交换令牌。他们的突破在于,他们如何设计系统使得仅在交易结算后才记录和审查数据块,而不是通常的在交易之间进行(为了验证上下文,通常也会验证交易之前的数据块)。这使在线数字资产交换更快速。 +- [Cardano][7] – 由以太坊的联合创始人之一创建,Cardano 自诩为一个真正“科学”的平台,和采用了严格的协议,对开发的代码和算法进行了多次审查。Cardano 的所有内容都在数学上尽可能的进行了优化。他们的共识算法叫做 **Ouroboros**,是一种改进的权益证明Proof of Stake(PoS)算法。Cardano 是用 [**haskell**][8] 开发的,智能合约引擎使用 haskell 的衍生工具 **plutus** 进行操作。这两者都是函数式编程语言,可以保证安全交易而不会影响效率。 +- EOS – 我们已经在 [这篇文章][9] 中描述了 EOS。 +- [COTI][10] – 一个鲜为人知的架构,COTI 不需要挖矿,而且在运行过程中趋近于零功耗。它还将资产存储在本地用户设备上的离线钱包中,而不是存储在纯粹的对等网络上。它们也遵循基于 DAG 的架构,并声称处理吞吐量高达 10000 TPS。他们的平台允许企业在不利用区块链的情况下建立自己的加密货币和数字化货币钱包。 + +[^1]: A. P. Paper, K. Croman, C. Decker, I. Eyal, A. E. Gencer, and A. Juels, “On Scaling Decentralized Blockchains | SpringerLink,” 2018. +[^4]: [Why is blockchain interoperability important][13] +[^5]: [The Importance of Blockchain Interoperability][14] +[^6]: R. Beck, C. Müller-Bloch, and J. L. King, “Governance in the Blockchain Economy: A Framework and Research Agenda,” J. Assoc. Inf. Syst., pp. 1020–1034, 2018. +[^7]: J. M. Woodside, F. K. A. Jr, W. Giberson, F. K. J. Augustine, and W. Giberson, “Blockchain Technology Adoption Status and Strategies,” J. Int. Technol. Inf. Manag., vol. 26, no. 2, pp. 65–93, 2017. + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/welcoming-blockchain-3-0/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[murphyzhao](https://github.com/murphyzhao) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/blockchain-720x340.jpg +[2]: https://linux.cn/article-10650-1.html +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[6]: https://0x.org/ +[7]: https://www.cardano.org/en/home/ +[8]: https://www.ostechnix.com/getting-started-haskell-programming-language/ +[9]: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ +[10]: https://coti.io/ +[11]: https://cryptoslate.com/beyond-blockchain-directed-acylic-graphs-dag/ +[12]: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#introduction +[13]: https://www.capgemini.com/2019/02/can-the-interoperability-of-blockchains-change-the-world/ +[14]: https://medium.com/wanchain-foundation/the-importance-of-blockchain-interoperability-b6a0bbd06d11 diff --git a/published/201906/20190612 Installing alternative versions of RPMs in Fedora.md b/published/201906/20190612 Installing alternative versions of RPMs in Fedora.md new file mode 100644 index 0000000000..54406f13ba --- /dev/null +++ b/published/201906/20190612 Installing alternative versions of RPMs in Fedora.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10999-1.html) +[#]: subject: (Installing alternative versions of RPMs in Fedora) +[#]: via: (https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +在 Fedora 中安装替代版本的 RPM 包 +====== + +![][1] + +[模块化][2]Modularity使 Fedora 能够在仓库中提供替代版本的 RPM 软件包。每个 Fedroa 版本可以原生构建不同应用、语言运行时和工具版本的多个版本。 + +Fedora Magazine 大约一年前就写了 [Fedora 28 服务器版的模块化][3]。那时,它只是一个有附加内容的可选仓库,并且明确只支持服务器版。到目前为止,它已经发生了很多变化,现在**模块化是 Fedora 发行版的核心部分**。一些软件包已完全变成模块。在编写本文时,Fedora 30 的 49,464 个二进制 RPM 软件包中的 1,119(2.26%)来自模块([关于这个数字的更多信息][4])。 + +### 模块化基础知识 + +由于许多软件包有不同的版本会让人难以承受(并且难以管理),所以包被分组为**模块**,它可以代表一个应用程序、一个语言运行时或任何其他合理的组。 + +模块通常有多个**流**,这通常代表软件的主要版本。它可以并行使用,但在给定系统上只能安装每个模块的一个流。 + +为了不让用户因为太多选择而难以承受,每个 Fedora 版本都有一组**默认**,因此只需要在需要时做出决定。 + +最后,为了简化安装,可以根据用例使用预定义的 **profile** 选择性地安装模块。例如,数据库模块可以作为客户端,服务端或同时安装。 + +### 实际使用模块化 + +当你在 Fedora 系统上安装 RPM 软件包时,它很可能它来自模块流。你可能没有注意到的原因之一是模块化的核心原则之一是在你探究之前保持不可见。 + +让我们比较以下两种情况。首先,安装流行的 i3 平铺窗口管理器,然后安装极简化的 dwm 窗口管理器: + +``` +$ sudo dnf install i3 +... +Done! +``` + +正如所料,上面的命令会在系统上安装 i3 包及其依赖项。这里没有其他事情发生。但另一个会怎么样? + +``` +$ sudo dnf install dwm +... +Enabling module streams: + dwm 6.1 +... +Done! +``` + +感觉是一样的,但后台发生了一些事情 。它启用了默认的 dwm 模块流(6.1),并且安装了模块中的 dwm 包。 + +为了保持透明,输出中有一条关于模块自动启用的消息。但除此之外,用户不需要了解模块化的任何信息,以便按照他们一贯的方式使用他们的系统。 + +但如果他们使用模块化方式呢?让我们看看如何安装不同版本的 dwm。 + +使用以下命令查看可用的模块流: + +``` +$ sudo dnf module list +... +dwm latest ... +dwm 6.0 ... +dwm 6.1 [d] ... +dwm 6.2 ... +... +Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled +``` + +输出显示 dwm 模块有四个流,6.1 是默认值。 + +要安装不同版本的 dwm 包,例如,安装 6.2 的流。启用它,然后使用以下两个命令安装软件包: + +``` +$ sudo dnf module enable dwm:6.2 +... +Enabling module streams: + dwm 6.2 +... +Done! +$ sudo dnf install dwm +... +Done! +``` + +最后,让我们看下配置,以 PostgreSQL 为例。 + +``` +$ sudo dnf module list +... +postgresql 9.6 client, server ... +postgresql 10 client, server ... +postgresql 11 client, server ... +... +``` + +要安装 PostgreSQL 11 服务端,使用以下命令: + +``` +$ sudo dnf module install postgresql:11/server +``` + +请注意,除了启用流之外,我们可以指定配置从而使用一条命令安装模块。 + +可以立即安装多个版本。要添加客户端工具,使用下面的命令: + +``` +$ sudo dnf module install postgresql:11/client +``` + +还有许多其他带有多个流的模块可供选择。在编写本文时,Fedora 30 中有 83 个模块流。包括两个版本的 MariaDB、三个版本的 Node.js、两个版本的 Ruby 等等。 + +有关完整的命令集(包括从一个流切换到另一个流),请参阅[模块化的官方用户文档][5]。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/installing-alternative-rpm-versions-in-fedora/ + +作者:[Adam Šamalík][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://fedoramagazine.org/author/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/modularity-f30-816x345.jpg +[2]: https://docs.pagure.org/modularity +[3]: https://linux.cn/article-10479-1.html +[4]: https://blog.samalik.com/2019/06/12/counting-modularity-packages.html +[5]: https://docs.fedoraproject.org/en-US/modularity/using-modules/ diff --git a/published/201906/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md b/published/201906/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md new file mode 100644 index 0000000000..03a5f4dd47 --- /dev/null +++ b/published/201906/20190613 Open hardware for musicians and music lovers- Headphone, amps, and more.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10998-1.html) +[#]: subject: (Open hardware for musicians and music lovers: Headphone, amps, and more) +[#]: via: (https://opensource.com/article/19/6/hardware-music) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +音乐家和音乐爱好者的开放硬件:耳机、放大器等 +====== + +> 从 3D 打印乐器到无线播放声音的设备,有很多通过开放硬件项目来奏乐的方法。 + +![][1] + +这个世界到处都是很棒的[开源音乐播放器][2],但为什么只是将开源用在播放音乐上呢?你还可以使用开源硬件奏乐。本文中描述的所有工具都是经过了[开源硬件协会][3](OSHWA)认证的。这意味着你可以自由地构建它们,重新组合它们,或者用它们做任何其他事情。 + +### 开源乐器 + +当你想奏乐时使用乐器总是最好的方式之一。如果你喜欢传统的的乐器,那么 [F-F-Fiddle][4] 可能适合你。 + +![F-f-fiddle][5] + +F-F-Fiddle 是一款全尺寸电子小提琴,你可以使用标准的桌面 3D 打印机制作(采用[熔丝制造][6])。如果你想眼见为真,那么这里有一个 F-F-Fiddle 的视频: https://img.linux.net.cn/static/video/The%20F-F-Fiddle-8NDWVcJJS2Y.mp4 + +如果你精通小提琴,但还对一些更具异国情调的东西感兴趣?[开源的特雷门琴][7]Open Theremin怎么样? + +![Open Theremin][8] + +与所有特雷门琴一样,开源特雷门琴可让你在不触碰乐器的情况下播放音乐。当然,它特别擅长为你的下一个科幻视频或空间主题派对制作[令人毛骨悚然的空间声音][9]。 + +[Waft][10] 的操作类似,也可以远程控制声音。它使用[激光雷达][11]来测量手与传感器的距离。看看这个: https://img.linux.net.cn/static/video/Waft%20Prototype%2012-Feb-2017-203705197.mp4 + +Waft 是特雷门琴吗?我不确定算不算,特雷门琴高手可以在下面的评论里发表一下看法。 + +如果特雷门琴对你来说太熟悉了,[SIGNUM][12] 可能就是你想要的。用其开发人员的话说,SIGNUM 通过将不可见的无线通信转换为可听信号来“揭示加密的信息代码和人/机通信的语言”。 + +![SIGNUM][13] + +这是演示: https://img.linux.net.cn/static/video/SIGNUM_Portable%20Analog%20Instrumentation%20Amplifier-142831757.mp4 + +### 输入 + +无论你使用什么乐器,都需要将其接到某些东西上。如果你想要连接到树莓派,请尝试 [AudioSense-Pi][14],它允许你一次将多个输入和输出连接到你的树莓派。 + +![AudioSense-Pi][15] + +### 合成器 + +合成器怎么样?SparkFun 的 [SparkPunk Sound Kit][16] 是一个简单的合成器,为你提供了很多音色。 + +![SparkFun SparkPunk Sound Kit][17] + +### 耳机 + +制作所有这些音乐很棒,但你还需要考虑如何听它。幸运的是,[EQ-1耳机][18]是开源,支持 3D 打印。 + +![EQ-1 headphones][19] + +你用开源硬件制作音乐吗?让我们在评论中知道! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/hardware-music + +作者:[Michael Weinberg][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/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_musicinfinity.png?itok=7LkfjcS9 +[2]: https://opensource.com/article/19/2/audio-players-linux +[3]: https://certification.oshwa.org/ +[4]: https://certification.oshwa.org/us000010.html +[5]: https://opensource.com/sites/default/files/uploads/f-f-fiddle.png (F-f-fiddle) +[6]: https://en.wikipedia.org/wiki/Fused_filament_fabrication +[7]: https://certification.oshwa.org/ch000001.html +[8]: https://opensource.com/sites/default/files/uploads/open-theremin.png (Open Theremin) +[9]: https://youtu.be/p05ZSHRYXVA?t=771 +[10]: https://certification.oshwa.org/uk000005.html +[11]: https://en.wikipedia.org/wiki/Lidar +[12]: https://certification.oshwa.org/es000003.html +[13]: https://opensource.com/sites/default/files/uploads/signum.png (SIGNUM) +[14]: https://certification.oshwa.org/in000007.html +[15]: https://opensource.com/sites/default/files/uploads/audiosense-pi.png (AudioSense-Pi) +[16]: https://certification.oshwa.org/us000016.html +[17]: https://opensource.com/sites/default/files/uploads/sparkpunksoundkit.png (SparkFun SparkPunk Sound Kit) +[18]: https://certification.oshwa.org/us000038.html +[19]: https://opensource.com/sites/default/files/uploads/eq-1-headphones.png (EQ-1 headphones) diff --git a/published/201906/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md b/published/201906/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md new file mode 100644 index 0000000000..fe9c2a13a6 --- /dev/null +++ b/published/201906/20190613 Ubuntu Kylin- The Official Chinese Version of Ubuntu.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10995-1.html) +[#]: subject: (Ubuntu Kylin: The Official Chinese Version of Ubuntu) +[#]: via: (https://itsfoss.com/ubuntu-kylin/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +优麒麟:Ubuntu 的官方中文版本 +====== + +> 让我们来看看国外是如何看优麒麟的。 + +[Ubuntu 有几个官方特色版本][1],优麒麟(Ubuntu Kylin)是它们中的一个。在这篇文章中,你将了解到优麒麟,它是什么,它为什么被创建,它的特色是什么。 + +麒麟操作系统最初由中华人民共和国的[国防科技大学][2]的院士在 2001 年开发。名字来源于[麒麟][3],这是一种来自中国神话的神兽。 + +麒麟操作系统的第一个版本基于 [FreeBSD][4],计划用于中国军方和其它政府组织。麒麟 3.0 完全基于 Linux 内核,并且在 2010 年 12 月发布一个称为 [NeoKylin][5] 的版本。 + +在 2013 年,[Canonical][6] (Ubuntu 的母公司) 与中华人民共和国的[工业和信息化部][7] 达成共识,共同创建和发布一个针对中国市场特色的基于 Ubuntu 的操作系统。 + +![Ubuntu Kylin][8] + +### 优麒麟是什么? + +根据上述 2013 年的共识,优麒麟现在是 Ubuntu 的官方中国版本。它不仅仅是语言本地化。事实上,它决心服务中国市场,就像 Ubuntu 服务全球市场一样。 + +[优麒麟][9]的第一个版本与 Ubuntu 13.04 一起到来。像 Ubuntu 一样,优麒麟也有 LTS (长期支持)和非 LTS 版本。 + +当前,优麒麟 19.04 LTS 采用了 [UKUI][10] 桌面环境,修改了启动动画、登录/锁屏程序和操作系统主题。为给用户提供更友好的体验,它修复了一些错误,带有文件预览、定时注销等功能,最新的 [WPS 办公组件][11]和 [搜狗][12] 输入法集成于其中。 + +- [https://youtu.be/kZPtFMWsyv4](https://youtu.be/kZPtFMWsyv4) + +银河麒麟 4.0.2 是一个基于优麒麟 16.04 LTS 的社区版本。它包含一些带有长期稳定支持的第三方应用程序。它非常适合服务器和日常桌面办公使用,欢迎开发者[下载][13]。麒麟论坛积极地获取来自提供的反馈以及解决问题来找到解决方案。 + +#### UKUI:优麒麟的桌面环境 + +![Ubuntu Kylin 19.04 with UKUI Desktop][15] + +[UKUI][16] 由优麒麟开发小组设计和开发,有一些非常好的特色和预装软件: + + * 类似 Windows 的交互功能,带来更友好的用户体验。安装导向易于使用,用户可以快速使用优麒麟。 + * 控制中心对主题和窗口采用了新的设置。如开始菜单、任务栏、文件管理器、窗口管理器和其它的组件进行了更新。 + * 在 Ubuntu 和 Debian 存储库上都可用,为 Debian/Ubuntu 发行版和其全球衍生版的的用户提供一个新单独桌面环境。 + * 新的登录和锁定程序,它更稳定和具有很多功能。 + * 包括一个反馈问题的实用的反馈程序。 + +#### 麒麟软件中心 + +![Kylin Software Center][17] + +麒麟有一个软件中心,类似于 Ubuntu 软件中心,并被称为优麒麟软件中心。它是优麒麟软件商店的一部分,该商店也包含优麒麟开发者平台和优麒麟存储库,具有一个简单的用户界面,并功能强大。它同时支持 Ubuntu 和优麒麟存储库,并特别适用于由优麒麟小组开发的中文特有的软件的快速安装! + +#### 优客:一系列的工具 + +优麒麟也有一系列被命名为优客的工具。在麒麟开始菜单中输入 “Youker” 将带来麒麟助手。如果你在键盘上按 “Windows” 按键,像你在 Windows 上一样,它将打开麒麟开始菜单。 + +![Kylin Assistant][18] + +其它麒麟品牌的应用程序包括麒麟影音(播放器)、麒麟刻录,优客天气、优客 Fcitx 输入法,它们更好地支持办公工作和个人娱乐。 + +![Kylin Video][19] + +#### 特别专注于中文 + +通过与金山软件合作,优麒麟开发者也致力于 Linux 版本的搜狗拼音输入法、快盘和优麒麟版本的金山 WPS,并解决了智能拼音、云存储和办公应用程序方面的问题。[拼音][20] 是中文字符的拉丁化系统。使用这个系统,用户用英文键盘输入,但在屏幕上将显示中文字符。 + +#### 有趣的事实:优麒麟运行在中国超级计算机上 + +![Tianhe-2 Supercomputer. Photo by O01326 – Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=45399546][22] + +众所周知[世界上最快的超级计算机 500 强都在运行 Linux][23]。中国超级计算机[天河-1][24]和[天河-2][25]都使用优麒麟的 64 位版本,致力于高性能的[并行计算][26]优化、电源管理和高性能的[虚拟化计算][27]。 + +### 总结 + +我希望你喜欢这篇优麒麟世界的介绍。你可以从它的[官方网站][28]获得优麒麟 19.04 或基于 Ubuntu 16.04 的社区版本(银河麒麟)。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-kylin/ + +作者:[Avimanyu Bandyopadhyay][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/which-ubuntu-install/ +[2]: https://english.nudt.edu.cn +[3]: https://www.thoughtco.com/what-is-a-qilin-195005 +[4]: https://itsfoss.com/freebsd-12-release/ +[5]: https://thehackernews.com/2015/09/neokylin-china-linux-os.html +[6]: https://www.canonical.com/ +[7]: http://english.gov.cn/state_council/2014/08/23/content_281474983035940.htm +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Ubuntu-Kylin.jpeg?resize=800%2C450&ssl=1 +[9]: http://www.ubuntukylin.com/ +[10]: http://ukui.org +[11]: https://www.wps.com/ +[12]: https://en.wikipedia.org/wiki/Sogou_Pinyin +[13]: http://www.ubuntukylin.com/downloads/show.php?lang=en&id=122 +[14]: https://itsfoss.com/solve-ubuntu-error-failed-to-download-repository-information-check-your-internet-connection/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/ubuntu-Kylin-19-04-desktop.jpg?resize=800%2C450&ssl=1 +[16]: http://www.ukui.org/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-software-center.jpg?resize=800%2C496&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-assistant.jpg?resize=800%2C535&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/kylin-video.jpg?resize=800%2C533&ssl=1 +[20]: https://en.wikipedia.org/wiki/Pinyin +[21]: https://itsfoss.com/remove-old-kernels-ubuntu/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/tianhe-2.jpg?resize=800%2C600&ssl=1 +[23]: https://itsfoss.com/linux-runs-top-supercomputers/ +[24]: https://en.wikipedia.org/wiki/Tianhe-1 +[25]: https://en.wikipedia.org/wiki/Tianhe-2 +[26]: https://en.wikipedia.org/wiki/Parallel_computing +[27]: https://computer.howstuffworks.com/how-virtual-computing-works.htm +[28]: http://www.ubuntukylin.com diff --git a/published/201906/20190614 How to send email from the Linux command line.md b/published/201906/20190614 How to send email from the Linux command line.md new file mode 100644 index 0000000000..b8754241ab --- /dev/null +++ b/published/201906/20190614 How to send email from the Linux command line.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: (Modrisco) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11020-1.html) +[#]: subject: (How to send email from the Linux command line) +[#]: via: (https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +如何用 Linux 命令行发电子邮件 +====== + +> Linux 提供了几个可以让你通过终端发送电子邮件的命令,下面来展示一些有趣的方法。 + +![Molnia/iStock][1] + +Linux 可以用多种方式通过命令行发送电子邮件。有一些方法十分简单,有一些相对会复杂一些,不过仍旧提供了很多有用的特性。选择哪一种方式取决于你想要什么 —— 向同事快速发送消息,还是向一批人群发带有附件的更复杂的信息。接下来看一看几种可行方案: + +### mail + +发送一条简单消息最便捷的 Linux 命令是 `mail`。假设你需要提醒老板你今天得早点走,你可以使用这样的一条命令: + +``` +$ echo "Reminder: Leaving at 4 PM today" | mail -s "early departure" myboss +``` + +另一种方式是从一个文件中提取出你想要发送的文本信息: + +``` +$ mail -s "Reminder:Leaving early" myboss < reason4leaving +``` + +在以上两种情况中,你都可以通过 `-s` 来为邮件添加标题。 + +### sendmail + +使用 `sendmail` 命令可以发送一封不包含标题的快信。(用目标收件人替换 `recip`): + +``` +$ echo "leaving now" | sendmail recip +``` + +你可以用这条命令发送一条只有标题,没有内容的信息: + +``` +$ echo "Subject: leaving now" | sendmail recip +``` + +你也可以用 `sendmail` 发送一条包含一条标题行的完整信息。不过使用这个方法时,你的标题行会被添加到要发送的文件中,如下例所示: + +``` +Subject: Requested lyrics +I would just like to say that, in my opinion, longer hair and other flamboyant +affectations of appearance are nothing more ... +``` + +你也可以发送这样的文件(`lyric` 文件包含标题和正文): + +``` +$ sendmail recip < lyrics +``` + +`sendmain` 的输出也可以很冗长。如果你感到好奇并希望查看发送系统和接收系统之间的交互,请添加 `-v` (verbose)选项。 + +``` +$ sendmail -v recip@emailsite.com < lyrics +``` + +### mutt + +`mutt` 是通过命令行发送邮件的一个很好的工具,在使用前你需要安装它。`mutt` 的一个很方便的优势就是它允许你在邮件中添加附件。 + +使用 `mutt` 发送一条快速信息: + +``` +$ echo "Please check last night's backups" | mutt -s "backup check" recip +``` + +从文件中获取内容: + +``` +$ mutt -s "Agenda" recip < agenda +``` + +使用 `-a` 选项在 `mutt` 中添加附件。你甚至可以添加不止一个附件 —— 如下一条命令所示: + +``` +$ mutt -s "Agenda" recip -a agenda -a speakers < msg +``` + +在以上的命令中,`msg` 文件包含了邮件中的正文。如果你没有其他补充的内容,你可以这样来代替之前的命令: + +``` +$ echo "" | mutt -s "Agenda" recip -a agenda -a speakers +``` + +`mutt` 另一个有用的功能是可以添加抄送(`-c`)和密送(`-b`)。 + +``` +$ mutt -s "Minutes from last meeting" recip@somesite.com -c myboss < mins +``` + +### telnet + +如果你想深入了解发送电子邮件的细节,你可以使用 `telnet` 来进行电子邮件交互操作。但正如所说的那样,你需要“学习术语”。邮件服务器期望一系列命令,其中包括自我介绍(`EHLO` 命令)、提供发件人(`MAIL FROM` 命令)、指定收件人(`RCPT TO` 命令),然后添加消息(`DATA`)并以 `.` 结束消息。并不是所有的电子邮件服务器都会响应这些请求。此方法通常仅用于故障排除。 + +``` +$ telnet emailsite.org 25 +Trying 192.168.0.12... +Connected to emailsite. +Escape character is '^]'. +220 localhost ESMTP Sendmail 8.15.2/8.15.2/Debian-12; Wed, 12 Jun 2019 16:32:13 -0400; (No UCE/UBE) logging access from: mysite(OK)-mysite [192.168.0.12] +EHLO mysite.org <== introduce yourself +250-localhost Hello mysite [127.0.0.1], pleased to meet you +250-ENHANCEDSTATUSCODES +250-PIPELINING +250-EXPN +250-VERB +250-8BITMIME +250-SIZE +250-DSN +250-ETRN +250-AUTH DIGEST-MD5 CRAM-MD5 +250-DELIVERBY +250 HELP +MAIL FROM: me@mysite.org <== 指定发件人 +250 2.1.0 shs@mysite.org... Sender ok +RCPT TO: recip <== 指定收件人 +250 2.1.5 recip... Recipient ok +DATA <== 邮件内容开始 +354 Enter mail, end with "." on a line by itself +This is a test message. Please deliver it for me. +. <== 内容结束 +250 2.0.0 x5CKWDds029287 Message accepted for delivery +quit <== 结束交互 +``` + +### 向多个收件人发送电子邮件 + +如果你希望通过 Linux 命令行向一大组收件人发送电子邮件,你可以使用一个循环来帮助你完成任务,如下面应用在 `mutt` 中的例子: + +``` +$ for recip in `cat recips` +do + mutt -s "Minutes from May meeting" $recip < May_minutes +done +``` + +### 总结 + +有很多方法可以从 Linux 命令行发送电子邮件。有些工具提供了相当多的选项。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402027/how-to-send-email-from-the-linux-command-line.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[Modrisco](https://github.com/Modrisco) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/08/email_image_blue-100732096-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190614 Personal assistant with Mycroft and Fedora.md b/published/201906/20190614 Personal assistant with Mycroft and Fedora.md new file mode 100644 index 0000000000..4b0a46c79d --- /dev/null +++ b/published/201906/20190614 Personal assistant with Mycroft and Fedora.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11022-1.html) +[#]: subject: (Personal assistant with Mycroft and Fedora) +[#]: via: (https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) + +在 Fedora 中使用私人助理 Mycroft +====== + +![][1] + +> 想要找个开源的私人助理么?[Mycroft][2] 可以让你运行一个开源的服务,从而更好地控制你的数据。 + +### 在 Fedora 上安装 Mycroft + +Mycroft 目前不存在于官方软件包集合中,但它可以轻松地从源码安装。第一步是从 Mycroft 的 GitHub 仓库下载源码。 + +``` +$ git clone https://github.com/MycroftAI/mycroft-core.git +``` + +Mycroft 是一个 Python 应用,它提供了一个脚本负责在安装 Mycroft 及其依赖项之前创建虚拟环境。 + +``` +$ cd mycroft-core +$ ./dev_setup.sh +``` + +安装脚本会提示用户以帮助他完成安装过程。建议运行稳定版本并获取自动更新。 + +当提示在本地安装 Mimic 文字转语音引擎时,请回答否。因为根据安装描述,这可能需要很长时间,并且 Mimic 有适合 Fedora 的 rpm 包,因此可以使用 `dnf` 进行安装。 + +``` +$ sudo dnf install mimic +``` + +### 开始使用 Mycroft + +安装完成后,可以使用以下脚本启动 Mycroft 服务。 + +``` +$ ./start-mycroft.sh all +``` + +要开始使用 Mycroft,需要注册运行服务的设备。因此需要一个帐户,可以在 中创建。 + +创建帐户后,可以在 [https://account.mycroft.ai/devices][3] 中添加新设备。添加新设备需要配对码,你的设备会在所有服务启动后告诉你。 + +![][4] + +现在可以使用该设备了。 + +### 使用 Mycroft + +Mycroft 提供了一组默认启用的[技能][5],它们或者可以从[市场][5]下载。刚开始,你可以简单地向 Mycroft 问好,或天气如何。 + +``` +Hey Mycroft, how are you ? + +Hey Mycroft, what's the weather like ? +``` + +如果你对它是如何工作的感兴趣,`start-mycroft.sh` 脚本提供了一个命令行选项,它能让你使用命令行交互。它也会显示用于调试的有用信息。 + +Mycroft 总在学习新技能,并且有很多方法给 Mycroft 社区做[贡献][6]。 + +由 [Przemyslaw Marczynski][7] 摄影,发布于 [Unsplash][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/personal-assistant-with-mycroft-and-fedora/ + +作者:[Clément Verna][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://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2017/08/mycroft-816x345.jpg +[2]: https://mycroft.ai/ +[3]: https://account.mycroft.ai/devices +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/Screenshot_2019-06-14-Account.png +[5]: https://market.mycroft.ai/skills +[6]: https://mycroft.ai/contribute/ +[7]: https://unsplash.com/@pemmax?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/ai?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/published/201906/20190617 Exploring -run on Linux.md b/published/201906/20190617 Exploring -run on Linux.md new file mode 100644 index 0000000000..575d5ffd0b --- /dev/null +++ b/published/201906/20190617 Exploring -run on Linux.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11008-1.html) +[#]: subject: (Exploring /run on Linux) +[#]: via: (https://www.networkworld.com/article/3403023/exploring-run-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +探索 Linux 上的 /run +====== + +> Linux 系统在运行时数据方面的工作方式发生了微小但重大的变化。 + +![](https://img.linux.net.cn/data/attachment/album/201906/23/092816aqczi984w30j8k12.jpg) + +如果你没有密切关注,你可能没有注意到 Linux 系统在运行时数据方面的工作方式有一些小但重大的变化。 它重新组织了文件系统中可访问的方式和位置,而这个变化在大约八年前就开始了。虽然这种变化可能不足以让你的袜子变湿,但它在 Linux 文件系统中提供了更多一致性,值得进行一些探索。 + +要开始,请转到 `/run`。如果你使用 `df` 来检查它,你会看到这样的输出: + +``` +$ df -k . +Filesystem 1K-blocks Used Available Use% Mounted on +tmpfs 609984 2604 607380 1% /run +``` + +它被识别为 “tmpfs”(临时文件系统),因此我们知道 `/run` 中的文件和目录没有存储在磁盘上,而只存储在内存中。它们表示保存在内存(或基于磁盘的交换空间)中的数据,它看起来像是一个已挂载的文件系统,这个可以使其更易于访问和管理。 + +`/run` 是各种各样数据的家园。例如,如果你查看 `/run/user`,你会注意到一组带有数字名称的目录。 + +``` +$ ls /run/user +1000 1002 121 +``` + +使用长文件列表可以发现这些数字的重要性。 + +``` +$ ls -l +total 0 +drwx------ 5 shs shs 120 Jun 16 12:44 1000 +drwx------ 5 dory dory 120 Jun 16 16:14 1002 +drwx------ 8 gdm gdm 220 Jun 14 12:18 121 +``` + +我们看到每个目录与当前登录的用户或显示管理器 gdm 相关。数字代表他们的 UID。每个目录的内容都是运行中的进程所使用的文件。 + +`/run/user` 文件只是你在 `/run` 中找到的一小部分。还有很多其他文件。有一些文件包含了各种系统进程的进程 ID。 + +``` +$ ls *.pid +acpid.pid atopacctd.pid crond.pid rsyslogd.pid +atd.pid atop.pid gdm3.pid sshd.pid +``` + +如下所示,上面列出的 `sshd.pid` 文件包含 ssh 守护程序(`sshd`)的进程 ID。 + +``` +$ cat sshd.pid +1148 +$ ps -ef | grep sshd +root 1148 1 0 Jun14 ? 00:00:00 /usr/sbin/sshd -D <== +root 10784 1148 0 12:44 ? 00:00:00 sshd: shs [priv] +shs 10922 10784 0 12:44 ? 00:00:00 sshd: shs@pts/0 +root 18109 1148 0 16:13 ? 00:00:00 sshd: dory [priv] +dory 18232 18109 0 16:14 ? 00:00:00 sshd: dory@pts/1 +shs 19276 10923 0 16:50 pts/0 00:00:00 grep --color=auto sshd +``` + +`/run` 中的某些子目录只能使用 root 权限访问,例如 `/run/sudo`。例如,以 root 身份运行我们可以看到一些与真实或尝试使用 `sudo` 相关的文件: + +``` +/run/sudo/ts# ls -l +total 8 +-rw------- 1 root dory 112 Jun 16 16:37 dory +-rw------- 1 root shs 168 Jun 17 08:33 shs +``` + +为了与 `/run` 的变化保持一致,一些运行时数据的旧位置现在是符号链接。`/var/run` 现在是指向 `/run` 的指针,`/var/lock` 指向 `/run/lock` 的指针,可以保证旧的引用按预期工作。 + +``` +$ ls -l /var +total 52 +drwxr-xr-x 2 root root 4096 Jun 17 07:36 backups +drwxr-xr-x 19 root root 4096 Apr 18 13:46 cache +drwxrwsrwt 2 root whoopsie 4096 Jun 13 07:39 crash +drwxr-xr-x 75 root root 4096 Jun 9 15:14 lib +drwxrwsr-x 2 root staff 4096 Oct 16 2017 local +lrwxrwxrwx 1 root root 9 May 14 2018 lock -> /run/lock +drwxrwxr-x 17 root syslog 4096 Jun 17 00:00 log +drwxrwsrwt 2 root mail 4096 Jun 13 12:10 mail +drwxrwsrwt 2 root whoopsie 4096 Jan 5 2018 metrics +drwxr-xr-x 2 root root 4096 Jan 5 2018 opt +lrwxrwxrwx 1 root root 4 May 14 2018 run -> /run +drwxr-xr-x 9 root root 4096 Jun 16 2018 snap +drwxr-xr-x 9 root root 4096 Jun 9 15:14 spool +drwxrwxrwt 8 root root 4096 Jun 17 00:00 tmp +drwxr-xr-x 3 root root 4096 Jan 19 12:14 www +``` + +虽然技术上的变化很小,但转换到使用 `/run` 只是为了在 Linux 文件系统中更好地组织运行时数据。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403023/exploring-run-on-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://images.idgesg.net/images/article/2019/06/exploring_run-100799398-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[3]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/published/201906/20190619 Get the latest Ansible 2.8 in Fedora.md b/published/201906/20190619 Get the latest Ansible 2.8 in Fedora.md new file mode 100644 index 0000000000..dd851a1dde --- /dev/null +++ b/published/201906/20190619 Get the latest Ansible 2.8 in Fedora.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11002-1.html) +[#]: subject: (Get the latest Ansible 2.8 in Fedora) +[#]: via: (https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +在 Fedora 中获取最新的 Ansible 2.8 +====== + +![][1] + +Ansible 是世界上最受欢迎的自动化引擎之一。它能让你自动化几乎任何事情,从本地系统的设置到大量的平台和应用。它是跨平台的,因此你可以将其用于各种操作系统。请继续阅读以获取有关如何在 Fedora 中获取最新 Ansible,以及它的一些更改和改进,以及如何使用它。 + +### 发布版本和功能 + +Ansible 2.8 最近发布了,其中包含许多修复、功能和增强。仅仅几天之后,它就可在 Fedora 29 和 30 以及 EPEL 中获取。两周前发布了后续版本 2.8.1。同样,新版本在几天内就可以在 Fedora 中获取。 + +[使用 sudo][2] 能够非常容易地从官方仓库安装: + +``` +$ sudo dnf -y install ansible +``` + +2.8 版本有很长的更新列表,你可以在 [2.8 的迁移指南][3]中阅读查看。但其中包含了一些好东西,比如 *Python 解释器发现功能* 。Ansible 2.8 现在会试图找出哪个 Python 是它所运行的平台的首选版本。如果失败,Ansible 会使用后备列表。但是,你仍然可以使用变量 `ansible_python_interpreter` 来设置 Python 解释器。 + +另一个变化使 Ansible 在各个平台上更加一致。由于 `sudo` 专用于 UNIX/Linux,而其他平台并没有,因此现在在更多地方使用 `become`。这包括了命令行开关。例如,`-ask-sudo-pass` 已变成了 `-ask-become-pass`,提示符也变成了 `BECOME password:`。 + +2.8 和 2.8.1 版本中还有许多其他功能。有关所有细节,请查看 [GitHub 上的官方更新日志][4]。 + +### 使用 Ansible + +也许你不确定 Ansible 是否可以实际使用。别担心,你并不是唯一一个这样想的,因为它太强大了。但事实证明,它并不难以使用,在一个家庭内的几台电脑(甚至一台电脑)上设置都可以。 + +我们之前在 Fedora Magazine 中也讨论过这个话题: + +- [使用 Ansible 设置工作站][5] + +试试看 Ansible,说下你的想法。很重要的一部分是让 Fedora 保持最新版本。自动化快乐! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/get-the-latest-ansible-2-8-in-fedora/ + +作者:[Paul W. Frields][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://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/ansible28-816x345.jpg +[2]: https://fedoramagazine.org/howto-use-sudo/ +[3]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.8.html +[4]: https://github.com/ansible/ansible/blob/stable-2.8/changelogs/CHANGELOG-v2.8.rst +[5]: https://fedoramagazine.org/using-ansible-setup-workstation/ diff --git a/published/201906/20190621 Bash Script to Monitor Memory Usage on Linux.md b/published/201906/20190621 Bash Script to Monitor Memory Usage on Linux.md new file mode 100644 index 0000000000..ee2a3cba8c --- /dev/null +++ b/published/201906/20190621 Bash Script to Monitor Memory Usage on Linux.md @@ -0,0 +1,151 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11007-1.html) +[#]: subject: (Bash Script to Monitor Memory Usage on Linux) +[#]: via: (https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +用 Bash 脚本监控 Linux 上的内存使用情况 +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/23/085446setqkshf5zk0tn2x.jpg) + +目前市场上有许多开源监控工具可用于监控 Linux 系统的性能。当系统达到指定的阈值限制时,它可以发送电子邮件警报。它可以监视 CPU 利用率、内存利用率、交换利用率、磁盘空间利用率等所有内容。 + +如果你只有很少的系统并且想要监视它们,那么编写一个小的 shell 脚本可以使你的任务变得非常简单。 + +在本教程中,我们添加了两个 shell 脚本来监视 Linux 系统上的内存利用率。当系统达到给定阈值时,它将给特定电子邮件地址发邮件。 + +### 方法-1:用 Linux Bash 脚本监视内存利用率并发送电子邮件 + +如果只想在系统达到给定阈值时通过邮件获取当前内存利用率百分比,请使用以下脚本。 + +这是个非常简单直接的单行脚本。在大多数情况下,我更喜欢使用这种方法。 + +当你的系统达到内存利用率的 80% 时,它将触发一封电子邮件。 + +``` +*/5 * * * * /usr/bin/free | awk '/Mem/{printf("RAM Usage: %.2f%\n"), $3/$2*100}' | awk '{print $3}' | awk '{ if($1 > 80) print $0;}' | mail -s "High Memory Alert" 2daygeek@gmail.com +``` + +**注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 + +**输出:**你将收到类似下面的电子邮件提醒。 + +``` +High Memory Alert: 80.40% +``` + +我们过去添加了许多有用的 shell 脚本。如果要查看这些内容,请导航至以下链接。 + + * [如何使用 shell 脚本自动执行日常活动?][1] + +### 方法-2:用 Linux Bash 脚本监视内存利用率并发送电子邮件 + +如果要在邮件警报中获取有关内存利用率的更多信息。使用以下脚本,其中包括基于 `top` 命令和 `ps` 命令的最高内存利用率和进程详细信息。 + +这将立即让你了解系统的运行情况。 + +当你的系统达到内存利用率的 “80%” 时,它将触发一封电子邮件。 + +**注意:**你需要更改电子邮件地址而不是使用我们的电子邮件地址。此外,你可以根据你的要求更改内存利用率阈值。 + +``` +# vi /opt/scripts/memory-alert.sh + +#!/bin/sh +ramusage=$(free | awk '/Mem/{printf("RAM Usage: %.2f\n"), $3/$2*100}'| awk '{print $3}') + +if [ "$ramusage" > 20 ]; then + + SUBJECT="ATTENTION: Memory Utilization is High on $(hostname) at $(date)" + MESSAGE="/tmp/Mail.out" + TO="2daygeek@gmail.com" + echo "Memory Current Usage is: $ramusage%" >> $MESSAGE + echo "" >> $MESSAGE + echo "------------------------------------------------------------------" >> $MESSAGE + echo "Top Memory Consuming Process Using top command" >> $MESSAGE + echo "------------------------------------------------------------------" >> $MESSAGE + echo "$(top -b -o +%MEM | head -n 20)" >> $MESSAGE + echo "" >> $MESSAGE + echo "------------------------------------------------------------------" >> $MESSAGE + echo "Top Memory Consuming Process Using ps command" >> $MESSAGE + echo "------------------------------------------------------------------" >> $MESSAGE + echo "$(ps -eo pid,ppid,%mem,%Memory,cmd --sort=-%mem | head)" >> $MESSAGE + mail -s "$SUBJECT" "$TO" < $MESSAGE + rm /tmp/Mail.out +fi +``` + +最后添加一个 [cron 任务][2] 来自动执行此操作。它将每 5 分钟运行一次。 + +``` +# crontab -e +*/5 * * * * /bin/bash /opt/scripts/memory-alert.sh +``` + +**注意:**由于脚本计划每 5 分钟运行一次,因此你将在最多 5 分钟后收到电子邮件提醒(但不是 5 分钟,取决于具体时间)。 + +比如说,如果你的系统达到 8.25 的给定限制,那么你将在 5 分钟内收到电子邮件警报。希望现在说清楚了。 + +**输出:**你将收到类似下面的电子邮件提醒。 + +``` +Memory Current Usage is: 80.71% + ++------------------------------------------------------------------+ +Top Memory Consuming Process Using top command ++------------------------------------------------------------------+ +top - 12:00:58 up 5 days, 9:03, 1 user, load average: 1.82, 2.60, 2.83 +Tasks: 314 total, 1 running, 313 sleeping, 0 stopped, 0 zombie +%Cpu0 : 8.3 us, 12.5 sy, 0.0 ni, 75.0 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st +%Cpu1 : 13.6 us, 4.5 sy, 0.0 ni, 81.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu2 : 21.7 us, 21.7 sy, 0.0 ni, 56.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu3 : 13.6 us, 9.1 sy, 0.0 ni, 77.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu4 : 17.4 us, 8.7 sy, 0.0 ni, 73.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu5 : 20.8 us, 4.2 sy, 0.0 ni, 70.8 id, 0.0 wa, 0.0 hi, 4.2 si, 0.0 st +%Cpu6 : 9.1 us, 0.0 sy, 0.0 ni, 90.9 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu7 : 17.4 us, 4.3 sy, 0.0 ni, 78.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +KiB Mem : 16248588 total, 5015964 free, 6453404 used, 4779220 buff/cache +KiB Swap: 17873388 total, 16928620 free, 944768 used. 6423008 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +17163 daygeek 20 2033204 487736 282888 S 10.0 3.0 8:26.07 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /u+ + 1121 daygeek 20 4191388 419180 100552 S 5.0 2.6 126:02.84 /usr/bin/gnome-shell + 1902 daygeek 20 1701644 327216 82536 S 20.0 2.0 153:27.92 /opt/google/chrome/chrome + 2969 daygeek 20 1051116 324656 92388 S 15.0 2.0 149:38.09 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=1339861+ + 1068 daygeek 20 1104856 309552 278072 S 5.0 1.9 143:47.42 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 +27246 daygeek 20 907344 265600 108276 S 30.0 1.6 10:42.80 /opt/google/chrome/chrome --type=renderer --field-trial-handle=10346122902703263820,11905758137655502112,131072 --service-pipe-token=8587368+ + ++------------------------------------------------------------------+ +Top Memory Consuming Process Using ps command ++------------------------------------------------------------------+ + PID PPID %MEM %CPU CMD + 8223 1 6.4 6.8 /usr/lib/firefox/firefox --new-window +13948 1121 6.3 1.2 /usr/bin/../lib/notepadqq/notepadqq-bin + 8671 8223 4.4 7.5 /usr/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 6999 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab +17163 8223 3.0 0.6 /usr/lib/firefox/firefox -contentproc -childID 15 -isForBrowser -prefsLen 9408 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 1121 1078 2.5 1.6 /usr/bin/gnome-shell +17937 8223 2.5 0.8 /usr/lib/firefox/firefox -contentproc -childID 16 -isForBrowser -prefsLen 9410 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 8499 8223 2.2 0.6 /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 6635 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 8306 8223 2.2 0.8 /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab + 9198 8223 2.1 0.6 /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8604 -prefMapSize 184979 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 8223 true tab +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-bash-script-to-monitor-memory-utilization-usage-and-send-email/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/shell-script/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ diff --git a/published/201906/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md b/published/201906/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md new file mode 100644 index 0000000000..8d6b7aad8a --- /dev/null +++ b/published/201906/20190622 Open Source Slack Alternative Mattermost Gets -50M Funding.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: (wahailin) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11014-1.html) +[#]: subject: (Open Source Slack Alternative Mattermost Gets $50M Funding) +[#]: via: (https://itsfoss.com/mattermost-funding/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Slack 的开源替代品 Mattermost 获得 5000 万美元融资 +====== + +[Mattermost][1],作为 [Slack][2] 的开源替代品,获得了 5000 万美元的 B 轮融资。这个消息极其令人振奋。 + +[Slack][3] 是一个基于云的团队内部沟通协作软件。企业、初创企业、甚至全球化的开源项目都在使用 Slack 进行同事及项目成员间的沟通。 + +[Slack 在 2019 年 6 月的估值为 200 亿美元][4],由此可见其在科技行业的巨大影响,当然也就有更多产品想与之竞争。 + +### 5000 万美元开源项目 + +![][5] + +就我个人而言,我并不知道 MatterMost 这个产品。但 [VentureBeat][6] 对这则新闻的报道,激发了我的好奇心。这次融资由 [Y Combinator][7] 的 Continuity 与一家新的投资方 BattleVentures 领投,现有投资者 Redpoint 和 S28 Captial 共同跟投。 + +在[公告][8]中,他们也提到: + +> 今天的公告中,Mattermost 成为了 YC 有史以来规模最大的 B 轮投资项目,更重要的是,它是 YC 迄今为止投资额最高的开源项目。 + +下面是摘自 VentureBeat 的报道,你可以从中了解到一些细节: + +> 本次资本注入,是继 2017 年 2 月的种子轮 350 万融资和今年 2 月份的 2000 万 A 轮融资之后进行的,并使得这家总部位于美国加州帕罗奥图Palo Alto的公司融资总额达到了约 7000 万美元。 + +如果你对他们的规划感兴趣,可以阅读[官方公告][8]。 + +尽管听起来很不错,但可能你并不知道 Mattermost 是什么。所以我们先来作个简单了解: + +### Mattermost 快览 + +![Mattermost][9] + +前面已经提到,Mattermost 是 Slack 的开源替代品。 + +乍一看,它几乎照搬了 Slack 的界面外观,没错,这就是关键所在,你将拥有你可以轻松使用的软件的开源解决方案。 + +它甚至集成了一些流行的 DevOps 工具,如 Git、自动机器人和 CI/CD。除了这些功能外,它还关注安全性和隐私。 + +同样,和 Slack 类似,它支持和多种应用程序与服务的集成。 + +听起来很有前景?我也这么认为。 + +#### 定价:企业版和团队版 + +如果你希望由 Mattermost 托管该服务(或获得优先支持),应选择其企业版。但如果你不想使用付费托管,可以下载[团队版][11],并将其安装到基于 Linux 的云服务器或 VPS 服务器上。 + +当然,我们不会在此进行深入探究。我确想在此提及的是,企业版并不昂贵。 + +![][12] + +### 总结 + +MatterMost 无疑相当出色,有了 5000 万巨额资金的注入,对于那些正在寻求安全的并能提供高效团队协作支持的开源通讯平台的用户,Mattermost 很可能成为开源社区重要的部分。 + +你觉得这条新闻怎么样?对你来说有价值吗?你是否已了解 Mattermost 是 Slack 的替代品? + +请在下面的评论中给出你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mattermost-funding/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wahailin](https://github.com/wahailin) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://mattermost.com/ +[2]: https://itsfoss.com/slack-use-linux/ +[3]: https://slack.com +[4]: https://www.ft.com/content/98747b36-9368-11e9-aea1-2b1d33ac3271 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-wallpaper.png?resize=800%2C450&ssl=1 +[6]: https://venturebeat.com/2019/06/19/mattermost-raises-50-million-to-advance-its-open-source-slack-alternative/ +[7]: https://www.ycombinator.com/ +[8]: https://mattermost.com/blog/yc-leads-50m-series-b-in-mattermost-as-open-source-slack-alternative/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-screenshot.jpg?fit=800%2C497&ssl=1 +[10]: https://itsfoss.com/zettlr-markdown-editor/ +[11]: https://mattermost.com/download/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/mattermost-enterprise-plan.jpg?fit=800%2C325&ssl=1 diff --git a/published/201906/20190624 Raspberry Pi 4 is here.md b/published/201906/20190624 Raspberry Pi 4 is here.md new file mode 100644 index 0000000000..3aab50ec31 --- /dev/null +++ b/published/201906/20190624 Raspberry Pi 4 is here.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: (wahailin) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11034-1.html) +[#]: subject: (Raspberry Pi 4 is here!) +[#]: via: (https://opensource.com/article/19/6/raspberry-pi-4) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +树莓派 4 来袭! +====== + +![](https://img.linux.net.cn/data/attachment/album/201906/29/161918icu6zrn8qrg3p38u.png) + +> 售价 35 美元起的新一代树莓派单板计算机,装载了 1.5 GHz 的 Arm 芯片,并支持双 HDMI 4K 显示,全吞吐量千兆以太网,以及更多新特性。 + +![Raspberry Pi 4 board][1] + +树莓派的最新版本树莓派 4 代,已于近日(北京时间 6 月 24 日)发布,这早于此前预期。树莓派 4 装载了 1.5 GHz 的 Arm 芯片和 VideoCore GPU,支持双 4K 显示输出,并引入了 USB 3 接口和全吞吐量千兆以太网,以及最高可达 4G 的多个可选 RAM 配置。 + +![Raspberry Pi 4 case][2] + +树莓派 4 是非常强大的单板计算机,其起始售价依然是 35 美元。起始版的 RAM 配置为 1G,2G RAM 配置的树莓派售价为 45 美元,顶配 4G RAM 的树莓派售价为 55 美元,采用这种差异化定价对树莓派尚属首次。 + +树莓派 4 的详细配置如下: + + * 1.5 GHz 4 核心 64 位博通 BCM2711 A72 CPU + * VideoCore VI GPU + * 千兆以太网端口 + * 1GB/2GB/4GB LPDDR4 SDRAM 内存 + * 双 Micro-HDMI 接口 + * 两个 USB 3 接口 + * 两个 USB 2 接口 + * 双频(2.4 GHz 和 5 GHz)无线网络 + * 蓝牙 5.0 + * USB Type C 电源接口 + * CSI 摄像头接口 + * DSI 显示接口 + * MicroSD 卡槽 + * PoE(以太网供电)供电针 + * 完全兼容早期的树莓派产品 + +### USB 接口和网络 + +树莓派 4 板载了更高速率的 USB 3 接口;它通过 Type C 接口供电,并提供两个 USB 3 接口和两个 USB 2 接口。USB 3 接口可以为连接的硬盘和其它外部设备提供更高的速率。 + +![Raspberry Pi 4 USBs][3] + +基于 BCM2835 的树莓派 1 到 3 代的芯片只有一个本地 USB 接口,并且没有以太网接口,因而需要使用板子的 USB 集线器给出更多的 USB 接口和以太网接口。树莓派 3B+ 增加了一个专用的局域网(LAN)芯片,装载了千兆以太网,但它受到 USB 2 速率的限制。树莓派 4 板载了专门的千兆以太网,并且由于它不再受到 USB 速率的限制,网络速度要快得多。 + +树莓派 4 采用了 3B+ 中已有的技术 —— 该技术使得树莓派 3B+ 成为了第一个带有双频无线网络的单板计算机,即可以同时连接 2.4 GHz 和 5 GHz 频率的网络。 + +### 显示 + +设计第一代树莓派时,其 CPU 和 GPU 性能的平衡大大偏向于 GPU。VideoCore IV 是一个非常强大的图形处理器,支持全高清 1080p 多媒体的处理,这就是为什么树莓派一直作为家庭媒体中心而广受欢迎的原因。树莓派 2 代在某种程度上进行了权衡修改,并将 CPU 的性能进行提升,将树莓派从单核发展成四核 ARM 芯片。而树莓派 4 代将 CPU 和 GPU 的性能都进行了大幅提升。新的 VideoCore VI GPU 支持 4K 视频,并允许通过板子上的两个 Micro HDMI 端口(板子特意保持了和旧有型号相同的尺寸)进行双显示输出,这里要用一个适配器或 Micro HDMI 转 full HDMI 的转换线连接到 HDMI 屏幕。 + +当你需要同时浏览多个窗口时,需要用到更多的物理显示屏,双显示的好处在此时就得到了绝佳体现。如果你正在编程,你可能会在其中一个屏幕上编写代码,构建网站或应用,而在另一个屏幕上查看数据库、Web 浏览器、电子邮件或其他内容。这是树莓派首次可以不必将开发局限在一台显示器上,从而可以让你在需要时,在不同的屏幕上构建具有不同内容的基于树莓派的项目。 + +该树莓派还有一个显示器串行接口(DSI),用于驱动另一个特殊的显示-这里并非指另一个监视器本身,而是通过一根挠性电缆连接的官方树莓派触摸屏显示器。 + +### Raspbian Buster + +树莓派 4 发布后,紧接着更新了基于 Debian 的系统 Raspbian Buster,而新的树莓派对 OpenGL ES 3 的支持,使我们在 Raspbian Buster 上为树莓派 4 开发任意软件成为可能。Buster 对界面进行了一些调整,并对很多软件进行了升级,其中包括 Python3.7。 + +![Raspbian Buster][4] + +### 开源图形驱动程序 + +在过去的五年中,Eric Anholt 一直致力于为树莓派编写开源图形驱动程序。现在,Raspbian 可以使用这个驱动程序加速树莓派上的 Web 浏览、桌面图形和 3D 应用,这取代了以前需要的大量闭源代码。非常感谢 Eric 和博通的贡献。 + +按之前预计,树莓派 4 将于明年完成,但由于芯片设计比预期更早投入生产,树莓派 4 因而可以提早到现在发布。 + +* * * + +树莓派 4 已经开始发售,你会选择哪个型号呢?在评论中说出你的想法吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/raspberry-pi-4 + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[wahailin](https://github.com/wahailin) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry-pi-4_lead.jpg?itok=2bkk43om (Raspberry Pi 4 board) +[2]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4-case.jpg (Raspberry Pi 4 case) +[3]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4-usb.jpg (Raspberry Pi 4 USBs) +[4]: https://opensource.com/sites/default/files/uploads/raspbian-buster.png (Raspbian Buster) diff --git a/published/201906/20190624 Using i3 with multiple monitors.md b/published/201906/20190624 Using i3 with multiple monitors.md new file mode 100644 index 0000000000..33eeeac1e2 --- /dev/null +++ b/published/201906/20190624 Using i3 with multiple monitors.md @@ -0,0 +1,192 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11031-1.html) +[#]: subject: (Using i3 with multiple monitors) +[#]: via: (https://fedoramagazine.org/using-i3-with-multiple-monitors/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +将 i3 与多个显示器配合使用 +====== + +![][1] + +你在 Linux 工作站上使用多个显示器吗?一次看到很多东西可能是有益的。但在我们的工作中通常有比实际显示器更多的窗口 —— 这是一件好事,因为一次看到太多东西可能会分散注意力。因此能够切换我们在单个显示器上看到的内容似乎很重要。 + +让我们来看看 i3,它是一个流行的平铺窗口管理器,可以与多个显示器配合使用。并且有许多其他窗口管理器没有的便利功能,它能够独立地在各个显示器上切换工作区。 + +### 快速介绍 i3 + +大约三年前,[Fedora Magazine 已经写了一篇关于 i3 的文章][2]。这是有史以来最受欢迎的文章之一!虽然情况并非总是如此,但 i3 非常稳定,而且那篇文章如今也很准确。所以,这次不会重复太多内容,本篇只涵盖了让 i3 启动和运行的极少内容,如果你是 i3 的新手,想要了解更多基础知识的话,欢迎你继续阅读。 + +要在系统上安装 i3,请运行以下命令: + +``` +$ sudo dnf install i3 +``` + +完成后,注销,然后在登录屏幕上选择 i3 作为窗口管理器,然后重新登录。 + +当你第一次运行 i3 时,系统会询问你是否要继续进行自动配置 —— 在此处回答是。之后,你将被要求选择 “mod 键”。如果你不确定,只需接受默认值,即将 Windows/Super 键设置为 mod 键。你将主要使用此键用于窗口管理器中的快捷方式。 + +此时,你应该在底部看到一个小条和一个空白屏幕。我们来看看一些基本的快捷方式。 + +打开终端: + +``` +$mod + enter +``` + +切换到第二个工作区: + +``` +$mod + 2 +``` + +通过以下两个步骤打开 firefox,首先: + +``` +$mod + d +``` + +然后输入 “firefox” 并按回车键。 + +将其移动到第一个工作区: + +``` +$mod + shift + 1 +``` + +切换到第一个工作区: + +``` +$mod + 1 +``` + +此时,你将并排看到一个终端和一个 firefox 窗口。要关闭窗口,请按: + +``` +$mod + shift + q +``` + +还有更多的快捷方式,但这些足够让你开始使用 i3。 + +要退出 i3(并退出登录)按: + +``` +$mod + shift + e +``` + +然后在右上角使用鼠标确认。 + +### 同时让多个屏幕工作 + +现在我们已经启动并运行了 i3,让我们把所有这些屏幕都用到! + +为此,我们需要使用命令行,因为 i3 非常轻量级,并且没有 GUI 来管理其他屏幕。如果这听起来很难也不用担心,它实际上非常简单! + +我们将使用的命令称为 `xrandr`。如果你的系统上没有 `xrandr`,请运行以下命令安装: + +``` +$ sudo dnf install xrandr +``` + +当它安装完毕后,让我们继续运行它: + +``` +$ xrandr +``` + +输出列出了所有可用输出设备,并通过显示支持的分辨率指示哪些输出连接了屏幕(通过电缆连接的显示器)。好消息是,我们不需要关心使它们工作的分辨率。 + +这个例子显示了笔记本电脑的主屏幕(名为 eDP1),以及连接到 HDMI-2 输出的第二个显示器,它位于笔记本电脑的右侧。要打开它,请运行以下命令: + +``` +$ xrandr --output HDMI-2 --auto --right-of eDP1 +``` + +就是这样!你的屏幕现已激活。 + +![第二个屏幕激活。截屏上显示命令与文章中略有不同,它设置了更小的分辨率以使截屏适合阅读][3] + +### 在多个屏幕上管理工作区 + +在多个屏幕上切换工作区和创建新工作区非常类似于只有一个屏幕的情况。新工作区会在当前处于活动状态(鼠标光标所在位置)的屏幕上创建。 + +因此,要切换到特定工作区(或在不存在的情况下创建新工作区),请按: + +``` +$mod + NUMBER +``` + +你可以独立切换各个显示器上的工作区! + +![工作空间 2 在左侧屏幕,工作空间 4 在右侧屏幕][4] + +![左侧屏幕切换为工作空间 3,右侧屏幕仍为工作空间 4][5] + +![右侧屏幕切换为工作空间 5,左侧屏幕仍为空间空间 3][6] + +### 在显示器之间移动工作区 + +我们可以通过以下命令将窗口移动到不同的工作区: + +``` +$mod + shift + NUMBER +``` + +我们也可以将工作区移动到不同的屏幕。但是,此操作没有默认快捷方式,因此我们必须先创建它。 + +要创建自定义快捷方式,你需要在你选择的文本编辑器中打开配置文件(本文使用 `vim`): + +``` +$ vim ~/.config/i3/config +``` + +并将以下行添加到配置文件的最底部: + +``` +# Moving workspaces between screens +bindsym $mod+p move workspace to output right +``` + +保存、关闭并重新加载以使配置生效,按下: + +``` +$mod + shift + r +``` + +现在你可以将活跃的工作区移动到第二个显示器: + +``` +$mod + p +``` + +![打开火狐浏览器的工作空间 2 在左侧][7] + +![打开火狐浏览器的工作空间 2 移动到第二个屏幕][8] + +就是这些了!享受你的新多显示器体验,并了解更多 i3,欢迎阅读 Fedora Magazine 上之前关于 i3 的文章,或者查看官方 i3 文档。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/using-i3-with-multiple-monitors/ + +作者:[Adam Šamalík][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://fedoramagazine.org/author/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/i3-title-816x345.jpg +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/0-1-1024x384.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-1-1024x384.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-2-1024x384.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/1-3-1024x384.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-1-1024x384.png +[8]: https://fedoramagazine.org/wp-content/uploads/2019/06/2-2-1024x384.png diff --git a/published/201906/20190628 FreeDOS turns 25 years old- An origin story.md b/published/201906/20190628 FreeDOS turns 25 years old- An origin story.md new file mode 100644 index 0000000000..bf11ae7964 --- /dev/null +++ b/published/201906/20190628 FreeDOS turns 25 years old- An origin story.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11033-1.html) +[#]: subject: (FreeDOS turns 25 years old: An origin story) +[#]: via: (https://opensource.com/article/19/6/freedos-anniversary) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +25 岁的 FreeDOS:起源故事 +====== + +> 操作系统的历史是开发人员共同造物的开源软件模型的很好例子。 + +![FreeDOS fish logo and command prompt on computer](https://img.linux.net.cn/data/attachment/album/201906/29/154802szbavz4a0fa8a27f.jpg) + +6 月 29 日是 [FreeDOS][2] 25 周年的日子。不管对于哪个开源软件项目来说,这都是一个重要的里程碑,我为过去这 1/4 个世纪来我们在这方面所做的工作感到自豪。我也为我们如何构建 FreeDOS 感到自豪,因为它是开源软件模型如何工作的一个很好的例子。 + +在它的那个时代,MS-DOS 是一个功能强大的操作系统。自从我的父母用新的 IBM 机器取代了老化的 Apple II 计算机以来,我已经使用 DOS 多年了。MS-DOS 提供了一个灵活的命令行,我非常喜欢它,它可以方便地操作我的文件。多年来,我学会了如何在 C 中编写自己的实用程序,以进一步扩展其命令行功能。 + +大约在 1994 年,微软宣布其下一代的 Windows 将取消 MS-DOS。但我喜欢 DOS,即使我已经开始迁移到 Linux,我仍然会启动到 MS-DOS 来运行一些 Linux 尚未拥有的应用程序。 + +我想,如果我们想留下 DOS,我们需要自己编写一个。FreeDOS 就是这样诞生的。 + +1994 年 6 月 29 日,我向 Usenet 上的 comp.os.msdos.apps 新闻组发表了关于我的想法的一个小小公告: + +> PD-DOS 项目公告: +> +> 几个月前,我发布了有关启动公共域(PD)版本 DOS 的文章。当时对此的普遍支持很强烈,很多人都赞同:“开始编写吧!”所以,我… +> +> 宣布开发 PD-DOS 的首次尝试。我写了一个“清单”来描述这样的一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要编码开发的内容。我会在这里发布,然后讨论。 +> + +虽然我宣布该项目为 PD-DOS(“公共领域”的意思,缩写是为了模仿 IBM 的“PC-DOS”),但我们很快将名称改为 Free-DOS,再后来又改为 FreeDOS。 + +我马上开始开发它。首先,我分享了我编写的用于扩展 DOS 命令行功能的实用程序。它们中的许多程序都重现了 MS-DOS 功能,包括 `CLS`、`DATE`、`DEL`、`FIND`、`HELP` 和 `MORE`。有些是我从 Unix 借来的新功能,比如 `TEE` 和 `TRCH`(Unix 的 `tr` 的简单实现)。我贡献了十几个 FreeDOS 工具。 + +通过分享我的实用程序,我给了其他开发人员一个起点。通过在 [GNU 通用公共许可证][3](GNU GPL)下共享我的源代码,我隐含地允许其他人添加新功能并修复错误。 + +看到 FreeDOS 开始成型的其他开发人员联系了我并希望提供帮助。Tim Norman 是第一个人,Tim 自愿编写命令行 shell(`COMMAND.COM`,后来命名为 `FreeCOM`)。其他人贡献了复制或扩展了 DOS 命令行的实用程序。 + +我们尽快发布了第一个 alpha 版本。在宣布了 FreeDOS 后不到三个月,我们就有了一个集合了我们所编写的功能的 Alpha 1 发行版。当我们发布 Alpha 5 时,FreeDOS 已经拥有了 60 多个实用程序。FreeDOS 包含了 MS-DOS 中从未想过的功能,包括通过 PPP 拨号驱动程序实现的互联网连接,以及使用主 VGA 监视器和辅助单色监视器的双显示器支持。 + +新的开发人员加入了该项目,我们很欢迎他们。到 1998 年 10 月,感谢 Pat Villani,FreeDOS 有了一个可以工作的内核。FreeDOS 还提供了许多新功能,不仅带来了与 MS-DOS 的同等性,而且超越了 MS-DOS,包括 ANSI 支持和类似 Unix lpr 的打印后台处理程序。 + +你可能熟悉其他的里程碑版本。我们继续向 1.0 版本迈进,终于在 2006 年 9 月发布了 FreeDOS 1.0,在 2012 年 1 月发布了 FreeDOS 1.1,在 2016 年 12 月发布了 FreeDOS 1.2。而 MS-DOS 很久以前就停止了开发,因此我们在 1.0 发布之后不需要经常更新了。 + +如今,FreeDOS 已经是一个非常现代的 DOS。我们已经超越了“经典 DOS”,现在 FreeDOS 拥有许多开发工具,如编译器、汇编器和调试器。除了普通的 DOS Edit 编辑器之外,我们还有许多编辑器,包括 Fed、Pico、TDE 以及 Emacs 和 Vi 的一个版本。FreeDOS 支持网络,甚至还提供简单的图形 Web 浏览器(Dillo)。我们有大量的新工具,包括许多可以让 Linux 用户感到熟悉的实用工具。 + +正因为开发人员的共同创造,FreeDOS 才走到如今。本着开源软件的精神,我们通过修复错误和添加新功能为彼此的工作做出了贡献。我们将用户视为共同开发者;我们总能找到方法来吸引贡献者,无论是编写代码还是编写文档。我们基于优点达成共识。如果这听起来很熟悉,那是因为这些是开源软件的核心价值:透明度、协作、尽早发布、经常发布、精英管理和社区。这就是[开源方式][4]! + +我鼓励你下载 FreeDOS 1.2 并尝试一下。 + +### 更多资源 + + * [FreeDOS 官方网站][2] + * [FreeDOS wiki][5] + * [下载 FreeDOS 1.2][6] + * [FreeDOS 的免费电子书][7] + * [FreeDOS 的简单介绍][8] + * [FreeDOS 起源与革命][9] + * [4 个 FreeDOS 的有趣事实][10] + * [如何使用 FreeDOS 升级你的系统 BIOS][11] + * [庆祝 FreeDOS 24 岁生日:有用的命令速查表][12] + * [如何在 Linux 中运行 DOS 程序][13] + * [让 DOS 活到现在并通过开源来起步][14] + * [在树莓派上运行 DOS][15] + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/freedos-anniversary + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos-fish-laptop-color.png?itok=vfv_Lpph (FreeDOS fish logo and command prompt on computer) +[2]: https://www.freedos.org/ +[3]: https://www.gnu.org/licenses/licenses.en.html +[4]: https://opensource.com/open-source-way +[5]: http://wiki.freedos.org/ +[6]: https://www.freedos.org/download/ +[7]: https://www.freedos.org/ebook/ +[8]:https://linux.cn/article-9983-1.html +[9]: https://opensource.com/article/17/10/freedos +[10]: https://opensource.com/article/17/6/freedos-still-cool-today +[11]: https://opensource.com/article/17/6/upgrade-bios-freedos +[12]: https://opensource.com/article/18/6/freedos-commands-cheat-sheet +[13]: https://linux.cn/article-9014-1.html +[14]: https://opensource.com/life/16/9/interview-jim-hall-freedos +[15]: https://linux.cn/article-9544-1.html diff --git a/published/20190603 How to set up virtual environments for Python on MacOS.md b/published/20190603 How to set up virtual environments for Python on MacOS.md new file mode 100644 index 0000000000..b86600953b --- /dev/null +++ b/published/20190603 How to set up virtual environments for Python on MacOS.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: (runningwater) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11086-1.html) +[#]: subject: (How to set up virtual environments for Python on MacOS) +[#]: via: (https://opensource.com/article/19/6/virtual-environments-python-macos) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/moshez/users/mbbroberg/users/moshez) + +MacOS 系统中如何设置 Python 虚拟环境 +====== + +> 使用 pyenv 和 virtualwrapper 来管理你的虚拟环境,可以避免很多困惑。 + +![][1] + +作为 Python 开发者和 MacOS 用户,拿到新机器首先要做的就是设置 Python 开发环境。下面是最佳实践(虽然我们已经写过 [在 MacOS 上管理 Python 的其它方法][2])。 + +### 预备 + +首先,打开终端,在其冰冷毫无提示的窗口输入 `xcode-select --install` 命令。点击确认后,基本的开发环境就会被配置上。MacOS 上需要此步骤来设置本地开发实用工具库,根据 [OS X Daily][3] 的说法,其包括 ”许多常用的工具、实用程序和编译器,如 make、GCC、clang、perl、svn、git、size、strip、strings、libtool、cpp、what 及许多在 Linux 中系统默认安装的有用命令“。 + +接下来,安装 [Homebrew][4], 执行如下的 Ruby 脚本。 + +``` +ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +如果你像我一样,对随意就运行的来源于互联网的脚本心存疑虑的话,可以点击上面的脚本去仔细看看其具体功能。 + +一旦安装完成后,就恭喜了,你拥有了一个优秀的包管理工具。自然的,你可能接下来会执行 `brew install python` 或其他的命令。不要这样,哈哈!Homebrew 是为我们提供了一个 Python 的管理版本,但让此工具来管理我们的 Python 环境话,很快会失控的。我们需要 [pyenv][5],一款简单的 Python 版本管理工具,它可以安装运行在 [许多操作系统][6] 上。运行如下命令: + +``` +$ brew install pyenv +``` + +想要每次打开命令提示框时 `pyenv` 都会运行的话,需要把下面的内容加入你的配置文件中(MacOS 中默认为 `.bash_profile`,位于家目录下): + +``` +$ cd ~/ +$ echo 'eval "$(pyenv init -)"' >> .bash_profile +``` + +添加此行内容后,每个终端都会启动 `pyenv` 来管理其 `PATH` 环境变量,并插入你想要运行的 Python 版本(而不是在环境变量里面设置的初始版本。更详细的信息,请阅读 “[如何给 Linux 系统设置 PATH 变量][7]”)。打开新的终端以使修改的 `.bash_profile` 文件生效。 + +在安装你中意的 Python 版本前,需要先安装一些有用的工具,如下示: + +``` +$ brew install zlib sqlite +``` + +`pyenv` 依赖于 [zlib][8] 压缩算法和 [SQLite][9] 数据库,如果未正确配置,往往会[导致构建问题][10]。将这些导出配置命令加入当前的终端窗口执行,确保它们安装完成。 + +``` +$ export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/sqlite/lib" +$ export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/sqlite/include" +``` + +现在准备工作已经完成,是时候安装一个适合于现代人的 Python 版本了: + +``` +$ pyenv install 3.7.3 +``` + +去喝杯咖啡吧,挑些豆类,亲自烧烤,然后品尝。说这些的意思是上面的安装过程需要一段时间。 + +### 添加虚拟环境 + +一旦完成,就可以愉快地使用虚拟环境了。如没有接下来的步骤的话,你只能在你所有的工作项目中共享同一个 Python 开发环境。使用虚拟环境来隔离每个项目的依赖关系的管理方式,比起 Python 自身提供的开箱即用功能来说,更加清晰明确和更具有重用性。基于这些原因,把 `virtualenvwrapper` 安装到 Python 环境中吧: + +``` +$ pyenv global 3.7.3 +# Be sure to keep the $() syntax in this command so it can evaluate +$ $(pyenv which python3) -m pip install virtualenvwrapper +``` + +再次打开 `.bash_profile` 文件,把下面内容添加进去,使得每次打开新终端时它都有效: + +``` +# We want to regularly go to our virtual environment directory +$ echo 'export WORKON_HOME=~/.virtualenvs' >> .bash_profile +# If in a given virtual environment, make a virtual environment directory +# If one does not already exist +$ echo 'mkdir -p $WORKON_HOME' >> .bash_profile +# Activate the new virtual environment by calling this script +# Note that $USER will substitute for your current user +$ echo '. ~/.pyenv/versions/3.7.3/bin/virtualenvwrapper.sh' >> .bash_profile +``` + +关掉终端再重新打开(或者运行 `exec /bin/bash -l` 来刷新当前的终端会话),你会看到 `virtualenvwrapper` 正在初始化环境配置: + +``` +$ exec /bin/bash -l +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkproject +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkproject +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/initialize +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/premkvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postmkvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/prermvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postrmvirtualenv +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/get_env_details +``` + +从此刻开始,你的所有工作都是在虚拟环境中的,其允许你使用临时环境来安全地开发。使用此工具链,你可以根据工作所需,设置多个项目并在它们之间切换: + +``` +$ mkvirtualenv test1 +Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' +New python executable in /Users/moshe/.virtualenvs/test1/bin/python3 +Also creating executable in /Users/moshe/.virtualenvs/test1/bin/python +Installing setuptools, pip, wheel... +done. +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test1/bin/get_env_details +(test1)$ mkvirtualenv test2 +Using base prefix '/Users/moshe/.pyenv/versions/3.7.3' +New python executable in /Users/moshe/.virtualenvs/test2/bin/python3 +Also creating executable in /Users/moshe/.virtualenvs/test2/bin/python +Installing setuptools, pip, wheel... +done. +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/predeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postdeactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/preactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/postactivate +virtualenvwrapper.user_scripts creating /Users/moshe/.virtualenvs/test2/bin/get_env_details +(test2)$ ls $WORKON_HOME +get_env_details postmkvirtualenv premkvirtualenv +initialize postrmvirtualenv prermvirtualenv +postactivate preactivate test1 +postdeactivate predeactivate test2 +postmkproject premkproject +(test2)$ workon test1 +(test1)$ +``` + +此处,使用 `deactivate` 命令可以退出当前环境。 + +### 推荐实践 + +你可能已经在比如 `~/src` 这样的目录中添加了长期的项目。当要开始了一个新项目时,进入此目录,为此项目增加子文件夹,然后使用强大的 Bash 解释程序自动根据你的目录名来命令虚拟环境。例如,名称为 “pyfun” 的项目: + +``` +$ mkdir -p ~/src/pyfun && cd ~/src/pyfun +$ mkvirtualenv $(basename $(pwd)) +# we will see the environment initialize +(pyfun)$ workon +pyfun +test1 +test2 +(pyfun)$ deactivate +$ +``` + +当需要处理此项目时,只要进入该目录,输入如下命令重新连接虚拟环境: + +``` +$ cd ~/src/pyfun +(pyfun)$ workon . +``` + +初始化虚拟环境意味着对 Python 版本和所加载的模块的时间点的拷贝。由于依赖关系会发生很大的改变,所以偶尔需要刷新项目的虚拟环境。这种情况,你可以通过删除虚拟环境来安全的执行此操作,源代码是不受影响的,如下所示: + +``` +$ cd ~/src/pyfun +$ rmvirtualenv $(basename $(pwd)) +$ mkvirtualenv $(basename $(pwd)) +``` + +这种使用 `pyenv` 和 `virtualwrapper` 管理虚拟环境的方法可以避免开发环境和运行环境中 Python 版本的不一致出现的苦恼。这是避免混淆的最简单方法 - 尤其是你工作的团队很大的时候。 + +如果你是初学者,正准备配置 Python 环境,可以阅读下 [MacOS 中使用 Python 3][2] 文章。 你们有关于 Python 相关的问题吗,不管是初学者的还是中级使用者的?给我们留下评论信息,我们在下篇文章中会考虑讲解。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/virtual-environments-python-macos + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[runningwater](https://github.com/runningwater) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg/users/moshez/users/mbbroberg/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_snake_file_box.jpg?itok=UuDVFLX- +[2]: https://opensource.com/article/19/5/python-3-default-macos +[3]: http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/ +[4]: https://brew.sh/ +[5]: https://github.com/pyenv/pyenv +[6]: https://github.com/pyenv/pyenv/wiki +[7]: https://opensource.com/article/17/6/set-path-linux +[8]: https://zlib.net/ +[9]: https://www.sqlite.org/index.html +[10]: https://github.com/pyenv/pyenv/wiki/common-build-problems#build-failed-error-the-python-zlib-extension-was-not-compiled-missing-the-zlib diff --git a/published/20190604 5G will augment Wi-Fi, not replace it.md b/published/20190604 5G will augment Wi-Fi, not replace it.md new file mode 100644 index 0000000000..1f15466851 --- /dev/null +++ b/published/20190604 5G will augment Wi-Fi, not replace it.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (GraveAccent) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11098-1.html) +[#]: subject: (5G will augment Wi-Fi, not replace it) +[#]: via: (https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + + +5G 会增强 Wi-Fi,而不是取代它 +====== +> Aruba 战略和企业发展副总裁 Jeff Lipton 为 5G 炒作增添了一些干货,讨论了它和 Wi-Fi 如何协同工作以及如何最大化两者的价值。 + +![Thinkstock][1] + +如今可以说没有技术主题比 [5G][2] 更热。这是最近 [移动世界大会][3] 节目的一个主题,并且已经在其他活动中占据了主导地位,例如 Enterprise Connect 和我参加的几乎所有供应商活动。 + +一些供应商将 5G 定位为解决所有网络问题的灵丹妙药,并预测它将消除所有其他形式的网络。像这样的观点显然是极端的,但我相信 5G 会对网络行业产生影响,网络工程师应该意识到这一点。 + +为了帮助为 5G 炒作带来一些现实感,我最近采访了一家惠普公司旗下的 Aruba 公司的战略和企业发展副总裁 Jeff Lipton,因为我知道惠普已经深入参与了 5G 和 Wi-Fi 的发展。 + +![Jeff Lipton, VP of strategy and corporate development, Aruba][4] + +### Zeus Kerravala: 5G 被吹捧为“明日之星”。你是这样看的吗? + +**Jeff Lipton:** 接下来的重点是连接“事物”并从这些事物中产生可操作的见解和背景。5G 是服务于这一趋势的技术之一。Wi-Fi 6 是另一个,还有边缘计算、蓝牙低功耗(BLE)、人工智能(AI)和机器学习(ML)。这一切都很重要,全都有自己的用武之地。 + +### 你是否在企业中看到 5G 的风头盖过 Wi-Fi? + +**Lipton:** 与所有蜂窝接入一样,如果你需要宏观区域覆盖macro area coverage和高速切换,使用 5G 是合适的。但对于大多数企业级应用程序而言,它通常不需要这些功能。从性能角度来看,[Wi-Fi 6][5] 和 5G 在大多数指标上大致相等,包括吞吐量、延迟、可靠性和连接密度。它们并不相似的地方在经济方面,Wi-Fi 要好得多。我不认为很多客户愿意用 Wi-Fi 交换 5G,除非他们需要宏观覆盖或高速切换。 + +### Wi-Fi 和 5G 可以共存吗? 企业如何一起使用 5G 和 Wi-Fi? + +**Lipton:** Wi-Fi 和 5G 可以共存并且应该是互补的。5G 架构将蜂窝核心和无线接入网络(RAN)分离。因此,Wi-Fi 可以是企业无线电前端,并与 5G 核心紧密连接。由于 Wi-Fi(特别是 Wi-Fi 6)的经济有利,并且性能非常好,我们设想许多服务提供商会使用 Wi-Fi 作为其 5G 系统的无线电前端,充当其分布式天线(DAS)和小型蜂窝系统的替代方案。 + +> “Wi-Fi 和 5G 可以并且应该是互补的。” — Jeff Lipton + +### 如果一个企业打算完全转向 5G,那将如何实现以及它的实用性如何? + +**Lipton:** 为了将 5G 用于主要的室内访问方式,客户需要升级其网络和几乎所有设备。5G 在室外提供良好的覆盖,但蜂窝信号不能可靠地穿透建筑物,5G 会使这个问题变得更糟,因为它部分依赖于更高频率的无线电。因此,服务提供商需要一种提供室内覆盖的方法。为了提供这种覆盖,他们会部署 DAS 或小型蜂窝系统 —— 由终端客户支付费用。然后,客户将他们的设备直连到这些蜂窝系统,并为每个设备支付服务合同。 + +这种方法存在一些问题。首先,DAS 和小型蜂窝系统比 Wi-Fi 网络贵得多。并且成本不会仅限于网络。每台设备都需要一台 5G 蜂窝调制解调器,批量价格高达数十美元,而终端用户通常需要花费一百多美元。由于目前很少或者没有 MacBook、PC、打印机、AppleTV 有 5G 调制解调器,因此需要对这些设备进行升级。我不相信很多企业会愿意支付这笔额外费用并升级他们的大部分设备以获得尚不明确的好处。 + +### 经济性是 5G 与 Wi-Fi 之争的一个要素吗? + +**Lipton:** 经济性始终是一个要素。让我们将对话集中在室内企业级应用程序上,因为这是一些运营商打算用 5G 定位的用例。我们已经提到升级到 5G 将要求企业部署昂贵的 DAS 或小型蜂窝系统用于室内覆盖,几乎将所有设备升级到包含 5G 调制解调器,并为每个设备支付服务合同。理解 5G 蜂窝网络和 DAS 系统在许可频谱上运行也很重要,这类似于一条私人高速公路。服务提供商为此频谱支付了数十亿美元,这笔费用需要货币化并嵌入服务成本中。因此,从部署和生命周期的角度来看,Wi-Fi 在经济上比 5G 有利。 + +### 5G 与 Wi-Fi 相比有任何安全隐患吗? + +**Lipton:** 一些人认为蜂窝技术比 Wi-Fi 更安全,但事实并非如此。LTE 相对安全,但也有弱点。例如,普渡大学和爱荷华大学的研究人员表示,LTE 容易受到一系列攻击,包括数据拦截和设备跟踪。5G 通过多种认证方法和更好的密钥管理改进了 LTE 安全性。 + +Wi-Fi 的安全性也没有停滞不前而是在继续发展。当然,不遵循最佳实践的 Wi-Fi 实现,例如那些甚至没有基本密码保护的实现,并不是最佳的。但那些配置了适当的访问控制和密码的则是非常安全的。随着新标准 —— 特别是 WPA3 和增强开放Enhanced Open —— Wi-Fi 网络安全性进一步提高。 + +同样重要的是要记住,企业已根据其特定需求对安全性和合规性解决方案进行了大量投资。对于包括 5G 在内的蜂窝网络,企业将失去部署所选安全性和合规性解决方案的能力,以及对流量流的大多数可见性。虽然 5G 的未来版本将通过称为网络切片的功能提供高级别的自定义,但企业仍将失去他们目前需要的和拥有的安全性和合规性定制级别。 + +### 关于 5G 与 Wi-Fi 之间的讨论的补充想法 + +**Lipton:** 围绕 Wi-Fi 与 5G 的争论忽略了这一点。它们都有自己的用武之地,而且它们在很多方面都是互补的。由于需要连接和分析越来越多的东西,Wi-Fi 和 5G 市场都将增长。如果客户需要宏观覆盖或高速切换,并且可以为这些功能支付额外成本,那么 5G 是可行的。 + +5G 也适用于客户需要物理网络分段的某些工业用例。但对于绝大多数企业客户而言,Wi-Fi 将继续像现在一样证明自己作为可靠、安全且经济高效的无线接入技术的价值。 + +**更多关于 802.11ax (Wi-Fi 6):** + + * [为什么 802.11ax 是无线网络的下一件大事][7] + * [FAQ:802.11ax Wi-Fi][8] + * [Wi-Fi 6 (802.11ax) 正在来到你附近的路由器][9] + * [带有 OFDMA 的 Wi-Fi 6 打开了一个全新的无线可能性世界][10] + * [802.11ax 预览:支持 Wi-Fi 6 的接入点和路由器随时可用][11] + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399978/5g-will-augment-wi-fi-not-replace-it.html + +作者:[Zeus Kerravala][a] +选题:[lujun9972][b] +译者:[GraveAccent](https://github.com/graveaccent) +校对:[wxy](https://github.com/wxy) + +本文由 [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://images.idgesg.net/images/article/2019/05/wireless_connection_speed_connectivity_bars_cell_tower_5g_by_thinkstock-100796921-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://images.idgesg.net/images/article/2019/06/headshot_jlipton_aruba-100798360-small.jpg +[5]: https://www.networkworld.com/article/3215907/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[8]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[9]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[10]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[11]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/published/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md b/published/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md new file mode 100644 index 0000000000..28a906fbdb --- /dev/null +++ b/published/20190606 Zorin OS Becomes Even More Awesome With Zorin 15 Release.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (qfzy1233) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11058-1.html) +[#]: subject: (Zorin OS Becomes Even More Awesome With Zorin 15 Release) +[#]: via: (https://itsfoss.com/zorin-os-15-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +随着 Zorin 15 的发布,Zorin OS 变得更为强大 +====== + +![](https://img.linux.net.cn/data/attachment/album/201907/05/112128zmz2n2csi6h7y6s2.png) + +长久以来 Zorin OS 一直在 [初学者适用的Linux发行版排行][1] 中占有一席之地。的确,它可能不是最受欢迎的,但是对于从 Windows 阵营转向 Linux 的用户而言,它一定是最好的一个发行版。 + +我还记得,在几年前,我的一位朋友一直坚持让我安装 [Zorin OS][2]。就我个人而言,当时我并不喜欢它的 UI 风格。但是,现如今 Zorin OS 15 发布了,这也让我有了更多的理由安装并将它作为我日常的操作系统。 + +不要担心,在这篇文章里,我会向你介绍你所需要了解的一切。 + +### Zorin 15 中的新特性 + +让我们来看一下最新版本的 Zorin 有哪些主要的改变。Zorin 15 是基于 Ubuntu 18.04.2 的,因此带来了许多性能上的提升。除此之外,也有许多 UI(用户界面)的改进。 + +#### Zorin Connect + +![Zorin Connect][3] + +Zorin OS 15 最主要的一个亮点就是 —— Zorin Connect。如果你使用的是安卓设备,那你一定会喜欢这一功能。类似于 [PushBullet][4](LCTT 译注:PushBullet,子弹推送,一款跨平台推送工具), [Zorin Connect][5] 会提升你的手机和桌面一体化的体验。 + +你可以在桌面上同步智能手机的通知,同时还可以回复它。甚至,你可以回复短信并查看对话。 + +总的来说,你可以体验到以下功能: + + * 在设备间分享文件或链接 + * 将你的手机作为电脑的遥控器 + * 使用手机控制电脑上媒体的播放,并且当有来电接入时自动停止播放 + +正如他们在[官方公告][6]中提到的, 数据的传输仅限于本地网络之间,并且不会有数据被上传到云端服务器。通过以下操作体验 Zorin Connect ,找到:Zorin menu (Zorin 菜单) > System Tools (系统工具) > Zorin Connect。 + +#### 新的桌面主题(包含夜间模式!) + +![Zorin 夜间模式][7] + +一提到 “夜间模式” 我就毫无抵抗力。对我而言,这是Zorin OS 15 自带的最好的功能。 + +当我启用了界面的深色模式时,我的眼睛感到如此舒适,你不想来试试么? + +它不单单是一个深色的主题,而是 UI 更干净直观,并且带有恰到好处的新动画。你可以从 Zorin 内置的外观应用程序里找到所有的相关设置。 + +#### 自适应背景调整 & 深色浅色模式 + +你可以选择让桌面背景根据一天中每小时的环境亮度进行自动调整。此外,如果你想避免蓝光给眼睛带来伤害,你可以使用夜间模式。 + +#### 代办事项应用 + +![Todo][9] + +我一直希望支持这个功能,这样我就不必使用其他 Linux 客户端程序来添加任务。很高兴看到内置的应用程序集成并支持谷歌任务和 Todoist。 + +#### 还有更多么? + +是的!其他主要的变化包括对 Flatpak 的支持,支持平板笔记本二合一电脑的触摸布局,DND 模式,以及一些重新设计的应用程序(设置、Libre Office),以此来给你更好的用户体验。 + +如果你想要了解所有更新和改动的详细信息,你可以查看[官方公告][6]。如果你已经是 Zorin 的用户,你应该已经注意到他们的网站也已经启用了一个全新的外观。 + +### 下载 Zorin OS 15 + +**注释** : 今年的晚些时候将会推出从 Zorin OS 12 直升 15 版本而不需要重新安装的升级包。 + +提示一下,Zorin OS 有三个版本:旗舰版本、核心板和轻量版。 + +如果你想支持开发者和项目,同时解锁 Zorin OS 全部的功能,你可以花 39 美元购买旗舰版本。 + +如果你只是想要一些基本功能,核心版就可以了(你可以免费下载)。如果是这种情况,比如你有一台旧电脑,那么你可以使用轻量版。 + +- [下载 ZORIN OS 15][10] + +你觉得 Zorin 15 怎么样? + +我肯定会尝试一下,将 Zorin OS 作为我的主要操作系统 -(手动狗头)。你呢?你觉得最新的版本怎么样?欢迎在下面的评论中告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zorin-os-15-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-beginners/ +[2]: https://zorinos.com/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/zorin-connect.jpg +[4]: https://www.pushbullet.com/ +[5]: https://play.google.com/store/apps/details?id=com.zorinos.zorin_connect&hl=en_IN +[6]: https://zoringroup.com/blog/2019/06/05/zorin-os-15-is-here-faster-easier-more-connected/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/zorin-dark-mode.jpg +[8]: https://itsfoss.com/necunos-linux-smartphone/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/Todo.jpg +[10]: https://zorinos.com/download/ +[11]: https://itsfoss.com/ubuntu-1404-codenamed-trusty-tahr/ diff --git a/published/20190607 4 tools to help you drive Kubernetes.md b/published/20190607 4 tools to help you drive Kubernetes.md new file mode 100644 index 0000000000..fda732e343 --- /dev/null +++ b/published/20190607 4 tools to help you drive Kubernetes.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11101-1.html) +[#]: subject: (4 tools to help you drive Kubernetes) +[#]: via: (https://opensource.com/article/19/6/tools-drive-kubernetes) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux/users/fatherlinux/users/fatherlinux/users/fatherlinux) + +帮助你驾驭 Kubernetes 的 4 个工具 +====== + +> 学习如何驾驭 Kubernetes 比如何建造它更重要,这些工具可以帮助你更快上路。 + +![Tools in a workshop][1] + +在本系列的第三篇文章中,[Kubernetes 基础:首先学习如何使用][2],我强调你应该学会使用 Kubernetes,而不是建造它。我还解释说,在 Kubernetes 中,你必须学习最小的一组原语来建模应用程序。我想强调这一点:你需要学习的这组原语是最简单的原语集,你可以通过它们学习如何实现生产级的应用程序部署(即高可用性 [HA]、多容器、多应用程序)。换句话说,学习 Kubernetes 内置的原语集比学习集群软件、集群文件系统、负载平衡器、让人发疯的 Apache 和 Nginx 的配置、路由器、交换机、防火墙和存储后端更容易 —— 这些是你在传统的 IT 环境(虚拟机或裸机)中建模简单的 HA 应用程序所需要的东西。 + +在这第四篇文章中,我将分享一些有助于你学习快速驾驭 Kubernetes 的工具。 + +### 1、Katacoda + +无疑,[Katacoda][3] 是试驾 Kubernetes 集群的最简单方法。只需单击一下,五秒钟后就可以将基于 Web 的终端直接连接到正在运行的 Kubernetes 集群中。这对于使用和学习来说非常棒。我甚至将它用于演示和测试新想法。Katacoda 提供了一个完整的临时环境,在你使用完毕后可以回收利用。 + +![OpenShift Playground][4] + +*[OpenShift Playground][5]* + +![Kubernetes Playground][6] + +*[Kubernetes Playground][7]* + +Katacoda 提供了一个临时的环境和更深入的实验室环境。例如,我最近三四年主讲的 [Linux Container Internals Lab][3] 是在 Katacoda 中构建的。 + +Katacoda 在其主站点上维护了若干 [Kubernetes 和云教程][8]并与 Red Hat 合作以支持了一个 [OpenShift 的专用学习门户][9]。了解一下,它们是极好的学习资源。 + +当你第一次学习驾驶翻斗车时,最好先观察一下其他人的驾驶方式。 + +### 2、Podman generate kube + +`podman generate kube` 命令是一个很棒的子命令,可以帮助用户自然地从运行简单容器的简单容器引擎转换到运行许多容器的集群用例(正如我在[上篇文章][2]中所描述的那样)。[Podman][10] 通过让你启动一个新的容器,然后导出这个可工作的 Kube YAML,并在 Kubernetes 中启动它来实现这一点。看看这个(你可以在 [Katacoda lab][3] 中运行它,它已经有了 Podman 和 OpenShift)。 + +首先,请注意运行容器的语法与 Docker 非常相似: + +``` +podman run -dtn two-pizza quay.io/fatherlinux/two-pizza +``` + +不过这个是其它容器引擎所没有的: + +``` +podman generate kube two-pizza +``` + +输出: + +``` +# Generation of Kubernetes YAML is still under development! +# +# Save the output of this file and use kubectl create -f to import +# it into Kubernetes. +# +# Created with podman-1.3.1 +apiVersion: v1 +kind: Pod +metadata: + creationTimestamp: "2019-06-07T08:08:12Z" + labels: + app: two-pizza + name: two-pizza +spec: + containers: + - command: + - /bin/sh + - -c + - bash -c 'while true; do /usr/bin/nc -l -p 3306 < /srv/hello.txt; done' + env: + - name: PATH + value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: TERM + value: xterm + - name: HOSTNAME + - name: container + value: oci + image: quay.io/fatherlinux/two-pizza:latest + name: two-pizza + resources: {} + securityContext: + allowPrivilegeEscalation: true + capabilities: {} + privileged: false + readOnlyRootFilesystem: false + tty: true + workingDir: / +status: {} +--- +apiVersion: v1 +kind: Service +metadata: + creationTimestamp: "2019-06-07T08:08:12Z" + labels: + app: two-pizza + name: two-pizza +spec: + selector: + app: two-pizza + type: NodePort +status: + loadBalancer: {} +``` + +你现在有了一些可以的工作 Kubernetes YAML,你可以用它作为练习的起点来学习、调整等等。`-s` 标志可以为你创造一项服务。[Brent Baude][11] 甚至致力于[添加卷/持久卷断言][12]等新功能。如果想进一步深入,请在 Brent 的博客文章《[Podman 现在可以轻松过渡到 Kubernetes 和 CRI-O][13]》中了解他的工作。 + +### 3、oc new-app + +`oc new-app` 命令非常强大。它是特定于 OpenShift 的,所以它在默认的 Kubernetes 中不可用,但是当你开始学习 Kubernetes 时它非常有用。让我们从快速命令开始创建一个相当复杂的应用程序: + +``` +oc new-project -n example +oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/quickstarts/cakephp-mysql.json +``` + +使用 `oc new-app`,你可以从 OpenShift 开发人员那里偷取模板,并在开发原语来描述你自己的应用程序时拥有一个已知良好的起点。运行上述命令后,你的 Kubernetes 命名空间(在 OpenShift 中)将由若干新的已定义资源填充。 + +``` +oc get all +``` + +输出: + +``` +NAME READY STATUS RESTARTS AGE +pod/cakephp-mysql-example-1-build 0/1 Completed 0 4m +pod/cakephp-mysql-example-1-gz65l 1/1 Running 0 1m +pod/mysql-1-nkhqn 1/1 Running 0 4m + +NAME DESIRED CURRENT READY AGE +replicationcontroller/cakephp-mysql-example-1 1 1 1 1m +replicationcontroller/mysql-1 1 1 1 4m + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/cakephp-mysql-example ClusterIP 172.30.234.135 8080/TCP 4m +service/mysql ClusterIP 172.30.13.195 3306/TCP 4m + +NAME REVISION DESIRED CURRENT TRIGGERED BY +deploymentconfig.apps.openshift.io/cakephp-mysql-example 1 1 1 config,image(cakephp-mysql-example:latest) +deploymentconfig.apps.openshift.io/mysql 1 1 1 config,image(mysql:5.7) + +NAME TYPE FROM LATEST +buildconfig.build.openshift.io/cakephp-mysql-example Source Git 1 + +NAME TYPE FROM STATUS STARTED DURATION +build.build.openshift.io/cakephp-mysql-example-1 Source Git@47a951e Complete 4 minutes ago 2m27s + +NAME DOCKER REPO TAGS UPDATED +imagestream.image.openshift.io/cakephp-mysql-example docker-registry.default.svc:5000/example/cakephp-mysql-example latest About aminute ago + +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD +route.route.openshift.io/cakephp-mysql-example cakephp-mysql-example-example.2886795271-80-rhsummit1.environments.katacoda.com cakephp-mysql-example None +``` + +这样做的好处是你可以删除 Pod,观察复制控制器如何重新创建它们,缩放 Pod 等等。你可以使用模板并将其更改为其他应用程序(这是我第一次启动时所做的)。 + +### 4、Visual Studio Code + +我把我最喜欢的放在最后。我的大部分工作都使用 [vi][14],但我从来没有为 Kubernetes 找到一个好的语法高亮器和代码补完插件(如果有的话,请告诉我)。相反,我发现微软的 [VS Code][15] 有一套杀手级的插件,可以完成 Kubernetes 资源的创建并提供样板。 + +![VS Code plugins UI][16] + +首先,安装上图中显示的 Kubernetes 和 YAML 插件。 + +![Autocomplete in VS Code][17] + +然后,你可以从头开始创建新的 YAML 文件,并自动补完 Kubernetes 资源。上面的示例显示了一个服务。 + +![VS Code autocomplete filling in boilerplate for an object][18] + +当你使用自动补完并选择服务资源时,它会填充该对象的一些模板。当你第一次学习使用 Kubernetes 时,这非常棒。你可以构建 Pod、服务、复制控制器、部署等。当你从头开始构建这些文件甚至修改你使用 `podman generate kube` 创建的文件时,这是一个非常好的功能。 + +### 总结 + +这四个工具(如果算上两个插件,则为六个)将帮助你学习驾驭 Kubernetes,而不是构造或装备它。在本系列的最后一篇文章中,我将讨论为什么 Kubernetes 如此适合运行这么多不同的工作负载。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/tools-drive-kubernetes + +作者:[Scott McCarty][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/fatherlinux/users/fatherlinux/users/fatherlinux/users/fatherlinux +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_workshop_blue_mechanic.jpg?itok=4YXkCU-J (Tools in a workshop) +[2]: https://linux.cn/article-11036-1.html +[3]: https://learn.openshift.com/subsystems/container-internals-lab-2-0-part-1 +[4]: https://opensource.com/sites/default/files/uploads/openshift-playground.png (OpenShift Playground) +[5]: https://learn.openshift.com/playgrounds/openshift311/ +[6]: https://opensource.com/sites/default/files/uploads/kubernetes-playground.png (Kubernetes Playground) +[7]: https://katacoda.com/courses/kubernetes/playground +[8]: https://katacoda.com/learn +[9]: http://learn.openshift.com/ +[10]: https://podman.io/ +[11]: https://developers.redhat.com/blog/author/bbaude/ +[12]: https://github.com/containers/libpod/issues/2303 +[13]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ +[14]: https://en.wikipedia.org/wiki/Vi +[15]: https://code.visualstudio.com/ +[16]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_red_hat_-_plugins.png (VS Code plugins UI) +[17]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_service_-_autocomplete.png (Autocomplete in VS Code) +[18]: https://opensource.com/sites/default/files/uploads/vscode_-_kubernetes_service_-_boiler_plate.png (VS Code autocomplete filling in boilerplate for an object) diff --git a/published/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md b/published/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md new file mode 100644 index 0000000000..213044032e --- /dev/null +++ b/published/20190607 Free and Open Source Trello Alternative OpenProject 9 Released.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11063-1.html) +[#]: subject: (Free and Open Source Trello Alternative OpenProject 9 Released) +[#]: via: (https://itsfoss.com/openproject-9-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +替代 Trello 的 OpenProject 9 发布了 +====== +![](https://img.linux.net.cn/data/attachment/album/201907/06/130201r9g70u01uuvvvvu7.jpg) + +[OpenProject][1] 是一个开源项目协作管理软件。它是 [Trello][2] 和 [Jira][3] 等专有方案的替代品。 + +如果个人使用,你可以免费使用它,并在你自己的服务器上进行设置(并托管它)。这样,你就可以控制数据。 + +当然,如果你是[企业云版的用户][4],那么你可以使用高级功能和更优先的帮助。 + +OpenProject 9 的重点是新的面板视图,包列表视图和工作模板。 + +如果你对此不了解,可以尝试一下。但是,如果你是已有用户 —— 在迁移到 OpenProject 9 之前,你应该知道这些新功能。 + +### OpenProject 9 有什么新功能? + +以下是最新版 OpenProject 的一些主要更改。 + +#### Scrum 和敏捷面板 + +![][5] + +对于企业云版,有了一个新的 [scrum][6] 和[敏捷][7]面板视图。你还可以[看板风格][8]方式展示你的工作,从而更轻松地支持你的敏捷和 scrum 团队。 + +新的面板视图使你可以轻松了解为该任务分配的人员并快速更新状态。你还有不同的面板视图选项,如基本面板、状态面板和版本面板。 + +#### 工作包模板 + +![Work Package Template][9] + +你不必为每个独立的工作包从头开始创建所有内容。而是,你只需保留一个模板,这样你就可以在需要创建新工作包时使用它。这将节省大量时间。 + +#### 新的工作包列表视图 + +![Work Package View][10] + +在工作包列表中,有一个微小的新增功能,可让你查看特定工作的已分配人员的头像。 + +#### “我的”页面的可自定义工作包视图 + +“我的”页面显示你正在处理的内容(以及进度),它不应该一直那么呆板。因此,现在你可以自定义它,甚至可以添加甘特图来可视化你的工作。 + +### 总结 + +有关迁移和安装的详细说明,请参阅[官方的公告帖][12],其中包含了必要的细节。 + +另外,我们很想知道你使用 OpenProject 9 的经历,请在下面的评论栏告诉我们!如果你使用其他一些项目管理软件,请随时向我们和其他 FOSS 读者推荐。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openproject-9-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.openproject.org/ +[2]: https://trello.com/ +[3]: https://www.atlassian.com/software/jira +[4]: https://www.openproject.org/pricing/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/open-project-9-scrum-agile.jpeg?fit=800%2C517&ssl=1 +[6]: https://en.wikipedia.org/wiki/Scrum_(software_development) +[7]: https://en.wikipedia.org/wiki/Agile_software_development +[8]: https://en.wikipedia.org/wiki/Kanban +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-template.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/work-package-view.jpg?fit=800%2C454&ssl=1 +[12]: https://www.openproject.org/openproject-9-new-scrum-agile-board-view/ diff --git a/published/20190609 How to set ulimit and file descriptors limit on Linux Servers.md b/published/20190609 How to set ulimit and file descriptors limit on Linux Servers.md new file mode 100644 index 0000000000..c2ca6cc0fe --- /dev/null +++ b/published/20190609 How to set ulimit and file descriptors limit on Linux Servers.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: (zgj1024) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11077-1.html) +[#]: subject: (How to set ulimit and file descriptors limit on Linux Servers) +[#]: via: (https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +如何在 Linux 服务器上设置 ulimit 和文件描述符数限制 +====== +
**简介**:在生产环境中遇到打开文件数这类的挑战如今已是司空见惯的事情了。因为许多应用程序是基于 Java 和 Apache 的,安装和配置它们可能会导致打开过多的文件(文件描述符)。如果打开的文件描述符超过了默认设置的限制,就可能会面临访问控制问题,受阻于打开文件的挑战。许多生产环境因此而陷入停滞状态。 + +![](https://img.linux.net.cn/data/attachment/album/201907/09/121422bv6t76nztjxqoprn.jpg) + +幸运的是,在基于 Linux 的服务器上,都有 `ulimit` 命令,通过它可以查看、设置、获取文件打开的状态和配置详情。此命令配备了许多选项,通过这些组合可以设置打开文件的数量。下面逐个命令用示例做了详细说明。 + +### 查看任何 Linux 系统中当前打开文件数的限制 + +要在 Linux 服务器上得到打开文件数的限制,请执行以下命令, + +``` +[root@ubuntu ~]# cat /proc/sys/fs/file-max +146013 +``` + +上面的数字表明用户可以在每个用户登录会话中打开 ‘146013’ 个文件。 + +``` +[root@centos ~]# cat /proc/sys/fs/file-max +149219 +[root@debian ~]# cat /proc/sys/fs/file-max +73906 +``` + +这清楚地表明,各个 Linux 操作系统具有不同的打开文件数限制。这基于各自系统中运行的依赖关系和应用程序。 + +### ulimit 命令 + +顾名思义,`ulimit`(用户限制)用于显示和设置登录用户的资源限制。当我们使用 `-a` 选项运行 `ulimit` 命令时,它将打印登录用户的所有资源限制。现在让我们在 Ubuntu/Debian 和 CentOS 系统上运行 `ulimit -a`, + +#### Ubuntu / Debian 系统 + +``` +shashi@Ubuntu ~}$ ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +scheduling priority (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 5731 +max locked memory (kbytes, -l) 64 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +real-time priority (-r) 0 +stack size (kbytes, -s) 8192 +cpu time (seconds, -t) unlimited +max user processes (-u) 5731 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +``` + +#### CentOS 系统 + +``` +shashi@centos ~}$ ulimit -a +core file size (blocks, -c) 0 +data seg size (kbytes, -d) unlimited +scheduling priority (-e) 0 +file size (blocks, -f) unlimited +pending signals (-i) 5901 +max locked memory (kbytes, -l) 64 +max memory size (kbytes, -m) unlimited +open files (-n) 1024 +pipe size (512 bytes, -p) 8 +POSIX message queues (bytes, -q) 819200 +real-time priority (-r) 0 +stack size (kbytes, -s) 8192 +cpu time (seconds, -t) unlimited +max user processes (-u) 5901 +virtual memory (kbytes, -v) unlimited +file locks (-x) unlimited +``` + +正如我们可以在这里看到的,不同的操作系统具有不同的限制设置。所有这些限制都可以使用 `ulimit` 命令进行配置/更改。 + +要显示单个资源限制,可以在 `ulimit` 命令中传递特定的参数,下面列出了一些参数: + + * `ulimit -n` –> 显示打开文件数限制 + * `ulimit -c` –> 显示核心转储文件大小 + * `umilit -u` –> 显示登录用户的最大用户进程数限制 + * `ulimit -f` –> 显示用户可以拥有的最大文件大小 + * `umilit -m` –> 显示登录用户的最大内存大小 + * `ulimit -v` –> 显示最大内存大小限制 + +使用以下命令检查登录用户打开文件数量的硬限制和软限制: + +``` +shashi@Ubuntu ~}$ ulimit -Hn +1048576 +shashi@Ubuntu ~}$ ulimit -Sn +1024 +``` + +### 如何修复达到最大文件数限制的问题? + +让我们假设我们的 Linux 服务器已经达到了打开文件的最大数量限制,并希望在系统范围扩展该限制,例如,我们希望将 100000 设置为打开文件数量的限制。 + +``` +root@ubuntu~]# sysctl -w fs.file-max=100000 +fs.file-max = 100000 +``` + +上述更改将在下次重启之前有效,因此要使这些更改在重启后仍存在,请编辑文件 `/etc/sysctl.conf` 并添加相同的参数, + +``` +root@ubuntu~]# vi /etc/sysctl.conf +fs.file-max = 100000 +``` + +保存文件并退出。 + +运行下面命令,使上述更改立即生效,而无需注销和重新启动。 + +``` +root@ubuntu~]# sysctl -p +``` + +现在验证新的更改是否生效。 + +``` +root@ubuntu~]# cat /proc/sys/fs/file-max +100000 +``` + +使用以下命令找出当前正在使用的文件描述符数量: + +``` +[root@ansible ~]# more /proc/sys/fs/file-nr +1216 0 100000 +``` + +注意:命令 `sysctl -p` 用于在不重新启动和注销的情况下提交更改。 + +### 通过 limit.conf 文件设置用户级资源限制 + +`/etc/sysctl.conf` 文件用于设置系统范围的资源限制,但如果要为 Oracle、MariaDB 和 Apache 等特定用户设置资源限制,则可以通过 `/etc/security/limits.conf` 文件去实现。 + +示例 `limits.conf` 如下所示, + +``` +root@ubuntu~]# cat /etc/security/limits.conf +``` + +![Limits-conf-linux-part1][1] + +![Limits-conf-linux-part2][2] + +假设我们要为 linuxtechi 用户设置打开文件数量的硬限制和软限制,而对于 oracle 用户设置打开进程数量的硬限制和软限制,编辑文件 `/etc/security/limits.conf` 并添加以下行: + +``` +# hard limit for max opened files for linuxtechi user +linuxtechi hard nofile 4096 +# soft limit for max opened files for linuxtechi user +linuxtechi soft nofile 1024 + +# hard limit for max number of process for oracle user +oracle hard nproc 8096 +# soft limit for max number of process for oracle user +oracle soft nproc 4096 +``` + +保存文件并退出。 + +**注意:** 如果你想对一个组而不是用户进行资源限制,那么也可以通过 `limits.conf` 文件,输入 `@<组名>` 代替用户名,其余项都是相同的,示例如下, + +``` +# hard limit for max opened files for sysadmin group +@sysadmin hard nofile 4096 +# soft limit for max opened files for sysadmin group +@sysadmin soft nofile 1024 +``` + +验证新的更改是否生效: + +``` +~]# su - linuxtechi +~]$ ulimit -n -H +4096 +~]$ ulimit -n -S +1024 + +~]# su - oracle +~]$ ulimit -H -u +8096 +~]$ ulimit -S -u +4096 +``` + +注:其他主要使用的命令是 [lsof][3],可用于找出“当前打开了多少个文件”,这命令对管理员非常有帮助。 + +### 结尾 + +正如在介绍部分提到的,`ulimit` 命令非常强大,可以帮助用户配置并确保应用程序安装更加流畅而没有任何瓶颈。此命令有助于修复基于 Linux 的服务器中的(打开)大量文件的限制。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/set-ulimit-file-descriptors-limit-linux-servers/ + +作者:[Shashidhar Soppin][a] +选题:[lujun9972][b] +译者:[zgj1024](https://github.com/zgj1024) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Limits-conf-linux-part1-1024x677.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Limits-conf-linux-part2-1024x443.jpg +[3]: https://www.linuxtechi.com/lsof-command-examples-linux-geeks/ diff --git a/published/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md b/published/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md new file mode 100644 index 0000000000..530d71d66e --- /dev/null +++ b/published/20190610 5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11051-1.html) +[#]: subject: (5 Easy Ways To Free Up Space (Remove Unwanted or Junk Files) on Ubuntu) +[#]: via: (https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-debian/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +5 种在 Ubuntu 上释放空间的简单方法 +====== + +![](https://img.linux.net.cn/data/attachment/album/201907/03/165641h0xy91x9109wz19w.jpg) + +大多数人可能在系统磁盘存储不足的情况下执行释放空间这个操作,也可能在 Linux 系统磁盘存储满了的情况下执行这个操作。 + +它应该被经常执行,来为安装一个新的应用程序和处理其它文件弥补磁盘存储空间。保持可用空间是 Linux 管理员的一个日常任务,以允许磁盘利用率维持在阈值之下。 + +这里有一些我们可以清理我们系统空间的方法。 + +当你有 TB 级存储容量时,可能不需要清理你的系统。但是,如果你空间有限,那么释放磁盘空间就变的不可避免。 + +在这篇文章中,我将向你展示一些最容易的或简单的方法来清理你的 Ubuntu 系统,获得更多空间。 + +### 在 Ubuntu 系统上如何检查可用的空间? + +在你的系统上使用 [df 命令][1] 来检查当前磁盘利用率。 + +``` +$ df -h +Filesystem Size Used Avail Use% Mounted on +udev 975M 0 975M 0% /dev +tmpfs 200M 1.7M 198M 1% /run +/dev/sda1 30G 16G 13G 55% / +tmpfs 997M 0 997M 0% /dev/shm +tmpfs 5.0M 4.0K 5.0M 1% /run/lock +tmpfs 997M 0 997M 0% /sys/fs/cgroup +``` + +图形界面用户可以使用“磁盘利用率分析器工具”来查看当前利用率。 + +![][3] + +#### 1) 移除不再需要的软件包 + +下面的命令移除系统不再需要的依赖库和软件包。这些软件包是自动安装的,以使一个安装的软件包满足依赖关系。同样,它也会移除安装在系统中的 Linux 旧内核。它会移除不再被系统需要的孤儿软件包,但是不会清除它们。 + +``` +$ sudo apt-get autoremove +[sudo] password for daygeek: +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages will be REMOVED: + apache2-bin apache2-data apache2-utils galera-3 libaio1 libapr1 libaprutil1 + libaprutil1-dbd-sqlite3 libaprutil1-ldap libconfig-inifiles-perl libdbd-mysql-perl + libdbi-perl libjemalloc1 liblua5.2-0 libmysqlclient20 libopts25 + libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common + mariadb-server-10.1 mariadb-server-core-10.1 mysql-common sntp socat +0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. +After this operation, 189 MB disk space will be freed. +Do you want to continue? [Y/n] +``` + +为清除它们,可以与命令一起使用 `--purge` 选项。 + +``` +$ sudo apt-get autoremove --purge +Reading package lists... Done +Building dependency tree +Reading state information... Done +The following packages will be REMOVED: + apache2-bin* apache2-data* apache2-utils* galera-3* libaio1* libapr1* libaprutil1* + libaprutil1-dbd-sqlite3* libaprutil1-ldap* libconfig-inifiles-perl* + libdbd-mysql-perl* libdbi-perl* libjemalloc1* liblua5.2-0* libmysqlclient20* + libopts25* libterm-readkey-perl* mariadb-client-10.1* mariadb-client-core-10.1* + mariadb-common* mariadb-server-10.1* mariadb-server-core-10.1* mysql-common* sntp* + socat* +0 upgraded, 0 newly installed, 25 to remove and 23 not upgraded. +After this operation, 189 MB disk space will be freed. +Do you want to continue? [Y/n] +``` + +#### 2) 清空回收站 + +有可能你的回收站里面有大量的无用数据。它会占用你的系统空间。最好解决方法之一是在你的系统上清理这些无用的数据,以获取一些可用的空间。 + +为清理这些,简单地使用文件管理器来清空你的回收站。 + +![][4] + +#### 3) 清理 APT 缓存文件 + +Ubuntu 使用 [APT 命令][5](高级软件包工具)用于软件包管理,如:安装、移除、搜索等等。 + +一般 Linux 操作系统会在各自的目录下保留下载和安装的软件包的缓冲文件。 + +Ubuntu 也一样,它在你的磁盘上以缓冲的形式保留它下载和安装的每次更新。Ubuntu 在 `/var/cache/apt/archives` 目录中保留 DEB 软件包的缓冲文件。随着时间推移,这些缓存可能快速增长,并在你的系统上占有很多空间。 + +运行下面的命令来检查当前 APT 缓存文件的使用率。 + +``` +$ sudo du -sh /var/cache/apt +147M /var/cache/apt +``` + +下面的命令会清理过时的 deb 软件包。我想说,一点都清理不干净。 + +``` +$ sudo apt-get autoclean +``` + +下面的命令会移除所有在 apt 缓存中的软件包。 + +``` +$ sudo apt-get clean +``` + +#### 4) 卸载不使用的应用程序 + +这需要你来检查在你的系统上安装的软件包和游戏,删除它们,如果你很少使用的话。 + +这可以通过 “Ubuntu 软件中心” 简单地做到。 + +![][6] + +#### 5) 清理缩略图缓存 + +缓存文件夹是程序存储它们可能再次需要的数据的地方,它是为速度保留的,而不是必需保留的。它可以被再次生成或再次下载。假如它真的填满了你的硬盘,那么你可以删除一些东西而不用担心。 + +运行下面的命令来检查当前 APT 缓存的利用率。 + +``` +$ du -sh ~/.cache/thumbnails/ +412K /home/daygeek/.cache/thumbnails/ +``` + +运行下面的命令来从你的系统中永久地删除它们。 + +``` +$ rm -rf ~/.cache/thumbnails/* +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-remove-delete-unwanted-junk-files-free-up-space-ubuntu-mint-debian/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-check-disk-space-usage-using-df-command/ +[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-1.jpg +[4]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-2.jpg +[5]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[6]: https://www.2daygeek.com/wp-content/uploads/2019/06/remove-delete-Unwanted-Junk-Files-free-up-space-ubuntu-mint-debian-3.jpg diff --git a/published/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md b/published/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md new file mode 100644 index 0000000000..7f100cfc52 --- /dev/null +++ b/published/20190612 BitTorrent Client Deluge 2.0 Released- Here-s What-s New.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11050-1.html) +[#]: subject: (BitTorrent Client Deluge 2.0 Released: Here’s What’s New) +[#]: via: (https://itsfoss.com/deluge-2-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +BitTorrent 客户端 Deluge 2.0 发布:新功能介绍 +====== + +你可能已经知道 [Deluge][1] 是[最适合 Linux 用户的 Torrent 客户端][2]之一。然而,最近的稳定版本差不多是两年前的了。 + +尽管它仍在积极开发中,但直到最近才出了一个主要的稳定版本。我们写这篇文章时,最新版本恰好是 2.0.2。所以,如果你还没有下载最新的稳定版本,请尝试一下。 + +不管如何,如果你感兴趣的话,让我们看看有哪些新的功能。 + +### Deluge 2.0 的主要改进 + +新版本引入了多用户支持,这是一个非常需要的功能。除此之外,还有一些性能改进可以更快地加载更多的种子。 + +此外,在 2.0 版本中,Deluge 使用了 Python 3,对 Python 2.7 提供最低支持。即使是用户界面,他们也从 GTK UI 迁移到了 GTK3。 + +根据发行说明,还有一些更重要的补充/改进,包括: + +* 多用户支持。 +* 性能提升,可以更快地加载数千个种子。 +* 一个模拟 GTK/Web UI 的新控制台 UI。 +* GTK UI 迁移到 GTK3,并带有 UI 改进和补充。 +* 磁链预获取功能可以在添加种子时选择文件。 +* 完全支持 libtorrent 1.2。 +* 语言切换支持。 +* 改进了在 ReadTheDocs 托管的文档。 +* AutoAdd 插件取代了内置功能。 + +### 如何安装或升级到 Deluge 2.0 + +![][4] + +对于任何 Linux 发行版,你都应该遵循官方[安装指南][5](使用 PPA 或 PyPi)。但是,如果你要升级,你应该留意发行说明中提到的: + +> “_Deluge 2.0 与 Deluge 1.x 客户端或守护进程不兼容,因此这些也需要升级。如果第三方脚本直接连接到 Deluge 客户端,那么可能也不兼容且需要迁移。_” + +因此,坚持在升级主版本之前备份你的[配置][6]以免数据丢失。而且,如果你是插件作者,那么需要升级它以使其与新版本兼容。 + +直接下载的安装包尚不包含 Windows 和 Mac OS。但是,说明中提到他们正在进行中。 + +除此之外,你可以按照更新后的官方文档中的[安装指南][5]来手动安装它们。 + +### 总结 + +你如何看待最新的稳定版本?你是否将 Deluge 用作 BitTorrent 客户端?或者你是否找到了其他更好的选择? + +请在下面的评论栏告诉我们你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deluge-2-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://dev.deluge-torrent.org/ +[2]: https://itsfoss.com/best-torrent-ubuntu/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/deluge.jpg?fit=800%2C410&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/Deluge-2-release.png?resize=800%2C450&ssl=1 +[5]: https://deluge.readthedocs.io/en/latest/intro/01-install.html +[6]: https://dev.deluge-torrent.org/wiki/Faq#WheredoesDelugestoreitssettingsconfig diff --git a/published/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md b/published/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md new file mode 100644 index 0000000000..c3e147d434 --- /dev/null +++ b/published/20190613 IPython is still the heart of Jupyter Notebooks for Python developers.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11064-1.html) +[#]: subject: (IPython is still the heart of Jupyter Notebooks for Python developers) +[#]: via: (https://opensource.com/article/19/6/ipython-still-heart-jupyterlab) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/marcobravo) + +对 Python 开发者而言,IPython 仍然是 Jupyter Notebook 的核心 +====== + +> Jupyter 项目提供的魔法般的开发体验很大程度上得益于它的 IPython 基因。 + +![](https://img.linux.net.cn/data/attachment/album/201907/06/131704z1lsfssamfxrrliq.jpg) + +最近刚刚写过我为什么觉得觉得 Jupyter 项目(特别是 JupyterLab)提供了一种 [魔法般的 Python 开发体验][2]。在研究这些不同项目之间的关联的时候,我回顾了一下 Jupyter 最初从 IPython 分支出来的这段历史。正如 Jupyter 项目的 [大拆分™ 声明][3] 所说: + +> “如果你不明白 Jupyter 是什么,这么说吧,它拥有和 IPython 同样的代码,并且是由同一批人开发的,只不过取了一个新名字、安了一个新家。” + +下面这个注脚进一步说明了这一点: + +> “我从声明中解读出来的信息是,‘Jupyter 和 IPython 非常相似,但是拥有多种语言’,这也可以很好地解释为什么这个项目的名字已经不再需要包含 Python,因为当时它已经支持多种语言了。” + +我明白 Jupyter Notebook 和 IPython 都是从同样的源代码里分支出来的,但是不太清楚 IPython 项目的现状。在大拆分™ 之后它是已经不再被需要了,还是在以另一种方式延续着? + +后来我惊讶地发现,IPython 仍然不断在为 Python 使用者提供价值,它正是 Jupyter 体验的核心部分。下面是 Jupyter 常见问题页面的一段截取: + +> **有什么语言是需要预装的吗?** +> +> 是的,安装 Jupyter Notebook 会首先安装 IPython 内核。这样我们就可以在 notebook 上运行 Python 语言了。 + +现在我明白了,在 JupyterLab(以及 Jupyter Notebook)上编写 Python 程序仍然需要依赖 IPython 内核的持续开发。不仅如此,IPython 还充当了最为强大的默认内核的角色,根据 [这份文档][4],它是其它语言内核之间的枢纽,节省了很多开发时间和精力。 + +现在唯一的问题是,IPython 本身可以做什么呢? + +### IPython 如今的作用 + +IPython 提供了一个强大的、交互性的 Python shell,以及 Jupyter 的内核。安装完成之后,我可以在任何命令行运行 `ipython` 本身,将它当作一个(比默认 Python shell 好太多的)Python shell 来使用: + + +``` +$ ipython +Python 3.7.3 (default, Mar 27 2019, 09:23:15) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: import numpy as np +In [2]: example = np.array([5, 20, 3, 4, 0, 2, 12]) +In [3]: average = np.average(example) +In [4]: print(average) +6.571428571428571 +``` + +这就让我们发现了一个更为重要的问题:是 IPython 让 JupyterLab 可以在项目中执行代码,并且支持了一系列被称为 *Magic* 的功能(感谢 Nicholas Reith 在我上一篇文章的评论里提到这点)。 + +### IPython 让魔法成为现实 + +JupyterLab 和其它使用 IPython 的前端工具可以让你感觉像是在最喜欢的 IDE 或者是终端模拟器的环境下工作。我非常喜欢 [点文件][5] 快捷键功能,Magic 也有类似点文件的特征。比如说,可以试一下 [%bookmark][6] 这个命令。我把默认开发文件夹 `~/Develop` 关联到了一个可以在任何时候直接跳转的快捷方式上。 + +![Screenshot of commands from JupyterLab][7] + +`%bookmark`、`%cd`,以及我在前一篇文章里介绍过的 `!` 操作符,都是由 IPython 支持的。正如这篇 [文档][8] 所说: + +> Jupyter 用户你们好:Magic 功能是 IPython 内核提供的专属功能。一个内核是否支持 Magic 功能是由该内核的开发者针对该内核所决定的。 + +### 写在最后 + +作为一个好奇的新手,我之前并不是特别确定 IPython 是否仍然和 Jupyter 生态还有任何联系。现在我对 IPython 的持续开发有了新的认识和,并且意识到它正是 JupyterLab 强大的用户体验的来源。这也是相当有才华的一批贡献者进行最前沿研究的成果,所以如果你在学术论文中使用到了 Jupyter 项目的话别忘了引用他们。为了方便引用,他们还提供了一个 [现成的引文][9]。 + +如果你在考虑参与哪个开源项目的贡献的话,一定不要忘了 IPython 哦。记得看看 [最新发布说明][10],在这里可以找到 Magic 功能的完整列表。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/ipython-still-heart-jupyterlab + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ilovefs_free_sticker_fsfe_heart.jpg?itok=gLJtaieq (I love Free Software FSFE celebration) +[2]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic +[3]: https://blog.jupyter.org/the-big-split-9d7b88a031a7 +[4]: https://jupyter-client.readthedocs.io/en/latest/kernels.html +[5]: https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory#Unix_and_Unix-like_environments +[6]: https://ipython.readthedocs.io/en/stable/interactive/magics.html?highlight=magic#magic-bookmark +[7]: https://opensource.com/sites/default/files/uploads/jupyterlab-commands-ipython.png (Screenshot of commands from JupyterLab) +[8]: https://ipython.readthedocs.io/en/stable/interactive/magics.html +[9]: https://ipython.org/citing.html +[10]: https://ipython.readthedocs.io/en/stable/whatsnew/index.html diff --git a/published/20190618 A beginner-s guide to Linux permissions.md b/published/20190618 A beginner-s guide to Linux permissions.md new file mode 100644 index 0000000000..a8206c14d4 --- /dev/null +++ b/published/20190618 A beginner-s guide to Linux permissions.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: (qfzy1233) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11056-1.html) +[#]: subject: (A beginner's guide to Linux permissions) +[#]: via: (https://opensource.com/article/19/6/understanding-linux-permissions) +[#]: author: (Bryant Son https://opensource.com/users/brson/users/greg-p/users/tj) + +Linux 权限入门指南 +====== + +> Linux 安全权限能够指定谁可以对文件或目录执行什么操作。 + +![](https://img.linux.net.cn/data/attachment/album/201907/04/133751argz0pp7hy5gvv7q.jpg) + +与其他系统相比而言 Linux 系统的众多优点中最为主要一个便是 Linux 系统有着更少的安全漏洞和被攻击的隐患。Linux 无疑为用户提供了更为灵活和精细化的文件系统安全权限控制。这可能意味着 Linux 用户理解安全权限是至关重要的。虽然这并不一定是必要的,但是对于初学者来说,理解 Linux 权限的基本知识仍是一个明智之选。 + +### 查看 Linux 安全权限 + +在开始 Linux 权限的相关学习之前,假设我们新建了一个名为 `PermissionDemo` 的目录。使用 `cd` 命令进入这个目录,然后使用 `ls -l` 命令查看 Linux 安全管理权限信息。如果你想以时间为序排列,加上 `-t` 选项 + + +``` +`ls -lt` +``` + +因为这一目录下没有文件,所以这一命令执行不会返回结果。 + +![No output from ls -l command][2] + +要了解关于 `ls` 命令的更多信息,请通过在命令行中输入 `man ls` 来查看命令手册。 + +![ls man page][3] + +现在,让我们创建两个名为 `cat.txt` 和 `dog.txt` 的空白文件;这一步使用 `touch` 命令将更为简便。然后继续使用 `mkdir` 命令创建一个名为 `Pets` 的空目录。我们可以再次使用`ls -l`命令查看这些新文件的权限。 + +![Creating new files and directory][4] + +我们需要留意这个命令输出结果的两个部分。 + +### 谁拥有权限? + +首先要注意的是*谁*具有访问文件/目录的权限。请注意下面红色框中突出显示的部分。第一列是指具有访问权限的*用户*,而第二列是指具有访问权限的*组*。 + +![Output from -ls command][5] + +用户的类型主要有三种:用户、组和其他人(本质上既不是用户也不是组)。还有一个*全部*,意思是几乎所有人。 + +![User types][6] + +由于我们使用 `root` 作为当前用户,所以我们可以访问任何文件或目录,因为 `root` 是超级用户。然而,通常情况并非如此,你可能会被限定使用你的普通用户登录。所有的用户都存储在 `/etc/passwd` 文件中。 + +![/etc/passwd file][7] + +“组“的相关信息保存在 `/etc/group` 文件中。 + +![/etc/passwd file][8] + +### 他们有什么权限? + +我们需要注意的是 `ls -l` 命令输出结果的另一部分与执行权限有关。以上,我们查看了创建的 `dog.txt` 和 `cat.txt` 文件以及 `Pets` 目录的所有者和组权限都属于 `root` 用户。我们可以通过这一信息了解到不同用户组所拥有的相应权限,如下面的红色框中的标示。 + +![Enforcing permissions for different user ownership types][9] + +我们可以把每一行分解成五部分。第一部分标志着它是文件还是目录:文件用 `-`(连字符)标记,目录用 `d` 来标记。接下来的三个部分分别是用户、组和其他人的对应权限。最后一部分是[访问控制列表][10] (ACL)的标志,是记录着特定用户或者用户组对该文件的操作权限的列表。 + +![Different Linux permissions][11] + +Linux 的权限级别可以用字母或数字标识。有三种权限类型: + + * 可读取:`r` 或 `4` + * 可写入:`w` 或 `2` + * 可执行:`x` 或 `1` + +(LCTT 译注:原文此处对应的字母标示 `x` 误写为 `e`,已更正) + +![Privilege types][12] + +每个字母符号(`r`、`w` 或 `x`)表示有该项权限,而 `-` 表示无该项权限。在下面的示例中,文件的所有者可读可写,用户组成员仅可读,其他人可读可执行。转换成数字表示法,对应的是 `645`(如何计算,请参见下图的图示)。 + +![Permission type example][13] + +以下是一些示例: + +![Permission type examples][14] + +完成下面的测试,检查你是否掌握了权限管理相关的知识。 + +![Permission type examples][15] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/understanding-linux-permissions + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[qfzy1233](https://github.com/qfzy1233) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson/users/greg-p/users/tj +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/sites/default/files/uploads/1_3.jpg (No output from ls -l command) +[3]: https://opensource.com/sites/default/files/uploads/1_man.jpg (ls man page) +[4]: https://opensource.com/sites/default/files/uploads/2_6.jpg (Creating new files and directory) +[5]: https://opensource.com/sites/default/files/uploads/3_2.jpg (Output from -ls command) +[6]: https://opensource.com/sites/default/files/uploads/4_0.jpg (User types) +[7]: https://opensource.com/sites/default/files/uploads/linuxpermissions_4_passwd.jpg (/etc/passwd file) +[8]: https://opensource.com/sites/default/files/uploads/linuxpermissions_4_group.jpg (/etc/passwd file) +[9]: https://opensource.com/sites/default/files/uploads/linuxpermissions_5.jpg (Enforcing permissions for different user ownership types) +[10]: https://en.wikipedia.org/wiki/Access-control_list +[11]: https://opensource.com/sites/default/files/uploads/linuxpermissions_6.jpg (Different Linux permissions) +[12]: https://opensource.com/sites/default/files/uploads/linuxpermissions_7.jpg (Privilege types) +[13]: https://opensource.com/sites/default/files/uploads/linuxpermissions_8.jpg (Permission type example) +[14]: https://opensource.com/sites/default/files/uploads/linuxpermissions_9.jpg (Permission type examples) +[15]: https://opensource.com/sites/default/files/uploads/linuxpermissions_10.jpg (Permission type examples) diff --git a/published/20190619 Leading in the Python community.md b/published/20190619 Leading in the Python community.md new file mode 100644 index 0000000000..9e75b8db87 --- /dev/null +++ b/published/20190619 Leading in the Python community.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11049-1.html) +[#]: subject: (Leading in the Python community) +[#]: via: (https://opensource.com/article/19/6/naomi-ceder-python-software-foundation) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +领导 Python 社区 +====== + +> 对话现任 Python 软件基金会董事会主席 Naomi Ceder。 + +![](https://img.linux.net.cn/data/attachment/album/201907/03/155715vrhkvapiiia9i3zp.jpg) + +和开源软件世界的很多其他领袖一样,[Python 软件基金会][3](PSF)的董事会主席 [Naomi Ceder][2] 通过一种不同寻常的方式走进了 Python 世界。正如她在 2017 年 PyCon España 大会上的 [keynote][4] 的标题所说,她是因为这个编程语言而来,因为这个社区而留下的。在我们和她的一次近期的交流中,她分享了自己成为 Python 社区领袖的历程,并且就“是什么让 Python 如此特别”这个问题提供了一些独到的见解。 + +### 从授课到编程 + +Naomi 的职业生涯是从古典文学开始的。她取得了拉丁文和古希腊文的博士学位,并且辅修了印欧语言学。在一家私立学校教授拉丁语的同时,她开始接触了计算机,学习如何编程、如何拆机进行升级或者维修。1995 年,她开始在 [Yggdrasil Linux][5] 系统上开发开源软件,并且帮助建立了印第安纳州韦恩堡的 [Linux 用户小组][6]。 + +作为一名教师,Naomi 相信在中学教授编程课程是非常重要的,因为等到大多数人上大学的时候,他们已经认为编程和科技相关的职业已经不是自己可以从事的了。她表示,更早地教授相关课程有助于增加科技人才的供给,提高人才的多元化和经验的广度,从而更好地满足行业需求。 + +大约在 2001 年前后,她决定从学习人类语言转向研究计算机语言,并同时教授计算机课程和管理学校的 IT 系统。在 2001 年的 Linux World 大会上听了一整天时任 PSF 主席 Guido Van Rossum (LCTT 译注:也是 Python 创始人)关于 Python 的演讲之后,她对 Python 的热情被点燃了。在那个时候,Python 还只是一门晦涩难懂的语言,但是她是如此喜欢 Python,以至于在她的学校开始使用 Python 记录学生信息、进行系统管理。 + +### 领导 Python 社区 + +Naomi 表示,“社区是 Python 成功背后的关键因素。开源软件的核心思想是分享,很少有人真的喜欢一个人坐在那儿盯着屏幕写代码。真正的满足来源于和别人交流想法,并且共同创造一些东西。” + +她在第一届 [PyCon][7] 大会上发表了演讲,并且从此之后一直是一名参与者和领导者。她组织了一些 趣味相投birds-of-a-feather 讨论会(LCTT 译注:birds-of-a-feather,一种在大会参与者之间进行的基于兴趣的非正式小规模讨论活动)、PyCon 和 PyCon UK 大会的海报展示会、教育峰会,以及 PyCon 大会的西班牙语频道。 + +她同时是 《[The Quick Python Book][9]》一书的作者,并且联合创立了 [Trans*Code][10],“英国唯一一个专注于变性者的问题和机遇的黑客节”(LCTT 译注:黑客节hack event是一种让软件开发、设计、项目管理等相关人员相聚在一起,针对软件项目进行高强度合作的活动)。Naomi 表示,“随着科技能够提供越来越多的机遇,确保传统意义上的边缘化群体能够同等地享受到这些机遇成为了一件更为重要的事情。” + +### 通过 PSF 进行贡献 + +作为 PSF 的董事会主席,Naomi 积极地参与着该组织对 Python 语言和其使用者的支持工作。除了赞助 PyCon 大会的举办之外,PSF 基金会还为世界各地的小型聚会、大型会议和研习会提供资助。2018 年,该组织发放的资助接近 335000 美元,其中大多数款项的金额都在 500 美元到 5000 美元之间。 + +PSF 的短期目标是成为一个由专业人员维护的可持续的、稳定的、成熟的非盈利机构。它的长期目标包括发展可以提供对 Python 开发工作有效支持的各种资源,以及扩展该组织对全世界范围内 Python 教育工作的支持。 + +这些工作都需要来自社区的经济上的支持。Naomi 表示,PSF “最大的资金来源是 PyCon 大会。为了确保 PSF 的可持续性,我们同时也关注使用 Python 的企业的赞助,这是我们增长最快的部分。”会员费是每年 99 美元,并且 [捐款和募捐人][12] 同样也在帮助维持该组织的工作。 + +你可以在 PSF 的 [年度报告][13] 中了解该组织的更多工作情况。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/naomi-ceder-python-software-foundation + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [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/BIZ_HighTrust_1110_A.png?itok=EF5Tmcdk (Hands together around the word trust) +[2]: https://www.naomiceder.tech/pages/about/ +[3]: https://www.python.org/psf/ +[4]: https://www.youtube.com/watch?v=ayQK6app_wA +[5]: https://en.wikipedia.org/wiki/Yggdrasil_Linux/GNU/X +[6]: http://fortwaynelinux.org/about +[7]: http://pycon.org/ +[8]: https://twitter.com/pyconcharlas?lang=en +[9]: https://www.manning.com/books/the-quick-python-book-third-edition +[10]: https://www.trans.tech/ +[11]: https://www.python.org/psf/sponsorship/ +[12]: https://www.python.org/psf/donations/ +[13]: https://www.python.org/psf/annual-report/2019/ diff --git a/published/20190621 Three Ways to Lock and Unlock User Account in Linux.md b/published/20190621 Three Ways to Lock and Unlock User Account in Linux.md new file mode 100644 index 0000000000..870285a844 --- /dev/null +++ b/published/20190621 Three Ways to Lock and Unlock User Account in Linux.md @@ -0,0 +1,294 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguagnzhi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11043-1.html) +[#]: subject: (Three Ways to Lock and Unlock User Account in Linux) +[#]: via: (https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +在 Linux 中锁定和解锁用户帐户的三种方法 +====== + +![](https://linux.cn/article-11043-1.html) + +如果你已经在你的组织中实施了某种密码策略,你无需看这篇文章了。但是在这种情况下,如果你给账户设置了 24 小时的锁定期,你需要手动解锁用户帐户。 + +本教程将帮助你在 Linux 中手动锁定和解锁用户帐户。 + +这可以通过三种方式使用以下两个 Linux 命令来完成。 + +* `passwd`:用于更新用户的身份验证令牌。这个任务是通过调用 Linux PAM 和 libuser API 来实现。 +* `usermod`:用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中等等功能。 + +为了说明这一点,我们选择 `daygeek` 用户帐户。让我们看看,怎么一步步来实现的。 + +请注意,你必须使用你需要锁定或解锁的用户的帐户,而不是我们的帐户。你可以使用 `id` 命令检查给定的用户帐户在系统中是否可用。是的,我的这个帐户在我的系统中是可用的。 + +``` +# id daygeek + +uid=2240(daygeek) gid=2243(daygeek) groups=2243(daygeek),2244(ladmin) +``` + +### 方法1: 如何使用 passwd 命令锁定、解锁和检查 Linux 中给定用户帐户的状态? + +`passwd` 命令是 Linux 管理员经常使用的命令之一。它用于更新 `/etc/shadow` 文件中用户的身份验证令牌。 + +使用 `-l` 开关运行 `passwd` 命令,锁定给定的用户帐户。 + +``` +# passwd -l daygeek + +Locking password for user daygeek. +passwd: Success +``` + +你可以通过 `passwd` 命令或从 `/etc/shadow` 文件中获取给定用户名来检查锁定的帐户状态。 + +使用 `passwd` 命令检查用户帐户锁定状态。 + +``` +# passwd -S daygeek +或 +# passwd --status daygeek + +daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) +``` + +这将输出给定帐户密码状态的简短信息。 + +* `LK`:密码被锁定 +* `NP`:没有设置密码 +* `PS`:密码已设置 + +使用 `/etc/shadow` 文件检查锁定的用户帐户状态。如果帐户已被锁定,密码前面将添加两个感叹号。 + +``` +# grep daygeek /etc/shadow + +daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: +``` + +使用 `-u` 开关运行 `passwd` 命令,可以解锁给定的用户帐户。 + +``` +# passwd -u daygeek + +Unlocking password for user daygeek. +passwd: Success +``` + +### 方法2:如何使用 usermod 命令在 Linux 中锁定、解锁和检查给定用户帐户的状态? + +`usermod` 命令也经常被 Linux 管理员使用。`usermod` 命令用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中,等等。 + +使用 `-L` 开关运行 `usermod` 命令,锁定给定的用户帐户。 + +``` +# usermod --lock daygeek +或 +# usermod -L daygeek +``` + +你可以通过 `passwd` 命令或从 `/etc/shadow` 文件中获取给定用户名来检查锁定的帐户状态。 + +使用 `passwd` 命令检查用户帐户锁定状态。 + +``` +# passwd -S daygeek +或 +# passwd --status daygeek + +daygeek LK 2019-05-30 7 90 7 -1 (Password locked.) +``` + +这将输出给定帐户密码状态的简短信息。 + +* `LK`:密码被锁定 +* `NP`:没有设置密码 +* `PS`:密码已设置 + +使用 `/etc/shadow` 文件检查锁定的用户帐户状态。如果帐户已被锁定,密码前面将添加两个感叹号。 + +``` +# grep daygeek /etc/shadow + +daygeek:!!$6$tGvVUhEY$PIkpI43HPaEoRrNJSRpM3H0YWOsqTqXCxtER6rak5PMaAoyQohrXNB0YoFCmAuh406n8XOvBBldvMy9trmIV00:18047:7:90:7::: +``` + +使用 `-U` 开关运行 `usermod` 命令以解锁给定的用户帐户。 + +``` +# usermod --unlock daygeek +或 +# usermod -U daygeek +``` + +### 方法-3:如何在 Linux 中使用 usermod 命令禁用、启用对给定用户帐户的 SSH 访问? + +`usermod` 命令也是经常被 Linux 管理员使用的命令。`usermod` 命令用于修改/更新给定用户的帐户信息。它用于将用户添加到特定的组中,等等。 + +替代的,锁定可以通过将 `nologin` shell 分配给给定用户来完成。为此,可以运行以下命令。 + +``` +# usermod -s /sbin/nologin daygeek +``` + +你可以通过从 `/etc/passwd` 文件中给定用户名来检查锁定的用户帐户详细信息。 + +``` +# grep daygeek /etc/passwd + +daygeek:x:2240:2243::/home/daygeek:/sbin/nologin +``` + +我们可以通过分配回原来的 shell 来启用用户的 ssh 访问。 + +``` +# usermod -s /bin/bash daygeek +``` + +### 如何使用 shell 脚本锁定、解锁和检查 Linux 中多个用户帐户的状态? + +如果你想锁定/解锁多个帐户,那么你需要找个脚本。 + +是的,我们可以编写一个小的 shell 脚本来执行这个操作。为此,请使用以下 shell 脚本。 + +创建用户列表。每个用户信息在单独的行中。 + +``` +$ cat user-lists.txt + +u1 +u2 +u3 +u4 +u5 +``` + +使用以下 shell 脚本锁定 Linux中 的多个用户帐户。 + +``` +# user-lock.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do + passwd -l $user +done +``` + +将 `user-lock.sh` 文件设置为可执行权限。 + +``` +# chmod + user-lock.sh +``` + +最后运行脚本来达成目标。 + +``` +# sh user-lock.sh + +Locking password for user u1. +passwd: Success +Locking password for user u2. +passwd: Success +Locking password for user u3. +passwd: Success +Locking password for user u4. +passwd: Success +Locking password for user u5. +passwd: Success +``` + +使用以下 shell 脚本检查锁定的用户帐户。 + +``` +# vi user-lock-status.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do + passwd -S $user +done +``` + +设置 `user-lock-status.sh` 可执行权限。 + +``` +# chmod + user-lock-status.sh +``` + +最后运行脚本来达成目标。 + +``` +# sh user-lock-status.sh + +u1 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u2 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u3 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u4 LK 2019-06-10 0 99999 7 -1 (Password locked.) +u5 LK 2019-06-10 0 99999 7 -1 (Password locked.) +``` + +使用下面的 shell 脚本来解锁多个用户。 + +``` +# user-unlock.sh + +#!/bin/bash +for user in `cat user-lists.txt` +do + passwd -u $user +done +``` + +设置 `user-unlock.sh` 可执行权限。 + +``` +# chmod + user-unlock.sh +``` + +最后运行脚本来达成目标。 + +``` +# sh user-unlock.sh + +Unlocking password for user u1. +passwd: Success +Unlocking password for user u2. +passwd: Success +Unlocking password for user u3. +passwd: Success +Unlocking password for user u4. +passwd: Success +Unlocking password for user u5. +passwd: Success +``` + +运行相同的 shell 脚本 `user-lock-status.sh`,检查这些锁定的用户帐户在 Linux 中是否被解锁。 + +``` +# sh user-lock-status.sh + +u1 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u2 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u3 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u4 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +u5 PS 2019-06-10 0 99999 7 -1 (Password set, SHA512 crypt.) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/lock-unlock-disable-enable-user-account-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 diff --git a/published/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md b/published/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md new file mode 100644 index 0000000000..54d28b5d1f --- /dev/null +++ b/published/20190624 With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: (wahailin) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11039-1.html) +[#]: subject: (With Upgraded Specs, Raspberry Pi 4 Takes Aim at Desktop Segment) +[#]: via: (https://itsfoss.com/raspberry-pi-4/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +升级配置后,树莓派 4 瞄准了桌面市场 +====== + +> 树莓派 4 升级配置后开始发售,其 RAM 配置最高可达 4 GB,并支持双 4k 显示。最新硬件配置下,你可以轻松将其作为桌面使用。起售价格依然和旧有型号一样,为 35 美元。 + +树莓派基金会已经发布了最新版的[树莓派 4B][1] 单板计算机。 + +在升级了几个重要特性后,树莓派 4 成为了 40 美元以下的[单板计算机][2]市场中最强大的产品。 + +![Raspberry Pi 4][3] + +### 树莓派 4 的新特性 + +树莓派 4 开始支持双 4k 显示器设置 —— 如果你对此有所需求的话。除此外,它还配备了更强大的处理器,其搭载的 RAM 最高可达 4 GB,这几乎可以媲美一个中端的便携电脑。 + +本次配置升级使树莓派可以参与[迷你 Linux 机][4]市场的竞争,而依旧 35 美元的起始售价使其比[其它单板计算机][2]更具优势。 + +树莓派 4 发布不久,各大主要的在线商店就几乎销售一空。那么,我们来看看它有哪些新卖点吧。 + +#### 树莓派 4 的核心配置 + +![Raspberry Pi 4 Tech Specs][5] + + * 博通 BCM2711,1.5 GHz 64 位 4 核心 Cortex-A72(ARM v8) + * 顶配 4 GB RAM(可选 RAM 配置为 1 GB,2 GB 和 4 GB) + * 无线网络和蓝牙 5.0 + * 两个 USB 3.0 接口,两个 USB 2.0 接口 + * 40 针 GPIO 引脚(向前兼容) + * 两个 Micro-HDMI 接口(支持 4k 显示) + * USB-C(供电接口) + * 千兆以太网 + +如果你想更深入的了解配置信息,可以参考树莓派网站的[官方技术规格][6]。 + +### 定价和可用性 + +树莓派 4 的板子起始售价为 35 美元,根据可选配置不同(1-4 GB),售价也不同。 + + * 1 GB RAM 树莓派 4 售价:35 美元 + * 2 GB RAM 树莓派 4 售价:45 美元 + * 4 GB RAM 树莓派 4 售价:55 美元 + +根据你所在国家或地区的不同,树莓派 4 有不同的供应商。现有库存即将售罄,如果你想购买一定尽快,否则就要再等上一段时日了,你还可以参考官方页面上的购买信息。 + +- [购买树莓派 4][1] + +请注意,[运行树莓派需要额外的配件][7],这就是为什么官方提供了可选的基础套件,套件中包含了所有必需的支持配件。 + +#### 树莓派 4 桌面套件 + +![Raspberry Pi 4 Desktop Kit][9] + +你可以在购买树莓派 4 时同时购买树莓派 4 的桌面套件:外壳、键盘、鼠标、micro HDMI 线、USB-C 电源、用户指南以及[预装了 Rasbian 的 16 GB microSD 卡][10]。 + +![Raspberry Pi Branded Desktop Kit][11] + +整组套件采用红白颜色设计,看起来很美观(如果你关心外观的话)。你可以在树莓派网站上获取更多的购买信息。 + +- [树莓派 4 桌面套件][12] + +### 树莓派 4 的前景 + +拥有所有这些配置后,树莓派 4 无疑会成为同类产品中最好的之一。同样,相比购买入门级桌面计算机,购买树莓派 4 也会是更好的选择。你可以只花很便宜的价格,就能轻松访问文档、管理电子表格,以及完成更多其它操作。 + +我绝对会考虑购买树莓派 4 作为备用(但强大)的入门级桌面计算机,但不会配备 4k 显示器,但依据文档,树莓派 4 肯定是支持双 4k 显示设置的。 + +你怎么评价最新版的树莓派 4B? 欢迎在评论中说出你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-4/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wahailin](https://github.com/wahailin) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4.jpeg?resize=800%2C449&ssl=1 +[4]: https://itsfoss.com/linux-based-mini-pc/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4-tech-specs.jpg?ssl=1 +[6]: https://www.raspberrypi.org/products/raspberry-pi-4-model-b/specifications/ +[7]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[8]: https://itsfoss.com/raspberry-pi-gets-ram-upgrade-in-the-same-price/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-4-desktop-kit.jpg?resize=800%2C427&ssl=1 +[10]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/raspberry-pi-desktop-kit-official.jpg?ssl=1 +[12]: https://www.raspberrypi.org/products/raspberry-pi-4-desktop-kit/ diff --git a/published/20190625 5 tiny Linux distros to try before you die.md b/published/20190625 5 tiny Linux distros to try before you die.md new file mode 100644 index 0000000000..1105ff0e52 --- /dev/null +++ b/published/20190625 5 tiny Linux distros to try before you die.md @@ -0,0 +1,264 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11040-1.html) +[#]: subject: (5 tiny Linux distros to try before you die) +[#]: via: (https://opensource.com/article/19/6/linux-distros-to-try) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/marcobravo) + +不容错过的 5 个微型 Linux 发行版 +====== + +> 这些微型 Linux 发行版可以让你的老爷机复活,可以启动一个损坏的系统,或者是确保在公共电脑上进行安全的操作。 + +![](https://img.linux.net.cn/data/attachment/album/201907/01/123700uva8cagcqywwj8jv.jpg) + +可供日常使用的 Linux 发行版比比皆是,不过其中有一些发行版常常被我们忽视,因为它们实在是太小了。但这些微型 Linux 发行版其实是一种非常强大的创新:使用一套完整的操作系统驱动一台只有不到 1 GB 存储空间和 512 MB 内存的计算机,真的是终极的黑客作风。 + +微型发行版的用法有很多种,比如说: + + * 从垃圾桶边挽救回那些又老又慢的电脑。你可以继续使用那些本来已经计划报废的机器,直到它们彻底解体(而不是在刚开始感觉有点儿慢的时候就扔掉)。 + * 使用 U盘启动一个损坏的系统来恢复数据或者修复启动分区。 + * 确保在安全和隐私的操作环境下使用公共电脑。如果使用 U 盘启动酒店大厅或者图书馆里的一台公共电脑,你是可以确定操作环境是安全的。 + +轻量级发行版有很多种,比如说 [Lubuntu][2]、[Peppermint OS][3] 和 [Bodhi][4],但是那些真正微型的发行版又有一些独到之处。下面就是你不容错过的五个微型发行版: + +### Tiny Core + +![Tiny Core Linux][5] + +[Tiny Core Linux][6] 小得近乎不可思议:终端版本只有 11 MB,图形界面版本只有 16 MB。我翻了一下之前收集的旧 U盘,最小的一个是 128 MB 的,也有 Tiny Core 镜像文件的八倍之大呢。 + +Tiny Core 默认包括只包括了基本的操作系统,你需要通过以太网下载需要的应用程序。由于设计得极端精简,甚至安装完整操作系统的应用程序都没有被包含在内(不过需要的话可以从 Tiny Core 的软件仓库下载)。 + +我使用过一个 128 MB 的 U盘在一台只有 512 MB 内存的机器上运行了 Tiny Core,对于一个只有 16 MB 的操作系统来说,效果算是非常棒了。只有在使用网页浏览器的时候速度才会变慢,但这主要是由于大部分现代网站太过复杂,而不是 Tiny Core 的问题。 + +如果不使用图形界面,运行 Tiny Core 就只需要 64 MB 的内存了。 + +#### 安装 + +[下载 Tiny Core][7] 并使用 `dd` 或者 [Etcher][8] 写入 U盘。 + +你只需要点击屏幕底部启动栏上的 **Apps** 图标下载 **tc-install** 或者 **tc-install-GUI** 应用,就可以轻松安装 Tiny Core了。 + +![Tiny Core installer][9] + +安装 Tiny Core 有几种不同的方式。你可以把它安装在一个格式化为 Linux 驱动器的 U盘里(这要求你的电脑支持使用 USB 驱动启动。大多数现代电脑都支持,但是在老一些的电脑上不太常见),或者安装在微软 FAT 文件系统的 U 盘里(这对于大多数不支持从 USB 驱动启动的电脑来说非常管用),或者甚至安装在一个现有 Linux 分区的一个文件夹里。 + +安装过程非常快,完成之后就可以重启计算机,进入到 Tiny Core Linux 系统中啦。 + +#### 应用程序 + +由于系统自带程序基本上只有一个文本编辑器和一个终端,你所要做的第一件事情就应该是安装一些应用程序。底部启动栏上的 **Apps** 图标展示了 Tiny Core 提供的所有软件包。**Apps** 软件仓库同时包含了一些重要的驱动程序,对于使用 WiFi 网卡或者是打印机等等都很有帮助。 + +在安装一个新的应用程序或者实用程序的时候,你可以选择在 Tiny Core 启动的时候就加载软件包,或者是需要的时候才加载。如果选择启动时加载,那么不仅该软件立即就可以使用,并且(不出所料地)下次重启之后也依然可用;如果选择需要时加载,那么在软件包下载完成之后仍然可以马上使用,但是重启之后就不会被自动加载到内存中了。这样可以保持很快的开机速度,并且只占用很少的内存,但同时也意味着每次开机之后,该应用的软件包只有在第一次被使用的时候才会被加载到内存中。 + +可供选择的应用程序同时包括像 office 和图像应用之类的用户端应用,以及像 [Samba][10] 和网站服务器这种的服务端应用。 + +当然了,随着你在 Tiny Core 上添加的应用程序越来越多,它就不那么“微型”了。不过在 Tiny Core 的网站上我们可以看到,即使是包括了所有 WiFi 驱动程序的 **Tiny Core Plus** 镜像文件也只有大约 100 MB,所以“不那么微型”也仍然很可能比 256 MB 要小很多。 + +#### 结论 + +Tiny Core 非常适合性能不佳的老爷机、用来通过网络启动的镜像文件,以及任何更看重应用而不是操作系统的人。Tiny Core 可以作为一个很好的周末工程来实践:从 16 MB 开始一步步搭建操作系统,直到你感觉这个操作系统已经足够满足你的需求了。 + +### SliTaz + +![SliTaz Linux][11] + +[SliTaz Linux][12] 的镜像文件有大约 51 MB 大小,差不多是 Tiny Core 的四倍,但是包含一整套出色的驱动程序和应用程序。事实上,如果事先不知道的话,你可能会以为是通过一个 1 GB 的 Ubuntu 镜像启动的,因为能想到的任何一个基本启动镜像应该有的东西都在这儿:文本编辑器、网页浏览器、绘画工具、表格工具等等。 + +我使用过一个 128 MB 的 U盘 在一个 512 MB 内存的机器上运行了 SliTaz,效果非常不错。浏览复杂网站的时候性能会下降,但是系统包含的轻量级浏览器 [Midori][13] 可以快速加载绝大多数网站。 + +你可以在启动的时候选择进入没有图形界面的 SliTaz,这样在仅仅只有 64 MB 的机器上也可以很好地运行。 + +#### 安装 + +可供下载的 SliTaz 有很多种,因为它的开发者和社区针对可能存在的限制提供了非常多的版本。比如说,有一种低内存版本可以在只有 24 MB 内存的机器上运行;有一种版本使用 Firefox 而不是 Midori;还有一种版本没有包含额外的应用程序,等等。 + +如果你挑花了眼,只想赶紧选择一个版本尝试一下的话,那就 [下载滚动发布版本吧][14]。这个版本有差不多 50 MB 大小,每周都会更新。如果你爱上了 SliTaz,而滚动发布版本又更新得 *过快* 了的话,可以再选择一个更符合你需求的版本。 + +下载好你选择的 SliTaz 镜像文件之后,你就可以用 `dd` 或者 [Etcher][8] 将它写入 U 盘,然后重启。 + +将 SliTaz 安装在 U 盘或者硬盘上需要通过 **TazPanel** 这个应用程序来实现。它会引导你对硬盘进行需要的分区,然后将 SliTaz 安装在你选择的地方。 + +![SliTaz installer][15] + +#### 应用程序 + +SliTaz 的控制中心是 **TazPanel** 这个应用程序。如果你喜欢 OpenSUSE 或者 Mageia (最初被称为 Mandrake),那 TazPanel 对你来说应该不会陌生(至少在核心思想上):包括系统设置、硬件监测、用户和用户组的管理、系统升级、安装应用程序在内的这些功能,都在这一个应用程序内实现。 + +SliTaz 提供的应用程序可以满足大多数基本需求,如果你不是非常在意完成某一项任务必须使用哪一个应用程序的话,那么在 SliTaz 的软件仓库里应该可以找到你想要的应用。如果你有一些特别的需求(比如说想要使用 GIMP 2.10 而不是 GIMP 2.8),那么就需要学习如何生成 SliTaz 软件包了。好消息是,**tazpkg** 命令支持从好几种软件包格式转换过来,包括: + + * Debian 软件包(.deb,.udeb) + * RPM 软件包(.rpm) + * Slackware 软件包(.tgz) + * Puppy 软件包(.sfs,.pet) + * NuTyX 软件包(.cards.tar.xz) + * Arch 和 Alpine Linux 软件包(.apk,.pkg.tar.gz,.pkg.tar.xz) + * OpenWrt 软件包(.ipk,.opk) + * Paldo 软件包(.tar.bz2) + * Void 软件包(.xbps) + * Tiny Core 软件包(.tce,.tcel,.tcem, .tcz) + +#### 结论 + +SliTaz 是一个快速而小巧的 Linux 发行版,并且非常容易上手(因为有一个中心化的控制面板)。由于它的软件包工具支持从其它格式的 Linux 软件包转换成自己的格式,它的应用程序理论上来说是非常丰富的,你可以很容易地使用喜欢的工具搭建自己的工作环境。SliTaz 很小,但是也非常具有杀伤力,正如它的蜘蛛 logo 所暗示的那样。 + +### Porteus + +![Porteus Linux][16] + +[Porteus][17] 提供了不同的桌面环境可供选择,最小的镜像文件大约在 270 MB 左右,最大的有 350 MB。它是微型 Linux 中镜像文件最大的一个,但是这些额外的空间都被用来确保一个非常顺畅的 Linux 桌面环境的体验,以至于你很可能会忘了自己是在使用一个 live 版本。如果将 Porteus 安装到 SSD 或者是在启动的时候加载到内存里的话,你就会得到一个如此天衣无缝地顺畅的环境,以至于不会相信你的操作系统所占用的空间只有不到半个 CD-ROM 的大小。 + +Porteus 的基础镜像文件相对来说比较小,因此被称为是“微型”,但是根据你选择的桌面环境版本,Porteus 有可能会需要 1 GB 之多的内存才可以运行。尽管其它微型 Linux 发行版倾向于通过精简应用程序来节约空间和资源,Porteus 却希望你像普通发行版一样来使用它。忘掉你是在使用一个微型的压缩根文件系统,尽情安装所有你喜欢的应用程序吧。 + +#### 安装 + +可以在 [离你最近的 Porteus 镜像网站][18] 上下载 Porteus,并且从 MATE、LXQT、LXDE、OpenBox、XFCE、Cinnamon 或者 KDE 里选择自己喜欢的桌面环境。如果没有特殊偏好,MATE 或者是 KDE 桌面都是不错的选择,他们可以提供熟悉的桌面环境体验,并且镜像文件又不至于太大。 + +![Porteus installer][19] + +你可以根据 [官方的安装指南][20] 将 Porteus 安装到一个 U盘 或者是内部硬盘里。这两种方式非常相似,都会使用一个不可变的压缩根文件系统。这是一种稳定的、受限制的文件系统,会根据你的使用被修改。你所做的变更和安装的应用程序在重启的时候都会被加载到内存里,从而还原你关机前的使用环境。 + +#### 应用程序 + +应用程序在 Porteus 里被称为“模块”,由 [Slackware 软件包统一管理器][21](USM)提供。USM 的资源涵盖五个不同的 Slackware 软件仓库,所以可供选择的应用还是很丰富的。 + +#### 结论 + +Porteus 可以提供完整的 Linux 使用体验,却只使用了正常 Linux 所需要空间的一小部分。这是一个配备了很多种可供选择的桌面环境和很多应用程序的出色的便携式 Linux 发行版。 + +### Bodhi Linux + +![Bodhi Linux][22] + +[Bodhi Linux][4] 的 ISO 镜像文件有 740 MB 大小,初看之下并不是很“微型”,不过一旦安装完成之后,你就会惊讶于它是多么微型了。Bodhi 在 512 MB 大小的内存上也可以顺畅运行,并且它的桌面环境看起来就像是来自未来一样。Bodhi 使用的是 [Enlightenment][23] 桌面,这是一个精心制作的优美的用户界面,小巧而强悍。 + +不过 Bodhi 并不只是简单地使用 Enlightenment,而是在此基础上增色不少。Bodhi 在配置型应用程序和系统设置面板上都进行了界面处理,避免了 Enlightenment 有时显得过于繁复的选项。Bodhi 替你做了一些很好的默认选择,并且只显示全部选项的一部分。如果你是一个 Enlightenment 狂热分子,那么 Bodhi 这样的做法对你来说可能显得不是很纯粹,但是对于大多数用户来说,Bodhi 这样做可以让人更加专注于 Enlightenment 桌面本身。 + +#### 安装 + +[下载 Bodhi Linux][24],通过 `dd` 或者 [Etcher][8] 写入 U盘,然后重启。 + +Bodhi 安装器可以在 **设置** 页面的 **应用程序** 菜单里找到。安装程序用的是 **Ubiquity**,所以整个过程和安装 Ubuntu 是一样的。如果你没有安装过 Ubuntu 也不必担心,因为这是最好安装的发行版之一了。 + +![Bodhi installer][25] + +#### 应用程序 + +Bodhi 是基于最新的 Ubuntu 长期维护发布版的,所以可供使用的应用程序简直数不胜数。只要是在 Ubuntu 上可以使用的应用,Bohdi 上就同样可以找到。 + +#### 结论 + +Bodhi Linux 相比一个标准的 Ubuntu 来说要小不少,但是相比其它微型 Ubuntu 环境来说又好一些(因为使用了 Enlightenment)。如果你在找一个比大多数发行版更轻量的 Linux 发行版,但是又不想使用 OverlayFS 或者是应用程序模块的话,那么 Bodhi 就是一个不错的选择了。 + +### Puppy Linux + +![Puppy Linux][26] + +早在 Tiny Core、SliTaz、[AntiX][27] 或者是 Porteus 诞生之前,就已经有 [Puppy Linux][28] 了。作为最早的微型 Linux 发行版之一,Puppy 已经历经了十五年风霜,并且无论是对于老爷机还是新用户来说始终都是一个可靠的、可启动的操作系统。 + +为了保证正常运行,Puppy 会在第一次启动之后引导用户完成必要的设置步骤。整个过程涉及很多个窗口,但是一旦完成,你就会对一切功能了如指掌,然后再决定是否需要安装。 + +Puppy 几乎有 300 MB 大小,并且在我测试的 1 GB 内存的机器上并不能正常运行,所以它并不是一个特别微型的 Linux 发行版。尽管如此,它仍然是一个非常棒的 1 GB 以下的操作系统,并且在该类系统里算是非常友好的一个。 + +#### 安装 + +[下载 Puppy Linux][29],然后通过 `dd` 或 [Etcher][8] 写入 U 盘,或者是刻录到 CD 或者 DVD 里,然后重启。 + +![Puppy installer][30] + +Puppy 几乎可以安装在支持任何一种数据格式的载体上。你可以在顶部启动栏里找到 **Puppy Installer** 安装程序,这个程序负责安装 Puppy 以及 Puppy 的应用程序。 + +Puppy 安装器会一步步引导你将系统安装在你提供的任何一种媒介上。Puppy 可以从 U盘、光盘、硬盘,或者甚至是 SD 卡上启动。我曾经在一台没有硬盘、光驱出了故障,并且也无法从 USB 启动的计算机上成功运行了 Puppy。由于 Puppy 支持在任何载体上写入你的配置选项,我甚至可以在一个拥有长期数据存储的外部设备上使用它。 + +#### 应用程序 + +**Puppy 安装器** 这个应用同样被用来在 Puppy 上安装应用。由于 Puppy 是基于 Ubuntu 的,它的软件仓库几乎不会缺少任何一个 Linux 软件包,并且如果真的出现了这种情况的话,你也可以使用 [Flatpak][31]。 + +#### 结论 + +Puppy 是最早的微型 Linux。尽管它已经不是最微型的了,却是目前最易用的一个。 + +### 附赠:Silverblue + +![SilverBlue, not tiny, but tiny-adjacent][32] + +微型 Linux 这个概念是随着时间不断变化的。很久以前,微型 Linux 发行版意味着需要下载到 CD-R 里,从光驱启动,然后将修改写入外部媒介中。后来,你可以从 U 盘启动它,并且有专门用来记录永久修改的空间。现在的微型 Linux 不仅支持上面两种方法,还可以被直接安装在内部驱动或者文件夹里。 + +大家都没有想到 Linux 开创了容器的热潮 —— 容器里应用程序是在半虚拟化的环境中运行的一套独立的 Linux 系统。曾经只是属于喜欢优化硬盘空间或者重新利用老爷机的人们的小众爱好,很快成为了那些想要开发容器但又不想在应用程序上添加太多负载的人的强烈需求。那些在极简化的、不起眼的 Linux 发行版上所付出的辛苦,一夜之间以一种意想不到的方式得到了回报。 + +立足于根文件系统这个概念,Fedora 项目发起的 [Silverblue][33] 试验旨在创造一个不可修改的操作系统。该操作系统主要通过容器的形式来更新系统以及安装应用,系统本身永远不会改变。 + +2.1 GB 的 Silverblue 可不是一个微型 Linux 发行版,但是从某种程度上来说,它是微型 Linux 和容器运动的产物。 + +#### 安装 + +[下载 Silverblue][34],然后通过 `dd` 琥或 [Etcher][8] 写入 U 盘,或者是刻录到 CD 或者 DVD 里,然后重启。 + +启动到 Silverblue 之后,使用 [Anaconda][35](标准的、友好的 Fedora 安装器)将它安装在一个内部硬盘里。 + +![Anaconda installer][36] + +#### 应用程序 + +Silverblue 安装应用的方式和传统意义上不同:它是在基础操作系统之上运行容器。具体来说,它使用 Flatpak 运行 GUI 应用程序,使用 [Toolbox][37] 运行命令。 + +由于 Flatpak 并非像传统的 Fedora RPM 软件包一样常见,Silverblue 也提供了一种可以将 Fedora RPM 软件包转换成 Silverblue 形式的方法:**软件包分层**。 + +#### 结论 + +Silverblue 可能是一个用来尝试前沿科技的有趣实验,或者也可能是桌面操作系统的未来。它之所以被称为微型,只是因为根文件系统的大小不会随着系统升级或者安装应用而改变。不过,透过 Silverblue 来看看对微型 Linux 的迷恋在带领着 Linux 社区和行业往哪个方向走,也是一件挺有意思的事情。对了,走之前不要忘了向 11 MB 大小的微型 Linux 先驱们脱帽致敬。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/linux-distros-to-try + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: http://lubuntu.net +[3]: http://peppermintos.com +[4]: https://www.bodhilinux.com/ +[5]: https://opensource.com/sites/default/files/uploads/tinycore.jpg (Tiny Core Linux) +[6]: http://tinycorelinux.net/ +[7]: http://tinycorelinux.net/welcome.html +[8]: https://www.balena.io/etcher/ +[9]: https://opensource.com/sites/default/files/uploads/tc-install-gui.png (Tiny Core installer) +[10]: https://www.samba.org/ +[11]: https://opensource.com/sites/default/files/uploads/slitaz.jpg (SliTaz Linux) +[12]: http://www.slitaz.org/en/ +[13]: https://github.com/midori-browser/core +[14]: http://slitaz.org/en/get/#rolling +[15]: https://opensource.com/sites/default/files/uploads/slitaz-install.jpg (SliTaz installer) +[16]: https://opensource.com/sites/default/files/uploads/porteus.jpg (Porteus Linux) +[17]: http://www.porteus.org/ +[18]: http://porteus.org/porteus-mirrors.txt +[19]: https://opensource.com/sites/default/files/images/porteus-installer.png (Porteus installer) +[20]: http://www.porteus.org/component/content/article/26-tutorials/general-info-tutorials/114-official-porteus-installation-guide.html +[21]: http://www.porteus.org/tutorials/9-modules/149-usm.html +[22]: https://opensource.com/sites/default/files/uploads/bodhi.jpg (Bodhi Linux) +[23]: https://www.enlightenment.org/ +[24]: https://www.bodhilinux.com/download +[25]: https://opensource.com/sites/default/files/uploads/bodhi-install.jpg (Bodhi installer) +[26]: https://opensource.com/sites/default/files/uploads/puppy.jpg (Puppy Linux) +[27]: https://antixlinux.com/ +[28]: http://puppylinux.com/ +[29]: http://puppylinux.com/index.html#download +[30]: https://opensource.com/sites/default/files/uploads/puppy-install.jpg (Puppy installer) +[31]: https://docs.fedoraproject.org/en-US/fedora-silverblue/getting-started/#flatpak +[32]: https://opensource.com/sites/default/files/uploads/silverblue.jpg (SilverBlue, not tiny, but tiny-adjacent) +[33]: https://silverblue.fedoraproject.org/ +[34]: https://silverblue.fedoraproject.org/download +[35]: https://fedoraproject.org/wiki/Anaconda +[36]: https://opensource.com/sites/default/files/uploads/silverblue-install.jpg (Anaconda installer) +[37]: https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/ diff --git a/published/20190625 The innovation delusion.md b/published/20190625 The innovation delusion.md new file mode 100644 index 0000000000..a2eca0f465 --- /dev/null +++ b/published/20190625 The innovation delusion.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11106-1.html) +[#]: subject: (The innovation delusion) +[#]: via: (https://opensource.com/open-organization/19/6/innovation-delusion) +[#]: author: (Jim Whitehurst https://opensource.com/users/jwhitehurst/users/jwhitehurst/users/n8chz/users/dhdeans) + +创新的幻觉 +====== + +> 创新是一种混乱的过程,但是关于创新的故事却很有条理。我们不应该把两者搞混了。 + +![](https://img.linux.net.cn/data/attachment/album/201907/16/120302zlyzlzl2d2vh1eyd.jpg) + +如果说 [传统的规划方法已经消亡了][2],为什么这么多机构还在孜孜不倦地运用那些针对工业革命所设计的规划方法呢? + +其中的一个原因是,我们错误地认为创新是可以通过结构化的、线性的过程实现的。我觉得这样做是在混淆关于创新的 **故事** 和创新这个 **过程** 本身 —— 两者是截然不同的东西。 + +创新的过程是混乱和不可预测的,并不遵循井然有序的时间线。过程中充满了重复迭代、突然的改变方向、各式各样的启动和终止、死胡同、失败(但愿是有用的失败),以及很多不可知的变量。创新是混乱的。 + +但是关于创新的故事却让事情显得很简单,从讲述伟大发明的书籍和文章,到我们(简化了整个过程之后)讲述自己在工作上的成功都是这样。想想你在社交媒体上读的帖子里,有多少都只写了最好的、最愉快的部分吧。 + +好故事就是这样。我们把一些原本分散的时间点干净利落地整理到一起,有开头、有发展、也有结尾。尽管我们一路上经历了很多没有把握、恐慌、甚至是绝望的时刻,在故事里这些坎坷却都被抹平了,让事情看起来像是从一开始就注定是成功的。 + +我们不应该把混乱的过程和简化了的故事搞混。否则,我们会错误地认为可以使用在简单线性过程中所使用的同样的方法迎接创新的挑战。换句话说,我们将适用于一种类型的活动(比较偏死记硬背、机械和规则性的任务)的管理技术应用在了并不适用的另一种类型的活动(更加有创造性的、非线性的工作,需要自主性和试验)上。 + +### 一个创新的故事 + +下面这个故事可以很好地说明这一点。这是我 [最喜欢举的例子][2] 之一。 + +在 1970 年代,英国的摩托车行业怎么也想不明白为什么他们在美国的市场份额急剧下降,而本田公司的市场份额却急速攀升。他们雇佣了波士顿咨询公司(刚好是我之前的雇主)帮助他们找出问题所在。波士顿咨询搜集了一些历史数据,回看了二十年的历史事件,总结出了一个井井有条的、线性的故事,可以很好地解释本田公司的成功。 + +[波士顿咨询的结论是][3],本田公司使用了一个巧妙的策略:通过一种可以以更低价格销售的偏小型摩托车进入美国市场,并且借助于他们在日本本土市场发展出来的规模经济,在美国市场使用低价策略发展市场份额,然后等到需求进一步增长的时候,再利用更大的规模经济发展他们在美国的市场份额。在所有人的眼中,本田公司都表现得非常出色,不仅发挥了自己的优势,还非常透彻和精准地理解了新的目标顾客:美国消费者。他们智胜一筹,通过一个执行得很好的计划占领了先机,胜过了竞争对手们。 + +这个故事 **听上去** 很厉害,但是实际情况没有这么简单。 + +没错,本田公司 **确实** 是想进入美国摩托车市场。他们最初是想 [效仿在美国的竞争对手][4],也制造美国人似乎更喜欢的大型摩托车。但是大型摩托车并不是本田公司的强项,他们生产的大型摩托车存在可靠性上的问题。更糟的是,他们的产品和市面上的其它产品没有什么差别,所以并不能脱颖而出。简单来说,他们的产品销售额表现平平。 + +但是在一次奇妙的巧合里,本田公司出访美国的日本代表们带了几辆自己开的摩托车。这些摩托车和本田公司试图在美国市场上销售的摩托车完全不同,它们更为小巧灵活、不那么笨重、更有效率,并且一般来说也更便宜。西尔斯公司(LCTT 译注:美国零售业巨头)注意到了这些小巧的摩托车,并且和日本代表达成了一项协议,让西尔斯公司可以在他们在美国的商店里出售这种被称为“超级幼兽”的新型摩托车。 + +剩下的故事已经载入史册。超级幼兽成为了 [史上最畅销的机动车][5],并且本田公司 [至今仍然在生产超级幼兽][6]。 + +事后看来,将超级幼兽带到美国的一连串事件似乎很有逻辑,近乎无聊了。但是本田公司的成功和“巧妙的计划”没有什么关系,而更应该归功于一些(大多数人不愿意承认的)机缘巧合。 + +### 开放(并且混乱的)创新 + +机构(特别是领导们)喜欢把成功说成是一件计划之内的事情 —— 好像成功人士可以驾驭混乱,并且几乎可以预测未来。但是这些言论都是事后诸葛亮罢了,他们在讲述自己充满偶然性的经历的时候会刻意将无序的事情整理一番,对于毫无确定性的事情也会说“我们就是想要那么做的”。 + +但是正如我前面说的,我们不应该相信这些故事是创新过程的真实还原,也不应该在这种错误的假设的基础之上去构建未来的方案或者实验。 + +试想有另一家摩托车制造商想要复制本田公司在超级幼兽上的成功,就逐字逐句地照搬波士顿咨询总结的故事。由于本田公司成功的 **故事** 听上去是如此有逻辑,并且是线性的,这家新公司也许会假定他们可以通过类似的程序得到同样的结果:制定目标、谋划行动,然后针对可预期的结果进行执行。但是我们知道本田公司并不是真的靠这种“制定、谋划、执行”的方式赢得他们的市场份额的。他们是通过灵活性和一点运气获得成功的 —— 更像是“尝试、学习、修改”。 + +当我们可以真正理解并且接受“创新过程是混乱的”这个事实的时候,我们就可以换种方式思考如何让我们的机构实现创新了。与其将资源浪费在预先制定的计划上,**强迫** 创新以一种线性时间线的方式发生,我们不如去构建一些开放并且敏捷的机构,可以 **在创新发生的时候做出及时的响应**。 + +几年前红帽公司发布一个包含了重大技术升级的产品的新版本的时候,我就看到了这样的方法。[红帽企业级 Linux 5.4 版本][8] 首次完全支持了一种被称为"基于内核的虚拟机"(KVM)的技术。这对于我们来说是一个重大的创新,不仅可以为顾客和合作伙伴带来巨大的价值,也有望为开源社区带来巨大的价值。 + +这项技术正在快速演进。幸运的事,因为我们是一个开放的机构,我们具有足够的适应能力,可以在这项创新发生的时候做出响应,从而帮助我们的顾客和合作伙伴可以更好地利用它。这项技术太重要了,并且竞争格局也太不稳定了,以至于我们没有理由要等到像 6.0 版本这样的里程碑时刻才出手。 + +如果你回看红帽企业级 Linux [已经存档的发行说明][9],你会发现它读起来并不像一个典型的软件创新的故事。一次改变游戏规则的进展突然出现在一个没有预测到的、并不起眼的时刻(5.4 版本),而不是一个事先计划好的重要里程碑时刻(6.0 版本)。事后看来,我们现在知道 KVM 这种“大爆炸”级别的进步是足够担得起 “6.0 版本”这样的里程碑式的名字的。但是创新并不是按照这样的剧本发生的。 + +不要误解我,机构仍然需要保持出色的运转,高效完成执行性的任务。但是 [不同的挑战需要不同的方法去应对][10],我们需要能够更好地建立灵活的机构,以及对 [意想不到和不可知的事情][11] 能够做出更好的响应。 + +一个在计划工作(以及按照计划执行)上做得很出色的公司很可能会得到他们计划要得到的结果。但是如果成功还取决于我们没有预测或者无法预测的的事情,那么仅仅精准地按照计划执行是不是就不够了? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/6/innovation-delusion + +作者:[Jim Whitehurst][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jwhitehurst/users/jwhitehurst/users/n8chz/users/dhdeans +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://www.youtube.com/watch?v=8MCbJmZQM9c +[3]: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/235319/0532.pdf +[4]: http://www.howardyu.org/the-revolutionary-approach-honda-took-to-rise-above-competition/ +[5]: https://autoweek.com/article/motorcycles/first-ride-honda-super-cub-c125-abs-all-new-and-still-super-cute +[6]: https://www.autoblog.com/2019/02/13/2019-honda-super-cub-first-ride-review/ +[7]: https://opensource.com/open-organization/18/3/try-learn-modify +[8]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.4_release_notes/index +[9]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/5.0_release_notes/index +[10]: https://opensource.com/open-organization/19/4/managed-enabled-empowered +[11]: https://www.linkedin.com/pulse/how-plan-world-full-unknowns-jim-whitehurst/ diff --git a/published/20190626 Tracking down library injections on Linux.md b/published/20190626 Tracking down library injections on Linux.md new file mode 100644 index 0000000000..706fa09d1a --- /dev/null +++ b/published/20190626 Tracking down library injections on Linux.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (LuuMing) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11079-1.html) +[#]: subject: (Tracking down library injections on Linux) +[#]: via: (https://www.networkworld.com/article/3404621/tracking-down-library-injections-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +追溯 Linux 上的库注入 +====== +> 库注入Library injections在 Linux 上不如 Windows 上常见,但它仍然是一个问题。下来看看它们如何工作的,以及如何鉴别它们。 + +![](https://img.linux.net.cn/data/attachment/album/201907/09/223222gje7l6a2hjhk364a.jpg) + +尽管在 Linux 系统上几乎见不到,但库(Linux 上的共享目标文件)注入仍是一个严峻的威胁。在采访了来自 AT&T 公司 Alien 实验室的 Jaime Blasco 后,我更加意识到了其中一些攻击是多么的易实施。 + +在这篇文章中,我会介绍一种攻击方法和它的几种检测手段。我也会提供一些展示攻击细节的链接和一些检测工具。首先,引入一个小小的背景信息。 + +### 共享库漏洞 + +DLL 和 .so 文件都是允许代码(有时候是数据)被不同的进程共享的共享库文件。公用的代码可以放进一个文件中使得每个需要它的进程可以重新使用而不是多次被重写。这也促进了对公用代码的管理。 + +Linux 进程经常使用这些共享库。(显示共享对象依赖的)`ldd` 命令可以对任何程序文件显示其共享库。这里有一些例子: + +``` +$ ldd /bin/date + linux-vdso.so.1 (0x00007ffc5f179000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f02bea15000) + /lib64/ld-linux-x86-64.so.2 (0x00007f02bec3a000) +$ ldd /bin/netstat + linux-vdso.so.1 (0x00007ffcb67cd000) + libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f45e5d7b000) + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f45e5b90000) + libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f45e5b1c000) + libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f45e5b16000) + /lib64/ld-linux-x86-64.so.2 (0x00007f45e5dec000) + libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f45e5af5000) +``` + +`linux-vdso.so.1` (在一些系统上也许会有不同的名字)是内核自动映射到每个进程地址空间的文件。它的工作是找到并定位进程所需的其他共享库。 + +对库加载机制加以利用的一种方法是通过使用 `LD_PRELOAD` 环境变量。正如 Jaime Blasco 在他的研究中所解释的那样,“`LD_PRELOAD` 是在进程启动时加载共享库的最简单且最受欢迎的方法。可以将此环境变量配置到共享库的路径,以便在加载其他共享对象之前加载该共享库。” + +为了展示有多简单,我创建了一个极其简单的共享库并且赋值给我的(之前不存在) `LD_PRELOAD` 环境变量。之后我使用 `ldd` 命令查看它对于常用 Linux 命令的影响。 + +``` +$ export LD_PRELOAD=/home/shs/shownum.so +$ ldd /bin/date + linux-vdso.so.1 (0x00007ffe005ce000) + /home/shs/shownum.so (0x00007f1e6b65f000) <== 它在这里 + libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1e6b458000) + /lib64/ld-linux-x86-64.so.2 (0x00007f1e6b682000) +``` + +注意,仅仅将新的库赋给 `LD_PRELOAD` 就影响到了运行的任何程序。 + +通过设置 `LD_PRELOAD` 指定的共享库首先被加载(紧随 linux-vdso.so.1),这些库可以极大程度上改变一个进程。例如,它们可以重定向系统调用到它们自己的资源,或对程序运行的行为方式进行意想不到的更改。 + +### osquery 工具可以检测库注入 + +`osquery` 工具(可以在 [osquery.io][4]下载)提供了一个非常独特的查看 Linux 系统的方式。它基本上将操作系统视作一个高性能的关系数据库。然后,也许你会猜到,这就意味着它可以用来查询并且生成 SQL 表,该表提供了诸如以下的详细信息: + + * 运行中的进程 + * 加载的内核模块 + * 打开的网络链接 + +一个提供了进程信息的内核表叫做 `process_envs`。它提供了各种进程使用环境变量的详细信息。Jaime Blasco 提供了一个相当复杂的查询,可以使用 `osquery` 识别出使用 `LD_PRELOAD` 的进程。 + +注意,这个查询是从 `process_envs` 表中获取数据。攻击 ID(T1055)参考 [Mitre 对攻击方法的解释][5]。 + +``` +SELECT process_envs.pid as source_process_id, process_envs.key as environment_variable_key, process_envs.value as environment_variable_value, processes.name as source_process, processes.path as file_path, processes.cmdline as source_process_commandline, processes.cwd as current_working_directory, 'T1055' as event_attack_id, 'Process Injection' as event_attack_technique, 'Defense Evasion, Privilege Escalation' as event_attack_tactic FROM process_envs join processes USING (pid) WHERE key = 'LD_PRELOAD'; +``` + +注意 `LD_PRELOAD` 环境变量有时是合法使用的。例如,各种安全监控工具可能会使用到它,因为开发人员需要进行故障排除、调试或性能分析。然而,它的使用仍然很少见,应当加以防范。 + +同样值得注意的是 `osquery` 可以交互使用或是作为定期查询的守护进程去运行。了解更多请查阅文章末尾给出的参考。 + +你也能够通过查看用户的环境设置来定位 `LD_PRELOAD` 的使用。如果在用户账户中使用了 `LD_PRELOAD`,你可以使用这样的命令来查看(假定以个人身份登录后): + +``` +$ env | grep PRELOAD +LD_PRELOAD=/home/username/userlib.so +``` + +如果你之前没有听说过 `osquery`,也别太在意。它正在成为一个更受欢迎的工具。事实上就在上周,Linux 基金会宣布打造了新的 [osquery 基金会][6]以支持 osquery 社区。 + +#### 总结 + +尽管库注入是一个严重的威胁,但了解一些优秀的工具来帮助你检测它是否存在是很有帮助的。 + +#### 扩展阅读 + +重要的参考和工具的链接: + + * [用 osquery 追寻 Linux 库注入][7],AT&T Cybersecurity + * [Linux:我的内存怎么了?][8],TrustedSec + * [下载 osquery][4] + * [osquery 模式][9] + * [osqueryd(osquery 守护进程)][10] + * [Mitre 的攻击框架][11] + * [新的 osquery 基金会成立][6] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3404621/tracking-down-library-injections-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[LuuMing](https://github.com/LuuMing) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/dll-injection-100800196-large.jpg +[2]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[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://osquery.io/ +[5]: https://attack.mitre.org/techniques/T1055/ +[6]: https://www.linuxfoundation.org/press-release/2019/06/the-linux-foundation-announces-intent-to-form-new-foundation-to-support-osquery-community/ +[7]: https://www.alienvault.com/blogs/labs-research/hunting-for-linux-library-injection-with-osquery +[8]: https://www.trustedsec.com/2018/09/linux-hows-my-memory/ +[9]: https://osquery.io/schema/3.3.2 +[10]: https://osquery.readthedocs.io/en/stable/deployment/configuration/#schedule +[11]: https://attack.mitre.org/ +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/published/20190627 How to use Tig to browse Git logs.md b/published/20190627 How to use Tig to browse Git logs.md new file mode 100644 index 0000000000..53629b1d19 --- /dev/null +++ b/published/20190627 How to use Tig to browse Git logs.md @@ -0,0 +1,202 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11069-1.html) +[#]: subject: (How to use Tig to browse Git logs) +[#]: via: (https://opensource.com/article/19/6/what-tig) +[#]: author: (Olaf Alders https://opensource.com/users/oalders/users/mbbroberg/users/marcobravo) + +如何使用 Tig 浏览 Git 日志 +====== + +> Tig 可不仅仅是 Git 的文本界面。以下是它如何增强你的日常工作流程。 + +![](https://img.linux.net.cn/data/attachment/album/201907/07/111847v1zx3qk5qqhklyjp.png) + +如果你使用 Git 作为你的版本控制系统,你可能已经让自己接受了 Git 是一个复杂的野兽的事实。它是一个很棒的工具,但浏览 Git 仓库可能很麻烦。因此像 [Tig][2] 这样的工具出现了。 + +来自 [Tig 手册页][3]: + +> Tig 是 `git`(1) 的基于 ncurses 的文本界面。它主要用作 Git 仓库浏览器,但也有助于在块级别暂存提交更改,并作为各种 Git 命令的输出分页器。 + +这基本上意味着 Tig 提供了一个可以在终端中运行的基于文本的用户界面。Tig 可以让你轻松浏览你的 Git 日志,但它可以做的远不止让你从最后的提交跳到前一个提交。 + +![Tig screenshot][4] + +这篇快速入门的 Tig 中的许多例子都是直接从其出色的手册页中拿出来的。我强烈建议你阅读它以了解更多信息。 + +### 安装 Tig + +* Fedora 和 RHEL: `sudo dnf install tig` +* Ubuntu 和 Debian: `sudo apt install tig` +* MacOS: `:brew install tig` + +有关更多方式,请参阅官方[安装说明][5]。 + +### 浏览当前分支中的提交 + +如果要浏览分支中的最新提交,请输入: + +``` +tig +``` + +就是这样。这个三字符命令将启动一个浏览器,你可以在其中浏览当前分支中的提交。你可以将其视为 `git log` 的封装器。 + +要浏览这些输出,可以使用向上和向下箭头键从一个提交移动到另一个提交。按回车键将会垂直分割窗口,右侧包含所选提交的内容。你可以继续在左侧的提交历史记录中上下浏览,你的更改将显示在右侧。使用 `k` 和 `j` 可以逐行上下浏览,`-` 和空格键可以在右侧上下翻页。使用 `q` 退出右侧窗格。 + +搜索 `tig` 输出也很简单。使用 `/` (向前)或 `?` (向后)在左右窗格中搜索。 + +![Searching Tig][6] + +这些就足以让你浏览你的提交信息了。这里有很多的键绑定,但单击 `h` 将显示“帮助”菜单,你可以在其中发现其导航和命令选项。你还可以使用 `/` 和 `?` 来搜索“帮助”菜单。使用 `q` 退出帮助。 + +![Tig Help][7] + +### 浏览单个文件的修改 + +由于 Tig 是 `git log` 的封装器,它可以方便地接受可以传递给 `git log` 的相同参数。例如,要浏览单个文件的提交历史记录,请输入: + +``` +tig README.md +``` + +将其与被封装的 Git 命令的输出进行比较,以便更清楚地了解 Tig 如何增强输出。 + +``` +git log README.md +``` + +要在原始 Git 输出中包含补丁,你可以添加 `-p` 选项: + +``` +git log -p README.md +``` + +如果要将提交范围缩小到特定日期范围,请尝试以下操作: + +``` +tig --after="2017-01-01" --before="2018-05-16" -- README.md +``` + +再一次,你可以将其与原始的 Git 版本进行比较: + + +``` +git log --after="2017-01-01" --before="2018-05-16" -- README.md +``` + +### 浏览谁更改了文件 + +有时你想知道谁对文件进行了更改以及原因。命令: + +``` +tig blame README.md +``` + +器本质上是 `git blame` 的封装。正如你所期望的那样,它允许你查看谁是编辑指定行的最后一人,它还允许你查看到引入该行的提交。这有点像 vim 的 `vim-fugitive` 插件提供的 `:Gblame` 命令。 + +### 浏览你的暂存区 + +如果你像我一样,你可能会在你的暂存区做了许多修改。你很容易忘记它们。你可以通过以下方式查看暂存处中的最新项目: + +``` +git stash show -p stash@{0} +``` + +你可以通过以下方式找到第二个最新项目: + +``` +git stash show -p stash@{1} +``` + +以此类推。如果你在需要它们时调用这些命令,那么你会有比我更清晰的记忆。 + +与上面的 Git 命令一样,Tig 可以通过简单的调用轻松增强你的 Git 输出: + +``` +tig stash +``` + +尝试在有暂存的仓库中执行此命令。你将能够浏览*并搜索*你的暂存项,快速浏览你的那些修改。 + +### 浏览你的引用 + +Git ref 是指你提交的东西的哈希值。这包括文件和分支。使用 `tig refs` 命令可以浏览所有的 ref 并深入查看特定提交。 + +``` +tig refs +``` + +完成后,使用 `q` 回到前面的菜单。 + +### 浏览 git 状态 + +如果要查看哪些文件已被暂存,哪些文件未被跟踪,请使用 `tig status`,它是 `git status` 的封装。 + +![Tig status][8] + +### 浏览 git grep + +你可以使用 `grep` 命令在文本文件中搜索表达式。命令 `tig grep` 允许你浏览 `git grep` 的输出。例如: + +``` +tig grep -i foo lib/Bar +``` + +它会让你浏览 `lib/Bar` 目录中以大小写敏感的方式搜索 `foo` 的输出。 + +### 通过标准输入管道输出给 Tig + +如果要将提交 ID 列表传递给 Tig,那么必须使用 `--stdin` 标志,以便 `tig show` 从标准输入读取。否则,`tig show` 会在没有输入的情况下启动(出现空白屏幕)。 + +``` +git rev-list --author=olaf HEAD | tig show --stdin +``` + +### 添加自定义绑定 + +你可以使用 [rc][9] 文件自定义 Tig。以下是如何根据自己的喜好添加一些有用的自定义键绑定的示例。 + +在主目录中创建一个名为 `.tigrc` 的文件。在你喜欢的编辑器中打开 `~/.tigrc` 并添加: + +``` +# 应用选定的暂存内容 +bind stash a !?git stash apply %(stash) + +# 丢弃选定的暂存内容 +bind stash x !?git stash drop %(stash) +``` + +如上所述,运行 `tig stash` 以浏览你的暂存。但是,通过这些绑定,你可以按 `a` 将暂存中的项目应用到仓库,并按 `x` 从暂存中删除项目。请记住,你要在浏览暂存*列表*时,才能执行这些命令。如果你正在浏览暂存*项*,请输入 `q` 退出该视图,然后按 `a` 或 `x` 以获得所需效果。 + +有关更多信息,你可以阅读有关 [Tig 键绑定][10]。 + +### 总结 + +我希望这有助于演示 Tig 如何增强你的日常工作流程。Tig 可以做更强大的事情(比如暂存代码行),但这超出了这篇介绍性文章的范围。这里有足够的让你置身于危险的信息,但还有更多值得探索的地方。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-tig + +作者:[Olaf Alders][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/oalders/users/mbbroberg/users/marcobravo +[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]: https://jonas.github.io/tig/ +[3]: http://manpages.ubuntu.com/manpages/bionic/man1/tig.1.html +[4]: https://opensource.com/sites/default/files/uploads/tig.jpg (Tig screenshot) +[5]: https://jonas.github.io/tig/INSTALL.html +[6]: https://opensource.com/sites/default/files/uploads/tig-search.png (Searching Tig) +[7]: https://opensource.com/sites/default/files/uploads/tig-help.png (Tig Help) +[8]: https://opensource.com/sites/default/files/uploads/tig-status.png (Tig status) +[9]: https://en.wikipedia.org/wiki/Run_commands +[10]: https://github.com/jonas/tig/wiki/Bindings diff --git a/published/20190628 Undo releases Live Recorder 5.0 for Linux debugging.md b/published/20190628 Undo releases Live Recorder 5.0 for Linux debugging.md new file mode 100644 index 0000000000..41aa3fa172 --- /dev/null +++ b/published/20190628 Undo releases Live Recorder 5.0 for Linux debugging.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11073-1.html) +[#]: subject: (Undo releases Live Recorder 5.0 for Linux debugging) +[#]: via: (https://www.networkworld.com/article/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Undo 发布用于 Linux 调试的 Live Recorder 5.0 +====== +> 随着 Undo 发布 Live Recorder 5.0,这使得在多进程系统上的调试变得更加轻松。 + +![](https://img.linux.net.cn/data/attachment/album/201907/08/133450i18fp2p011bs5pu6.jpg) + +随着 Undo 发布 Live Recorder 5.0,Linux 调试迈出了一大步。该产品于上个月发布,这使得在多进程系统上的调试变得更加轻松。它基于飞行记录仪技术flight recorder technology,它更加深入进程之中,以深入了解每个进程的情况。这包括内存、线程、程序流,服务调用等。为了实现这一目标,Live Recorder 5.0 的记录、重放和调试功能都得到了增强,能够: + + * 记录进程更改共享内存变量的确切顺序。甚至可以针对特定变量并在任何进程中跳转到最后修改该变量的一行。 + * 通过随机化线程执行来暴露潜在缺陷,以帮助揭示竞态、崩溃和其他多线程缺陷。 + * 记录并重放单个 Kubernetes 和 Docker 容器的执行,以帮助在微服务环境中更快地解决缺陷。 + +Undo Live Recorder 使工程团队能够记录和重放任何软件程序的执行,而无论软件多么复杂。并且可以诊断和修复测试或生产中问题的根本原因。 + +根据你的许可证,Live Recorder 可以在命令行中使用 `live-record` 命令,但有点类似于 `strace`,但它不会打印系统调用和信号,而是创建一个“Undo 录制”。然后你可以调试录制中捕获的失败(远比分析核心转储高效!)。这些录制也可以与其他工作人员共享,并可以使用可逆调试器进行重放,以进一步调查崩溃原因或其他问题。 + +Undo 引擎支持以下 Linux 发行版: + + * Red Hat Enterprise Linux 6.8、6.9、6.10、7.4、7.5、7.6 和 8.0 + * Fedora 28、29 和 30 + * SuSE Linux Enterprise Server 12.3、12.4 和 15 + * Ubuntu 16.04 LTS、18.04 LTS、18.10 和 19.04 + +Undo 是一家快速发展的,有风险投资支持的技术初创公司,它的总部位于旧金山和英国剑桥。他们称 Live Recorder 可以 100% 确定导致任何软件故障的因素 —— 即使在最复杂的软件环境中也是如此。 + +在 [Facebook][2] 和 [LinkedIn][3] 上加入 Network World 社区,评论你想说的话题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3405584/undo-releases-live-recorder-5-0-for-linux-debugging.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/flight_data_recorder-100800552-large.jpg +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world diff --git a/published/20190630 Donald Trump Now Wants to Ban End-to-End Encryption.md b/published/20190630 Donald Trump Now Wants to Ban End-to-End Encryption.md new file mode 100644 index 0000000000..636bb334c3 --- /dev/null +++ b/published/20190630 Donald Trump Now Wants to Ban End-to-End Encryption.md @@ -0,0 +1,51 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11092-1.html) +[#]: subject: (Donald Trump Now Wants to Ban End-to-End Encryption) +[#]: via: (https://news.softpedia.com/news/donald-trump-now-wants-to-ban-end-to-end-encryption-526567.shtml) +[#]: author: (Bogdan Popa https://news.softpedia.com/editors/browse/bogdan-popa) + +美国总统特朗普要禁用端到端加密 +====== + +> 美国官方在开会讨论端到端加密。 + +在[禁止][1]和[解禁][2]华为之后,美国总统唐纳德特朗普现在将目光盯上了端到端加密,据一份新的报告声称,白宫高级官员本周会面讨论了政府可以在这方面采取的第一项动作。 + +[Politico][3] 援引了三位知情人士的话指出,来自几个关键机构的二号官员讨论了针对端到端加密的潜在攻击。 + +“这两条路径是,要么就加密问题发表声明或一般立场,并且[说]他们将继续致力于解决方案,或者要求国会立法,”Politico 援引一位消息人士的话说。 + +虽然美国政府希望终止美国公司开发的软件中的端到端加密功能,但这一提议却招致了美国各机构代表的不同反应。 + +Politico 指出,例如,国土安全部 “内部存在分歧”,因为该机构意识到禁止端到端加密可能产生的安全隐患。 + +### 加密争议 + +推动制定这项针对端到端加密的规定,被视为美国情报机构和执法部门努力获取属于犯罪分子和恐怖分子的设备和数据的决定性步骤。 + +大多数美国公司已经将加密捆绑到他们的产品当中,这包括苹果和谷歌,它阻止了调查人员访问嫌疑人的数据。科技公司将端到端加密定位为一项关键的隐私功能,其中一些人警告说,任何针对它的监管都可能影响到国家安全。 + +特别是苹果公司,它是反对加密监管的最大公司之一。该公司[拒绝解锁圣贝纳迪诺恐怖分子使用的 iPhone][4],解释说侵入该设备会损害所有客户的安全。 + +FBI 最终使用了第三方开发的软件解锁了该设备。 + +-------------------------------------------------------------------------------- + +via: https://news.softpedia.com/news/donald-trump-now-wants-to-ban-end-to-end-encryption-526567.shtml + +作者:[Bogdan Popa][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://news.softpedia.com/editors/browse/bogdan-popa +[b]: https://github.com/lujun9972 +[1]: https://news.softpedia.com/news/google-bans-huawei-from-using-android-google-play-gmail-other-services-526083.shtml +[2]: https://news.softpedia.com/news/breaking-donald-trump-says-huawei-can-buy-american-products-again-526564.shtml +[3]: https://www.politico.com/story/2019/06/27/trump-officials-weigh-encryption-crackdown-1385306 +[4]: https://news.softpedia.com/news/judge-orders-apple-to-help-the-fbi-hack-san-bernardino-shooter-s-iphone-500517.shtml diff --git a/published/20190701 Ubuntu or Fedora- Which One Should You Use and Why.md b/published/20190701 Ubuntu or Fedora- Which One Should You Use and Why.md new file mode 100644 index 0000000000..e4251ec54e --- /dev/null +++ b/published/20190701 Ubuntu or Fedora- Which One Should You Use and Why.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11059-1.html) +[#]: subject: (Ubuntu or Fedora: Which One Should You Use and Why) +[#]: via: (https://itsfoss.com/ubuntu-vs-fedora/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +你应该选择 Ubuntu 还是 Fedora? +====== + +> 选择 Ubuntu 还是 Fedora?它们的区别是什么?哪一个更好?你应该使用哪一个?看看这篇对比 Ubuntu 和 Fedora 的文章吧。 + +[Ubuntu][1] 和 [Fedora][2] 都是最流行的 Linux 发行版之一,在两者之间做出选择实非易事。在这篇文章里,我会对比一下 Ubuntu 和 Fedora 的不同特点,帮助你进行决策。 + +请注意,这篇文章主要是从桌面版的角度进行对比的。Fedora 或者 Ubuntu 针对容器的特殊版本不会被考虑在内。 + +### Ubuntu vs Fedora: 哪一个更好? + +![Ubuntu Vs Fedora][3] + +不同 Linux 发行版之间的区别主要体现在以下几个方面: + + * 基础发行版(Debian、红帽、Arch,或者是从头做起) + * 安装方式 + * 支持的桌面环境 + * 软件包管理、软件支持和更新 + * 硬件支持 + * 开发团队(由企业支持,还是由业余爱好者创建) + * 发布周期 + * 社区和线上支持 + +下面我们来看一下 Ubuntu 和 Fedora 之间的相似之处和不同之处。掌握了这些信息之后,也许就更容易在两者之间做出选择了。 + +#### 安装方式 + +Ubuntu 的 Ubiquity 安装器是最好用的安装器之一。我认为这是让 Ubuntu 如此流行的重要原因之一,因为在 2004 年 Ubuntu 刚刚诞生的时候,安装 Linux 还是一个很庞大的工程。 + +Ubuntu 安装器可以让你在大约 10 分钟左右完成安装。大多数情况下,它还可以识别出机器里安装的 Windows 系统,并且只需要几下点击就可以实现 Ubuntu 和 Windows 的双系统启动。 + +锦上添花的是,在安装 Ubuntu 的过程中你还可以进行系统更新,或者是安装第三方编译码器。 + +![Ubuntu Installer][4] + +Fedora 使用的是 Anaconda 安装器,拥有简单易用的界面,同样简化了安装过程。 + +![Fedora Installer | Image Credit Fedora Magazine][5] + +Fodora 还提供了一个可以在 Windows 操作系统上下载并创建 Fedora live USB 的写入工具。不过我在大约两年前尝试使用它的时候并不成功,最后使用了一个常规的创建 live USB 的软件。 + +根据我的经验,安装 Ubuntu 要比安装 Fedora 容易一些。不过这并不是说安装 Fedora 有多困难,只是 Ubuntu 更简单而已。 + +#### 桌面环境 + +Ubuntu 和 Fedora 默认都使用 GNOME 桌面环境。 + +![GNOME Desktop in Fedora][6] + +Fedora 使用的是原装的 GNOME 桌面,而 Ubuntu 则在此基础上做了个性化调整,让它看起来就像 Ubuntu 之前使用的 Unity 桌面环境。 + +![GNOME desktop customized by Ubuntu][7] + +除了 GNOME,Ubuntu 和 Fedora 都提供了一些其它桌面环境的版本。 + +Ubuntu 有 Kubuntu、Xubuntu、Lubuntu 等版本,分别提供不同的桌面环境。虽然它们都是 Ubuntu 的官方版本,但是却不是由 Canonical 的 Ubuntu 团队直接开发的,而是由另外的团队开发。 + +Fedora 通过 [Fedora Spins][8] 的方式提供了一些不同桌面环境的版本。和 Kubuntu、Lubuntu 等版本不同的是,这些版本并非由独立团队开发,而是由 Fedora 核心团队开发的。 + +#### 软件包管理和可用软件数量 + +Ubuntu 使用 APT 软件包管理器提供软件并进行管理(包括应用程序、库,以及其它所需编解码器),而 Fedora 使用 DNF 软件包管理器。 + +[Ubuntu 拥有庞大的软件仓库][10],能够让你轻松安装数以千计的程序,包括 FOSS(LCTT 译注:Free and Open-Source Software 的缩写,自由开源软件)和非 FOSS 的软件。Fedora 则只专注于提供开源软件。虽然这一点在最近的版本里有所转变,但是 Fedora 的软件仓库在规模上仍然比 Ubuntu 的要逊色一些。 + +一些第三方软件开发者为 Linux 提供像 .exe 文件一样可以点击安装的软件包。在 Ubuntu 里这些软件包是 .deb 格式的,在 Fedora 里是 .rpm 格式的。 + +大多数软件供应商都为 Linux 用户提供 DEB 和 RPM 文件,但是我也经历过供应商只提供 DEB 文件的情况。比如说 SEO 工具 [Screaming Frog][11] 就只提供 DEB 软件包。反过来,一个软件只有 RPM 格式但是没有 DEB 格式这种情况就极其罕见了。 + +#### 硬件支持 + +一般来说,Linux 在 WiFi 适配器和显卡的兼容性上容易出现问题,Ubuntu 和 Fedora 都受此影响。以 Nvidia 为例,它的 [开源驱动程序 Nouveau 经常会引发系统启动时假死机之类的问题][12]。 + +在 Ubuntu 上你可以轻松安装专有驱动程序作为补充。在很多情况下,这样可以获得对硬件更好的支持。 + +![Installing proprietary driver is easier in Ubuntu][13] + +Fedora 则坚持使用开源软件,所以在 Fedora 上安装专有驱动程序就比较困难了。 + +#### 线上支持和用户群 + +Ubuntu 和 Fedora 都通过社区论坛提供了很好的线上支持。Ubuntu 主要有两个论坛:[UbuntuForums][14] 和 [Ask Ubuntu][15]。Fedora 主要的论坛则是 [Ask Fedora][16]。 + +就用户群体而言,Fedora 有着庞大的用户数量。不过 Ubuntu 更为流行,用户数量甚至更为庞大。 + +Ubuntu 的流行催生了很多专注于 Ubuntu 的网站和博客。所以相比 Fedora,你可以得到更多关于 Ubuntu 的故障排除指导和学习材料。 + +#### 发布周期 + +Fedora 每六个月发布一个新版本,每个版本有九个月的支持周期。也就是说,你必须在六个月到九个月之间进行一次系统升级。进行 Fedora 版本升级并不是一件困难的事情,但是需要良好的网络连接。并非所有人都喜欢每九个月进行一次 1.5 GB 的版本升级。 + +Ubuntu 有两种版本:常规发布版本和长期支持(LTS)发布版本。常规版本和 Fedora 比较类似,每隔六个月发布一次,有九个月的支持周期。 + +而长期支持发布版本则每两年发布一次,有五年的支持周期。常规发布版本探索新功能特性和新的软件版本,而长期支持发布版本则支持旧版本软件。对于不喜欢经常改变、青睐稳定性的人来说,这是一个很好的选择。 + +#### 强大的基础发行版 + +Ubuntu 是基于 [Debian][17] 发行版的。Debian 是最大的社区项目之一,并且也是 [自由软件][18] 世界里最受尊敬的项目之一。 + +Fedora 则是红帽公司的一个社区项目。红帽公司是一个专注于 Linux 发行版的公司。Fedora 充当了一个“试验田”的角色(用技术术语来说叫做“上游”),用来在红帽企业级 Linux 发布新功能之前对这些新功能进行试验。 + +#### 在背后支持的企业 + +Ubuntu 和 Fedora 都有来自母公司的支持。Ubuntu 源自 [Canonical][21] 公司,而 Fedora 源自 [红帽公司][22](现在是 [IBM 的一部分][23])。背后企业的支持非常重要,因为可以确保 Linux 发行版良好的维护。 + +有一些发行版是由一群独立的业余爱好者们共同创建的,但是在工作压力之下经常会结束。你也许见过一些还算比较流行的发行版项目仅仅是因为这个原因而终止了。很多这样的发行版由于开发者没有足够的业余时间可以投入到项目上而不得不终止,比如 [Antergos][24] 和 Korora。 + +Ubuntu 和 Fedora 的背后都有基于 Linux 的企业的支持,这让它们比其它独立的发行版更胜一筹。 + +#### Ubuntu vs Fedora:服务端 + +到目前为止,我们在 Ubuntu 和 Fedora 之间的对比主要都集中在桌面端。不过如果不考虑一下服务端的话,对 Linux 的讨论就不能算是完整的。 + +![Ubuntu Server][25] + +Ubuntu 不仅在桌面端很流行,在服务端也有很强的存在感。如果你能够在桌面端熟练使用 Ubuntu,那么也不会对 Ubuntu 服务器版本感到陌生。我就是从使用 Ubuntu 桌面端开始的,现在我的网站都运行在 Ubuntu 服务器上。 + +Fedora 同样有服务端版本,并且也有人在使用。但是大多数系统管理者不会喜欢一个每九个月就需要重启升级的服务器。 + +学习 Fedora 可以更好地帮助你使用红帽企业级 Linux(RHEL)。RHEL 是一个付费产品,你需要购买订阅才可以使用。如果你希望在服务器上运行一个和 Fedora 或者红帽类似的操作系统,我推荐使用 CentOS。[CentOS][26] 同样是红帽公司附属的一个社区项目,但是专注于服务端。 + +### 结论 + +你可以看到,Ubuntu 和 Fedora 有很多相似之处。不过就可用软件数量、驱动安装和线上支持来说,Ubuntu 的确更有优势。**Ubuntu 也因此成为了一个更好的选择,尤其是对于没有经验的 Linux 新手而言。** + +如果你想要熟悉红帽的话,Fedora 是一个很好的开始。如果你对 Linux 有一定经验,或者是只想要使用开源软件,Fedora 就是一个很棒的选择。 + +最终还是需要你自己来决定是使用 Fedora 还是 Ubuntu。我会建议为两个发行版分别创建一个 live USB,并且在虚拟机上体验一下。 + +你对于 Ubuntu vs Fedora 的看法是什么呢?你更喜欢哪一个发行版,为什么?在评论里分享你的看法吧。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-vs-fedora/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntu.com/ +[2]: https://getfedora.org/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-vs-fedora.png?resize=800%2C450&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/03/install-linux-inside-windows-10.jpg?resize=800%2C479&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/fedora-installer.png?resize=800%2C598&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/gnome-desktop-fedora.png?resize=800%2C450&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/applications_menu.jpg?resize=800%2C450&ssl=1 +[8]: https://spins.fedoraproject.org/ +[9]: https://itsfoss.com/system-76-galago-pro/ +[10]: https://itsfoss.com/ubuntu-repositories/ +[11]: https://www.screamingfrog.co.uk/seo-spider/#download +[12]: https://itsfoss.com/fix-ubuntu-freezing/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/software_updates_additional_drivers_nvidia.png?resize=800%2C523&ssl=1 +[14]: https://ubuntuforums.org/ +[15]: https://askubuntu.com/ +[16]: https://ask.fedoraproject.org/ +[17]: https://www.debian.org/ +[18]: https://www.fsf.org/ +[19]: https://en.wikipedia.org/wiki/Upstream_(software_development) +[20]: https://itsfoss.com/manage-startup-applications-ubuntu/ +[21]: https://canonical.com/ +[22]: https://www.redhat.com/en +[23]: https://itsfoss.com/ibm-red-hat-acquisition/ +[24]: https://itsfoss.com/antergos-linux-discontinued/ +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/ubuntu-server.png?resize=800%2C232&ssl=1 +[26]: https://centos.org/ diff --git a/published/20190702 Jupyter and data science in Fedora.md b/published/20190702 Jupyter and data science in Fedora.md new file mode 100644 index 0000000000..00448d68bc --- /dev/null +++ b/published/20190702 Jupyter and data science in Fedora.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11072-1.html) +[#]: subject: (Jupyter and data science in Fedora) +[#]: via: (https://fedoramagazine.org/jupyter-and-data-science-in-fedora/) +[#]: author: (Avi Alkalay https://fedoramagazine.org/author/aviram/) + +在 Fedora 上搭建 Jupyter 和数据科学环境 +====== + +![][1] + +在过去,神谕和魔法师被认为拥有发现奥秘的力量,国王和统治者们会借助他们预测未来,或者至少是听取一些建议。如今我们生活在一个痴迷于将一切事情量化的社会里,这份工作就交给数据科学家了。 + +数据科学家通过使用统计模型、数值分析,以及统计学之外的高级算法,结合数据库里已经存在的数据,去发掘、推断和预测尚不存在的数据(有时是关于未来的数据)。这就是为什么我们要做这么多的预测分析和规划分析。 + +下面是一些可以借助数据科学家回答的问题: + + 1. 哪些学生有旷课倾向?每个人旷课的原因分别是什么? + 2. 哪栋房子的售价比合理价格要高或者低?一栋房子的合理价格是多少? + 3. 如何将我们的客户按照潜在的特质进行分组? + 4. 这个孩子的早熟可能会在未来引发什么问题? + 5. 我们的呼叫中心在明天早上 11 点 43 分会接收到多少次呼叫? + 6. 我们的银行是否应该向这位客户发放贷款? + +请注意,这些问题的答案是在任何数据库里都查询不到的,因为它们尚不存在,需要被计算出来才行。这就是我们数据科学家从事的工作。 + +在这篇文章中你会学习如何将 Fedora 系统打造成数据科学家的开发环境和生产系统。其中大多数基本软件都有 RPM 软件包,但是最先进的组件目前只能通过 Python 的 `pip` 工具安装。 + +### Jupyter IDE + +大多数现代数据科学家使用 Python 工作。他们工作中很重要的一部分是 探索性数据分析Exploratory Data Analysis(EDA)。EDA 是一种手动进行的、交互性的过程,包括提取数据、探索数据特征、寻找相关性、通过绘制图形进行数据可视化并理解数据的分布特征,以及实现原型预测模型。 + +Jupyter 是能够完美胜任该工作的一个 web 应用。Jupyter 使用的 Notebook 文件支持富文本,包括渲染精美的数学公式(得益于 [mathjax][2])、代码块和代码输出(包括图形输出)。 + +Notebook 文件的后缀是 `.ipynb`,意思是“交互式 Python Notebook”。 + +#### 搭建并运行 Jupyter + +首先,[使用 sudo][3] 安装 Jupyter 核心软件包: + +``` +$ sudo dnf install python3-notebook mathjax sscg +``` + +你或许需要安装数据科学家常用的一些附加可选模块: + +``` +$ sudo dnf install python3-seaborn python3-lxml python3-basemap python3-scikit-image python3-scikit-learn python3-sympy python3-dask+dataframe python3-nltk +``` + +设置一个用来登录 Notebook 的 web 界面的密码,从而避免使用冗长的令牌。你可以在终端里任何一个位置运行下面的命令: + +``` +$ mkdir -p $HOME/.jupyter +$ jupyter notebook password +``` + +然后输入你的密码,这时会自动创建 `$HOME/.jupyter/jupyter_notebook_config.json` 这个文件,包含了你的密码的加密后版本。 + +接下来,通过使用 SSLby 为 Jupyter 的 web 服务器生成一个自签名的 HTTPS 证书: + +``` +$ cd $HOME/.jupyter; sscg +``` + +配置 Jupyter 的最后一步是编辑 `$HOME/.jupyter/jupyter_notebook_config.json` 这个文件。按照下面的模版编辑该文件: + +``` +{ + "NotebookApp": { + "password": "sha1:abf58...87b", + "ip": "*", + "allow_origin": "*", + "allow_remote_access": true, + "open_browser": false, + "websocket_compression_options": {}, + "certfile": "/home/aviram/.jupyter/service.pem", + "keyfile": "/home/aviram/.jupyter/service-key.pem", + "notebook_dir": "/home/aviram/Notebooks" + } +} +``` + +`/home/aviram/` 应该替换为你的文件夹。`sha1:abf58...87b` 这个部分在你创建完密码之后就已经自动生成了。`service.pem` 和 `service-key.pem` 是 `sscg` 生成的和加密相关的文件。 + +接下来创建一个用来存放 Notebook 文件的文件夹,应该和上面配置里 `notebook_dir` 一致: + +``` +$ mkdir $HOME/Notebooks +``` + +你已经完成了配置。现在可以在系统里的任何一个地方通过以下命令启动 Jupyter Notebook: + +``` +$ jupyter notebook +``` + +或者是将下面这行代码添加到 `$HOME/.bashrc` 文件,创建一个叫做 `jn` 的快捷命令: + +``` +alias jn='jupyter notebook' +``` + +运行 `jn` 命令之后,你可以通过网络内部的任何一个浏览器访问 `` (LCTT 译注:请将域名替换为服务器的域名),就可以看到 Jupyter 的用户界面了,需要使用前面设置的密码登录。你可以尝试键入一些 Python 代码和标记文本,看起来会像下面这样: + +![Jupyter with a simple notebook][4] + +除了 IPython 环境,安装过程还会生成一个由 `terminado` 提供的基于 web 的 Unix 终端。有人觉得这很实用,也有人觉得这样不是很安全。你可以在配置文件里禁用这个功能。 + +### JupyterLab:下一代 Jupyter + +JupyterLab 是下一代的 Jupyter,拥有更好的用户界面和对工作空间更强的操控性。在写这篇文章的时候 JupyterLab 还没有可用的 RPM 软件包,但是你可以使用 `pip` 轻松完成安装: + +``` +$ pip3 install jupyterlab --user +$ jupyter serverextension enable --py jupyterlab +``` + +然后运行 `jupiter notebook` 命令或者 `jn` 快捷命令。访问 `` (LCTT 译注:将域名替换为服务器的域名)就可以使用 JupyterLab 了。 + +### 数据科学家使用的工具 + +在下面这一节里,你将会了解到数据科学家使用的一些工具及其安装方法。除非另作说明,这些工具应该已经有 Fedora 软件包版本,并且已经作为前面组件所需要的软件包而被安装了。 + +#### Numpy + +Numpy 是一个针对 C 语言优化过的高级库,用来处理大型的内存数据集。它支持高级多维矩阵及其运算,并且包含了 `log()`、`exp()`、三角函数等数学函数。 + +#### Pandas + +在我看来,正是 Pandas 成就了 Python 作为数据科学首选平台的地位。Pandas 构建在 Numpy 之上,可以让数据准备和数据呈现工作变得简单很多。你可以把它想象成一个没有用户界面的电子表格程序,但是能够处理的数据集要大得多。Pandas 支持从 SQL 数据库或者 CSV 等格式的文件中提取数据、按列或者按行进行操作、数据筛选,以及通过 Matplotlib 实现数据可视化的一部分功能。 + +#### Matplotlib + +Matplotlib 是一个用来绘制 2D 和 3D 数据图像的库,在图象注解、标签和叠加层方面都提供了相当不错的支持。 + +![matplotlib pair of graphics showing a cost function searching its optimal value through a gradient descent algorithm][5] + +#### Seaborn + +Seaborn 构建在 Matplotlib 之上,它的绘图功能经过了优化,更加适合数据的统计学研究,比如说可以自动显示所绘制数据的近似回归线或者正态分布曲线。 + +![Linear regression visualised with SeaBorn][6] + +#### StatsModels + +[StatsModels][7] 为统计学和经济计量学的数据分析问题(例如线形回归和逻辑回归)提供算法支持,同时提供经典的 [时间序列算法][8] 家族 ARIMA。 + +![Normalized number of passengers across time \(blue\) and ARIMA-predicted number of passengers \(red\)][9] + +#### Scikit-learn + +作为机器学习生态系统的核心部件,[Scikit][10] 为不同类型的问题提供预测算法,包括 [回归问题][11](算法包括 Elasticnet、Gradient Boosting、随机森林等等)、[分类问题][11] 和聚类问题(算法包括 K-means 和 DBSCAN 等等),并且拥有设计精良的 API。Scikit 还定义了一些专门的 Python 类,用来支持数据操作的高级技巧,比如将数据集拆分为训练集和测试集、降维算法、数据准备管道流程等等。 + +#### XGBoost + +XGBoost 是目前可以使用的最先进的回归器和分类器。它并不是 Scikit-learn 的一部分,但是却遵循了 Scikit 的 API。[XGBoost][12] 并没有针对 Fedora 的软件包,但可以使用 `pip` 安装。[使用英伟达显卡可以提升 XGBoost 算法的性能][13],但是这并不能通过 `pip` 软件包来实现。如果你希望使用这个功能,可以针对 CUDA (LCTT 译注:英伟达开发的并行计算平台)自己进行编译。使用下面这个命令安装 XGBoost: + +``` +$ pip3 install xgboost --user +``` + +#### Imbalanced Learn + +[Imbalanced-learn][14] 是一个解决数据欠采样和过采样问题的工具。比如在反欺诈问题中,欺诈数据相对于正常数据来说数量非常小,这个时候就需要对欺诈数据进行数据增强,从而让预测器能够更好地适应数据集。使用 `pip` 安装: + +``` +$ pip3 install imblearn --user +``` + +#### NLTK + +[Natural Language toolkit][15](简称 NLTK)是一个处理人类语言数据的工具,举例来说,它可以被用来开发一个聊天机器人。 + +#### SHAP + +机器学习算法拥有强大的预测能力,但并不能够很好地解释为什么做出这样或那样的预测。[SHAP][16] 可以通过分析训练后的模型来解决这个问题。 + +![Where SHAP fits into the data analysis process][17] + +使用 `pip` 安装: + +``` +$ pip3 install shap --user +``` + +#### Keras + +[Keras][18] 是一个深度学习和神经网络模型的库,使用 `pip` 安装: + +``` +$ sudo dnf install python3-h5py +$ pip3 install keras --user +``` + +#### TensorFlow + +[TensorFlow][19] 是一个非常流行的神经网络模型搭建工具,使用 `pip` 安装: + +``` +$ pip3 install tensorflow --user +``` + +* * * + +_Photo courtesy of [FolsomNatural][20] on [Flickr][21] (CC BY-SA 2.0)._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/jupyter-and-data-science-in-fedora/ + +作者:[Avi Alkalay][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/aviram/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/jupyter-816x345.jpg +[2]: http://mathjax.org +[3]: https://fedoramagazine.org/howto-use-sudo/ +[4]: https://avi.alkalay.net/articlefiles/2018/07/jupyter-fedora.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/gradient-descent-cost-function-optimization.png +[6]: https://seaborn.pydata.org/_images/regression_marginals.png +[7]: https://www.statsmodels.org/ +[8]: https://www.statsmodels.org/stable/examples/index.html#stats +[9]: https://fedoramagazine.org/wp-content/uploads/2019/06/time-series.png +[10]: https://scikit-learn.org/stable/ +[11]: https://scikit-learn.org/stable/supervised_learning.html#supervised-learning +[12]: https://xgboost.ai +[13]: https://xgboost.readthedocs.io/en/latest/gpu/index.html +[14]: https://imbalanced-learn.readthedocs.io +[15]: https://www.nltk.org +[16]: https://github.com/slundberg/shap +[17]: https://raw.githubusercontent.com/slundberg/shap/master/docs/artwork/shap_diagram.png +[18]: https://keras.io +[19]: https://www.tensorflow.org +[20]: https://www.flickr.com/photos/87249144@N08/ +[21]: https://www.flickr.com/photos/87249144@N08/45871861611/ diff --git a/published/20190702 Make Linux stronger with firewalls.md b/published/20190702 Make Linux stronger with firewalls.md new file mode 100644 index 0000000000..6b455a7c84 --- /dev/null +++ b/published/20190702 Make Linux stronger with firewalls.md @@ -0,0 +1,259 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11093-1.html) +[#]: subject: (Make Linux stronger with firewalls) +[#]: via: (https://opensource.com/article/19/7/make-linux-stronger-firewalls) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用防火墙让你的 Linux 更加强大 +====== +> 掌握防火墙的工作原理,以及如何设置防火墙来提高 Linux 的安全性 + +![](https://img.linux.net.cn/data/attachment/album/201907/13/114424m9clibvi0p128fln.jpg) + +所有人都听说过防火墙(哪怕仅仅是在网络犯罪片里看到过相关的情节设定),很多人也知道他们的计算机里很可能正运行着防火墙,但是很少有人明白在必要的时候如何驾驭防火墙。 + +防火墙被用来拦截那些不请自来的网络流量,然而不同网络需要的安全级别也不尽相同。比如说,和在外面一家咖啡馆里使用公共 WiFi 相比,你在家里的时候可以更加信任网络里的其它计算机和设备。你或许希望计算机能够区分可以信任和不可信任的网络,不过最好还是应该学会自己去管理(或者至少是核实)你的安全设置。 + +### 防火墙的工作原理 + +网络里不同设备之间的通信是通过一种叫做端口port的网关实现的。这里的端口指的并不是像 USB 端口 或者 HDMI 端口这样的物理连接。在网络术语中,端口是一个纯粹的虚拟概念,用来表示某种类型的数据到达或离开一台计算机时候所走的路径。其实也可以换个名字来称呼,比如叫“连接”或者“门口”,不过 [早在 1981 年的时候][2] 它们就被称作端口了,这个叫法也沿用至今。其实端口这个东西没有任何特别之处,只是一种用来指代一个可能会发生数据传输的地址的方式。 + +1972 年,发布了一份 [端口号列表][3](那时候的端口被称为“套接字socket”),并且从此演化为一组众所周知的标准端口号,帮助管理特定类型的网络流量。比如说,你每天访问网站的时候都会使用 80 和 443 端口,因为互联网上的绝大多数人都同意(或者是默认)数据从 web 服务器上传输的时候是通过这两个端口的。如果想要验证这一点,你可以在使用浏览器访问网站的时候在 URL 后面加上一个非标准的端口号码。比如说,访问 `example.com:42` 的请求会被拒绝,因为 example.com 在 42 端口上并不提供网站服务。 + +![Navigating to a nonstandard port produces an error][4] + +如果你是通过 80 端口访问同一个网站,就可以(不出所料地)正常访问了。你可以在 URL 后面加上 `:80` 来指定使用 80 端口,不过由于 80 端口是 HTTP 访问的标准端口,所以你的浏览器其实已经默认在使用 80 端口了。 + +当一台计算机(比如说 web 服务器)准备在指定端口接收网络流量的时候,保持该端口向网络流量开放是一种可以接受的(也是必要的)行为。但是不需要接收流量的端口如果也处在开放状态就比较危险了,这就是需要用防火墙解决的问题。 + +#### 安装 firewalld + +有很多种配置防火墙的方式,这篇文章介绍 [firewalld][5]。在桌面环境下它被集成在网络管理器Network Manager里,在终端里则是集成在 `firewall-cmd` 里。很多 Linux 发行版都预装了这些工具。如果你的发行版里没有,你可以把这篇文章当成是管理防火墙的通用性建议,在你所使用的防火墙软件里使用类似的方法,或者你也可以选择安装 `firewalld`。 + +比如说在 Ubuntu 上,你必须启用 universe 软件仓库,关闭默认的 `ufw` 防火墙,然后再安装 `firewalld`: + +``` +$ sudo systemctl disable ufw +$ sudo add-apt-repository universe +$ sudo apt install firewalld +``` + +Fedora、CentOS、RHEL、OpenSUSE,以及其它很多发行版默认就包含了 `firewalld`。 + +无论你使用哪个发行版,如果希望防火墙发挥作用,就必须保持它在开启状态,并且设置成开机自动加载。你应该尽可能减少在防火墙维护工作上所花费的精力。 + +``` +$ sudo systemctl enable --now firewalld +``` + +### 使用网络管理器选择区域 + +或许你每天都会连接到很多不同的网络。在工作的时候使用的是一个网络,在咖啡馆里是另一个,在家里又是另一个。你的计算机可以判断出哪一个网络的使用频率比较高,但是它并不知道哪一个是你信任的网络。 + +一个防火墙的区域zone里包含了端口开放和关闭的预设规则。你可以通过使用区域来选择一个对当前网络最适用的策略。 + +你可以打开网络管理器里的连接编辑器(可以在应用菜单里找到),或者是使用 `nm-connection-editor &` 命令以获取所有可用区域的列表。 + +![Network Manager Connection Editor][6] + +在网络连接列表中,双击你现在所使用的网络。 + +在出现的网络配置窗口中,点击“通用”标签页。 + +在“通用”面板中,点击“防火墙区域”旁边的下拉菜单以获取所有可用区域的列表。 + +![Firewall zones][7] + +也可以使用下面的终端命令以获取同样的列表: + +``` +$ sudo firewall-cmd --get-zones +``` + +每个区域的名称已经可以透露出设计者创建这个区域的意图,不过你也可以使用下面这个终端命令获取任何一个区域的详细信息: + +``` +$ sudo firewall-cmd --zone work --list-all +work +  target: default +  icmp-block-inversion: no +  interfaces: +  sources: +  services: ssh dhcpv6-client +  ports: +  protocols: +  [...] +``` + +在这个例子中,`work` 区域的配置是允许接收 SSH 和 DHCPv6-client 的流量,但是拒绝接收其他任何用户没有明确请求的流量。(换句话说,`work` 区域并不会在你浏览网站的时候拦截 HTTP 响应流量,但是 **会** 拦截一个针对你计算机上 80 端口的 HTTP 请求。) + +你可以依次查看每一个区域,弄清楚它们分别都允许什么样的流量。比较常见的有: + + * `work`:这个区域应该在你非常信任的网络上使用。它允许 SSH、DHCPv6 和 mDNS,并且还可以添加更多允许的项目。该区域非常适合作为一个基础配置,然后在此之上根据日常办公的需求自定义一个工作环境。 + * `public`: 用在你不信任的网络上。这个区域的配置和工作区域是一样的,但是你不应该再继续添加其它任何允许项目。 + * `drop`: 所有传入连接都会被丢弃,并且不会有任何响应。在不彻底关闭网络的条件下,这已经是最接近隐形模式的配置了,因为只允许传出网络连接(不过随便一个端口扫描器就可以通过传出流量检测到你的计算机,所以这个区域并不是一个隐形装置)。如果你在使用公共 WiFi,这个区域可以说是最安全的选择;如果你觉得当前的网络比较危险,这个区域也一定是最好的选择。 + * `block`: 所有传入连接都会被拒绝,但是会返回一个消息说明所请求的端口被禁用了。只有你主动发起的网络连接是被允许的。这是一个友好版的 `drop` 区域,因为虽然还是没有任何一个端口允许传入流量,但是说明了会拒绝接收任何不是本机主动发起的连接。 + * `home`: 在你信任网络里的其它计算机的情况下使用这个区域。该区域只会允许你所选择的传入连接,但是你可以根据需求添加更多的允许项目。 + * `internal`: 和工作区域类似,该区域适用于内部网络,你应该在基本信任网络里的计算机的情况下使用。你可以根据需求开放更多的端口和服务,同时保持和工作区域不同的一套规则。 + * `trusted`: 接受所有的网络连接。适合在故障排除的情况下或者是在你绝对信任的网络上使用。 + +### 为网络指定一个区域 + +你可以为你的任何一个网络连接都指定一个区域,并且对于同一个网络的不同连接方式(比如以太网、WiFi 等等)也可以指定不同的区域。 + +选择你想要的区域,点击“保存”按钮提交修改。 + +![Setting a new zone][8] + +养成为网络连接指定区域的习惯的最好办法是从你最常用的网络开始。为你的家庭网络指定家庭区域,为工作网络指定工作区域,为你最喜欢的图书馆或者咖啡馆的网络指定公关区域。 + +一旦你为所有常用的网络都指定了一个区域,在之后加入新的网络的时候(无论是一个新的咖啡馆还是你朋友家的网络),试图也为它指定一个区域吧。这样可以很好地让你意识到不同的网络的安全性是不一样的,你并不会仅仅因为使用了 Linux 而比任何人更加安全。 + +### 默认区域 + +每次你加入一个新的网络的时候,`firewalld` 并不会提示你进行选择,而是会指定一个默认区域。你可以在终端里输入下面这个命令来获取你的默认区域: + +``` +$ sudo firewall-cmd --get-default +public +``` + +在这个例子里,默认区域是 `public` 区域。你应该保证该区域有非常严格的限制规则,这样在将它指定到未知网络中的时候才比较安全。或者你也可以设置你自己的默认区域。 + +比如说,如果你是一个比较多疑的人,或者需要经常接触不可信任的网络的话,你可以设置一个非常严格的默认区域: + +``` +$ sudo firewall-cmd --set-default-zone drop +success +$ sudo firewall-cmd --get-default +drop +``` + +这样一来,任何你新加入的网络都会被指定使用 `drop` 区域,除非你手动将它制定为另一个没有这么严格的区域。 + +### 通过开放端口和服务实现自定义区域 + +Firewalld 的开发者们并不是想让他们设定的区域能够适应世界上所有不同的网络和所有级别的信任程度。你可以直接使用这些区域,也可以在它们基础上进行个性化配置。 + +你可以根据自己所需要进行的网络活动决定开放或关闭哪些端口,这并不需要对防火墙有多深的理解。 + +#### 预设服务 + +在你的防火墙上添加许可的最简单的方式就是添加预设服务。严格来讲,你的防火墙并不懂什么是“服务”,因为它只知道端口号码和使用协议的类型。不过在标准和传统的基础之上,防火墙可以为你提供一套端口和协议的组合。 + +比如说,如果你是一个 web 开发者并且希望你的计算机对本地网络开放(这样你的同事就可以看到你正在搭建的网站了),可以添加 `http` 和 `https` 服务。如果你是一名游戏玩家,并且在为你的游戏公会运行开源的 [murmur][9] 语音聊天服务器,那么你可以添加 `murmur` 服务。还有其它很多可用的服务,你可以使用下面这个命令查看: + +``` +$ sudo firewall-cmd --get-services + amanda-client amanda-k5-client bacula bacula-client \ + bgp bitcoin bitcoin-rpc ceph cfengine condor-collector \ + ctdb dhcp dhcpv6 dhcpv6-client dns elasticsearch \ + freeipa-ldap freeipa-ldaps ftp [...] +``` + +如果你找到了一个自己需要的服务,可以将它添加到当前的防火墙配置中,比如说: + +``` +$ sudo firewall-cmd --add-service murmur +``` + +这个命令 **在你的默认区域里** 添加了指定服务所需要的所有端口和协议,不过在重启计算机或者防火墙之后就会失效。如果想让你的修改永久有效,可以使用 `--permanent` 标志: + +``` +$ sudo firewall-cmd --add-service murmur --permanent +``` + +你也可以将这个命令用于一个非默认区域: + +``` +$ sudo firewall-cmd --add-service murmur --permanent --zone home +``` + +#### 端口 + +有时候你希望允许的流量并不在 `firewalld` 定义的服务之中。也许你想在一个非标准的端口上运行一个常规服务,或者就是想随意开放一个端口。 + +举例来说,也许你正在运行开源的 [虚拟桌游][10] 软件 [MapTool][11]。由于 MapTool 服务器应该使用哪个端口这件事情并没有一个行业标准,所以你可以自行决定使用哪个端口,然后在防火墙上“开一个洞”,让它允许该端口上的流量。 + +实现方式和添加服务差不多: + +``` +$ sudo firewall-cmd --add-port 51234/tcp +``` + +这个命令 **在你的默认区域** 里将 51234 端口向 TCP 传入连接开放,不过在重启计算机或者防火墙之后就会失效。如果想让你的修改永久有效,可以使用 `--permanent` 标志: + +``` +$ sudo firewall-cmd --add-port 51234/tcp --permanent +``` + +你也可以将这个命令用于一个非默认区域: + +``` +$ sudo firewall-cmd --add-port 51234/tcp --permanent --zone home +``` + +在路由器的防火墙上设置允许流量和在本机上设置的方式是不同的。你的路由器可能会为它的内嵌防火墙提供一个不同的配置界面(原理上是相同的),不过这就超出本文范围了。 + +### 移除端口和服务 + +如果你不再需要某项服务或者某个端口了,并且设置的时候没有使用 `--permanent` 标志的话,那么可以通过重启防火墙来清除修改。 + +如果你已经将修改设置为永久生效了,可以使用 `--remove-port` 或者 `--remove-service` 标志来清除: + +``` +$ sudo firewall-cmd --remove-port 51234/tcp --permanent +``` + +你可以通过在命令中指定一个区域以将端口或者服务从一个非默认区域中移除。 + +``` +$ sudo firewall-cmd --remove-service murmur --permanent --zone home +``` + +### 自定义区域 + +你可以随意使用 `firewalld` 默认提供的这些区域,不过也完全可以创建自己的区域。比如如果希望有一个针对游戏的特别区域,你可以创建一个,然后只有在玩儿游戏的时候切换到该区域。 + +如果想要创建一个新的空白区域,你可以创建一个名为 `game` 的新区域,然后重新加载防火墙规则,这样你的新区域就启用了: + +``` +$ sudo firewall-cmd --new-zone game --permanent +success +$ sudo firewall-cmd --reload +``` + +一旦创建好并且处于启用状态,你就可以通过添加玩游戏时所需要的服务和端口来实现个性化定制了。 + +### 勤勉 + +从今天起开始思考你的防火墙策略吧。不用着急,可以试着慢慢搭建一些合理的默认规则。你也许需要花上一段时间才能习惯于思考防火墙的配置问题,以及弄清楚你使用了哪些网络服务,不过无论是处在什么样的环境里,只要稍加探索你就可以让自己的 Linux 工作站变得更为强大。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/make-linux-stronger-firewalls + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[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/BUSINESS_buildtogether.png?itok=9Tvz64K5 (People working together to build ) +[2]: https://tools.ietf.org/html/rfc793 +[3]: https://tools.ietf.org/html/rfc433 +[4]: https://opensource.com/sites/default/files/uploads/web-port-nonstandard.png (Navigating to a nonstandard port produces an error) +[5]: https://firewalld.org/ +[6]: https://opensource.com/sites/default/files/uploads/nm-connection-editor.png (Network Manager Connection Editor) +[7]: https://opensource.com/sites/default/files/uploads/nm-zone.png (Firewall zones) +[8]: https://opensource.com/sites/default/files/uploads/nm-set.png (Setting a new zone) +[9]: https://www.mumble.com/ +[10]: https://opensource.com/article/18/5/maptool +[11]: https://github.com/RPTools diff --git a/published/20190705 Copy and paste at the Linux command line with xclip.md b/published/20190705 Copy and paste at the Linux command line with xclip.md new file mode 100644 index 0000000000..057af5876f --- /dev/null +++ b/published/20190705 Copy and paste at the Linux command line with xclip.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11089-1.html) +[#]: subject: (Copy and paste at the Linux command line with xclip) +[#]: via: (https://opensource.com/article/19/7/xclip) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +使用 xclip 在 Linux 命令行中复制粘贴 +====== +> 了解如何在 Linux 中使用 xclip。 + +![Green paperclips][1] + +在使用 Linux 桌面工作时,你通常如何复制全部或部分文本?你可能会在文本编辑器中打开文件,选择全部或仅选择要复制的文本,然后将其粘贴到其他位置。 + +这样没问题。但是你可以使用 [xclip][2] 在命令行中更有效地完成工作。`xclip` 提供了在终端窗口中运行的命令与 Linux 图形桌面环境中的剪贴板之间的管道。 + +### 安装 xclip + +`xclip` 并不是许多 Linux 发行版的标准套件。要查看它是否已安装在你的计算机上,请打开终端窗口并输入 `which xclip`。如果该命令返回像 `/usr/bin/xclip` 这样的输出,那么你可以开始使用了。否则,你需要安装 `xclip`。 + +为此,请使用你的发行版的包管理器。如果你喜欢冒险,你可以[从 GitHub 获取源代码][2]并自己编译。 + +### 基础使用 + +假设你要将文件的内容复制到剪贴板。在 `xclip` 中可以使用两种方法。输入: + +``` +xclip file_name +``` + +或者 + +``` +xclip -sel clip file_name +``` + +两个命令之间有什么区别(除了第二个命令更长)?第一个命令在你使用鼠标中键粘贴的情况下有效。但是,不是每个人都这样做。许多人习惯使用右键单击菜单或按 `Ctrl+V` 粘贴文本。如果你时其中之一(我就是!),使用 `-sel clip` 选项可确保你可以粘贴要粘贴的内容。 + +### 将 xclip 与其他应用一起使用 + +将文件内容直接复制到剪贴板是个巧妙的技巧。很可能你不会经常这样做。还有其他方法可以使用 `xclip`,其中包括将其与另一个命令行程序结合。 + +结合是用管道(`|`)完成的。管道将一个命令行程序的输出重定向到另一个命令行程序。这样我们就会有更多的可能性,我们来看看其中的三个。 + +假设你是系统管理员,你需要将日志文件的最后 30 行复制到 bug 报告中。在文本编辑器中打开文件,向下滚动到最后,复制和粘贴有一点工作量。为什么不使用 `xclip` 和 [tail][3] 来快速轻松地完成?运行此命令以复制最后 30 行: + + +``` +tail -n 30 logfile.log | xclip -sel clip +``` + +我的写作有相当一部分用于内容管理系统 (CMS) 或者在其他网络中发布。但是,我从不使用 CMS 的 WYSIWYG 编辑器来编写 - 我采用 [Markdown][5] 格式离线编写[纯文本][4]。也就是说,许多编辑器都有 HTML 模式。通过使用此命令,我可以使用 [Pandoc][6] 将 Markdown 格式的文件转换为 HTML 并将其一次性复制到剪贴板: + +``` +pandoc -t html file.md | xclip -sel clip +``` + +在其他地方,粘贴完成。 + +我的两个网站使用 [GitLab Pages][7] 托管。我使用名为 [Certbot][8] 的工具为这些站点生成 HTTPS 证书,每当我更新它时,我需要将每个站点的证书复制到 GitLab。结合 [cat][9] 命令和 xclip 比使用编辑器更快,更有效。例如: + +``` +cat /etc/letsencrypt/live/website/fullchain.pem | xclip -sel clip +``` + +这就是全部可以用 xclip 做的事么?当然不是。我相信你可以找到更多用途来满足你的需求。 + +### 最后总结 + +不是每个人都会使用 `xclip`。没关系。然而,它是一个在你需要它时非常方便的一个小工具。而且,正如我几次发现的那样,你不知道什么时候需要它。等到时候,你会很高兴能用上 `xclip`。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/xclip + +作者:[Scott Nesbitt][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/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_paperclips.png?itok=j48op49T (Green paperclips) +[2]: https://github.com/astrand/xclip +[3]: https://en.wikipedia.org/wiki/Tail_(Unix) +[4]: https://plaintextproject.online +[5]: https://gumroad.com/l/learnmarkdown +[6]: https://pandoc.org +[7]: https://docs.gitlab.com/ee/user/project/pages/ +[8]: https://certbot.eff.org/ +[9]: https://en.wikipedia.org/wiki/Cat_(Unix) diff --git a/published/20190705 Manage your shell environment.md b/published/20190705 Manage your shell environment.md new file mode 100644 index 0000000000..9f7d8d9612 --- /dev/null +++ b/published/20190705 Manage your shell environment.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11095-1.html) +[#]: subject: (Manage your shell environment) +[#]: via: (https://fedoramagazine.org/manage-your-shell-environment/) +[#]: author: (Eduard Lucena https://fedoramagazine.org/author/x3mboy/) + +管理你的 shell 环境 +====== + +![][1] + +前段时间,Fedora Magazine 发表了一篇 [介绍 ZSH][2] 的文章,它是 Fedora 默认的 bash shell 的替代品。这一次,我们将着重定制它来更有效地使用它。本文中显示的所有概念也适用于其他 shell,例如 bash。 + +### 别名 + +别名是命令的快捷方式。为那些需要经常执行,但需要很长时间输入的长命令创建快捷方式很有用。语法是: + +``` +$ alias yourAlias='complex command with arguments' +``` + +它们并不总是用来缩短长命令。重要的是,你将它们用于你经常执行的任务。可能的例子: + +``` +$ alias dnfUpgrade='dnf -y upgrade' +``` + +这样,为了进行系统升级,我只需输入 `dnfUpgrade` 而不用输入完整的 `dnf` 命令。 + +在终端中设置别名的问题是,一旦终端会话关闭,别名就会丢失。要永久设置它们,请使用资源文件。 + +### 资源文件 + +资源文件(即 rc 文件)是在会话或进程开始时(每个用户在开启新终端窗口或启动 vim 等新程序时)加载的配置文件。对于 ZSH,资源文件是 `.zshrc`,对于 bash,它是 `.bashrc`。 + +要使别名成为永久别名,你可以将它们放入资源文件中。你可以使用你选择的文本编辑器编辑资源文件。这里使用 vim: + +``` +$ vim $HOME/.zshrc +``` + +或者对于 bash: + +``` +$ vim $HOME/.bashrc +``` + +请注意,资源文件的位置是相对于家目录指定的。这是 ZSH(或 bash)默认为每个用户查找该文件的位置。 + +还有一种是将你的配置放在任何其他文件中,然后读取它: + +``` +$ source /path/to/your/rc/file +``` + +同样,在会话中直接读取它只会将其应用于会话,因此要使其永久化,请将 `source` 命令添加到资源文件中。将文件放在不同位置的优点是你可以随时读取它。这在共享环境中很有用。 + +### 环境变量 + +环境变量是分配了特定名称的值,你可以在脚本和命令中调用它们。它们以美元符号(`$`)开始。其中最常见的是指向主目录的 `$HOME`。 + +顾名思义,环境变量是你环境的一部分。使用以下语法设置变量: + +``` +$ http_proxy="http://your.proxy" +``` + +要使其成为环境变量,请使用以下命令将其导出: + +``` +$ export $http_proxy +``` + +要查看当前设置的所有环境变量,请使用 `env` 命令: + +``` +$ env +``` + +该命令输出会话中可用的所有变量。要演示如何在命令中使用它们,请尝试运行以下 `echo` 命令: + +``` +$ echo $PWD +/home/fedora +$ echo $USER +fedora +``` + +这里发生了变量扩展,即存储在变量中的值在命令中使用。 + +另一个有用的变量是 `$PATH`,它定义了 shell 查找二进制文件的目录。 + +### $PATH 变量 + +有许多对于操作系统很重要的目录或文件夹(在图形环境中调用它们的方式)。某些目录设置为保存可直接在 shell 中使用的二进制文件。这些目录在 `$PATH` 变量中定义。 + +``` +$ echo $PATH +/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/usr/libexec/sdcc:/usr/libexec/sdcc:/usr/bin:/bin:/sbin:/usr/sbin:/opt/FortiClient +``` + +当你希望在 shell 中访问自己的二进制文件(或脚本)时,这会有帮助。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-your-shell-environment/ + +作者:[Eduard Lucena][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://fedoramagazine.org/author/x3mboy/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2018/05/manage-shell-env-816x345.jpg +[2]: https://fedoramagazine.org/set-zsh-fedora-system/ diff --git a/published/20190706 Say WHAAAT- Mozilla has Been Nominated for the -Internet Villain- Award in the UK.md b/published/20190706 Say WHAAAT- Mozilla has Been Nominated for the -Internet Villain- Award in the UK.md new file mode 100644 index 0000000000..feddddee95 --- /dev/null +++ b/published/20190706 Say WHAAAT- Mozilla has Been Nominated for the -Internet Villain- Award in the UK.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: (chen-ni) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11068-1.html) +[#]: subject: (Say WHAAAT? Mozilla has Been Nominated for the “Internet Villain” Award in the UK) +[#]: via: (https://itsfoss.com/mozilla-internet-villain/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +什么?!Mozilla 被提名英国“互联网恶棍”奖 +====== + +Mozilla Firefox 是目前最流行的浏览器之一。很多用户喜欢它胜过 Chrome 就是因为它鼓励隐私保护,并且可以通过一些选项设置让你的互联网活动尽可能地私密。 + +不过最近推出的功能之一 —— 仍然处于测试阶段的 [DoH (DNS-over-HTTPS)][1] 功能却受到了英国互联网服务提供商行业协会的负面评价。 + +英国互联网服务提供商行业协会Internet Services Providers Association(ISPA)决定将 Mozilla 列入 2019 年“互联网恶棍”奖的最终入围者名单。该奖项将在 ISPA 于 7 月 11 日在伦敦举行的颁奖典礼上进行颁发。 + +![][3] + +### 为什么说 “Mozilla” 是 “互联网恶棍”? + +ISPA 在他们的声明中表示,Mozilla 因为支持了 DoH(DNS-over-HTTPS)而被视为“互联网恶棍”。 + +> [@mozilla][4] 被提名为 [#ISPA][5] 的 [#互联网恶棍][6] 是因为他们试图推行 DNS-over-HTTPS 以绕开英国的内容过滤系统和家长监护模式,破坏了英国 [#互联网][7] 安全准则。 [pic.twitter.com/WeZhLq2uvi][8] +> +> — 英国互联网提供商行业协会 (ISPAUK) (@ISPAUK) [2019 年 7 月 4 日][9] + +![](https://pbs.twimg.com/media/D-n8WlvX4AAnWIW.jpg) + +和 Mozilla 一同被列入最终入围者名单的还有欧盟《版权法第 13 条》和美国总统特朗普。ISPA 在他们的声明里是这样解释的: + +**Mozilla**:因为试图推行 DNS-over-HTTPS 以绕开英国的内容过滤系统和家长监护模式,破坏了英国互联网安全准则。 + +**欧盟《版权法第 13 条》**:因为要求各平台使用“内容识别技术”,威胁到了线上言论自由。 + +**美国总统特朗普**:因为在试图保护其国家安全的过程中,为复杂的全球通信供应链带来了巨大的不确定性。 + +### 什么是 DNS-over-HTTPS? + +你可以将 DoH 理解为,域名解析服务(DNS)的请求通过 HTTPS 连接加密传输。 + +传统意义上的 DNS 请求是不会被加密的,因此你的 DNS 提供商或者是互联网服务提供商(ISP)可以监视或者是控制你的浏览行为。如果没有 DoH,你很容易被 DNS 提供商强制拦截和进行内容过滤,并且你的互联网服务提供商也同样可以做到。 + +然而 DoH 颠覆了这一点,可以让你得到一个私密的浏览体验。 + +你可以研究一下 [Mozilla 是如何开展和 Cloudflare 的合作的][11],并且可以自己配置一下 DoH(如果需要的话)。 + +### DoH 有用吗? + +既有用又没有用。 + +当然了,从事情的一方面来看,DoH 可以帮助用户绕过 DNS 或者互联网服务提供商强制的内容过滤系统。如果说 DoH 有助于满足我们避开互联网审查的需求,那么它是一件好事情。 + +不过从事情的另一方面来看,如果你是一位家长,而你的孩子在 Mozilla Firefox 上使用了 DoH 的话,你就无法 [设置内容过滤器][12] 了。这取决于 [防火墙配置][13] 的好坏。 + +DoH 可能会成为一些人绕过家长监护的手段,这可能不是一件好事。 + +如果我这样的说法有问题,你可以在下面的评论区纠正我。 + +并且,使用 DoH 就意味着你没办法使用本地 host 文件了(如果你正用它作为广告拦截或者是其它用途的话)。 + +### 总结 + +你是如何看待 DoH 的呢?它足够好吗? + +你又是如何看待 ISPA 的决定的呢?你觉得他们这样的声明是不是在鼓励互联网审查和政府对网民的监控呢? + +我个人觉得这个提名决定非常可笑。即使 DoH 并不是所有人都需要的那个终极功能,能够有一种保护个人隐私的选择也总不是件坏事。 + +在下面的评论区里发表你的看法吧。最后我想引用这么一句话: + +> 在谎言遍地的时代,说真话是一种革命行为。(LCTT 译注:引自乔治奥威尔) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/mozilla-internet-villain/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/DNS_over_HTTPS +[2]: https://www.ispa.org.uk/ispa-announces-finalists-for-2019-internet-heroes-and-villains-trump-and-mozilla-lead-the-way-as-villain-nominees/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/mozilla-internet-villain.jpg?resize=800%2C450&ssl=1 +[4]: https://twitter.com/mozilla?ref_src=twsrc%5Etfw +[5]: https://twitter.com/hashtag/ISPAs?src=hash&ref_src=twsrc%5Etfw +[6]: https://twitter.com/hashtag/InternetVillain?src=hash&ref_src=twsrc%5Etfw +[7]: https://twitter.com/hashtag/internet?src=hash&ref_src=twsrc%5Etfw +[8]: https://t.co/WeZhLq2uvi +[9]: https://twitter.com/ISPAUK/status/1146725374455373824?ref_src=twsrc%5Etfw +[10]: https://itsfoss.com/why-firefox/ +[11]: https://blog.nightly.mozilla.org/2018/06/01/improving-dns-privacy-in-firefox/ +[12]: https://itsfoss.com/how-to-block-porn-by-content-filtering-on-ubuntu/ +[13]: https://itsfoss.com/set-up-firewall-gufw/ diff --git a/published/20190708 Debian 10 (Buster) Installation Steps with Screenshots.md b/published/20190708 Debian 10 (Buster) Installation Steps with Screenshots.md new file mode 100644 index 0000000000..c593cf7ec9 --- /dev/null +++ b/published/20190708 Debian 10 (Buster) Installation Steps with Screenshots.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11083-1.html) +[#]: subject: (Debian 10 (Buster) Installation Steps with Screenshots) +[#]: via: (https://www.linuxtechi.com/debian-10-buster-installation-guide/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +图解 Debian 10(Buster)安装步骤 +====== + +![](https://img.linux.net.cn/data/attachment/album/201907/11/000856swbwnfyknnbn3twk.jpg) + +Debian 项目发布了它的最新稳定版 Debian 10,其代号是 “Buster”,这个发布版将获得 5 年的支持。Debian 10 可用于 32 位和 64 位系统。这个发布版带来很多新的特色,列出下面一些特色: + + * 引入新的 Debian 10 的主题 “FuturePrototype” + * 新版本的电脑桌面环境 GNOME 3.30、Cinnamon 3.8、KDE Plasma 5.14、MATE 1.20、Xfce 4.12 + * 长期支持版内核 4.19.0-4 + * 新的 Python 3 (3.7.2)、Perl 5.28、PHP 7.3 + * iptables 替换为 nftables + * 更新 LibreOffice 6.1、GIMP 2.10.8 + * 更新 OpenJDK 11、MariaDB 10.3 和 Apache 2.4.38 + * 更新 Chromium 73.0、Firefox 60.7 + * 改进 UEFI 支持 + +在这篇文章中,我们将演示如何在你的笔记本电脑和台式电脑上安装 Debian 10 “Buster” 工作站。 + +Debian 10 建议系统要求: + + * 2 GB 内存 + * 2 GHz 双核处理器 + * 10 GB 可用硬盘空间 + * 可启动安装介质(USB / DVD) + * 网络连接(可选) + +让我们跳转到 Debian 10 的安装步骤。 + +### 步骤:1)下载 Debian 10 ISO 文件 + +从它的官方入口网站,下载 Debian 10 ISO 文件, + +- https://www.debian.org/releases/buster/debian-installer/ + +ISO 文件下载完成后刻录它到 USB 或 DVD,使其可用来启动。 + +### 步骤:2)使用安装可启动介质(USB / DVD)启动你的电脑系统 + +重启你将安装 Debian 10 的电脑,转到 BIOS 设置,并设置启动介质为 USB 或 DVD。 用可启动介质启动电脑后,那么我们将看到下面的屏幕。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Choose-Graphical-Install-Debian-10.jpg) + +选择第一个选项 “Graphical Install”。 + +### 步骤:3)选择你的首选语言、位置和键盘布局 + +在这个步骤中,你将被要求选择你的首选语言。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Choose-Language-Debian10-Installation.jpg) + +点击 “Continue”。 + +选择你的首选位置,电脑系统将依照位置自动设置时区。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Select-Location-Debain10-Installation.jpg) + +现在选择适合于你安装设备的键盘布局。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Keyboard-Layout-Debian10-Installation.jpg) + +点击 “Continue” 以继续。 + +### 步骤:4)为 Debian 10 系统设置主机名称和域名 + +设置适合于你的环境的主机名,然后在 “Continue” 上单击,就我而言, 我指定主机名为 “debian10-buster”。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Hostname-During-Debian10-Installation.jpg) + +指定适合于环境的域名,并安装,然后在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Domain-Name-During-Debian10-Installation.jpg) + +### 步骤:5)指定 root 用户的密码 + +在下面的屏幕中指定 root 密码,然后在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Root-Password-Debian10-Installation.jpg) + +### 步骤:6)创建本地用户和它的密码 + +在这个步骤中,你将被提示指定本地用户具体信息,如完整的姓名、用户名和密码, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Local-User-FullName-Debian10.jpg) + +在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/UserName-LocalUser-Debian10-Installation.jpg) + +在 “Continue” 上单击,并在接下来的窗口中指定密码。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Password-Localuser-Debian10.jpg) + +### 步骤:7)为 Debian 10 选择硬盘分区方案 + +在这个步骤中,为 Debian 10 选择硬盘分区方案,就我而言,我有 40 GB 硬盘可用于操作系统安装。分区方案有两种类型: + + * 向导分区(安装器将自动创建需要的分区) + * 手动分区(正如名字所示,使用这种方式,我们可以手动创建分区方案) + +在这篇教程中,我们将在我 42 GB 硬盘上使用带有 LVM 的向导分区。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Choose-Guided-Partitioning-Scheme-Debain10-Installation.jpg) + +在 “Continue” 上单击来继续, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Hard-Disk-Debian10-Installation.jpg) + +正如我们所视,我大约有 42 GB 硬盘空间,选择 “Continue”。 + +在接下来的屏幕中,你将被要求选择分区,如果是 Linux 新用户,那么选择第一个选项。假使你想要一个独立的 home 分区,那么选择第二种方案,否则选择第三种方案,它们将为 `/home`、`/var` 和 `/tmp` 创建独立的分区。 + +就我而言,我将通过选择第三种选项来为 `/home`、`/var` 和 `/tmp` 创建独立的分区。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Guided-Separate-Partitions-Debian10-Installation.jpg) + +在接下来的屏幕中,选择 “yes” 来将更改写到磁盘中,配置 LVM ,然后在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Write-Changes-Disk-Debian10-Installation.jpg) + +在接下来的屏幕中,将显示分区表,验证分区大小、文件系统类型和挂载点。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Debian10-Partition-Table.jpg) + +在 “Continue” 上单击来继续, + +在接下来的屏幕中,选择 “yes” 来写更改到磁盘中, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Choose-Yes-Write-Changes-Disk-Debian10-Installation.jpg) + +在 “Continue” 上单击来继续安装, + +### 步骤:7)Debian 10 安装开始 + +在这一步骤中,Debian 10 的安装已经开始,并正在进行中, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Debian10-Installation-Progress.jpg) + +在安装期间,安装器将提示你扫描 CD/DVD 以配置软件包管理器,选择 “No” ,然后在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Scan-DVD-Debian10-Installation.jpg) + +在接下来的屏幕中,如果你想配置基于网络的软件包管理器选择 “yes” ,但是为了使这个方式工作,要确保你的系统连接到了网络,否则选择 “No”。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Network-Mirror-Debian10-Package-Manager.jpg) + +在 “Continue” 上单击来配置基于你本地的软件包管理器,在接下来的几个屏幕中,你将被提示选择本地和 Debian 软件包存储库 URL ,然后你将获得下面的屏幕。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Apt-Config-Debian10-Installation.jpg) + +选择 “No” 来跳过软件包审查步骤,然后在 “Continue” 上单击。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Pkg-Survey-Debian10-Installation.jpg) + +在接下来的窗口中,你将被提示选择电脑桌面环境和其它软件包,就我而言,我选择 “Gnome Desktop” ,“SSH Server” 和 “Standard System utilities”。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Software-Selection-Debian10-Installation.jpg) + +在 “Continue” 上单击来继续安装, + +选择选项 “yes” 来安装 Grub 引导加载程序。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Install-Grub-Bootloader-Debian10-Installation.jpg) + +在 “Continue” 上单击来继续,然后在接下来的窗口中选择将安装引导加载程序的磁盘(`/dev/sda`)。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Install-grub-on-dev-sda-debian10.jpg) + +在 “Continue” 上单击来继续安装,一旦安装完成,安装器将提示我们来重启系统, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Installation-Completed-Debain10.jpg) + +在 “Continue” 上单击来重启你的系统,不要忘记在 BIOS 设置中更改启动介质,以便系统从我们已经安装 Debian 10 操作系统的硬盘启动。 + +### 步骤:8)启动你新安装的 Debian 10 系统 + +在成功安装后,一旦我们重启系统,我们将获取下面的引导加载程序屏幕。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Bootloader-Screen-Debian10.jpg) + +选择第一个选项 “Debian GNU/Linux” 并敲击回车键。 + +一旦系统启动,使用我在安装期间创建的本地用户和它的密码。 + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Local-User-Debian10-Login.jpg) + +在成功登录后,将看到如下电脑桌面屏幕, + +![](https://www.linuxtechi.com/wp-content/uploads/2019/07/Desktop-Screen-Debian10-Buster.jpg) + +这证实 Debian 10 已经成功安装,这就是本文的全部,探索这个令人激动的 Linux 发行版吧,玩得开心 😊 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/debian-10-buster-installation-guide/ + +作者:[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 diff --git a/published/20190708 Linux Games Get A Performance Boost for AMD GPUs Thanks to Valve-s New Compiler.md b/published/20190708 Linux Games Get A Performance Boost for AMD GPUs Thanks to Valve-s New Compiler.md new file mode 100644 index 0000000000..c2d310c26c --- /dev/null +++ b/published/20190708 Linux Games Get A Performance Boost for AMD GPUs Thanks to Valve-s New Compiler.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11082-1.html) +[#]: subject: (Linux Games Get A Performance Boost for AMD GPUs Thanks to Valve’s New Compiler) +[#]: via: (https://itsfoss.com/linux-games-performance-boost-amd-gpu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +借助 Valve 的新编译器,Linux 游戏在 AMD GPU 中获得了性能提升 +====== + +Steam 寻求公众反馈以便为 AMD GPU 测试 ACO(一个新的 Mesa [着色器][1]编译器)已经有几天了。 + +目前,AMD 驱动程序使用 LLVM 作为着色器编译器。而 [Mesa][2] 则是一个开源的 [LLVM][3] 的替代品。因此,在这种情况下,Valve 希望支持 AMD 显卡以提高 Linux 游戏在各种 Linux 发行版上的性能。 + +![][4] + +为了提高游戏性能,编译时间至关重要,使用新的 ACO 编译器,它将时间缩短了近 50%。 Valve 在其 [Steam 社区][5]的帖子中解释了更多关于它的信息: + +> AMD OpenGL 和 Vulkan 驱动程序目前使用的着色器编译器是上游 LLVM 项目的一部分。该项目规模庞大,并且有许多不同的目标,游戏着色器的在线编译只是其中之一。这可能会导致不同的开发权衡,其中改进游戏特定功能比其他情况更难,特定于游戏的功能也经常被 LLVM 的开发人员因其他事情破坏。特别是,着色器编译速度就是这样一个例子:它在大多数其他场景中并不是一个关键因素,只能锦上添花。但是对于游戏来说,编译时间是至关重要的,而缓慢的着色器编译可能导致几乎无法播放的顿挫。 + +### Linux 游戏真的有性能提升吗? + +是的,没错。 + +这里的主要亮点是编译时间。如果着色器编译时间急剧减少,理论上应该会改善游戏的性能。 + +而且,根据[最初的基准报告][6],我们确实看到了一些重大改进。 + +![][7] + +当然,游戏中的 FPS 改进并不是很大。但是,它在早期阶段仍然是一个很好的进步。 + +如果你对编译时间的改进感到好奇,下面是结果: + +![][8] + +是的,即使大幅的编译时间减少也不会大幅影响游戏中的 FPS。但是,它仍然是一件大事,因为目前,这是一项正在进行中的工作。所以,我们可以有更多期待。 + +但是,还能做些什么呢? + +好吧,ACO 还没完成。下面是为什么(在 Valve 中提到): + +> 现在,ACO 只处理像素和计算着色器阶段。当其余的阶段实现时,我们预计编译时间将进一步减少。 + +#### 总结 + +尽管我没有配备 AMD GPU,但我很有兴趣看到对 Linux 游戏场景的改进。 + +此外,随着事情进展,我们将期待更多的基准和报告。 + +你怎么看待?请在下面的评论中告诉我们你的想法。如果你有基本报告要分享,请告诉我们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-games-performance-boost-amd-gpu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Shader +[2]: https://en.wikipedia.org/wiki/Mesa_(computer_graphics) +[3]: https://en.wikipedia.org/wiki/LLVM +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/Improved-Linux-Gaming.png?resize=800%2C450&ssl=1 +[5]: https://steamcommunity.com/games/221410/announcements/detail/1602634609636894200 +[6]: https://gist.github.com/pendingchaos/aba1e4c238cf039d17089f29a8c6aa63 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/fps-improvement-amd.png?fit=800%2C412&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/compile-time-amd-gpu-linux.png?ssl=1 diff --git a/published/20190709 From BASIC to Ruby- Life lessons from first programming languages on Command Line Heroes.md b/published/20190709 From BASIC to Ruby- Life lessons from first programming languages on Command Line Heroes.md new file mode 100644 index 0000000000..2d80df3e29 --- /dev/null +++ b/published/20190709 From BASIC to Ruby- Life lessons from first programming languages on Command Line Heroes.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11097-1.html) +[#]: subject: (From BASIC to Ruby: Life lessons from first programming languages on Command Line Heroes) +[#]: via: (https://opensource.com/19/7/command-line-heroes-ruby-basic) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +从 BASIC 到 Ruby:入门编程语言的体悟 +====== + +> 为什么 BASIC 是一种备受喜爱的入门语言?下一代该如何学习编程? + +![Listen to the Command Line Heroes Podcast][1] + +《[Command Line Heroes][2]》 第三季的第二集今天抵达了,它对我的入门编程的怀旧让我回到了过去。 + +(LCTT 译注:《Command Line Heroes》 是红帽公司制作的播客,讲述了开发人员、程序员、黑客、极客和开源反叛者如何彻底改变技术前景的真实史诗。其第一季制作于 2017 年,邀请到了谷歌、NASA 等重量级企业的技术专家担当嘉宾,讲述操作系统战争风云、美国航天局如何开源等等,涉及开源、操作系统、容器、DevOps、云计算等话题。) + +### 语言会影响可访问性 + +这一集告诉我,BASIC 是计算机的理解力民主化的一次巨大飞跃。我很难想象,在一个不太遥远的、计算机尚且是稀罕之物的时代,是 BASIC 改变了世界。正如 [Saron Yitbarek][3] 提到的那样,“在早些年编程,你几乎得有个博士学位才行。”BASIC 是一个巨大的飞跃,它专注于可用性(适合初学者的命令)和资源共享(单个计算机的分时操作)。它使得编程不在局限于当时的“计算机玩家”(我喜欢这集中的这句话),并帮助了新一代人参与了进来。进入编程领域的壁垒得以下降。 + +### 入门编程语言 + +这一集的核心话题是围绕学习入门语言展开的。关于学习什么编程语言以及如何学习,有很多建议。关于这个问题[在这里][4]已经写了很多。我喜欢听到 Saron 以 Ruby 作为她的介绍的故事,以及它以一种几乎意想不到的方式变得有趣。我有一些类似的经历,因为我在一些项目中用到了 Ruby。它的灵活性让我感到开心。当我(对编程)感到紧张时,正是这种快乐让我重新回到它的身边,并且它有一些能够使语言如此充满情感的强大功能。 + +我第一次体验编程是用 HTML 和 CSS,但我第一个重型编程语言是 Java。我永远不会忘记在课堂的第一天被告知要记住 `public static void main`,但没有告知我关于它意味着什么的任何信息。我们花了很多时间在面向对象编程的上下文环境中探讨它是什么,但它从未像我在 Ruby 中使用 `.each` 迭代列表,或者像在 Python 中用 `import numpy` 做一些数学魔术那样感到兴奋。然后我听说孩子们正在学习如何使用 Python 编写 [Minecraft][5] 或使用像 [Scratch][6] 这样的可视化编程语言,我因此而悟,BASIC 的遗产正在以新的方式存在。 + +我从这一集中获取到的内容: + +* 请记住,没有人出生就是程序员。每个人都没有这样的背景。你并不孤单。 +* 学习一门语言。任何一种都行。如果你有选择的可能,那么请选择能带给你最大乐趣的那个。 +* 不要忘记所有语言都可以构建一些东西。请为人类创造有意义的事物。 + +《Command Line Heroes》整个第三季将涉及编程语言。[请在此处订阅来学习你想要了解的有关编程语言的起源][2],我很乐意在下面的评论中听到你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/19/7/command-line-heroes-ruby-basic + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ep1_blog-header-520x292_lgr.png?itok=I8IS1hkt (Listen to the Command Line Heroes Podcast) +[2]: https://www.redhat.com/en/command-line-heroes +[3]: https://twitter.com/saronyitbarek +[4]: https://linux.cn/article-8379-1.html +[5]: https://opensource.com/life/15/5/getting-started-minecraft-pi +[6]: https://opensource.com/education/11/6/how-teach-next-generation-open-source-scratch diff --git a/published/20190709 Pipx - Install And Run Python Applications In Isolated Environments.md b/published/20190709 Pipx - Install And Run Python Applications In Isolated Environments.md new file mode 100644 index 0000000000..1fb5155fc7 --- /dev/null +++ b/published/20190709 Pipx - Install And Run Python Applications In Isolated Environments.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11104-1.html) +[#]: subject: (Pipx – Install And Run Python Applications In Isolated Environments) +[#]: via: (https://www.ostechnix.com/pipx-install-and-run-python-applications-in-isolated-environments/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Pipx:在隔离环境中安装和运行 Python 应用 +====== + +![][1] + +我们始终建议在虚拟环境中安装 Python 应用以避免彼此冲突。Pip 包管理器可以帮助我们在隔离的环境中安装 Python 应用,我们使用两个工具,即 `venv` 和 `virtualenv`。还有一个 Python.org 推荐的名为 [Pipenv][2] 的 Python 包管理器也可以用来安装 Python 应用。与 Pip 不同,Pipenv 默认会自动创建虚拟环境。这意味着你不再需要为项目手动创建虚拟环境。今天,我偶然发现了一个名为 “Pipx” 的类似工具,它是一个自由开源程序,允许你在隔离的虚拟环境中安装和运行 Python 应用。 + +使用 Pipx,我们可以轻松安装 PyPI 中托管的数千个 Python 应用,而不会有太多麻烦。好的是,你可以使用常规用户权限执行所有操作。你不需要成为 “root” 用户或不需要具有 “sudo” 权限。值得一提的是,Pipx 可以从临时环境运行程序,而无需安装它。当你经常测试同一程序的多个版本时,这将非常方便。随 Pipx 一起安装的软件包可以随时列出、升级或卸载。Pipx 是一个跨平台的程序,因此它可以在 Linux、Mac OS 和 Windows 上运行。 + +### 安装 Pipx + +Python 3.6+ 、Pip 和 `venv` 模块是安装 `pipx` 所必需的。确保按照以下指南中的说明安装它们。 + +* [如何使用 Pip 管理 Python 包][3] + +此处,需要 `venv` 来创建虚拟环境。 + +接下来,运行以下命令安装 Pipx。 + +``` +$ python3 -m pip install --user pipx +$ python3 -m userpath append ~/.local/bin +``` + +`pipx` 二进制文件的默认位置是 `~/.local/bin`。你可以使用 `PIPX_BIN_DIR` 环境变量覆盖它。如果要覆盖 `PIPX_BIN_DIR`,只需运行 `userpath append $PIPX_BIN_DIR`,确保它在你的路径中。 + +Pipx 的默认虚拟环境位置是 `~/.local/pipx`。这可以用环境变量 `PIPX_HOME` 覆盖。 + +让我们继续看看如何使用 Pipx 安装 Python 应用。 + +### 使用 Pipx 在隔离环境中安装和运行 Python 应用 + +以下是 Pipx 入门的几个例子 + +#### 安装 Python 包 + +要全局安装 Python 应用,例如 cowsay,请运行: + +``` +$ pipx install cowsay +``` + +此命令将自动创建虚拟环境,在其中安装包并包的可执行文件放在 `$PATH` 中。 + +示例输出: + +``` +installed package cowsay 2.0.3, Python 3.6.8 +These binaries are now globally available +- cowsay +done! ✨ 🌟 ✨ +``` + +![1][4] + +*使用 Pipx 安装 Python 应用* + +让我们测试新安装的 cowsay 程序: + +![1][5] + +在这里,我从官方网站上摘取了这些例子。你可以安装/测试任何其他的 Python 包。 + +#### 列出 Python 包 + +要使用 Pipx 列出所有已安装的应用,请运行: + +``` +$ pipx list +``` + +示例输出: + +``` +venvs are in /home/sk/.local/pipx/venvs +binaries are exposed on your $PATH at /home/sk/.local/bin +package cowsay 2.0.3, Python 3.6.8 +- cowsay +``` + +如果你尚未安装任何软件包,你将看到以下输出: + +``` +nothing has been installed with pipx 😴 +``` + +#### 升级包 + +要升级包,只需执行以下操作: + +``` +$ pipx upgrade cowsay +``` + +要一次性升级所有已安装的软件包,请使用: + +``` +$ pipx upgrade-all +``` + +#### 从临时虚拟环境运行应用 + +有时,你可能希望运行特定的 Python 程序,但并不实际安装它。 + +``` +$ pipx run pycowsay moooo +``` + +![1][6] + +*在临时隔离虚拟环境中运行 Python 应用* + +此命令实际上并不安装指定程序,而是从临时虚拟环境运行它。你可以使用此命令快速测试 Python 应用。 + +你甚至可以直接运行 .py 文件。 + +``` +$ pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0f/raw/6bdfbb6e9c1132b1c38fdd2f195d4a24c540c324/pipx-demo.py +pipx is working! +``` + +#### 卸载软件包 + +可以使用以下命令卸载软件包: + +``` +$ pipx uninstall cowsay +``` + +要删除所有已安装的包: + +``` +$ pipx uninstall-all +``` + +#### 获得帮助 + +要查看帮助部分,请运行: + +``` +$ pipx --help +``` + +就是这些了。如果你一直在寻找安全,方便和可靠的程序来安装和运行 Python 应用,Pipx 可能是一个不错的选择。 + +资源: + +* [Pipx 的 GitHub 仓库][7] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/pipx-install-and-run-python-applications-in-isolated-environments/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/07/pipx-720x340.png +[2]: https://www.ostechnix.com/pipenv-officially-recommended-python-packaging-tool/ +[3]: https://www.ostechnix.com/manage-python-packages-using-pip/ +[4]: https://www.ostechnix.com/wp-content/uploads/2019/07/Install-Python-Applications-Using-Pipx.png +[5]: https://www.ostechnix.com/wp-content/uploads/2019/07/Test-Python-application.png +[6]: https://www.ostechnix.com/wp-content/uploads/2019/07/Run-Python-Applications-In-Isolated-Environments.png +[7]: https://github.com/pipxproject/pipx diff --git a/published/20190710 How To Find Virtualbox Version From Commandline In Linux.md b/published/20190710 How To Find Virtualbox Version From Commandline In Linux.md new file mode 100644 index 0000000000..02c775ec21 --- /dev/null +++ b/published/20190710 How To Find Virtualbox Version From Commandline In Linux.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11099-1.html) +[#]: subject: (How To Find Virtualbox Version From Commandline In Linux) +[#]: via: (https://www.ostechnix.com/how-to-find-virtualbox-version-from-commandline-in-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +在 Linux 中如何从命令行查找 VirtualBox 版本 +====== + +![FInd Virtualbox version from commandline In Linux][1] + +我使用 Oracle VirtualBox 和 [KVM][2] 虚拟化程序[测试不同的 Linux 操作系统][3]。虽然我偶尔使用 KVM,但 Virtualbox 始终是我的首选。不是因为我不喜欢 KVM,而是因为我只是习惯了 VirtualBox。当在我的 Ubuntu 无头服务器上使用 [Virtualbox][4] 时,我需要知道 VirtualBox 的版本。如果它有 GUI,我可以进入 Virtualbox -> About -> Help 轻松找到它。但我的是没有 GUI 的 Ubuntu 服务器。如果你想知道如何在 Linux 中从命令行查找 VirtualBox 版本,可以采用以下几种方法。 + + +### 在 Linux 中从命令行查找 VirtualBox 版本 + +要查找已安装的 VirtualBox 的版本,请打开终端并运行以下命令: + +``` +$ vboxmanage --version +``` + +示例输出: + +``` +5.2.18_Ubuntur123745 +``` + +![][5] + +*在 Linux 中从命令行查找 Virtualbox 版本* + +正如你在上面的输出中看到的,安装的 VirtualBox 的版本是 5.2。 + +查找 VirtualBox 版本的另一种方法是: + +``` +$ vbox-img --version +``` + +示例输出: + +``` +5.2.18_Ubuntur123745 +``` + +或者,你可以使用 `head` 和 `awk` 命令来查找 VirtualBox 版本。 + +``` +$ virtualbox --help | head -n 1 | awk '{print $NF}' +``` + +示例输出: + +``` +5.2.18_Ubuntu +``` + +或者,使用 `echo` 命令结合 `head` 和 `awk` 命令: + +``` +$ echo $(virtualbox --help | head -n 1 | awk '{print $NF}') +``` + +示例输出: + +``` +5.2.18_Ubuntu +``` + +以上命令适用于任何 Linux 发行版。如果你使用的是 Ubuntu,你可以使用 `dpkg` 命令查看 VirtualBox 版本。 + +``` +$ dpkg -l | grep virtualbox | awk '{print $3}' +``` + +示例输出: + +``` +5.2.30-130521~Ubuntu~bionic +5.2.18-dfsg-2~ubuntu18.04.5 +``` + +就是这些了。这些是从 Linux 中的终端查找 Oracle Virtualbox 版本的几种方法。希望这篇文章很有用。 + +参考来自: + + * [AskUbuntu][6] + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-find-virtualbox-version-from-commandline-in-linux/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/07/Find-Virtualbox-Version-1-720x340.png +[2]: https://www.ostechnix.com/setup-headless-virtualization-server-using-kvm-ubuntu/ +[3]: https://www.ostechnix.com/test-100-linux-and-unix-operating-systems-online-for-free/ +[4]: https://www.ostechnix.com/install-oracle-virtualbox-ubuntu-16-04-headless-server/ +[5]: https://www.ostechnix.com/wp-content/uploads/2019/07/Find-Virtualbox-Version.png +[6]: https://askubuntu.com/questions/420363/how-do-i-check-virtualbox-version-from-cli diff --git a/published/20190712 Make an RGB cube with Python and Scribus.md b/published/20190712 Make an RGB cube with Python and Scribus.md new file mode 100644 index 0000000000..167a8d1d20 --- /dev/null +++ b/published/20190712 Make an RGB cube with Python and Scribus.md @@ -0,0 +1,251 @@ +[#]: collector: "lujun9972" +[#]: translator: "zianglei" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-11108-1.html" +[#]: subject: "Make an RGB cube with Python and Scribus" +[#]: via: "https://opensource.com/article/19/7/rgb-cube-python-scribus" +[#]: author: "Greg Pittman https://opensource.com/users/greg-p/users/greg-p" + +使用 Python 和 Scribus 创建一个 RGB 立方体 +====== + +> 使用 Scribus 的 Python 脚本编写器功能,开发一个显示 RGB 色谱的 3D 立方体。 + +![cubes coming together to create a larger cube][1] + +当我决定这个夏天要玩色彩游戏时,我想到通常色彩都是在色轮上描绘的。这些色彩通常都是使用色素而不是光,并且你失去了任何对颜色亮度或光度变化的感觉。 + +作为色轮的替代,我想在立方体表面使用一系列图形来显示 RGB 频谱。色彩的 RGB 值将在具有 X、Y、Z 轴的三维图形上展示。例如,一个平面将会保持 B(蓝色)为 0,其余的坐标轴将显示当我将 R(红色)和 G (绿色)的值从 0 绘制到 255 时发生的情况。 + +事实证明,使用 [Scribus][2] 及其 [Python 脚本编写器][3] 功能实现这一点并不困难。我可以创建 RGB 颜色,使矩形显示颜色,并以 2D 格式排列它们。我决定设置颜色值的间隔为 5,并让矩形按 5 个点(pt)进行绘图。因此,对于每个 2D 图形,我将使用大约 250 种颜色,立方体的一个边有 250 个点(pt),也就是 3.5 英寸。 + +我使用下面这段 Python 代码完成了绿 - 红图的任务: + +```python +x = 300 +y = 300 +r = 0 +g = 0 +b = 0 + +if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1,                  scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): +    while r < 256: +        while g < 256: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '0_0_0': +                newcolor = 'Black' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + g, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            g = g + 5 +        g = 0 +        r = r + 5 +        y = y – 5 +``` + +这个脚本在 `300,300` 位置开始绘制图形,这个位置大约是一个美国信件大小的纸张的水平中心,大概是垂直方向从顶部到底的三分之一位置;这是图像的原点,然后它沿着 X 轴(绿色值)水平构建图形,然后返回到 Y 轴,向上移动 5 个点,然后绘制下一条矩形线。 + +![Red-Green graph][4] + +这看起来很简单;我只需要调整一下数字就可以把立方体的另一面画出来。但这不仅仅是再画两个图,一个是蓝 - 绿色,另一个是红 - 蓝色的问题。我想创建一个展开的立方体,这样我就可以打印、剪开然后折叠它,创建一个 RGB 的 3D 视图。因此,下一部分(向下的页面)的原点(黑色的角落)需要在左上角,其水平方向是绿色,垂直方向是蓝色。 + +“调整数字”最终或多或少变成了试错,从而得到我想要的东西。在创建了第二个图之后,我需要第三个图,它是红 - 蓝色的,原点位于左上角,红色向左递增,蓝色向下递增。 + +下面是最终效果图: + +![First half of RGB cube][5] + +当然,这只是这个立方体的前半部分。我需要做一个类似的形状,除了原点应该是白色(而不是黑色)来表示高值。这是我希望自己更聪明的时候之一,因为我不仅需要做出一个类似的整体形状,还需要以镜像的方式与第一个形状交互(我认为)。有时候,尝试和错误是你唯一的朋友。 + +结果是这样的;我使用了一个单独的脚本,因为在一个美国信件大小的页面上没有足够的空间同时容纳这两个图案。 + +![Second half of RGB cube][6] + +现在,是时候轮到打印机了!在这里,你可以直观了解彩色打印机如何处理 RGB 颜色到 CMYK 颜色的转换以及打印颜色密集空间。 + +接下来,朋友们,是剪切粘贴时间!我可以用胶带,但我不想改变表面的外观,所以我在切割的时候在两边留下了一些空间,这样我就可以把它们粘在里面了。根据我的经验,在复印纸上打印会产生一些不需要的皱纹,所以在我的复印纸原型完成后,我把立方体打印在了更厚的纸上,表面是哑光的。 + +![RGB cubes][7] + +请记住,这只是 RGB 空间边界的一个视图;更准确地说,你必须做出一个可以在中间切片的实心立方体。例如,这是一个实心 RGB 立方体在蓝色 = 120 的切片。 + +![RGB cube slice][8] + +最后,我做这个项目很开心。如果您也想参与其中,这里有两个脚本。 + +这是前半部分: + +```python +#!/usr/bin/env python +# black2rgb.py +""" +Creates one-half of RGB cube with Black at origin +""" + +import scribus + +x = 300 +y = 300 +r = 0 +g = 0 +b = 0 + +if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): +    while r < 256: +        while g < 256: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '0_0_0': +                newcolor = 'Black' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + g, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            g = g + 5 +        g = 0 +        r = r + 5 +        y = y - 5 +        +    r = 0 +    g = 0 +    y = 305 + +    while b < 256: +        while g < 256: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '0_0_0': +                newcolor = 'Black' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + g, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            g = g + 5 +        g = 0 +        b = b + 5 +        y = y + 5 +        +    r = 255 +    g = 0 +    y = 305 +    x = 39 +    b = 0 + +    while b < 256: +        while r >= 0: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '0_0_0': +                newcolor = 'Black' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            r = r - 5 +            x = x+5 +        b = b + 5 +        x = 39.5 +        r = 255 +        y = y + 5 +        +scribus.setRedraw(True) +scribus.redrawAll() +``` + +后半部分: + + +```python +#!/usr/bin/env python +# white2rgb.py +""" +Creates one-half of RGB cube with White at origin +""" + +import scribus + +x = 300 +y = 300 +r = 255 +g = 255 +b = 255 + +if scribus.newDoc(scribus.PAPER_LETTER, (0,0,0,0),scribus.PORTRAIT, 1, scribus.UNIT_POINTS, scribus.NOFACINGPAGES, scribus.FIRSTPAGERIGHT): +    while g >= 0: +        while r >= 0: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '255_255_255': +                newcolor = 'White' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + 255 - r, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            r = r - 5 +        r = 255 +        g = g - 5 +        y = y - 5 +        +    r = 255 +    g = 255 +    y = 305 + +    while b >= 0: +        while r >= 0: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '255_255_255': +                newcolor = 'White' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + 255 - r, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            r = r - 5 +        r = 255 +        b = b - 5 +        y = y + 5 +        +    r = 255 +    g = 0 +    y = 305 +    x = 39 +    b = 255 + +    while b >= 0: +        while g < 256: +            newcolor = str(r) + '_' + str(g) + '_' + str(b) +            if newcolor == '255_255_255': +                newcolor = 'White' +            scribus.defineColorRGB(newcolor,r, g, b) +            rect = scribus.createRect(x + g, y, 5, 5) +            scribus.setFillColor(newcolor, rect) +            scribus.setLineColor(newcolor, rect) +            g = g + 5 +        g = 0 +        b = b - 5 +        y = y + 5 +        +scribus.setRedraw(True) +scribus.redrawAll() +``` + +由于我创建了大量的颜色,所以当看到 Scribus 文件比我用它创建的 PDF 文件大得多的时候,我并不感到惊讶。例如,我的 Scribus SLA 文件是 3.0MB,而从中生成的 PDF 只有 70KB。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/7/rgb-cube-python-scribus + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[zianglei](https://github.com/zianglei) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ "cubes coming together to create a larger cube" +[2]: https://www.scribus.net/ +[3]: https://opensource.com/sites/default/files/ebooks/pythonscriptingwithscribus.pdf +[4]: https://opensource.com/sites/default/files/uploads/redgreengraph.png "Red-Green graph" +[5]: https://opensource.com/sites/default/files/uploads/rgbcubefirsthalf.png "First half of RGB cube" +[6]: https://opensource.com/sites/default/files/uploads/rgbcubesecondhalf.png "Second half of RGB cube" +[7]: https://opensource.com/sites/default/files/uploads/rgbcubecompositephoto.png "RGB cubes" +[8]: https://opensource.com/sites/default/files/uploads/rgbcubeslice.png "RGB cube slice" diff --git a/published/20191110 What is DevSecOps.md b/published/20191110 What is DevSecOps.md new file mode 100644 index 0000000000..dc55731146 --- /dev/null +++ b/published/20191110 What is DevSecOps.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (PandaWizard) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11102-1.html) +[#]: subject: (What is DevSecOps?) +[#]: via: (https://opensource.com/article/19/1/what-devsecops) +[#]: author: (Brett Hunoldt https://opensource.com/users/bretthunoldtcom) + +什么是 DevSecOps? +====== + +> DevSecOps 的实践之旅开始于 DevSecOps 增权、赋能和培养。下面就介绍如何开始学习使用 DevSecOps。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devop.png?itok=Yicb2nnZ) + +> Stephen Streichsbier 说过: DevSecOps 使得组织可以用 DevOps 的速度发布内在安全的软件。 + +DevSecOps 是一场关于 DevOps 概念实践或艺术形式的变革。为了更好理解 DevSecOps,你应该首先理解 DevOps 的含义。 + +DevOps 起源于通过合并开发和运维实践,消除隔离,统一关注点,提升团队和产品的效率和性能。它是一种注重于构建容易维护和易于平常自动运营的产品和服务的新型协作方式。 + +安全在很多团队中都是常见的隔离点。安全的核心关注点是保护团队,而有时这也意味着创建延缓新服务或是新产品发布的障碍或策略,用于保障任何事都能被很好的理解和安全的执行,并且没有给团队带来不必要的风险。 + +因为安全隔离点方面的明显特征和它可能带来的摩擦,开发和运维有时会避开安全要求以满足客观情况。在一些公司,这种隔离形成了一种产品安全完全是安全团队责任的期望,并取决于安全团队去寻找产品的安全缺陷或是可能带来的问题。 + +DevSecOps 看起来是通过给开发或是运维角色加强或是建立安全意识,或是在产品团队中引入一个安全工程师角色,在产品设计中找到安全问题,从而把安全要求汇聚在 Devops 中。 + +这样使得公司能更快发布和更新产品,并且充分相信安全已经嵌入产品中。 + +### 坚固的软件哪里适用 DevSecOps? + +建造坚固的软件是 DevOps 文化的一个层面而不是一个特别的实践,它完善和增强了 DevSecOps 实践。想想一款坚固的软件就像是某些经历过残酷战斗过程的事物。 + +有必要指出坚固的软件并不是 100% 安全可靠的(虽然它可能最终是在某些方面)。然而,它被设计成可以处理大部分被抛过来的问题。 + +践行坚固软件最重要的原则是促进竞争、实践、可控的失败与合作。 + +### 你该如何开始学习 DevSecOps ? + +开始实践 DevSecOps 涉及提升安全需求和在开发过程中尽可能早的阶段进行实践。它最终在公司文化上提升了安全的重要性,使得安全成为所有人的责任,而并不只是安全团队的责任。 + +你可能在团队中听说过“左上升shift left”这个词,如果你把开发周期线扁平化到一条横线上,以包括产品变革的的关键时期:从初始化到设计、建造、测试以及最终的运行,安全的目的就是尽早的参与进来。这使得风险可以在设计中能更好的评估、交流和减轻。“左提升”的含义是指促使安全能在开发周期线上更往左走。 + +这个过程始于三个关键要素: + + * 增权empowerment + * 赋能enablement + * 培养education + +增权,在我看来,是关于释放控制权以及使得团队(在理性分析下)做出独立决定而不用害怕失败或影响。这个过程的唯一告诫信息就是要严格的做出明智的决定(不要比这更低要求)。 + +为了实现增权,商务和行政支持(通过内部销售、展示来建立,通过建立矩阵来展示这项投资的回报)是打破历史障碍和割裂的团队的关键。合并安全人员到开发和运维团队中,提升交流和透明度有助于开始 DevSecOps 之旅。 + +这个整合和移动使得团队只关注单一的结果:打造一个他们共同负责的产品,让开发和安全人员相互依赖合作。这将引领你们共同走向增权。这是产品研发团队的共同责任,并保证每个可分割的产品都保持其安全性。 + +赋能涉及正确的使用掌握在团队手中的工具和资源。这是建立一种通过论坛、维基、信息聚合的知识分享文化。 + +打造一种注重自动化、重复任务应该编码来尽可能减少以后的操作并增强安全性的理念。这种场景不仅仅是提供知识,而是让这种知识能够通过多种渠道和媒介(通过某些工具)可获取,以便它可以被团队或是个人以他喜欢的方式去消化和分享。当团队成员正在编码时一种媒介可能工作的很好,而当他们在进行中时另一种可能更好。让工具简单可用,让团队用上它们。 + +不同的 DevSecOps 团队有不同的喜好,因此允许他们尽可能的保持独立。这是一个微妙的平衡工作,因为你确实希望实现规模经济和产品间共享的能力。在选择中协作和参与,并更新工具方法有助于减少使用中的障碍。 + +最后,也可能是最重要的,DevSecOps 是有关训练和兴趣打造。聚会、社交或是组织中通常的报告会都是让同事们教学和分享他们的知识的很棒的方式。有时,这些会突出其他人可能没有考虑过的共同挑战、顾虑或风险。分享和教学也是一种高效的学习和指导团队的方法。 + +在我个人经验中,每个团队的文化都是独一无二的,因此你不能用一种“普适”的方法。走进你的团队并找到他们想要使用的工具方法。尝试不同的论坛和聚会并找出最适用于你们文化的方式。寻找反馈并询问团队如何工作,他们喜欢什么以及对应的原因。适应和学习,保持乐观,不要停止尝试,你们将会有所收获。 + +- [下载 DevSecOps 的入门手册][1] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/1/what-devsecops + +作者:[Brett Hunoldt][a] +选题:[lujun9972][b] +译者:[PandaWizard](https://github.com/PandaWizard) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bretthunoldtcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/downloads/devsecops diff --git a/scripts/check/common.inc.sh b/scripts/check/common.inc.sh index 2bc0334930..905699a139 100644 --- a/scripts/check/common.inc.sh +++ b/scripts/check/common.inc.sh @@ -10,7 +10,7 @@ export TSL_DIR='translated' # 已翻译 export PUB_DIR='published' # 已发布 # 定义匹配规则 -export CATE_PATTERN='(talk|tech)' # 类别 +export CATE_PATTERN='(talk|tech|news)' # 类别 export FILE_PATTERN='[0-9]{8} [a-zA-Z0-9_.,() -]*\.md' # 文件名 # 获取用于匹配操作的正则表达式 diff --git a/sources/news/20190619 Codethink open sources part of onboarding process.md b/sources/news/20190619 Codethink open sources part of onboarding process.md new file mode 100644 index 0000000000..537ded948b --- /dev/null +++ b/sources/news/20190619 Codethink open sources part of onboarding process.md @@ -0,0 +1,42 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Codethink open sources part of onboarding process) +[#]: via: (https://opensource.com/article/19/6/codethink-onboarding-process) +[#]: author: (Laurence Urhegyi https://opensource.com/users/laurence-urhegyi) + +Codethink open sources part of onboarding process +====== +In other words, how to Git going in FOSS. +![Teacher or learner?][1] + +Here at [Codethink][2], we’ve recently focused our energy into enhancing the onboarding process we use for all new starters at the company. As we grow steadily in size, it’s important that we have a well-defined approach to both welcoming new employees into the company, and introducing them to the organization’s culture. + +As part of this overall onboarding effort, we’ve created [_How to Git going in FOSS_][3]: an introductory guide to the world of free and open source software (FOSS), and some of the common technologies, practices, and principles associated with free and open source software. + +This guide was initially aimed at work experience students and summer interns. However, the document is in fact equally applicable to anyone who is new to free and open source software, no matter their prior experience in software or IT in general. _How to Git going in FOSS_ is hosted on GitLab and consists of several repositories, each designed to be a self-guided walk through. + +Our guide begins with a general introduction to FOSS, including explanations of the history of GNU/Linux, how to use [Git][4] (as well as Git hosting services such as GitLab), and how to use a text editor. The document then moves on to exercises that show the reader how to implement some of the things they’ve just learned. + +_How to Git going in FOSS_ is fully public and available for anyone to try. If you’re new to FOSS or know someone who is, then please have a read-through, and see what you think. If you have any feedback, feel free to raise an issue on GitLab. And, of course, we also welcome contributions. We’re keen to keep improving the guide however possible. One future improvement we plan to make is an additional exercise that is more complex than the existing two, such as potentially introducing the reader to [Continuous Integration][5]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/codethink-onboarding-process + +作者:[Laurence Urhegyi][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/laurence-urhegyi +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://www.codethink.co.uk/about.html +[3]: https://gitlab.com/ct-starter-guide +[4]: https://git-scm.com +[5]: https://en.wikipedia.org/wiki/Continuous_integration diff --git a/sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md b/sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md new file mode 100644 index 0000000000..af595d310b --- /dev/null +++ b/sources/news/20190622 Cloudflare-s random number generator, robotics data visualization, npm token scanning, and more news.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cloudflare's random number generator, robotics data visualization, npm token scanning, and more news) +[#]: via: (https://opensource.com/article/19/6/news-june-22) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Cloudflare's random number generator, robotics data visualization, npm token scanning, and more 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 Cloudflare's open source random number generator, more open source robotics data, new npm functionality, and more! + +### Cloudflare announces open source random number generator project + +Is there such a thing as a truly random number? Internet security and services provider Cloudflare things so. To prove it, the company has formed [The League of Entropy][2], an open source project to create a generator for random numbers. + +The League consists of Cloudflare and "five other organisations — predominantly universities and security companies." They share random numbers, using an open source tool called [Drand][3] (short for Distributed Randomness Beacon Daemon). The numbers are then "composited into one random number" on the basis that "several random numbers are more random than one random number." While the League's random number generator isn't intended "for any kind of password or cryptographic seed generation," Cloudflare's CEO Matthew Prince points out that if "you need a way of having a known random source, this is a really valuable tool." + +### Cruise open sources robotics data analysis tool + +Projects involved in creating self-driving vehicles generate petabytes of data. And with amounts of data that large comes the challenge of quickly and effectively analyzing it. To make the task easier, General Motors subsidiary Cruise has made its Webviz data visualization tool "[freely available to developers][4] in need of a modular robotics analysis solution." + +Webviz "takes as input any bag file (the message format used by the popular Robot Operating System) and outputs charts and graphs." It "contains a collection of general panels (which visualize data) applicable to most robotics developers," said Esther Weon, a software engineer at Cruise. The company also plans to "release a public API that’ll allow developers to build custom panels themselves." + +The code for Webviz is [available on GitHub][5], where you can download or contribute to the project. + +### npm provides more security + +The team behind npm, the site providing JavaScript package hosting, has a new collaboration with GitHub to automatically scan for exposed tokens that could give hackers access that doesn't belong to them. The project includes a handy automatic revoke of leaked credentials them if are still valid. This could drastically reduce vulnerabilities in the JavaScript community. For instructions on how to participate, see the [original article][6]. + +Note that this news was found via the [Changelog news][7]. + +### Better end of life tracking via open source + +A new project, [endoflife.date][8], aims to overcome the complexity of end of life (EOL) announcements for software. It's part tracker, part public announcement on what good documentation looks like for software. As the README states: "The reason this site exists is because this information is very often hidden away. If you're releasing something on a regular basis: + + 1. List only supported releases. + 2. Give EoL dates/policy if possible. + 3. Hide unsupported releases behind a few extra clicks. + 4. Mention security/active release difference if needed." + + + +Check out the [source code][9] for more information. + +### In other news + + * [Medicine needs to embrace open source][10] + * [Using geospatial data to create safer roads][11] + * [Embracing open source could be a big competitive advantage for businesses][12] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/news-june-22 + +作者:[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://thenextweb.com/dd/2019/06/17/cloudflares-new-open-source-project-helps-anyone-obtain-truly-random-numbers/ +[3]: https://github.com/dedis/drand +[4]: https://venturebeat.com/2019/06/18/cruise-open-sources-webview-a-tool-for-robotics-data-analysis/ +[5]: https://github.com/cruise-automation/webviz +[6]: https://blog.npmjs.org/post/185680936500/protecting-package-publishers-npm-token-security +[7]: https://changelog.com/news/npm-token-scanning-extending-to-github-NAoe +[8]: https://endoflife.date/ +[9]: https://github.com/captn3m0/endoflife.date +[10]: https://www.zdnet.com/article/medicine-needs-to-embrace-open-source/ +[11]: https://itbrief.co.nz/story/using-geospatial-data-to-create-safer-roads +[12]: https://www.fastcompany.com/90364152/embracing-open-source-could-be-a-big-competitive-advantage-for-businesses diff --git a/sources/news/20190714 Excellent- Ubuntu LTS Users Will Now Get the Latest Nvidia Driver Updates -No PPA Needed Anymore.md b/sources/news/20190714 Excellent- Ubuntu LTS Users Will Now Get the Latest Nvidia Driver Updates -No PPA Needed Anymore.md new file mode 100644 index 0000000000..246ab1160d --- /dev/null +++ b/sources/news/20190714 Excellent- Ubuntu LTS Users Will Now Get the Latest Nvidia Driver Updates -No PPA Needed Anymore.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Excellent! Ubuntu LTS Users Will Now Get the Latest Nvidia Driver Updates [No PPA Needed Anymore]) +[#]: via: (https://itsfoss.com/ubuntu-lts-latest-nvidia-drivers/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Excellent! Ubuntu LTS Users Will Now Get the Latest Nvidia Driver Updates [No PPA Needed Anymore] +====== + +_**Brief: To get the latest Nvidia drivers in Ubuntu LTS versions, you don’t have to use PPA anymore. The latest drivers will now be available in the repositories of the Ubuntu LTS versions.**_ + +![][1] + +You might be aware of the troubles to install the latest and greatest Nvidia binary driver updates on Ubuntu. + +By default, Ubuntu provides the open source [Nvidia Nouveau drivers][2] that some time result in Ubuntu being stuck at boot screen. + +You can also [install the proprietary Nvidia driver in Ubuntu][3] easily. The problem is that the Nvidia drivers in the default [Ubuntu repositories][4] are not the latest one. To solve this problem, [Ubuntu introduced a dedicated PPA][5] a few years back. + +[Using the official PPA][6] is still a decent workaround for installing the closed source graphics driver. However, it is definitely not the most convenient option. + +But, now, Ubuntu agreed to include the latest Nvidia driver update as part of the SRU ([StableReleaseUpdates][7]). So, you will have Nvidia drivers baked in with Ubuntu LTS versions. + +Well, this means that you no longer have to separately download/install the Nvidia graphics drivers on Ubuntu LTS versions. + +Just like you get an update for your browser or the core OS updates (or the security updates), similarly, you will get the required Nvidia binary driver update packages. + +### Can We Rely on the Latest Nvidia Graphics Driver? + +SRU literally refers to stable updates for Ubuntu (or Ubuntu-based distros). So, instead of opting for the pre-released updates in order to get the latest graphics driver, you should wait for it to drop as a stable update. + +Of course, no one can guarantee that it will work 100% of the time – but it will be way more safe to install than the pre-released ones. + +### How Can I Get the latest Nvidia drivers? + +![Software Updates Nvidia][8] + +You just have to enable “Using NVIDIA driver meta package….” from the additional drivers section in the software update option. + +[][9] + +Suggested read  Ubuntu 17.04 Release Date, Features And Upgrade Procedure + +Originally, [The Linux Experiment][10] shared this news through a video – which then Ubuntu’s official Twitter handle re-tweeted as an announcement. You can watch the video below to get more details on it: + +### Which Ubuntu LTS Versions are Supported? + +For now, Ubuntu 18.04 LTS supports this out of the box. It will soon be available for Ubuntu 16.04 LTS (and later LTS versions will follow). + +**Wrapping Up** + +Now that you can install the latest Nvidia binary driver updates, how do you think will it help you? + +If you have tested a pre-released package, let us know your thoughts on that in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-lts-latest-nvidia-drivers/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2019/07/nvidia-ubuntu-logo.png?resize=800%2C450&ssl=1 +[2]: https://nouveau.freedesktop.org/wiki/ +[3]: https://itsfoss.com/install-additional-drivers-ubuntu/ +[4]: https://itsfoss.com/ubuntu-repositories/ +[5]: https://itsfoss.com/ubuntu-official-ppa-graphics/ +[6]: https://itsfoss.com/ppa-guide/ +[7]: https://wiki.ubuntu.com/StableReleaseUpdates +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/07/software-updates-nvidia.jpg?fit=800%2C542&ssl=1 +[9]: https://itsfoss.com/ubuntu-17-04-release-features/ +[10]: https://twitter.com/thelinuxEXP diff --git a/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md b/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md new file mode 100644 index 0000000000..61a4c4993c --- /dev/null +++ b/sources/talk/20170320 An Ubuntu User-s Review Of Dell XPS 13 Ubuntu Edition.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Ubuntu User’s Review Of Dell XPS 13 Ubuntu Edition) +[#]: via: (https://itsfoss.com/dell-xps-13-ubuntu-review) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +An Ubuntu User’s Review Of Dell XPS 13 Ubuntu Edition +====== + +_**Brief: Sharing my feel and experience about Dell XPS 13 Kaby Lake Ubuntu edition after using it for over three months.**_ + +During Black Friday sale last year, I took the bullet and ordered myself a [Dell XPS 13][1] with the new [Intel Kaby Lake processor][2]. It got delivered in the second week of December and if you [follow It’s FOSS on Facebook][3], you might have seen the [live unboxing][4]. + +Though I was tempted to do the review of Dell XPS 13 Ubuntu edition almost at the same time, I knew it won’t be fair. A brand new system will, of course, feel good and work smooth. + +But that’s not the real experience. The real experience of any system comes after weeks, if not months, of use. That’s the reason I hold myself back and waited three months to review Dell XPS Kobylake Ubuntu edition. + +### Dell XPS 13 Ubuntu Edition Review + +Before we saw what’s hot and what’s not in the latest version of Dell XPS 13, I should tell you that I was using an Acer R13 ultrabook book before this. So I may compare the new Dell system with the older Acer one. + +![Dell XPS 13 Ubuntu Edition System Settings][5]![Dell XPS 13 Ubuntu Edition System Settings][5] + +Dell XPS 13 has several versions based on processor. The one I am reviewing is Dell XPS13 MLK (9360). It has i5-7200U 7th generation processor. Since I hardly used the touch screen in Acer Aspire R13, I chose to go with the non-touch version of XPS. This decision also saved me a couple of hundreds of Euro. + +It has 8 GB of LPDDR3 1866MHz RAM and 256 GB SSD PCIe. Graphics is Intel HD. On connectivity side, it’s got Killer 1535 Wi-Fi 802.11ac 2×2 and Bluetooth 4.1. Screen is InfinityEdge Full HD (1 920 x 1080). + +Now, you know what kind of hardware we’ve got here, let’s see what works and what sucks. + +#### Look and feel + +![Dell XPS 13 Kaby Lake Ubuntu Edition][6]![Dell XPS 13 Kaby Lake Ubuntu Edition][6] + +At 13.3″, Dell XPS 13 looks even smaller than a regular 13.3″ laptop, thanks to its non-existent bezel which is the specialty of the infinite display. It is light as a feather with weight just under 1.23 Kg. + +The outer surface is metallic, not very shiny but a decent aluminum look. On the interior, the palm rest is made of carbon fiber which is very comfortable at the rest. Unlike the MacBook Air that uses metallic palm rests, the carbon fiber ones are more friendly, especially in winters. + +It is almost centimeter and a half high at it’s thickest part (around hinges). This also adds a plus point to the elegance of XPS 13. + +Overall, Dell XPS 13 has a compact body and an elegant body. + +#### Keyboard and touchpad + +The keyboard and touchpad mix well with the carbon fiber interiors. The keys are smooth with springs in the back (perhaps) and give a rich feel while typing. All of the important keys are present and are not tiny in size, something you might be worried of, considering the overall tiny size of XPS13. + +Oh! the keyboards have backlit support. Which adds to the rich feel of this expensive laptop. + +While the keyboard is a great experience, the same cannot be said about the touchpad. In fact, the touchpad is the weakest part which mars the overall good experience of XPS 13. + +The touchpad has a cheap feeling because it makes an irritating sound while tapping on the right side as if it’s hollow underneath. This is [something that has been noticed in the earlier versions of XPS 13][7] but hasn’t been given enough consideration to fix it. This is something you do not expect from a product at such a price. + +Also, the touchpad scroll on websites is hideous. It is also not suitable for pixel works because of difficulty in moving little adjustments. + +#### Ports + +Dell XPS 13 has two USB 3.0 ports, one of them with PowerShare. If you did not know, [USB 3.0 PowerShare][8] ports allow you to charge external devices even when your system is turned off. + +![Dell XPS 13 Kaby Lake Ubuntu edition ports][9]![Dell XPS 13 Kaby Lake Ubuntu edition ports][9] + +It also has a [Thunderbolt][10] (doubles up as [USB Type-C port][11]). It doesn’t have HDMI port, Ethernet port or VGA port. However, all of these three can be used via the Thunderbolt port and external adapters (sold separately). + +![Dell XPS 13 Kaby Lake Ubuntu edition ports][12]![Dell XPS 13 Kaby Lake Ubuntu edition ports][12] + +It also has an SD card reader and a headphone jack. In addition to all these, there is an [anti-theft slot][13] (a common security practice in enterprises). + +#### Display + +The model I have packs 1920x1080px. It’s full HD and display quality is at par. It perfectly displays the high definition pictures and 1080p video files. + +I cannot compare it with the [qHD model][14] as I never used it. But considering that there are not enough 4K contents for now, full HD display should be sufficient for next few years. + +#### Sound + +Compared to Acer R13, XPS 13 has better audio quality. Even the max volume is louder than that of Acer R13. The dual speakers give a nice stereo effect. + +#### Webcam + +The weirdest part of Dell XPS 13 review comes now. We all have been accustomed of seeing the webcam at the top-middle position on any laptop. But this is not the case here. + +XPS 13 puts the webcam on the bottom left corner of the laptop. This is done to keep the bezel as thin as possible. But this creates a problem. + +![Image captured with laptop screen at 90 degree][15] + +When you video chat with someone, it is natural to look straight up. With the top-middle webcam, your face is in direct line with the camera. But with the bottom left position of web cam, it looks like those weird accidental selfies you take with the front camera of your smartphone. Heck, people on the other side might see inside of your nostrils. + +#### Battery + +Battery life is the strongest point of Dell XPS 13. While Dell claims an astounding 21-hour battery life, but in my experience, it smoothly gives a battery life of 8-10 hours. This is when I watch movies, browse the internet and other regular stuff. + +There is one strange thing that I noticed, though. It charges pretty quick until 90% but the charging slows down afterward. And it almost never goes beyond 98%. + +The battery indicator turns red when the battery status falls below 30% and it starts displaying notifications if the battery goes below 10%. There is small light indicator under the touchpad that turns yellow when the battery is low and it turns white when the charger is plugged in. + +#### Overheating + +I have previously written about ways to [reduce laptop overheating in Linux][16]. Thankfully, so far, I didn’t need to employ those tricks. + +Dell XPS 13 remains surprisingly cool when you are using it on battery, even in long runs. The bottom does get heated a little when you use it while charging. + +Overall, XPS 13 manages overheating very well. + +#### The Ubuntu experience with Dell XPS 13 + +So far we have seen pretty generic things about the Dell XPS 13. Let’s talk about how good a Linux laptop it is. + +Until now, I used to manually [install Linux on Windows laptop][17]. This is the first Linux laptop I ever bought. I would also like to mention the awesome first boot animation of Dell’s Ubuntu laptop. Here’s a YouTube video of the same: + +One thing I would like to mention here is that Dell never displays Ubuntu laptops on its website. You’ll have to search the website with Ubuntu then you’ll see the Ubuntu editions. Also, Ubuntu edition is cheaper just by 50 Euro in comparison to its Windows counterpart whereas I was expecting it to be at least 100 Euro less than that of Windows. + +Despite being an Ubuntu preloaded laptop, the super key still comes with Windows logo on it. It’s trivial but I would have loved to see the Ubuntu logo on it. + +Now talking about Ubuntu experience, the first thing I noticed was that there was no hardware issue. Even the function and media keys work perfectly in Ubuntu, which is a pleasant surprise. + +Dell has also added its own repository in the software sources to provide for some Dell specific tools. You can see the footprints of Dell in the entire system. + +You might be interested to see how Dell partitioned the 256Gb of disk space. Let me show that to you. + +![Default disk partition by Dell][18] + +As you can see, there is 524MB reserved for [EFI][19]. Then there is 3.2 GB of factory restore image perhaps. + +Dell is using 17Gb of Swap partition, which is more than double of the RAM size. It seems Dell didn’t put enough thought here because this is simply waste of disk space, in my opinion. I would have used not [more than 11 GB of Swap partition][20] here. + +As I mentioned before, Dell adds a “restore to factory settings” option in the Grub menu. This is a nice little feature to have. + +One thing which I don’t like in the XPS 13 Ubuntu edition is the long boot time. It takes entire 23 seconds to reach the login screen after pressing the power button. I would expect it to be faster considering that it uses SSD PCIe. + +If it interests you, the XPS 13 had Chromium and Google Chrome browsers installed by default instead of Firefox. + +As far my experience goes, I am fairly impressed with Dell XPS 13 Ubuntu edition. It gives a smooth Ubuntu experience. The laptop seems to be a part of Ubuntu. Though it is an expensive laptop, I would say it is definitely worth the money. + +To summarize, let’s see the good, the bad and the ugly of Dell XPS 13 Ubuntu edition. + +#### The Good + + * Ultralight weight + * Compact + * Keyboard + * Carbon fiber palm rest + * Full hardware support for Ubuntu + * Factory restore option for Ubuntu + * Nice display and sound quality + * Good battery life + + + +#### The bad + + * Poor touchpad + * A little pricey + * Long boot time for SSD powered laptop + * Windows key still present :P + + + +#### The ugly + + * Weird webcam placement + + + +How did you like the **Dell XPS 13 Ubuntu edition review** from an Ubuntu user’s point of view? Do you find it good enough to spend over a thousand bucks? Do share your views in the comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dell-xps-13-ubuntu-review + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://amzn.to/2ImVkCV +[2]: http://www.techradar.com/news/computing-components/processors/kaby-lake-intel-core-processor-7th-gen-cpu-news-rumors-and-release-date-1325782 +[3]: https://www.facebook.com/itsfoss/ +[4]: https://www.facebook.com/itsfoss/videos/810293905778045/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/Dell-XPS-13-Ubuntu-Edition-spec.jpg?resize=540%2C337&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-Ubuntu-review.jpeg?resize=800%2C600&ssl=1 +[7]: https://www.youtube.com/watch?v=Yt5SkI0c3lM +[8]: http://www.dell.com/support/article/fr/fr/frbsdt1/SLN155147/usb-powershare-feature?lang=EN +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-Ubuntu-XPS-13-Kaby-Lake-ports-1.jpg?resize=800%2C435&ssl=1 +[10]: https://en.wikipedia.org/wiki/Thunderbolt_(interface) +[11]: https://en.wikipedia.org/wiki/USB-C +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-Ubuntu-XPS-13-Kaby-Lake-ports-2.jpg?resize=800%2C325&ssl=1 +[13]: http://accessories.euro.dell.com/sna/productdetail.aspx?c=ie&l=en&s=dhs&cs=iedhs1&sku=461-10169 +[14]: https://recombu.com/mobile/article/quad-hd-vs-qhd-vs-4k-ultra-hd-what-does-it-all-mean_M20472.html +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-webcam-issue.jpg?resize=800%2C450&ssl=1 +[16]: https://itsfoss.com/reduce-overheating-laptops-linux/ +[17]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/03/Dell-XPS-13-Ubuntu-Edition-disk-partition.jpeg?resize=800%2C448&ssl=1 +[19]: https://en.wikipedia.org/wiki/EFI_system_partition +[20]: https://itsfoss.com/swap-size/ diff --git a/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md new file mode 100644 index 0000000000..923d4618a9 --- /dev/null +++ b/sources/talk/20170717 The Ultimate Guide to JavaScript Fatigue- Realities of our industry.md @@ -0,0 +1,221 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Ultimate Guide to JavaScript Fatigue: Realities of our industry) +[#]: via: (https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html) +[#]: author: (Lucas Fernandes Da Costa https://lucasfcosta.com) + +The Ultimate Guide to JavaScript Fatigue: Realities of our industry +====== + +**Complaining about JS Fatigue is just like complaining about the fact that humanity has created too many tools to solve the problems we have** , from email to airplanes and spaceships. + +Last week I’ve done a talk about this very same subject at the NebraskaJS 2017 Conference and I got so many positive feedbacks that I just thought this talk should also become a blog post in order to reach more people and help them deal with JS Fatigue and understand the realities of our industry. **My goal with this post is to change the way you think about software engineering in general and help you in any areas you might work on**. + +One of the things that has inspired me to write this blog post and that totally changed my life is [this great post by Patrick McKenzie, called “Don’t Call Yourself a Programmer and other Career Advice”][1]. **I highly recommend you read that**. Most of this blog post is advice based on what Patrick has written in that post applied to the JavaScript ecosystem and with a few more thoughts I’ve developed during these last years working in the tech industry. + +This first section is gonna be a bit philosophical, but I swear it will be worth reading. + +### Realities of Our Industry 101 + +Just like Patrick has done in [his post][1], let’s start with the most basic and essential truth about our industry: + +Software solves business problems + +This is it. **Software does not exist to please us as programmers** and let us write beautiful code. Neither it exists to create jobs for people in the tech industry. **Actually, it exists to kill as many jobs as possible, including ours** , and this is why basic income will become much more important in the next few years, but that’s a whole other subject. + +I’m sorry to say that, but the reason things are that way is that there are only two things that matter in the software engineering (and any other industries): + +**Cost versus Revenue** + +**The more you decrease cost and increase revenue, the more valuable you are** , and one of the most common ways of decreasing cost and increasing revenue is replacing human beings by machines, which are more effective and usually cost less in the long run. + +You are not paid to write code + +**Technology is not a goal.** Nobody cares about which programming language you are using, nobody cares about which frameworks your team has chosen, nobody cares about how elegant your data structures are and nobody cares about how good is your code. **The only thing that somebody cares about is how much does your software cost and how much revenue it generates**. + +Writing beautiful code does not matter to your clients. We write beautiful code because it makes us more productive in the long run and this decreases cost and increases revenue. + +The whole reason why we try not to write bugs is not that we value correctness, but that **our clients** value correctness. If you have ever seen a bug becoming a feature you know what I’m talking about. That bug exists but it should not be fixed. That happens because our goal is not to fix bugs, our goal is to generate revenue. If our bugs make clients happy then they increase revenue and therefore we are accomplishing our goals. + +Reusable space rockets, self-driving cars, robots, artificial intelligence: these things do not exist just because someone thought it would be cool to create them. They exist because there are business interests behind them. And I’m not saying the people behind them just want money, I’m sure they think that stuff is also cool, but the truth is that if they were not economically viable or had any potential to become so, they would not exist. + +Probably I should not even call this section “Realities of Our Industry 101”, maybe I should just call it “Realities of Capitalism 101”. + +And given that our only goal is to increase revenue and decrease cost, I think we as programmers should be paying more attention to requirements and design and start thinking with our minds and participating more actively in business decisions, which is why it is extremely important to know the problem domain we are working on. How many times before have you found yourself trying to think about what should happen in certain edge cases that have not been thought before by your managers or business people? + +In 1975, Boehm has done a research in which he found out that about 64% of all errors in the software he was studying were caused by design, while only 36% of all errors were coding errors. Another study called [“Higher Order Software—A Methodology for Defining Software”][2] also states that **in the NASA Apollo project, about 73% of all errors were design errors**. + +The whole reason why Design and Requirements exist is that they define what problems we’re going to solve and solving problems is what generates revenue. + +> Without requirements or design, programming is the art of adding bugs to an empty text file. +> +> * Louis Srygley +> + + +This same principle also applies to the tools we’ve got available in the JavaScript ecosystem. Babel, webpack, react, Redux, Mocha, Chai, Typescript, all of them exist to solve a problem and we gotta understand which problem they are trying to solve, we need to think carefully about when most of them are needed, otherwise, we will end up having JS Fatigue because: + +JS Fatigue happens when people use tools they don't need to solve problems they don't have. + +As Donald Knuth once said: “Premature optimization is the root of all evil”. Remember that software only exists to solve business problems and most software out there is just boring, it does not have any high scalability or high-performance constraints. Focus on solving business problems, focus on decreasing cost and generating revenue because this is all that matters. Optimize when you need, otherwise you will probably be adding unnecessary complexity to your software, which increases cost, and not generating enough revenue to justify that. + +This is why I think we should apply [Test Driven Development][3] principles to everything we do in our job. And by saying this I’m not just talking about testing. **I’m talking about waiting for problems to appear before solving them. This is what TDD is all about**. As Kent Beck himself says: “TDD reduces fear” because it guides your steps and allows you take small steps towards solving your problems. One problem at a time. By doing the same thing when it comes to deciding when to adopt new technologies then we will also reduce fear. + +Solving one problem at a time also decreases [Analysis Paralysis][4], which is basically what happens when you open Netflix and spend three hours concerned about making the optimal choice instead of actually watching something. By solving one problem at a time we reduce the scope of our decisions and by reducing the scope of our decisions we have fewer choices to make and by having fewer choices to make we decrease Analysis Paralysis. + +Have you ever thought about how easier it was to decide what you were going to watch when there were only a few TV channels available? Or how easier it was to decide which game you were going to play when you had only a few cartridges at home? + +### But what about JavaScript? + +By the time I’m writing this post NPM has 489,989 packages and tomorrow approximately 515 new ones are going to be published. + +And the packages we use and complain about have a history behind them we must comprehend in order to understand why we need them. **They are all trying to solve problems.** + +Babel, Dart, CoffeeScript and other transpilers come from our necessity of writing code other than JavaScript but making it runnable in our browsers. Babel even lets us write new generation JavaScript and make sure it will work even on older browsers, which has always been a great problem given the inconsistencies and different amount of compliance to the ECMA Specification between browsers. Even though the ECMA spec is becoming more and more solid these days, we still need Babel. And if you want to read more about Babel’s history I highly recommend that you read [this excellent post by Henry Zhu][5]. + +Module bundlers such as Webpack and Browserify also have their reason to exist. If you remember well, not so long ago we used to suffer a lot with lots of `script` tags and making them work together. They used to pollute the global namespace and it was reasonably hard to make them work together when one depended on the other. In order to solve this [`Require.js`][6] was created, but it still had its problems, it was not that straightforward and its syntax also made it prone to other problems, as you can see [in this blog post][7]. Then Node.js came with `CommonJS` imports, which were synchronous, simple and clean, but we still needed a way to make that work on our browsers and this is why we needed Webpack and Browserify. + +And Webpack itself actually solves more problems than that by allowing us to deal with CSS, images and many other resources as if they were JavaScript dependencies. + +Front-end frameworks are a bit more complicated, but the reason why they exist is to reduce the cognitive load when we write code so that we don’t need to worry about manipulating the DOM ourselves or even dealing with messy browser APIs (another problem JQuery came to solve), which is not only error prone but also not productive. + +This is what we have been doing this whole time in computer science. We use low-level abstractions and build even more abstractions on top of it. The more we worry about describing how our software should work instead of making it work, the more productive we are. + +But all those tools have something in common: **they exist because the web platform moves too fast**. Nowadays we’re using web technology everywhere: in web browsers, in desktop applications, in phone applications or even in watch applications. + +This evolution also creates problems we need to solve. PWAs, for example, do not exist only because they’re cool and we programmers have fun writing them. Remember the first section of this post: **PWAs exist because they create business value**. + +And usually standards are not fast enough to be created and therefore we need to create our own solutions to these things, which is why it is great to have such a vibrant and creative community with us. We’re solving problems all the time and **we are allowing natural selection to do its job**. + +The tools that suit us better thrive, get more contributors and develop themselves more quickly and sometimes other tools end up incorporating the good ideas from the ones that thrive and becoming even more popular than them. This is how we evolve. + +By having more tools we also have more choices. If you remember the UNIX philosophy well, it states that we should aim at creating programs that do one thing and do it well. + +We can clearly see this happening in the JS testing environment, for example, where we have Mocha for running tests and Chai for doing assertions, while in Java JUnit tries to do all these things. This means that if we have a problem with one of them or if we find another one that suits us better, we can simply replace that small part and still have the advantages of the other ones. + +The UNIX philosophy also states that we should write programs that work together. And this is exactly what we are doing! Take a look at Babel, Webpack and React, for example. They work very well together but we still do not need one to use the other. In the testing environment, for example, if we’re using Mocha and Chai all of a sudden we can just install Karma and run those same tests in multiple environments. + +### How to Deal With It + +My first advice for anyone suffering from JS Fatigue would definitely be to stay aware that **you don’t need to know everything**. Trying to learn it all at once, even when we don’t have to do so, only increases the feeling of fatigue. Go deep in areas that you love and for which you feel an inner motivation to study and adopt a lazy approach when it comes to the other ones. I’m not saying that you should be lazy, I’m just saying that you can learn those only when needed. Whenever you face a problem that requires you to use a certain technology to solve it, go learn. + +Another important thing to say is that **you should start from the beginning**. Make sure you have learned enough about JavaScript itself before using any JavaScript frameworks. This is the only way you will be able to understand them and bend them to your will, otherwise, whenever you face an error you have never seen before you won’t know which steps to take in order to solve it. Learning core web technologies such as CSS, HTML5, JavaScript and also computer science fundamentals or even how the HTTP protocol works will help you master any other technologies a lot more quickly. + +But please, don’t get too attached to that. Sometimes you gotta risk yourself and start doing things on your own. As Sacha Greif has written in [this blog post][8], spending too much time learning the fundamentals is just like trying to learn how to swim by studying fluid dynamics. Sometimes you just gotta jump into the pool and try to swim by yourself. + +And please, don’t get too attached to a single technology. All of the things we have available nowadays have already been invented in the past. Of course, they have different features and a brand new name, but, in their essence, they are all the same. + +If you look at NPM, it is nothing new, we already had Maven Central and Ruby Gems quite a long time ago. + +In order to transpile your code, Babel applies the very same principles and theory as some of the oldest and most well-known compilers, such as the GCC. + +Even JSX is not a new idea. It E4X (ECMAScript for XML) already existed more than 10 years ago. + +Now you might ask: “what about Gulp, Grunt and NPM Scripts?” Well, I’m sorry but we can solve all those problems with GNU Make in 1976. And actually, there are a reasonable number of JavaScript projects that still use it, such as Chai.js, for example. But we do not do that because we are hipsters that like vintage stuff. We use `make` because it solves our problems, and this is what you should aim at doing, as we’ve talked before. + +If you really want to understand a certain technology and be able to solve any problems you might face, please, dig deep. One of the most decisive factors to success is curiosity, so **dig deep into the technologies you like**. Try to understand them from bottom-up and whenever you think something is just “magic”, debunk that myth by exploring the codebase by yourself. + +In my opinion, there is no better quote than this one by Richard Feinman, when it comes to really learning something: + +> What I cannot create, I do not understand + +And just below this phrase, [in the same blackboard, Richard also wrote][9]: + +> Know how to solve every problem that has been solved + +Isn’t this just amazing? + +When Richard said that, he was talking about being able to take any theoretical result and re-derive it, but I think the exact same principle can be applied to software engineering. The tools that solve our problems have already been invented, they already exist, so we should be able to get to them all by ourselves. + +This is the very reason I love [some of the videos available in Egghead.io][10] in which Dan Abramov explains how to implement certain features that exist in Redux from scratch or [blog posts that teach you how to build your own JSX renderer][11]. + +So why not trying to implement these things by yourself or going to GitHub and reading their codebase in order to understand how they work? I’m sure you will find a lot of useful knowledge out there. Comments and tutorials might lie and be incorrect sometimes, the code cannot. + +Another thing that we have been talking a lot in this post is that **you should not get ahead of yourself**. Follow a TDD approach and solve one problem at a time. You are paid to increase revenue and decrease cost and you do this by solving problems, this is the reason why software exists. + +And since we love comparing our role to the ones related to civil engineering, let’s do a quick comparison between software development and civil engineering, just as [Sam Newman does in his brilliant book called “Building Microservices”][12]. + +We love calling ourselves “engineers” or “architects”, but is that term really correct? We have been developing software for what we know as computers less than a hundred years ago, while the Colosseum, for example, exists for about two thousand years. + +When was the last time you’ve seen a bridge falling and when was the last time your telephone or your browser crashed? + +In order to explain this, I’ll use an example I love. + +This is the beautiful and awesome city of Barcelona: + +![The City of Barcelona][13] + +When we look at it this way and from this distance, it just looks like any other city in the world, but when we look at it from above, this is how Barcelona looks: + +![Barcelona from above][14] + +As you can see, every block has the same size and all of them are very organized. If you’ve ever been to Barcelona you will also know how good it is to move through the city and how well it works. + +But the people that planned Barcelona could not predict what it was going to look like in the next two or three hundred years. In cities, people come in and people move through it all the time so what they had to do was make it grow organically and adapt as the time goes by. They had to be prepared for changes. + +This very same thing happens to our software. It evolves quickly, refactors are often needed and requirements change more frequently than we would like them to. + +So, instead of acting like a Software Engineer, act as a Town Planner. Let your software grow organically and adapt as needed. Solve problems as they come by but make sure everything still has its place. + +Doing this when it comes to software is even easier than doing this in cities due to the fact that **software is flexible, civil engineering is not**. **In the software world, our build time is compile time**. In Barcelona we cannot simply destroy buildings to give space to new ones, in Software we can do that a lot easier. We can break things all the time, we can make experiments because we can build as many times as we want and it usually takes seconds and we spend a lot more time thinking than building. Our job is purely intellectual. + +So **act like a town planner, let your software grow and adapt as needed**. + +By doing this you will also have better abstractions and know when it’s the right time to adopt them. + +As Sam Koblenski says: + +> Abstractions only work well in the right context, and the right context develops as the system develops. + +Nowadays something I see very often is people looking for boilerplates when they’re trying to learn a new technology, but, in my opinion, **you should avoid boilerplates when you’re starting out**. Of course boilerplates and generators are useful if you are already experienced, but they take a lot of control out of your hands and therefore you won’t learn how to set up a project and you won’t understand exactly where each piece of the software you are using fits. + +When you feel like you are struggling more than necessary to get something simple done, it might be the right time for you to look for an easier way to do this. In our role **you should strive to be lazy** , you should work to not work. By doing that you have more free time to do other things and this decreases cost and increases revenue, so that’s another way of accomplishing your goal. You should not only work harder, you should work smarter. + +Probably someone has already had the same problem as you’re having right now, but if nobody did it might be your time to shine and build your own solution and help other people. + +But sometimes you will not be able to realize you could be more effective in your tasks until you see someone doing them better. This is why it is so important to **talk to people**. + +By talking to people you share experiences that help each other’s careers and we discover new tools to improve our workflow and, even more important than that, learn how they solve their problems. This is why I like reading blog posts in which companies explain how they solve their problems. + +Especially in our area we like to think that Google and StackOverflow can answer all our questions, but we still need to know which questions to ask. I’m sure you have already had a problem you could not find a solution for because you didn’t know exactly what was happening and therefore didn’t know what was the right question to ask. + +But if I needed to sum this whole post in a single advice, it would be: + +Solve problems. + +Software is not a magic box, software is not poetry (unfortunately). It exists to solve problems and improves peoples’ lives. Software exists to push the world forward. + +**Now it’s your time to go out there and solve problems**. + + +-------------------------------------------------------------------------------- + +via: https://lucasfcosta.com/2017/07/17/The-Ultimate-Guide-to-JavaScript-Fatigue.html + +作者:[Lucas Fernandes Da Costa][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://lucasfcosta.com +[b]: https://github.com/lujun9972 +[1]: http://www.kalzumeus.com/2011/10/28/dont-call-yourself-a-programmer/ +[2]: http://ieeexplore.ieee.org/document/1702333/ +[3]: https://en.wikipedia.org/wiki/Test_Driven_Development +[4]: https://en.wikipedia.org/wiki/Analysis_paralysis +[5]: https://babeljs.io/blog/2016/12/07/the-state-of-babel +[6]: http://requirejs.org +[7]: https://benmccormick.org/2015/05/28/moving-past-requirejs/ +[8]: https://medium.freecodecamp.org/a-study-plan-to-cure-javascript-fatigue-8ad3a54f2eb1 +[9]: https://www.quora.com/What-did-Richard-Feynman-mean-when-he-said-What-I-cannot-create-I-do-not-understand +[10]: https://egghead.io/lessons/javascript-redux-implementing-store-from-scratch +[11]: https://jasonformat.com/wtf-is-jsx/ +[12]: https://www.barnesandnoble.com/p/building-microservices-sam-newman/1119741399/2677517060476?st=PLA&sid=BNB_DRS_Marketplace+Shopping+Books_00000000&2sid=Google_&sourceId=PLGoP4760&k_clickid=3x4760 +[13]: /assets/barcelona-city.jpeg +[14]: /assets/barcelona-above.jpeg +[15]: https://twitter.com/thewizardlucas diff --git a/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md b/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md deleted file mode 100644 index 09223ccb21..0000000000 --- a/sources/talk/20171222 18 Cyber-Security Trends Organizations Need to Brace for in 2018.md +++ /dev/null @@ -1,116 +0,0 @@ -18 Cyber-Security Trends Organizations Need to Brace for in 2018 -====== - -### 18 Cyber-Security Trends Organizations Need to Brace for in 2018 - -Enterprises, end users and governments faced no shortage of security challenges in 2017. Some of those same challenges will continue into 2018, and there will be new problems to solve as well. Ransomware has been a concern for several years and will likely continue to be a big issue in 2018. The new year is also going to bring the formal introduction of the European Union's General Data Protection Regulation (GDPR), which will impact how organizations manage private information. A key trend that emerged in 2017 was an increasing use of artificial intelligence (AI) to help solve cyber-security challenges, and that's a trend that will continue to accelerate in 2018. What else will the new year bring? In this slide show, eWEEK presents 18 security predictions for the year ahead from 18 security experts. - - -### Africa Emerges as New Area for Threat Actors and Targets - -"In 2018, Africa will emerge as a new focus area for cyber-threats--both targeting organizations based there and attacks originating from the continent. With its growth in technology adoption and operations and rising economy, and its increasing number of local resident threat actors, Africa has the largest potential for net-new impactful cyber events." -Steve Stone, IBM X-Force IRIS - - -### AI vs. AI - -"2018 will see a rise in AI-based attacks as cyber-criminals begin using machine learning to spoof human behaviors. The cyber-security industry will need to tune their own AI tools to better combat the new threats. The cat and mouse game of cybercrime and security innovation will rapidly escalate to include AI-enabled tools on both sides." --Caleb Barlow, vice president of Threat Intelligence, IBM Security - - -### Cyber-Security as a Growth Driver - -"CEOs view cyber-security as one of their top risks, but many also see it as an opportunity to innovate and find new ways to generate revenue. In 2018 and beyond, effective cyber-security measures will support companies that are transforming their security, privacy and continuity controls in an effort to grow their businesses." -Greg Bell, KMPG's Global Cyber Security Practice co-leader - - -### GDPR Means Good Enough Isn't Good Enough - -"Too many professionals share a 'good enough' philosophy that they've adopted from their consumer mindset that they can simply upgrade and patch to comply with the latest security and compliance best practices or regulations. In 2018, with the upcoming enforcement of the EU GDPR 'respond fast' rules, organizations will quickly come to terms, and face fines, with why 'good enough' is not 'good' anymore." -Kris Lovejoy, CEO of BluVector - - -### Consumerization of Cyber-Security - -"2018 will mark the debut of the 'consumerization of cyber-security.' This means consumers will be offered a unified, comprehensive suite of security offerings, including, in addition to antivirus and spyware protection, credit and identify abuse monitoring and identity restoration. This is a big step forward compared to what is available in one package today. McAfee Total Protection, which safeguards consumer identities in addition to providing virus and malware protection, is an early, simplified example of this. Consumers want to feel more secure." -Don Dixon, co-founder and managing director, Trident Capital Cybersecurity - - -### Ransomware Will Continue - -"Ransomware will continue to plague organizations with 'old' attacks 'refreshed' and reused. The threat of ransomware will continue into 2018. This year we've seen ransomware wreak havoc across the globe with both WannaCry and NotPetya hitting the headlines. Threats of this type and on this scale will be a common feature of the next 12 months." -Andrew Avanessian, chief operating officer at Avecto - - -### More Encryption Will Be Needed - -"It will become increasingly clear in the industry that HTTPS does not offer the robust security and end-to-end encryption as is commonly believed, and there will be a push to encrypt data before it is sent over HTTPS." -Darren Guccione, CEO and co-founder, Keeper Security - - -### Denial of Service Will Become Financially Lucrative - -"Denial of service will become as financially lucrative as identity theft. Using stolen identities for new account fraud has been the major revenue driver behind breaches. However, in recent years ransomware attacks have caused as much if not more damage, as increased reliance on distributed applications and cloud services results in massive business damage when information, applications or systems are held hostage by attackers." -John Pescatore. SANS' director of emerging security trends - - -### Goodbye Social Security Number - -"2018 is the turning point for the retirement of the Social Security number. At this point, the vast majority of SSNs are compromised, and we can no longer rely on them--nor should we have previously." -Michael Sutton, CISO, Zscaler - - -### Post-Quantum Cyber-Security Discussion Warms Up the Boardroom - -"The uncertainty of cyber-security in a post-quantum world is percolating some circles, but 2018 is the year the discussions gain momentum in the top levels of business. As security experts grapple with preparing for a post-quantum world, top executives will begin to ask what can be done to ensure all of our connected 'things' remain secure." -Malte Pollmann, CEO of Utimaco - - -### Market Consolidation Is Coming - -"There will be accelerated consolidation of cyber niche markets flooded with too many 'me-too' companies offering extremely similar products and services. As an example, authentication, end-point security and threat intelligence now boast a total of more than 25 competitors. Ultimately, only three to six companies in each niche can survive." -Mike Janke, co-founder of DataTribe - - -### Health Care Will Be a Lucrative Target - -"Health records are highly valued on the black market because they are saturated with Personally Identifiable Information (PII). Health care institutions will continue to be a target as they have tighter allocations for security in their IT budgets. Also, medical devices are hard to update and often run on older operating system versions." -Larry Cashdollar, senior engineer, Security Intelligence Response Team, Akamai - - -### 2018: The Year of Simple Multifactor Authentication for SMBs - -"Unfortunately, effective multifactor authentication (MFA) solutions have remained largely out of reach for the average small- and medium-sized business. Though enterprise multifactor technology is quite mature, it often required complex on-premises solutions and expensive hardware tokens that most small businesses couldn't afford or manage. However, the growth of SaaS and smartphones has introduced new multifactor solutions that are inexpensive and easy for small businesses to use. Next year, many SMBs will adopt these new MFA solutions to secure their more privileged accounts and users. 2018 will be the year of MFA for SMBs." -Corey Nachreiner, CTO at WatchGuard Technologies - - -### Automation Will Improve the IT Skills Gap - -"The security skills gap is widening every year, with no signs of slowing down. To combat the skills gap and assist in the growing adoption of advanced analytics, automation will become an even higher priority for CISOs." -Haiyan Song, senior vice president of Security Markets at Splunk - - -### Industrial Security Gets Overdue Attention - -"The high-profile attacks of 2017 acted as a wake-up call, and many plant managers now worry that they could be next. Plant manufacturers themselves will offer enhanced security. Third-party companies going on their own will stay in a niche market. The industrial security manufacturers themselves will drive a cooperation with the security industry to provide security themselves. This is because there is an awareness thing going on and impending government scrutiny. This is different from what happened in the rest of IT/IoT where security vendors just go to market by themselves as a layer on top of IT (i.e.: an antivirus on top of Windows)." -Renaud Deraison, co-founder and CTO, Tenable - - -### Cryptocurrencies Become the New Playground for Identity Thieves - -"The rising value of cryptocurrencies will lead to greater attention from hackers and bad actors. Next year we'll see more fraud, hacks and money laundering take place across the top cryptocurrency marketplaces. This will lead to a greater focus on identity verification and, ultimately, will result in legislation focused on trader identity." -Stephen Maloney, executive vice president of Business Development & Strategy, Acuant - - -### GDPR Compliance Will Be a Challenge - -"In 2018, three quarters of companies or apps will be ruled out of compliance with GDPR and at least one major corporation will be fined to the highest extent in 2018 to set an example for others. Most companies are preparing internally by performing more security assessments and recruiting a mix of security professionals with privacy expertise and lawyers, but with the deadline quickly approaching, it's clear the bulk of businesses are woefully behind and may not be able to avoid these consequences." -Sanjay Beri, founder and CEO, Netskope - - -### Data Security Solidifies Its Spot in the IT Security Stack - -"Many businesses are stuck in the mindset that security of networks, servers and applications is sufficient to protect their data. However, the barrage of breaches in 2017 highlights a clear disconnect between what organizations think is working and what actually works. In 2018, we expect more businesses to implement data security solutions that complement their existing network security deployments." -Jim Varner, CEO of SecurityFirst - - -### [Eight Cyber-Security Vendors Raise New Funding in November 2017][1] - -Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. - -Though the pace of funding slowed in November, multiple firms raised new venture capital to develop and improve their cyber-security products. - --------------------------------------------------------------------------------- - -via: http://voip.eweek.com/security/18-cyber-security-trends-organizations-need-to-brace-for-in-2018 - -作者:[Sean Michael Kerner][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://voip.eweek.com/Authors/sean-michael-kerner -[1]:http://voip.eweek.com/security/eight-cyber-security-vendors-raise-new-funding-in-november-2017 diff --git a/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md b/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md deleted file mode 100644 index 0cb3755ca1..0000000000 --- a/sources/talk/20180209 A review of Virtual Labs virtualization solutions for MOOCs - WebLog Pro Olivier Berger.md +++ /dev/null @@ -1,255 +0,0 @@ -A review of Virtual Labs virtualization solutions for MOOCs – WebLog Pro Olivier Berger -====== -### 1 Introduction - -This is a memo that tries to capture some of the experience gained in the [FLIRT project][3] on the topic of Virtual Labs for MOOCs (Massive Open Online Courses). - -In this memo, we try to draw an overview of some benefits and concerns with existing approaches at using virtualization techniques for running Virtual Labs, as distributions of tools made available for distant learners. - -We describe 3 main technical architectures: (1) running Virtual Machine images locally on a virtual machine manager, or (2) displaying the remote execution of similar virtual machines on a IaaS cloud, and (3) the potential of connecting to the remote execution of minimized containers on a remote PaaS cloud. - -We then elaborate on some perspectives for locally running ports of applications to the WebAssembly virtual machine of the modern Web browsers. - -Disclaimer: This memo doesn’t intend to point to extensive literature on the subject, so part of our analysis may be biased by our particular context. - -### 2 Context : MOOCs - -Many MOOCs (Massive Open Online Courses) include a kind of “virtual laboratory” for learners to experiment with tools, as a way to apply the knowledge, practice, and be more active in the learning process. In quite a few (technical) disciplines, this can consist in using a set of standard applications in a professional domain, which represent typical tools that would be used in real life scenarii. - -Our main perspective will be that of a MOOC editor and of MOOC production teams which want to make “virtual labs” available for MOOC participants. - -Such a “virtual lab” would typically contain installations of existing applications, pre-installed and configured, and loaded with scenario data in order to perform a lab. - -The main constraint here is that such labs would typically be fabricated with limited software development expertise and funds[1][4]. Thus we consider here only the assembly of existing “normal” applications and discard the option of developping novel “serious games” and simulator applications for such MOOCs. - -#### 2.1 The FLIRT project - -The [FLIRT project][5] groups a consortium of 19 partners in Industry, SMEs and Academia to work on a collection of MOOCs and SPOCs for professional development in Networks and Telecommunications. Lead by Institut Mines Telecom, it benefits from the funding support of the French “Investissements d’avenir” programme. - -As part of the FLIRT roadmap, we’re leading an “innovation task” focused on Virtual Labs in the context of the Cloud. This memo was produced as part of this task. - -#### 2.2 Some challenges in virtual labs design for distant learning - -Virtual Labs used in distance learning contexts require the use of software applications in autonomy, either running on a personal, or professional computer. In general, the technical skills of participants may be diverse. So much for the quality (bandwith, QoS, filtering, limitations: firewaling) of the hardware and networks they use at home or at work. It’s thus very optimistic to seek for one solution fits all strategy. - -Most of the time there’s a learning curve on getting familiar with the tools which students will have to use, which constitutes as many challenges to overcome for beginners. These tools may not be suited for beginners, but they will still be selected by the trainers as they’re representative of the professional context being taught. - -In theory, this usability challenge should be addressed by devising an adapted pedagogical approach, especially in a context of distance learning, so that learners can practice the labs on their own, without the presence of a tutor or professor. Or some particular prerequisite skills could be required (“please follow System Administration 101 before applying to this course”). - -Unfortunately there are many cases where instructors basically just translate to a distant learning scenario, previous lab resources that had previously been devised for in presence learning. This lets learner faced with many challenges to overcome. The only support resource is often a regular forum on the MOOC’s LMS (Learning Management System). - -My intuition[2][6] is that developing ad-hoc simulators for distant education would probably be more efficient and easy to use for learners. But that would require a too high investment for the designers of the courses. - -In the context of MOOCs which are mainly free to participate to, not much investment is possible in devising ad-hoc lab applications, and instructors have to rely on existing applications, tools and scenarii to deliver a cheap enough environment. Furthermore, technical or licensing constraints[3][7] may lead to selecting lab tools which may not be easy to learn, but have the great advantage or being freely redistributable[4][8]. - -### 3 Virtual Machines for Virtual Labs - -The learners who will try unattended learning in such typical virtual labs will face difficulties in making specialized applications run. They must overcome the technical details of downloading, installing and configuring programs, before even trying to perform a particular pedagogical scenario linked to the matter studied. - -To diminish these difficulties, one traditional approach for implementing labs in MOOCs has been to assemble in advance a Virtual Machine image. This already made image can then be downloaded and run with a virtual machine simulator (like [VirtualBox][9][5][10]). - -The pre-loaded VM will already have everything ready for use, so that the learners don’t have to install anything on their machines. - -An alternative is to let learners download and install the needed software tools themselves, but this leads to so many compatibility issues or technical skill prerequisites, that this is often not advised, and mentioned only as a fallback option. - -#### 3.1 Downloading and installation issues - -Experience shows[2][11] that such virtual machines also bring some issues. Even if installation of every piece of software is no longer required, learners still need to be able to run the VM simulator on a wide range of diverse hardware, OSes and configurations. Even managing to download the VMs, still causes many issues (lack admin privileges, weight vs download speed, memory or CPU load, disk space, screen configurations, firewall filtering, keayboard layout, etc.). - -These problems aren’t generally faced by the majority of learners, but the impacted minority is not marginal either, and they generally will produce a lot of support requests for the MOOC team (usually in the forums), which needs to be anticipated by the community managers. - -The use of VMs is no show stopper for most, but can be a serious problem for a minority of learners, and is then no silver bullet. - -Some general usability issues may also emerge if users aren’t used to the look and feel of the enclosed desktop. For instance, the VM may consist of a GNU/Linux desktop, whereas users would use a Windows or Mac OS system. - -#### 3.2 Fabrication issues for the VM images - -On the MOOC team’s side, the fabrication of a lightweight, fast, tested, license-free and easy to use VM image isn’t necessarily easy. - -Software configurations tend to rot as time passes, and maintenance may not be easy when the later MOOC editions evolutions lead to the need to maintain the virtual lab scenarii years later. - -Ideally, this would require adopting an “industrial” process in building (and testing) the lab VMs, but this requires quite an expertise (system administration, packaging, etc.) that may or not have been anticipated at the time of building the MOOC (unlike video editing competence, for instance). - -Our experiment with the [Vagrant][12] technology [[0][13]] and Debian packaging was interesting in this respect, as it allowed us to use a well managed “script” to precisely control the build of a minimal VM image. - -### 4 Virtual Labs as a Service - -To overcome the difficulties in downloading and running Virtual Machines on one’s local computer, we have started exploring the possibility to run these applications in a kind of Software as a Service (SaaS) context, “on the cloud”. - -But not all applications typically used in MOOC labs are already available for remote execution on the cloud (unless the course deals precisely with managing email in GMail). - -We have then studied the option to use such an approach not for a single application, but for a whole virtual “desktop” which would be available on the cloud. - -#### 4.1 IaaS deployments - -A way to achieve this goal is to deploy Virtual Machine images quite similar to the ones described above, on the cloud, in an Infrastructure as a Service (IaaS) context[6][14], to offer access to remote desktops for every learners. - -There are different technical options to achieve this goal, but a simplified description of the architecture can be seen as just running Virtual Machines on a single IaaS platform instead of on each learner’s computer. Access to the desktop and application interfaces is made possible with the use of Web pages (or other dedicated lightweight clients) which will display a “full screen” display of the remote desktop running for the user on the cloud VM. Under the hood, the remote display of a Linux desktop session is made with technologies like [VNC][15] and [RDP][16] connecting to a [Guacamole][17] server on the remote VM. - -In the context of the FLIRT project, we have made early experiments with such an architecture. We used the CloVER solution by our partner [ProCAN][18] which provides a virtual desktops broker between [OpenEdX][19] and an [OpenStack][20] IaaS public platform. - -The expected benefit is that users don’t have to install anything locally, as the only tool needed locally is a Web browser (displaying a full-screen [HTML5 canvas][21] displaying the remote desktop run by the Guacamole server running on the cloud VM. - -But there are still some issues with such an approach. First, the cost of operating such an infrastructure : Virtual Machines need to be hosted on a IaaS platform, and that cost of operation isn’t null[7][22] for the MOOC editor, compared to the cost of VirtualBox and a VM running on the learner’s side (basically zero for the MOOC editor). - -Another issue, which could be more problematic lies in the need for a reliable connection to the Internet during the whole sequences of lab execution by the learners[8][23]. Even if Guacamole is quite efficient at compressing rendering traffic, some basic connectivity is needed during the whole Lab work sessions, preventing some mobile uses for instance. - -One other potential annoyance is the potential delays for making a VM available to a learner (provisioning a VM), when huge VMs images need to be copied inside the IaaS platform when a learner connects to the Virtual Lab activity for the first time (several minutes delays). This may be worse if the VM image is too big (hence the need for optimization of the content[9][24]). - -However, the fact that all VMs are running on a platform under the control of the MOOC editor allows new kind of features for the MOOC. For instance, learners can submit results of their labs directly to the LMS without the need to upload or copy-paste results manually. This can help monitor progress or perform evaluation or grading. - -The fact that their VMs run on the same platform also allows new kinds of pedagogical scenarii, as VMs of multiple learners can be interconnected, allowing cooperative activities between learners. The VM images may then need to be instrumented and deployed in particular configurations, which may require the use of a dedicated broker like CloVER to manage such scenarii. - -For the records, we have yet to perform a rigorous benchmarking of such a solution in order to evaluate its benefits, or constraints given particular contexts. In FLIRT, our main focus will be in the context of SPOCs for professional training (a bit different a context than public MOOCs). - -Still this approach doesn’t solve the VMs fabrication issues for the MOOC staff. Installing software inside a VM, be it local inside a VirtualBox simulator of over the cloud through a remote desktop display, makes not much difference. This relies mainly on manual operations and may not be well managed in terms of quality of the process (reproducibility, optimization). - -#### 4.2 PaaS deployments using containers - -Some key issues in the IaaS context described above, are the cost of operation of running full VMs, and long provisioning delays. - -We’re experimenting with new options to address these issues, through the use of [Linux containers][25] running on a PaaS (Platform as a Service) platform, instead of full-fleshed Virtual Machines[10][26]. - -The main difference, with containers instead of Virtual Machines, lies in the reduced size of images, and much lower CPU load requirements, as the container remove the need for one layer of virtualization. Also, the deduplication techniques at the heart of some virtual file-systems used by container platforms lead to really fast provisioning, avoiding the need to wait for the labs to start. - -The traditional making of VMs, done by installing packages and taking a snapshot, was affordable for the regular teacher, but involved manual operations. In this respect, one other major benefit of containers is the potential for better industrialization of the virtual lab fabrication, as they are generally not assembled manually. Instead, one uses a “scripting” approach in describing which applications and their dependencies need to be put inside a container image. But this requires new competence from the Lab creators, like learning the [Docker][27] technology (and the [OpenShift][28] PaaS, for instance), which may be quite specialized. Whereas Docker containers tend to become quite popular in Software Development faculty (through the “[devops][29]” hype), they may be a bit new to other field instructors. - -The learning curve to mastering the automation of the whole container-based labs installation needs to be evaluated. There’s a trade-off to consider in adopting technology like Vagrant or Docker: acquiring container/PaaS expertise vs quality of industrialization and optimization. The production of a MOOC should then require careful planning if one has to hire or contract with a PaaS expert for setting up the Virtual Labs. - -We may also expect interesting pedagogical benefits. As containers are lightweight, and platforms allow to “easily” deploy multiple interlinked containers (over dedicated virtual networks), this enables the setup of more realistic scenarii, where each learner may be provided with multiple “nodes” over virtual networks (all running their individual containers). This would be particularly interesting for Computer Networks or Security teaching for instance, where each learner may have access both to client and server nodes, to study client-server protocols, for instance. This is particularly interesting for us in the context of our FLIRT project, where we produce a collection of Computer Networks courses. - -Still, this mode of operation relies on a good connectivity of the learners to the Cloud. In contexts of distance learning in poorly connected contexts, the PaaS architecture doesn’t solve that particular issue compared to the previous IaaS architecture. - -### 5 Future server-less Virtual Labs with WebAssembly - -As we have seen, the IaaS or PaaS based Virtual Labs running on the Cloud offer alternatives to installing local virtual machines on the learner’s computer. But they both require to be connected for the whole duration of the Lab, as the applications would be executed on the remote servers, on the Cloud (either inside VMs or containers). - -We have been thinking of another alternative which could allow the deployment of some Virtual Labs on the local computers of the learners without the hassles of downloading and installing a Virtual Machine manager and VM image. We envision the possibility to use the infrastructure provided by modern Web browsers to allow running the lab’s applications. - -At the time of writing, this architecture is still highly experimental. The main idea is to rebuild the applications needed for the Lab so that they can be run in the “generic” virtual machine present in the modern browsers, the [WebAssembly][30] and Javascript execution engine. - -WebAssembly is a modern language which seeks for maximum portability, and as its name hints, is a kind of assembly language for the Web platform. What is of interest for us is that WebAssembly is portable on most modern Web browsers, making it a very interesting platform for portability. - -Emerging toolchains allow recompiling applications written in languages like C or C++ so that they can be run on the WebAssembly virtual machine in the browser. This is interesting as it doesn’t require modifying the source code of these programs. Of course, there are limitations, in the kind of underlying APIs and libraries compatible with that platform, and on the sandboxing of the WebAssembly execution engine enforced by the Web browser. - -Historically, WebAssembly has been developped so as to allow running games written in C++ for a framework like Unity, in the Web browser. - -In some contexts, for instance for tools with an interactive GUI, and processing data retrieved from files, and which don’t need very specific interaction with the underlying operating system, it seems possible to port these programs to WebAssembly for running them inside the Web browser. - -We have to experiment deeper with this technology to validate its potential for running Virtual Labs in the context of a Web browser. - -We used a similar approach in the past in porting a Relational Database course lab to the Web browser, for standalone execution. A real database would run in the minimal SQLite RDBMS, recompiled to JavaScript[11][31]. Instead of having to download, install and run a VM with a RDBMS, the students would only connect to a Web page, which would load the DBMS in memory, and allow performing the lab SQL queries locally, disconnected from any third party server. - -In a similar manner, we can think for instance, of a Lab scenario where the Internet packet inspector features of the Wireshark tool would run inside the WebAssembly virtual machine, to allow dissecting provided capture files, without having to install Wireshard, directly into the Web browser. - -We expect to publish a report on that last experiment in the future with more details and results. - -### 6 Conclusion - -The most promising architecture for Virtual Lab deployments seems to be the use of containers on a PaaS platform for deploying virtual desktops or virtual application GUIs available in the Web browser. - -This would allow the controlled fabrication of Virtual Labs containing the exact bits needed for learners to practice while minimizing the delays. - -Still the need for always-on connectivity can be a problem. - -Also, the potential for inter-networked containers allowing the kind of multiple nodes and collaborative scenarii we described, would require a lot of expertise to develop, and management platforms for the MOOC operators, which aren’t yet mature. - -We hope to be able to report on our progress in the coming months and years on those aspects. - -### 7 References - - - -[0] -Olivier Berger, J Paul Gibson, Claire Lecocq and Christian Bac “Designing a virtual laboratory for a relational database MOOC”. International Conference on Computer Supported Education, SCITEPRESS, 23-25 may 2015, Lisbonne, Portugal, 2015, vol. 7, pp. 260-268, ISBN 978-989-758-107-6 – [DOI: 10.5220/0005439702600268][1] ([preprint (HTML)][2]) - -### 8 Copyright - - [![Creative Commons License](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)][45] - -This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][46] - -. - -### Footnotes: - -[1][32] – The FLIRT project also works on business model aspects of MOOC or SPOC production in the context of professional development, but the present memo starts from a minimalitic hypothesis where funding for course production is quite limited. - -[2][33] – research-based evidence needed - -[3][34] – In typical MOOCs which are free to participate, the VM should include only gratis tools, which typically means a GNU/Linux distribution loaded with applications available under free and open source licenses. - -[4][35] – Typically, Free and Open Source software, aka Libre Software - -[5][36] – VirtualBox is portable on many operating systems, making it a very popular solution for such a need - -[6][37] – the IaaS platform could typically be an open cloud for MOOCs or a private cloud for SPOCs (for closer monitoring of student activity or security control reasons). - -[7][38] – Depending of the expected use of the lab by learners, this cost may vary a lot. The size and configuration required for the included software may have an impact (hence the need to minimize the footprint of the VM images). With diminishing costs in general this may not be a show stopper. Refer to marketing figures of commercial IaaS offerings for accurate figures. Attention to additional licensing costs if the OS of the VM isn’t free software, or if other licenses must be provided for every learners. - -[8][39] – The needs for always-on connectivity may not be a problem for professional development SPOCs where learners connect from enterprise networks for instance. It may be detrimental when MOOCs are very popular in southern countries where high bandwidth is both unreliable and expensive. - -[9][40] – In this respect, providing a full Linux desktop inside the VM doesn’t necessarily make sense. Instead, running applications full-screen may be better, avoiding installation of whole desktop environments like Gnome or XFCE… but which has usability consequences. Careful tuning and testing is needed in any case. - -[10][41] – The availability of container based architectures is quite popular in the industry, but has not yet been deployed to a large scale in the context of large public MOOC hosting platforms, to our knowledge, at the time of writing. There are interesting technical challenges which the FLIRT project tries to tackle together with its partner ProCAN. - -[11][42] – See the corresponding paragraph [http://www-inf.it-sudparis.eu/PROSE/csedu2015/#standalone-sql-env][43] in [0][44] - - --------------------------------------------------------------------------------- - -via: https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/ - -作者:[Author;Olivier Berger;Télécom Sudparis][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www-public.tem-tsp.eu -[1]:http://dx.doi.org/10.5220/0005439702600268 -[2]:http://www-inf.it-sudparis.eu/PROSE/csedu2015/ -[3]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#org50fdc1a -[4]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.1 -[5]:http://flirtmooc.wixsite.com/flirt-mooc-telecom -[6]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.2 -[7]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.3 -[8]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.4 -[9]:http://virtualbox.org -[10]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.5 -[11]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.2 -[12]:https://www.vagrantup.com/ -[13]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#orgde5af50 -[14]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.6 -[15]:https://en.wikipedia.org/wiki/Virtual_Network_Computing -[16]:https://en.wikipedia.org/wiki/Remote_Desktop_Protocol -[17]:http://guacamole.apache.org/ -[18]:https://www.procan-group.com/ -[19]:https://open.edx.org/ -[20]:http://openstack.org/ -[21]:https://en.wikipedia.org/wiki/Canvas_element -[22]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.7 -[23]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.8 -[24]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.9 -[25]:https://www.redhat.com/en/topics/containers -[26]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.10 -[27]:https://en.wikipedia.org/wiki/Docker_(software) -[28]:https://www.openshift.com/ -[29]:https://en.wikipedia.org/wiki/DevOps -[30]:http://webassembly.org/ -[31]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fn.11 -[32]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.1 -[33]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.2 -[34]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.3 -[35]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.4 -[36]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.5 -[37]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.6 -[38]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.7 -[39]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.8 -[40]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.9 -[41]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.10 -[42]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#fnr.11 -[43]:http://www-inf.it-sudparis.eu/PROSE/csedu2015/#standalone-sql-env -[44]:https://www-public.tem-tsp.eu/~berger_o/weblog/a-review-of-virtual-labs-virtualization-solutions-for-moocs/#orgde5af50 -[45]:http://creativecommons.org/licenses/by-nc-sa/4.0/ -[46]:http://creativecommons.org/licenses/by-nc-sa/4.0/ diff --git a/sources/talk/20180604 10 principles of resilience for women in tech.md b/sources/talk/20180604 10 principles of resilience for women in tech.md index 3f451089bb..e5d6b09401 100644 --- a/sources/talk/20180604 10 principles of resilience for women in tech.md +++ b/sources/talk/20180604 10 principles of resilience for women in tech.md @@ -1,93 +1,94 @@ -10 principles of resilience for women in tech -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity-women-meeting-team.png?itok=BdDKxT1w) - -Being a woman in tech is pretty damn cool. For every headline about [what Silicon Valley thinks of women][1], there are tens of thousands of women building, innovating, and managing technology teams around the world. Women are helping build the future despite the hurdles they face, and the community of women and allies growing to support each other is stronger than ever. From [BetterAllies][2] to organizations like [Girls Who Code][3] and communities like the one I met recently at [Red Hat Summit][4], there are more efforts than ever before to create an inclusive community for women in tech. - -But the tech industry has not always been this welcoming, nor is the experience for women always aligned with the aspiration. And so we're feeling the pain. Women in technology roles have dropped from its peak in 1991 at 36% to 25% today, [according to a report by NCWIT][5]. [Harvard Business Review estimates][6] that more than half of the women in tech will eventually leave due to hostile work conditions. Meanwhile, Ernst & Young recently shared [a study][7] and found that merely 11% of high school girls are planning to pursue STEM careers. - -We have much work to do, lest we build a future that is less inclusive than the one we live in today. We need everyone at the table, in the lab, at the conference and in the boardroom. - -I've been interviewing both women and men for more than a year now about their experiences in tech, all as part of [The Chasing Grace Project][8], a documentary series about women in tech. The purpose of the series is to help recruit and retain female talent for the tech industry and to give women a platform to be seen, heard, and acknowledged for their experiences. We believe that compelling story can begin to transform culture. - -### What Chasing Grace taught me - -What I've learned is that no matter the dismal numbers, women want to keep building and they collectively possess a resilience unmatched by anything I've ever seen. And this is inspiring me. I've found a power, a strength, and a beauty in every story I've heard that is the result of resilience. I recently shared with the attendees at the Red Hat Summit Women’s Leadership Luncheon the top 10 principles of resilience I've heard from throughout my interviews so far. I hope that by sharing them here the ideas and concepts can support and inspire you, too. - -#### 1\. Practice optimism - -When taken too far, optimism can give you blind spots. But a healthy dose of optimism allows you to see the best in people and situations and that positive energy comes back to you 100-fold. I haven’t met a woman yet as part of this project who isn’t an optimist. - -#### 2\. Build mental toughness - -I haven’t met a woman yet as part of this project who isn’t an optimist. - -When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said _mental toughness_. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. - -#### 3\. Recognize your power - -When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. - -Most of the women I’ve interviewed don’t know their own power and so they give it away unknowingly. Too many women have told me that they willingly took on the housekeeping roles on their teams—picking up coffee, donuts, office supplies, and making the team dinner reservations. Usually the only woman on their teams, this put them in a position to be seen as less valuable than their male peers who didn’t readily volunteer for such tasks. All of us, men and women, have innate powers. Identify and know what your powers are and understand how to use them for good. You have so much more power than you realize. Know it, recognize it, use it strategically, and don’t give it away. It’s yours. - -#### 4\. Know your strength - -Not sure whether you can confront your boss about why you haven’t been promoted? You can. You don’t know your strength until you exercise it. Then, you’re unstoppable. Test your strength by pushing your fear aside and see what happens. - -#### 5\. Celebrate vulnerability - -Every single successful women I've interviewed isn't afraid to be vulnerable. She finds her strength in acknowledging where she is vulnerable and she looks to connect with others in that same place. Exposing, sharing, and celebrating each other’s vulnerabilities allows us to tap into something far greater than simply asserting strength; it actually builds strength—mental and emotional muscle. One women with whom we’ve talked shared how starting her own tech company made her feel like she was letting her husband down. She shared with us the details of that conversation with her husband. Honest conversations that share our doubts and our aspirations is what makes women uniquely suited to lead in many cases. Allow yourself to be seen and heard. It’s where we grow and learn. - -#### 6\. Build community - -If it doesn't exist, build it. - -Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. - -#### 7\. Celebrate victories - -Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. - -One of my favorite Facebook groups is [TechLadies][9] because of its recurring hashtag #YEPIDIDTHAT. It allows women to share their victories in a supportive community. No matter how big or small, don't let a victory go unrecognized. When you recognize your wins, you own them. They become a part of you and you build on top of each one. - -#### 8\. Be curious - -Being curious in the tech community often means asking questions: How does that work? What language is that written in? How can I make this do that? When I've managed teams over the years, my best employees have always been those who ask a lot of questions, those who are genuinely curious about things. But in this context, I mean be curious when your gut tells you something doesn't seem right. _The energy in the meeting was off. Did he/she just say what I think he said?_ Ask questions. Investigate. Communicate openly and clearly. It's the only way change happens. - -#### 9\. Harness courage - -One women told me a story about a meeting in which the women in the room kept being dismissed and talked over. During the debrief roundtable portion of the meeting, she called it out and asked if others noticed it, too. Being a 20-year tech veteran, she'd witnessed and experienced this many times but she had never summoned the courage to speak up about it. She told me she was incredibly nervous and was texting other women in the room to see if they agreed it should be addressed. She didn't want to be a "troublemaker." But this kind of courage results in an increased understanding by everyone in that room and can translate into other meetings, companies, and across the industry. - -#### 10\. Share your story - -When people connect to compelling story, they begin to change behaviors. - -Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. - -Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. - -If you would like to support [The Chasing Grace Project][8], email Jennifer Cloer to learn more about how to get involved: [jennifer@wickedflicksproductions.com][10] - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/6/being-woman-tech-10-principles-resilience - -作者:[Jennifer Cloer][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/jennifer-cloer -[1]:http://www.newsweek.com/2015/02/06/what-silicon-valley-thinks-women-302821.html%E2%80%9D -[2]:https://opensource.com/article/17/6/male-allies-tech-industry-needs-you%E2%80%9D -[3]:https://twitter.com/GirlsWhoCode%E2%80%9D -[4]:http://opensource.com/tags/red-hat-summit%E2%80%9D -[5]:https://www.ncwit.org/sites/default/files/resources/womenintech_facts_fullreport_05132016.pdf%E2%80%9D -[6]:Dhttp://www.latimes.com/business/la-fi-women-tech-20150222-story.html%E2%80%9D -[7]:http://www.ey.com/us/en/newsroom/news-releases/ey-news-new-research-reveals-the-differences-between-boys-and-girls-career-and-college-plans-and-an-ongoing-need-to-engage-girls-in-stem%E2%80%9D -[8]:https://www.chasinggracefilm.com/ -[9]:https://www.facebook.com/therealTechLadies/%E2%80%9D -[10]:mailto:jennifer@wickedflicksproductions.com +XYenChi is translating +10 principles of resilience for women in tech +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/diversity-women-meeting-team.png?itok=BdDKxT1w) + +Being a woman in tech is pretty damn cool. For every headline about [what Silicon Valley thinks of women][1], there are tens of thousands of women building, innovating, and managing technology teams around the world. Women are helping build the future despite the hurdles they face, and the community of women and allies growing to support each other is stronger than ever. From [BetterAllies][2] to organizations like [Girls Who Code][3] and communities like the one I met recently at [Red Hat Summit][4], there are more efforts than ever before to create an inclusive community for women in tech. + +But the tech industry has not always been this welcoming, nor is the experience for women always aligned with the aspiration. And so we're feeling the pain. Women in technology roles have dropped from its peak in 1991 at 36% to 25% today, [according to a report by NCWIT][5]. [Harvard Business Review estimates][6] that more than half of the women in tech will eventually leave due to hostile work conditions. Meanwhile, Ernst & Young recently shared [a study][7] and found that merely 11% of high school girls are planning to pursue STEM careers. + +We have much work to do, lest we build a future that is less inclusive than the one we live in today. We need everyone at the table, in the lab, at the conference and in the boardroom. + +I've been interviewing both women and men for more than a year now about their experiences in tech, all as part of [The Chasing Grace Project][8], a documentary series about women in tech. The purpose of the series is to help recruit and retain female talent for the tech industry and to give women a platform to be seen, heard, and acknowledged for their experiences. We believe that compelling story can begin to transform culture. + +### What Chasing Grace taught me + +What I've learned is that no matter the dismal numbers, women want to keep building and they collectively possess a resilience unmatched by anything I've ever seen. And this is inspiring me. I've found a power, a strength, and a beauty in every story I've heard that is the result of resilience. I recently shared with the attendees at the Red Hat Summit Women’s Leadership Luncheon the top 10 principles of resilience I've heard from throughout my interviews so far. I hope that by sharing them here the ideas and concepts can support and inspire you, too. + +#### 1\. Practice optimism + +When taken too far, optimism can give you blind spots. But a healthy dose of optimism allows you to see the best in people and situations and that positive energy comes back to you 100-fold. I haven’t met a woman yet as part of this project who isn’t an optimist. + +#### 2\. Build mental toughness + +I haven’t met a woman yet as part of this project who isn’t an optimist. + +When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said _mental toughness_. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. + +#### 3\. Recognize your power + +When I recently asked a 32-year-old tech CEO, who is also a single mom of three young girls, what being a CEO required she said. It really summed up what I’d heard in other words from other women, but it connected with me on another level when she proceeded to tell me how caring for her daughter—who was born with a hole in heart—prepared her for what she would encounter as a tech CEO. Being mentally tough to her means fighting for what you love, persisting like a badass, and building your EQ as well as your IQ. + +Most of the women I’ve interviewed don’t know their own power and so they give it away unknowingly. Too many women have told me that they willingly took on the housekeeping roles on their teams—picking up coffee, donuts, office supplies, and making the team dinner reservations. Usually the only woman on their teams, this put them in a position to be seen as less valuable than their male peers who didn’t readily volunteer for such tasks. All of us, men and women, have innate powers. Identify and know what your powers are and understand how to use them for good. You have so much more power than you realize. Know it, recognize it, use it strategically, and don’t give it away. It’s yours. + +#### 4\. Know your strength + +Not sure whether you can confront your boss about why you haven’t been promoted? You can. You don’t know your strength until you exercise it. Then, you’re unstoppable. Test your strength by pushing your fear aside and see what happens. + +#### 5\. Celebrate vulnerability + +Every single successful women I've interviewed isn't afraid to be vulnerable. She finds her strength in acknowledging where she is vulnerable and she looks to connect with others in that same place. Exposing, sharing, and celebrating each other’s vulnerabilities allows us to tap into something far greater than simply asserting strength; it actually builds strength—mental and emotional muscle. One women with whom we’ve talked shared how starting her own tech company made her feel like she was letting her husband down. She shared with us the details of that conversation with her husband. Honest conversations that share our doubts and our aspirations is what makes women uniquely suited to lead in many cases. Allow yourself to be seen and heard. It’s where we grow and learn. + +#### 6\. Build community + +If it doesn't exist, build it. + +Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. + +#### 7\. Celebrate victories + +Building community seems like a no-brainer in the world of open source, right? But take a moment to think about how many minorities in tech, especially those outside the collaborative open source community, don’t always feel like part of the community. Many women in tech, for example, have told me they feel alone. Reach out and ask questions or answer questions in community forums, at meetups, and in IRC and Slack. When you see a woman alone at an event, consider engaging with her and inviting her into a conversation. Start a meetup group in your company or community for women in tech. I've been so pleased with the number of companies that host these groups. If it doesn't exists, build it. + +One of my favorite Facebook groups is [TechLadies][9] because of its recurring hashtag #YEPIDIDTHAT. It allows women to share their victories in a supportive community. No matter how big or small, don't let a victory go unrecognized. When you recognize your wins, you own them. They become a part of you and you build on top of each one. + +#### 8\. Be curious + +Being curious in the tech community often means asking questions: How does that work? What language is that written in? How can I make this do that? When I've managed teams over the years, my best employees have always been those who ask a lot of questions, those who are genuinely curious about things. But in this context, I mean be curious when your gut tells you something doesn't seem right. _The energy in the meeting was off. Did he/she just say what I think he said?_ Ask questions. Investigate. Communicate openly and clearly. It's the only way change happens. + +#### 9\. Harness courage + +One women told me a story about a meeting in which the women in the room kept being dismissed and talked over. During the debrief roundtable portion of the meeting, she called it out and asked if others noticed it, too. Being a 20-year tech veteran, she'd witnessed and experienced this many times but she had never summoned the courage to speak up about it. She told me she was incredibly nervous and was texting other women in the room to see if they agreed it should be addressed. She didn't want to be a "troublemaker." But this kind of courage results in an increased understanding by everyone in that room and can translate into other meetings, companies, and across the industry. + +#### 10\. Share your story + +When people connect to compelling story, they begin to change behaviors. + +Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. + +Share your experience with a friend, a group, a community, or an industry. Be empowered by the experience of sharing your experience. Stories change culture. When people connect to compelling story, they begin to change behaviors. When people act, companies and industries begin to transform. + +If you would like to support [The Chasing Grace Project][8], email Jennifer Cloer to learn more about how to get involved: [jennifer@wickedflicksproductions.com][10] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/6/being-woman-tech-10-principles-resilience + +作者:[Jennifer Cloer][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[译者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/jennifer-cloer +[1]:http://www.newsweek.com/2015/02/06/what-silicon-valley-thinks-women-302821.html%E2%80%9D +[2]:https://opensource.com/article/17/6/male-allies-tech-industry-needs-you%E2%80%9D +[3]:https://twitter.com/GirlsWhoCode%E2%80%9D +[4]:http://opensource.com/tags/red-hat-summit%E2%80%9D +[5]:https://www.ncwit.org/sites/default/files/resources/womenintech_facts_fullreport_05132016.pdf%E2%80%9D +[6]:Dhttp://www.latimes.com/business/la-fi-women-tech-20150222-story.html%E2%80%9D +[7]:http://www.ey.com/us/en/newsroom/news-releases/ey-news-new-research-reveals-the-differences-between-boys-and-girls-career-and-college-plans-and-an-ongoing-need-to-engage-girls-in-stem%E2%80%9D +[8]:https://www.chasinggracefilm.com/ +[9]:https://www.facebook.com/therealTechLadies/%E2%80%9D +[10]:mailto:jennifer@wickedflicksproductions.com diff --git a/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md b/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md deleted file mode 100644 index dedbf748d6..0000000000 --- a/sources/talk/20180705 New Training Options Address Demand for Blockchain Skills.md +++ /dev/null @@ -1,45 +0,0 @@ -New Training Options Address Demand for Blockchain Skills -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/blockchain-301.png?itok=1EA-Ob6F) - -Blockchain technology is transforming industries and bringing new levels of trust to contracts, payment processing, asset protection, and supply chain management. Blockchain-related jobs are the second-fastest growing in today’s labor market, [according to TechCrunch][1]. But, as in the rapidly expanding field of artificial intelligence, there is a pronounced blockchain skills gap and a need for expert training resources. - -### Blockchain for Business - -A new training option was recently announced from The Linux Foundation. Enrollment is now open for a free training course called[Blockchain: Understanding Its Uses and Implications][2], as well as a [Blockchain for Business][2] professional certificate program. Delivered through the edX training platform, the new course and program provide a way to learn about the impact of blockchain technologies and a means to demonstrate that knowledge. Certification, in particular, can make a difference for anyone looking to work in the blockchain arena. - -“In the span of only a year or two, blockchain has gone from something seen only as related to cryptocurrencies to a necessity for businesses across a wide variety of industries,” [said][3] Linux Foundation General Manager, Training & Certification Clyde Seepersad. “Providing a free introductory course designed not only for technical staff but business professionals will help improve understanding of this important technology, while offering a certificate program through edX will enable professionals from all over the world to clearly demonstrate their expertise.” - -TechCrunch [also reports][4] that venture capital is rapidly flowing toward blockchain-focused startups. And, this new program is designed for business professionals who need to understand the potential – or threat – of blockchain to their company and industry. - -“Professional Certificate programs on edX deliver career-relevant education in a flexible, affordable way, by focusing on the critical skills industry leaders and successful professionals are seeking today,” said Anant Agarwal, edX CEO and MIT Professor. - -### Hyperledger Fabric - -The Linux Foundation is steward to many valuable blockchain resources and includes some notable community members. In fact, a recent New York Times article — “[The People Leading the Blockchain Revolution][5]” — named Brian Behlendorf, Executive Director of The Linux Foundation’s [Hyperledger Project][6], one of the [top influential voices][7] in the blockchain world. - -Hyperledger offers proven paths for gaining credibility and skills in the blockchain space. For example, the project offers a free course titled Introduction to Hyperledger Fabric for Developers. Fabric has emerged as a key open source toolset in the blockchain world. Through the Hyperledger project, you can also take the B9-lab Certified Hyperledger Fabric Developer course. More information on both courses is available [here][8]. - -“As you can imagine, someone needs to do the actual coding when companies move to experiment and replace their legacy systems with blockchain implementations,” states the Hyperledger website. “With training, you could gain serious first-mover advantage.” - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/7/new-training-options-address-demand-blockchain-skills - -作者:[SAM DEAN][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/sam-dean -[1]:https://techcrunch.com/2018/02/14/blockchain-engineers-are-in-demand/ -[2]:https://www.edx.org/course/understanding-blockchain-and-its-implications -[3]:https://www.linuxfoundation.org/press-release/as-demand-skyrockets-for-blockchain-expertise-the-linux-foundation-and-edx-offer-new-introductory-blockchain-course-and-blockchain-for-business-professional-certificate-program/ -[4]:https://techcrunch.com/2018/05/20/with-at-least-1-3-billion-invested-globally-in-2018-vc-funding-for-blockchain-blows-past-2017-totals/ -[5]:https://www.nytimes.com/2018/06/27/business/dealbook/blockchain-stars.html -[6]:https://www.hyperledger.org/ -[7]:https://www.linuxfoundation.org/blog/hyperledgers-brian-behlendorf-named-as-top-blockchain-influencer-by-new-york-times/ -[8]:https://www.hyperledger.org/resources/training diff --git a/sources/talk/20180802 How blockchain will influence open source.md b/sources/talk/20180802 How blockchain will influence open source.md deleted file mode 100644 index 707f4fe033..0000000000 --- a/sources/talk/20180802 How blockchain will influence open source.md +++ /dev/null @@ -1,185 +0,0 @@ -How blockchain will influence open source -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/block-quilt-chain.png?itok=mECoDbrc) - -What [Satoshi Nakamoto][1] started as Bitcoin a decade ago has found a lot of followers and turned into a movement for decentralization. For some, blockchain technology is a religion that will have the same impact on humanity as the Internet has had. For others, it is hype and technology suitable only for Ponzi schemes. While blockchain is still evolving and trying to find its place, one thing is for sure: It is a disruptive technology that will fundamentally transform certain industries. And I'm betting open source will be one of them. - -### The open source model - -Open source is a collaborative software development and distribution model that allows people with common interests to gather and produce something that no individual can create on their own. It allows the creation of value that is bigger than the sum of its parts. Open source is enabled by distributed collaboration tools (IRC, email, git, wiki, issue trackers, etc.), distributed and protected by an open source licensing model and often governed by software foundations such as the [Apache Software Foundation][2] (ASF), [Cloud Native Computing Foundation][3] (CNCF), etc. - -One interesting aspect of the open source model is the lack of financial incentives in its core. Some people believe open source work should remain detached from money and remain a free and voluntary activity driven only by intrinsic motivators (such as "common purpose" and "for the greater good”). Others believe open source work should be rewarded directly or indirectly through extrinsic motivators (such as financial incentive). While the idea of open source projects prospering only through voluntary contributions is romantic, in reality, the majority of open source contributions are done through paid development. Yes, we have a lot of voluntary contributions, but these are on a temporary basis from contributors who come and go, or for exceptionally popular projects while they are at their peak. Creating and sustaining open source projects that are useful for enterprises requires developing, documenting, testing, and bug-fixing for prolonged periods, even when the software is no longer shiny and exciting. It is a boring activity that is best motivated through financial incentives. - -### Commercial open source - -Software foundations such as ASF survive on donations and other income streams such as sponsorships, conference fees, etc. But those funds are primarily used to run the foundations, to provide legal protection for the projects, and to ensure there are enough servers to run builds, issue trackers, mailing lists, etc. - -Similarly, CNCF has member fees and other income streams, which are used to run the foundation and provide resources for the projects. These days, most software is not built on laptops; it is run and tested on hundreds of machines on the cloud, and that requires money. Creating marketing campaigns, brand designs, distributing stickers, etc. takes money, and some foundations can assist with that as well. At its core, foundations implement the right processes to interact with users, developers, and control mechanisms and ensure distribution of available financial resources to open source projects for the common good. - -If users of open source projects can donate money and the foundations can distribute it in a fair way, what is missing? - -What is missing is a direct, transparent, trusted, decentralized, automated bidirectional link for transfer of value between the open source producers and the open source consumer. Currently, the link is either unidirectional or indirect: - - * **Unidirectional** : A developer (think of a "developer" as any role that is involved in the production, maintenance, and distribution of software) can use their brain juice and devote time to do a contribution and share that value with all open source users. But there is no reverse link. - - * **Indirect** : If there is a bug that affects a specific user/company, the options are: - - * To have in-house developers to fix the bug and do a pull request. That is ideal, but it not always possible to hire in-house developers who are knowledgeable about hundreds of open source projects used daily. - - * To hire a freelancer specializing in that specific open source project and pay for the services. Ideally, the freelancer is also a committer for the open source project and can directly change the project code quickly. Otherwise, the fix might not ever make it to the project. - - * To approach a company providing services around the open source project. Such companies typically employ open source committers to influence and gain credibility in the community and offer products, expertise, and professional services. - - - - -The third option has been a successful [model][4] for sustaining many open source projects. Whether they provide services (training, consulting, workshops), support, packaging, open core, or SaaS, there are companies that employ hundreds of staff members who work on open source full time. There is a long [list of companies][5] that have managed to build a successful open source business model over the years, and that list is growing steadily. - -The companies that back open source projects play an important role in the ecosystem: They are the catalyst between the open source projects and the users. The ones that add real value do more than just package software nicely; they can identify user needs and technology trends, and they create a full stack and even an ecosystem of open source projects to address these needs. They can take a boring project and support it for years. If there is a missing piece in the stack, they can start an open source project from scratch and build a community around it. They can acquire a closed source software company and open source the projects (here I got a little carried away, but yes, I'm talking about my employer, [Red Hat][6]). - -To summarize, with the commercial open source model, projects are officially or unofficially managed and controlled by a very few individuals or companies that monetize them and give back to the ecosystem by ensuring the project is successful. It is a win-win-win for open source developers, managing companies, and end users. The alternative is inactive projects and expensive closed source software. - -### Self-sustaining, decentralized open source - -For a project to become part of a reputable foundation, it must conform to certain criteria. For example, ASF and CNCF require incubation and graduation processes, respectively, where apart from all the technical and formal requirements, a project must have a healthy number of active committer and users. And that is the essence of forming a sustainable open source project. Having source code on GitHub is not the same thing as having an active open source project. The latter requires committers who write the code and users who use the code, with both groups enforcing each other continuously by exchanging value and forming an ecosystem where everybody benefits. Some project ecosystems might be tiny and short-lived, and some may consist of multiple projects and competing service providers, with very complex interactions lasting for many years. But as long as there is an exchange of value and everybody benefits from it, the project is developed, maintained, and sustained. - -If you look at ASF [Attic][7], you will find projects that have reached their end of life. When a project is no longer technologically fit for its purpose, it is usually its natural end. Similarly, in the ASF [Incubator][8], you will find tons of projects that never graduated but were instead retired. Typically, these projects were not able to build a large enough community because they are too specialized or there are better alternatives available. - -But there are also cases where projects with high potential and superior technology cannot sustain themselves because they cannot form or maintain a functioning ecosystem for the exchange of value. The open source model and the foundations do not provide a framework and mechanisms for developers to get paid for their work or for users to get their requests heard. There isn’t a common value commitment framework for either party. As a result, some projects can sustain themselves only in the context of commercial open source, where a company acts as an intermediary and value adder between developers and users. That adds another constraint and requires a service provider company to sustain some open source projects. Ideally, users should be able to express their interest in a project and developers should be able to show their commitment to the project in a transparent and measurable way, which forms a community with common interest and intent for the exchange of value. - -Imagine there is a model with mechanisms and tools that enable direct interaction between open source users and developers. This includes not only code contributions through pull requests, questions over the mailing lists, GitHub stars, and stickers on laptops, but also other ways that allow users to influence projects' destinies in a richer, more self-controlled and transparent manner. - -This model could include incentives for actions such as: - - * Funding open source projects directly rather than through software foundations - - * Influencing the direction of projects through voting (by token holders) - - * Feature requests driven by user needs - - * On-time pull request merges - - * Bounties for bug hunts - - * Better test coverage incentives - - * Up-to-date documentation rewards - - * Long-term support guarantees - - * Timely security fixes - - * Expert assistance, support, and services - - * Budget for evangelism and promotion of the projects - - * Budget for regular boring activities - - * Fast email and chat assistance - - * Full visibility of the overall project findings, etc. - - - - -If you haven't guessed, I'm talking about using blockchain and [smart contracts][9] to allow such interactions between users and developers—smart contracts that will give power to the hand of token holders to influence projects. - -![blockchain_in_open_source_ecosystem.png][11] - -The usage of blockchain in the open source ecosystem - -Existing channels in the open source ecosystem provide ways for users to influence projects through financial commitments to service providers or other limited means through the foundations. But the addition of blockchain-based technology to the open source ecosystem could open new channels for interaction between users and developers. I'm not saying this will replace the commercial open source model; most companies working with open source do many things that cannot be replaced by smart contracts. But smart contracts can spark a new way of bootstrapping new open source projects, giving a second life to commodity projects that are a burden to maintain. They can motivate developers to apply boring pull requests, write documentation, get tests to pass, etc., providing a direct value exchange channel between users and open source developers. Blockchain can add new channels to help open source projects grow and become self-sustaining in the long term, even when company backing is not feasible. It can create a new complementary model for self-sustaining open source projects—a win-win. - -### Tokenizing open source - -There are already a number of initiatives aiming to tokenize open source. Some focus only on an open source model, and some are more generic but apply to open source development as well: - - * [Gitcoin][12] \- grow open source, one of the most promising ones in this area. - - * [Oscoin][13] \- cryptocurrency for open source - - * [Open collective][14] \- a platform for supporting open source projects. - - * [FundYourselfNow][15] \- Kickstarter and ICOs for projects. - - * [Kauri][16] \- support for open source project documentation. - - * [Liberapay][17] \- a recurrent donations platform. - - * [FundRequest][18] \- a decentralized marketplace for open source collaboration. - - * [CanYa][19] \- recently acquired [Bountysource][20], now the world’s largest open source P2P bounty platform. - - * [OpenGift][21] \- a new model for open source monetization. - - * [Hacken][22] \- a white hat token for hackers. - - * [Coinlancer][23] \- a decentralized job market. - - * [CodeFund][24] \- an open source ad platform. - - * [IssueHunt][25] \- a funding platform for open source maintainers and contributors. - - * [District0x 1Hive][26] \- a crowdfunding and curation platform. - - * [District0x Fixit][27] \- github bug bounties. - - - - -This list is varied and growing rapidly. Some of these projects will disappear, others will pivot, but a few will emerge as the [SourceForge][28], the ASF, the GitHub of the future. That doesn't necessarily mean they'll replace these platforms, but they'll complement them with token models and create a richer open source ecosystem. Every project can pick its distribution model (license), governing model (foundation), and incentive model (token). In all cases, this will pump fresh blood to the open source world. - -### The future is open and decentralized - - * Software is eating the world. - - * Every company is a software company. - - * Open source is where innovation happens. - - - - -Given that, it is clear that open source is too big to fail and too important to be controlled by a few or left to its own destiny. Open source is a shared-resource system that has value to all, and more importantly, it must be managed as such. It is only a matter of time until every company on earth will want to have a stake and a say in the open source world. Unfortunately, we don't have the tools and the habits to do it yet. Such tools would allow anybody to show their appreciation or ignorance of software projects. It would create a direct and faster feedback loop between producers and consumers, between developers and users. It will foster innovation—innovation driven by user needs and expressed through token metrics. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/open-source-tokenomics - -作者:[Bilgin lbryam][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/bibryam -[1]:https://en.wikipedia.org/wiki/Satoshi_Nakamoto -[2]:https://www.apache.org/ -[3]:https://www.cncf.io/ -[4]:https://medium.com/open-consensus/3-oss-business-model-progressions-dafd5837f2d -[5]:https://docs.google.com/spreadsheets/d/17nKMpi_Dh5slCqzLSFBoWMxNvWiwt2R-t4e_l7LPLhU/edit#gid=0 -[6]:http://jobs.redhat.com/ -[7]:https://attic.apache.org/ -[8]:http://incubator.apache.org/ -[9]:https://en.wikipedia.org/wiki/Smart_contract -[10]:/file/404421 -[11]:https://opensource.com/sites/default/files/uploads/blockchain_in_open_source_ecosystem.png (blockchain_in_open_source_ecosystem.png) -[12]:https://gitcoin.co/ -[13]:http://oscoin.io/ -[14]:https://opencollective.com/opensource -[15]:https://www.fundyourselfnow.com/page/about -[16]:https://kauri.io/ -[17]:https://liberapay.com/ -[18]:https://fundrequest.io/ -[19]:https://canya.io/ -[20]:https://www.bountysource.com/ -[21]:https://opengift.io/pub/ -[22]:https://hacken.io/ -[23]:https://www.coinlancer.com/home -[24]:https://codefund.io/ -[25]:https://issuehunt.io/ -[26]:https://blog.district0x.io/district-proposal-spotlight-1hive-283957f57967 -[27]:https://github.com/district0x/district-proposals/issues/177 -[28]:https://sourceforge.net/ diff --git a/sources/talk/20180813 Using D Features to Reimplement Inheritance and Polymorphism.md b/sources/talk/20180813 Using D Features to Reimplement Inheritance and Polymorphism.md new file mode 100644 index 0000000000..eed249b8bf --- /dev/null +++ b/sources/talk/20180813 Using D Features to Reimplement Inheritance and Polymorphism.md @@ -0,0 +1,235 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using D Features to Reimplement Inheritance and Polymorphism) +[#]: via: (https://theartofmachinery.com/2018/08/13/inheritance_and_polymorphism_2.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Using D Features to Reimplement Inheritance and Polymorphism +====== + +Some months ago I showed [how inheritance and polymorphism work in compiled languages][1] by reimplementing them with basic structs and function pointers. I wrote that code in D, but it could be translated directly to plain old C. In this post I’ll show how to take advantage of D’s features to make DIY inheritance a bit more ergonomic to use. + +Although [I have used these tricks in real code][2], I’m honestly just writing this because I think it’s neat what D can do, and because it helps explain how high-level features of D can be implemented — using the language itself. + +### `alias this` + +In the original version of the code, the `Run` command inherited from the `Commmand` base class by including a `Command` instance as its first member. `Run` and `Command` were still considered completely different types, so this meant explicit typecasting was needed every time a `Run` instance was polymorphically used as a `Command`. + +The D type system actually allows declaring a struct to be a subtype of another struct (or even of a primitive type) using a feature called “[`alias this`][3]”. Here’s a simple example of how it works: + +``` +struct Base +{ + int x; +} + +struct Derived +{ + // Add an instance of Base as a member like before... + Base _base; + // ...but this time we declare that the member is used for subtyping + alias _base this; +} + +void foo(Base b) +{ + // ... +} + +void main() +{ + Derived d; + + // Derived "inherits" members from Base + d.x = 42; + + // Derived instances can be used where a Base instance is expected + foo(d); +} +``` + +The code above works in the same way as the code in the previous blog post, but `alias this` tells the type system what we’re doing. This allows us to work _with_ the type system more, and do less typecasting. The example showed a `Derived` instance being passed by value as a `Base` instance, but passing by `ref` also works. Unfortunately, D version 2.081 won’t implicitly convert a `Derived*` to a `Base*`, but maybe it’ll be implemented in future. + +Here’s an example of `alias this` being used to implement some slightly more realistic inheritance: + +``` +import io = std.stdio; + +struct Animal +{ + struct VTable + { + void function(Animal* instance) greet; + } + immutable(VTable)* vtable; + + void greet() + { + vtable.greet(&this); + } +} + +struct Penguin +{ + private: + static immutable Animal.VTable vtable = {greet: &greetImpl}; + auto _base = Animal(&vtable); + alias _base this; + + public: + string name; + + this(string name) pure + { + this.name = name; + } + + static void greetImpl(Animal* instance) + { + // We still need one typecast here because the type system can't guarantee this is okay + auto penguin = cast(Penguin*) instance; + io.writef("I'm %s the penguin and I can swim.\n", penguin.name); + } +} + +void main() +{ + auto p = Penguin("Paul"); + + // p inherits members from Animal + p.greet(); + + // and can be passed to functions that work with Animal instances + doThings(p); +} + +void doThings(ref Animal a) +{ + a.greet(); +} +``` + +Unlike the code in the previous blog post, this version uses a vtable, just like the polymorphic inheritance in normal compiled languages. As explained in the previous post, every `Penguin` instance will use the same list of function pointers for its virtual functions. So instead of repeating the function pointers in every instance, we can have one list of function pointers that’s shared across all `Penguin` instances (i.e., a list that’s a `static` member). That’s all the vtable is, but it’s how real-world compiled OOP languages work. + +### Template Mixins + +If we implemented another `Animal` subtype, we’d have to add exactly the same vtable and base member boilerplate as in `Penguin`: + +``` +struct Snake +{ + // This bit is exactly the same as before + private: + static immutable Animal.VTable vtable = {greet: &greetImpl}; + auto _base = Animal(&vtable); + alias _base this; + + public: + + static void greetImpl(Animal* instance) + { + io.writeln("I'm an unfriendly snake. Go away."); + } +} +``` + +D has another feature for dumping this kind of boilerplate code into things: [template mixins][4]. + +``` +mixin template DeriveAnimal() +{ + private: + static immutable Animal.VTable vtable = {greet: &greetImpl}; + auto _base = Animal(&vtable); + alias _base this; +} + +struct Snake +{ + mixin DeriveAnimal; + + static void greetImpl(Animal* instance) + { + io.writeln("I'm an unfriendly snake. Go away."); + } +} +``` + +Actually, template mixins can take parameters, so it’s possible to create a generic `Derive` mixin that inherits from any struct that defines a `VTable` struct. Because template mixins can inject any kind of declaration, including template functions, the `Derive` mixin can even handle more complex things, like the typecast from `Animal*` to the subtype. + +By the way, [the `mixin` statement can also be used to “paste” code into places][5]. It’s like a hygienic version of the C preprocessor, and it’s used below (and also in this [compile-time Brainfuck compiler][6]). + +### `opDispatch()` + +There’s some highly redundant wrapper code inside the definition of `Animal`: + +``` +void greet() +{ + vtable.greet(&this); +} +``` + +If we added another virtual method, we’d have to add another wrapper: + +``` +void eat(Food food) +{ + vtable.eat(&this, food); +} +``` + +But D has `opDispatch()`, which provides a way to automatically add members to a struct. When an `opDispatch()` is defined in a struct, any time the compiler fails to find a member, it tries the `opDispatch()` template function. In other words, it’s a fallback for member lookup. A fallback to a fully generic `return vtable.MEMBER(&this, args)` will effectively fill in all the virtual function dispatchers for us: + +``` +auto opDispatch(string member_name, Args...)(auto ref Args args) +{ + mixin("return vtable." ~ member_name ~ "(&this, args);"); +} +``` + +The downside is that if the `opDispatch()` fails for any reason, the compiler gives up on the member lookup and we get a generic “Error: no property foo for type Animal”. This is confusing if `foo` is actually a valid virtual member but was called with arguments of the wrong type, or something, so `opDispatch()` needs some good error handling (e.g., with [`static assert`][7]). + +### `static foreach` + +An alternative is to use a newer feature of D: [`static foreach`][8]. This is a powerful tool that can create declarations inside a struct (and other places) using a loop. We can directly read a list of members from the `VTable` definition by using some compile-time reflection: + +``` +import std.traits : FieldNameTuple; +static foreach (member; FieldNameTuple!VTable) +{ + mixin("auto " ~ member ~ "(Args...)(auto ref Args args) { return vtable." ~ member ~ "(&this, args); }"); +} +``` + +The advantage in this case is that we’re explicitly creating struct members. Now the compiler can distinguish between a member that shouldn’t exist at all, and a member that exists but isn’t used properly. + +### It’s all just like the C equivalent + +As I said, this is basically just a tour-de-force of ways that D can improve the code from the previous post. However, the original motivation for this blog post was people asking me about tricks I used to implement polymorphic inheritance in bare metal D code, so I’ll finish up by saying this: All this stuff works in [`-betterC`][9] code, and none of it requires extra runtime support. The code in this post implements the same kind of thing as in the [previous post][1]. It’s just expressed in a more compact and less error-prone way. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2018/08/13/inheritance_and_polymorphism_2.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: /2018/04/02/inheritance_and_polymorphism.html +[2]: https://gitlab.com/sarneaud/xanthe/blob/master/src/game/rigid_body.d#L15 +[3]: https://dlang.org/spec/class.html#alias-this +[4]: https://dlang.org/spec/template-mixin.html +[5]: https://dlang.org/articles/mixin.html +[6]: /2017/12/31/compile_time_brainfuck.html +[7]: https://dlang.org/spec/version.html#StaticAssert +[8]: https://dlang.org/spec/version.html#staticforeach +[9]: https://dlang.org/blog/2018/06/11/dasbetterc-converting-make-c-to-d/ diff --git a/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md b/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md deleted file mode 100644 index c90262dfee..0000000000 --- a/sources/talk/20180816 Debian Turns 25- Here are Some Interesting Facts About Debian Linux.md +++ /dev/null @@ -1,116 +0,0 @@ -Debian Turns 25! Here are Some Interesting Facts About Debian Linux -====== -One of the oldest Linux distribution still in development, Debian has just turned 25. Let’s have a look at some interesting facts about this awesome FOSS project. - -### 10 Interesting facts about Debian Linux - -![Interesting facts about Debian Linux][1] - -The facts presented here have been collected from various sources available from the internet. They are true to my knowledge, but in case of any error, please remind me to update the article. - -#### 1\. One of the oldest Linux distributions still under active development - -[Debian project][2] was announced on 16th August 1993 by Ian Murdock, Debian Founder. Like Linux creator [Linus Torvalds][3], Ian was a college student when he announced Debian project. - -![](https://farm6.staticflickr.com/5710/20006308374_7f51ae2a5c_z.jpg) - -#### 2\. Some people get tattoo while some name their project after their girlfriend’s name - -The project was named by combining the name of Ian and his then-girlfriend Debra Lynn. Ian and Debra got married and had three children. Debra and Ian got divorced in 2008. - -#### 3\. Ian Murdock: The Maverick behind the creation of Debian project - -![Debian Founder Ian Murdock][4] -Ian Murdock - -[Ian Murdock][5] led the Debian project from August 1993 until March 1996. He shaped Debian into a community project based on the principals of Free Software. The [Debian Manifesto][6] and the [Debian Social Contract][7] are still governing the project. - -He founded a commercial Linux company called [Progeny Linux Systems][8] and worked for a number of Linux related companies such as Sun Microsystems, Linux Foundation and Docker. - -Sadly, [Ian committed suicide in December 2015][9]. His contribution to Debian is certainly invaluable. - -#### 4\. Debian is a community project in the true sense - -Debian is a community based project in true sense. No one ‘owns’ Debian. Debian is being developed by volunteers from all over the world. It is not a commercial project, backed by corporates like many other Linux distributions. - -Debian Linux distribution is composed of Free Software only. It’s one of the few Linux distributions that is true to the spirit of [Free Software][10] and takes proud in being called a GNU/Linux distribution. - -Debian has its non-profit organization called [Software in Public Interest][11] (SPI). Along with Debian, SPI supports many other open source projects financially. - -#### 5\. Debian and its 3 branches - -Debian has three branches or versions: Debian Stable, Debian Unstable (Sid) and Debian Testing. - -Debian Stable, as the name suggests, is the stable branch that has all the software and packages well tested to give you a rock solid stable system. Since it takes time before a well-tested software lands in the stable branch, Debian Stable often contains older versions of programs and hence people joke that Debian Stable means stale. - -[Debian Unstable][12] codenamed Sid is the version where all the development of Debian takes place. This is where the new packages first land or developed. After that, these changes are propagated to the testing version. - -[Debian Testing][13] is the next release after the current stable release. If the current stable release is N, Debian testing would be the N+1 release. The packages from Debian Unstable are tested in this version. After all the new changes are well tested, Debian Testing is then ‘promoted’ as the new Stable version. - -There is no strict release schedule for Debian. - -#### 7\. There was no Debian 1.0 release - -Debian 1.0 was never released. The CD vendor, InfoMagic, accidentally shipped a development release of Debian and entitled it 1.0 in 1996. To prevent confusion between the CD version and the actual Debian release, the Debian Project renamed its next release to “Debian 1.1”. - -#### 8\. Debian releases are codenamed after Toy Story characters - -![Toy Story Characters][14] - -Debian releases are codenamed after the characters from Pixar’s hit animation movie series [Toy Story][15]. - -Debian 1.1 was the first release with a codename. It was named Buzz after the Toy Story character Buzz Lightyear. - -It was in 1996 and [Bruce Perens][16] had taken over leadership of the Project from Ian Murdock. Bruce was working at Pixar at the time. - -This trend continued and all the subsequent releases had codenamed after Toy Story characters. For example, the current stable release is Stretch while the upcoming release has been codenamed Buster. - -The unstable Debian version is codenamed Sid. This character in Toy Story is a kid with emotional problems and he enjoys breaking toys. This is symbolic in the sense that Debian Unstable might break your system with untested packages. - -#### 9\. Debian also has a BSD ditribution - -Debian is not limited to Linux. Debian also has a distribution based on FreeBSD kernel. It is called [Debian GNU/kFreeBSD][17]. - -#### 10\. Google uses Debian - -[Google uses Debian][18] as its in-house development platform. Earlier, Google used a customized version of Ubuntu as its development platform. Recently they opted for Debian based gLinux. - -#### Happy 25th birthday Debian - -![Happy 25th birthday Debian][19] - -I hope you liked these little facts about Debian. Stuff like these are reasons why people love Debian. - -I wish a very happy 25th birthday to Debian. Please continue to be awesome. Cheers :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/debian-facts/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/Interesting-facts-about-debian.jpeg -[2]:https://www.debian.org -[3]:https://itsfoss.com/linus-torvalds-facts/ -[4]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/ian-murdock.jpg -[5]:https://en.wikipedia.org/wiki/Ian_Murdock -[6]:https://www.debian.org/doc/manuals/project-history/ap-manifesto.en.html -[7]:https://www.debian.org/social_contract -[8]:https://en.wikipedia.org/wiki/Progeny_Linux_Systems -[9]:https://itsfoss.com/ian-murdock-dies-mysteriously/ -[10]:https://www.fsf.org/ -[11]:https://www.spi-inc.org/ -[12]:https://www.debian.org/releases/sid/ -[13]:https://www.debian.org/releases/testing/ -[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/toy-story-characters.jpeg -[15]:https://en.wikipedia.org/wiki/Toy_Story_(franchise) -[16]:https://perens.com/about-bruce-perens/ -[17]:https://wiki.debian.org/Debian_GNU/kFreeBSD -[18]:https://itsfoss.com/goobuntu-glinux-google/ -[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/happy-25th-birthday-Debian.jpeg diff --git a/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md b/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md index 8bbb651cfd..fc669a1a3c 100644 --- a/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md +++ b/sources/talk/20180818 What Did Ada Lovelace-s Program Actually Do.md @@ -1,3 +1,5 @@ +Northurland Translating + What Did Ada Lovelace's Program Actually Do? ====== The story of Microsoft’s founding is one of the most famous episodes in computing history. In 1975, Paul Allen flew out to Albuquerque to demonstrate the BASIC interpreter that he and Bill Gates had written for the Altair microcomputer. Because neither of them had a working Altair, Allen and Gates tested their interpreter using an emulator that they wrote and ran on Harvard’s computer system. The emulator was based on nothing more than the published specifications for the Intel 8080 processor. When Allen finally ran their interpreter on a real Altair—in front of the person he and Gates hoped would buy their software—he had no idea if it would work. But it did. The next month, Allen and Gates officially founded their new company. diff --git a/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md b/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md deleted file mode 100644 index 5a0c1aabdd..0000000000 --- a/sources/talk/20181004 Interview With Peter Ganten, CEO of Univention GmbH.md +++ /dev/null @@ -1,97 +0,0 @@ -Interview With Peter Ganten, CEO of Univention GmbH -====== -I have been asking the Univention team to share the behind-the-scenes story of [**Univention**][1] for a couple of months. Finally, today we got the interview of **Mr. Peter H. Ganten** , CEO of Univention GmbH. Despite his busy schedule, in this interview, he shares what he thinks of the Univention project and its impact on open source ecosystem, what open source developers and companies will need to do to keep thriving and what are the biggest challenges for open source projects. - -**OSTechNix: What’s your background and why have you founded Univention?** - -**Peter Ganten:** I studied physics and psychology. In psychology I was a research assistant and coded evaluation software. I realized how important it is that results have to be disclosed in order to verify or falsify them. The same goes for the code that leads to the results. This brought me into contact with Open Source Software (OSS) and Linux. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/peter-ganten-interview.jpg) - -I was a kind of technical lab manager and I had the opportunity to try out a lot, which led to my book about Debian. That was still in the New Economy era where the first business models emerged on how to make money with Open Source. When the bubble burst, I had the plan to make OSS a solid business model without venture capital but with Hanseatic business style – seriously, steadily, no bling bling. - -**What were the biggest challenges at the beginning?** - -When I came from the university, the biggest challenge clearly was to gain entrepreneurial and business management knowledge. I quickly learned that it’s not about Open Source software as an end to itself but always about customer value, and the benefits OSS offers its customers. We all had to learn a lot. - -In the beginning, we expected that Linux on the desktop would become established in a similar way as Linux on the server. However, this has not yet been proven true. The replacement has happened with Android and the iPhone. Our conclusion then was to change our offerings towards ID management and enterprise servers. - -**Why does UCS matter? And for whom makes it sense to use it?** - -There is cool OSS in all areas, but many organizations are not capable to combine it all together and make it manageable. For the basic infrastructure (Windows desktops, users, user rights, roles, ID management, apps) we need a central instance to which groupware, CRM etc. is connected. Without Univention this would have to be laboriously assembled and maintained manually. This is possible for very large companies, but far too complex for many other organizations. - -[**UCS**][2] can be used out of the box and is scalable. That’s why it’s becoming more and more popular – more than 10,000 organizations are using UCS already today. - -**Who are your users and most important clients? What do they love most about UCS?** - -The Core Edition is free of charge and used by organizations from all sectors and industries such as associations, micro-enterprises, universities or large organizations with thousands of users. In the enterprise environment, where Long Term Servicing (LTS) and professional support are particularly important, we have organizations ranging in size from 30-50 users to several thousand users. One of the target groups is the education system in Germany. In many large cities and within their school administrations UCS is used, for example, in Cologne, Hannover, Bremen, Kassel and in several federal states. They are looking for manageable IT and apps for schools. That’s what we offer, because we can guarantee these authorities full control over their users’ identities. - -Also, more and more cloud service providers and MSPs want to take UCS to deliver a selection of cloud-based app solutions. - -**Is UCS 100% Open Source? If so, how can you run a profitable business selling it?** - -Yes, UCS is 100% Open Source, every line, the whole code is OSS. You can download and use UCS Core Edition for **FREE!** - -We know that in large, complex organizations, vendor support and liability is needed for LTS, SLAs, and we offer that with our Enterprise subscriptions and consulting services. We don’t offer these in the Core Edition. - -**And what are you giving back to the OS community?** - -A lot. We are involved in the Debian team and co-finance the LTS maintenance for Debian. For important OS components in UCS like [**OpenLDAP**][3], Samba or KVM we co-finance the development or have co-developed them ourselves. We make it all freely available. - -We are also involved on the political level in ensuring that OSS is used. We are engaged, for example, in the [**Free Software Foundation Europe (FSFE)**][4] and the [**German Open Source Business Alliance**][5], of which I am the chairman. We are working hard to make OSS more successful. - -**How can I get started with UCS?** - -It’s easy to get started with the Core Edition, which, like the Enterprise Edition, has an App Center and can be easily installed on your own hardware or as an appliance in a virtual machine. Just [**download Univention ISO**][6] and install it as described in the below link. - -Alternatively, you can try the [**UCS Online Demo**][7] to get a first impression of Univention Corporate Server without actually installing it on your system. - -**What do you think are the biggest challenges for Open Source?** - -There is a certain attitude you can see over and over again even in bigger projects: OSS alone is viewed as an almost mandatory prerequisite for a good, sustainable, secure and trustworthy IT solution – but just having decided to use OSS is no guarantee for success. You have to carry out projects professionally and cooperate with the manufacturers. A danger is that in complex projects people think: “Oh, OSS is free, I just put it all together by myself”. But normally you do not have the know-how to successfully implement complex software solutions. You would never proceed like this with Closed Source. There people think: “Oh, the software costs 3 $ millions, so it’s okay if I have to spend another 300,000 Dollars on consultants.” - -At OSS this is different. If such projects fail and leave burnt ground behind, we have to explain again and again that the failure of such projects is not due to the nature of OSS but to its poor implementation and organization in a specific project: You have to conclude reasonable contracts and involve partners as in the proprietary world, but you’ll gain a better solution. - -Another challenge: We must stay innovative, move forward, attract new people who are enthusiastic about working on projects. That’s sometimes a challenge. For example, there are a number of proprietary cloud services that are good but lead to extremely high dependency. There are approaches to alternatives in OSS, but no suitable business models yet. So it’s hard to find and fund developers. For example, I can think of Evernote and OneNote for which there is no reasonable OSS alternative. - -**And what will the future bring for Univention?** - -I don’t have a crystal ball, but we are extremely optimistic. We see a very high growth potential in the education market. More OSS is being made in the public sector, because we have repeatedly experienced the dead ends that can be reached if we solely rely on Closed Source. - -Overall, we will continue our organic growth at double-digit rates year after year. - -UCS and its core functionalities of identity management, infrastructure management and app center will increasingly be offered and used from the cloud as a managed service. We will support our technology in this direction, e.g., through containers, so that a hypervisor or bare metal is not always necessary for operation. - -**You have been the CEO of Univention for a long time. What keeps you motivated?** - -I have been the CEO of Univention for more than 16 years now. My biggest motivation is to realize that something is moving. That we offer the better way for IT. That the people who go this way with us are excited to work with us. I go home satisfied in the evening (of course not every evening). It’s totally cool to work with the team I have. It motivates and pushes you every time I need it myself. - -I’m a techie and nerd at heart, I enjoy dealing with technology. So I’m totally happy at this place and I’m grateful to the world that I can do whatever I want every day. Not everyone can say that. - -**Who gives you inspiration?** - -My employees, the customers and the Open Source projects. The exchange with other people. - -The motivation behind everything is that we want to make sure that mankind will be able to influence and change the IT that surrounds us today and in the future just the way we want it and we thinks it’s good. We want to make a contribution to this. That is why Univention is there. That is important to us every day. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/interview-with-peter-ganten-ceo-of-univention-gmbh/ - -作者:[SK][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[1]: https://www.ostechnix.com/introduction-univention-corporate-server/ -[2]: https://www.univention.com/products/ucs/ -[3]: https://www.ostechnix.com/redhat-and-suse-announced-to-withdraw-support-for-openldap/ -[4]: https://fsfe.org/ -[5]: https://osb-alliance.de/ -[6]: https://www.univention.com/downloads/download-ucs/ -[7]: https://www.univention.com/downloads/ucs-online-demo/ diff --git a/sources/talk/20181007 Why it-s Easier to Get a Payrise by Switching Jobs.md b/sources/talk/20181007 Why it-s Easier to Get a Payrise by Switching Jobs.md new file mode 100644 index 0000000000..3baf2f7126 --- /dev/null +++ b/sources/talk/20181007 Why it-s Easier to Get a Payrise by Switching Jobs.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why it's Easier to Get a Payrise by Switching Jobs) +[#]: via: (https://theartofmachinery.com/2018/10/07/payrise_by_switching_jobs.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Why it's Easier to Get a Payrise by Switching Jobs +====== + +It’s an empirical fact that it’s easier to get a payrise if you’re negotiating a new job than if you’re negotiating within your current job. When I look back over my own career, every time I’ve worked somewhere longer term (over a year), payrises have been a hard struggle. But eventually I’d leave for a new position, and my new pay made all payrises at the previous job irrelevant. These days I make job switching upfront and official: I run my own business and most of my money comes from short contracts. Getting rewarded for new skills or extra work is nowhere near as difficult as before. + +I know I’m not the only one to notice this effect, but I’ve never heard anyone explain why things might be this way. + +Before I give my explanation, let me make a couple of things clear from the start. I’m not going to argue that everyone should quit their jobs. I don’t know your situation, and maybe you’re getting a good deal already. Also, I apply game theory here, but, no, I don’t assume that humans are slaves to simplistic, mechanical laws of behaviour. However, just like music composition, even if humans are free, there are still patterns that matter. If you understand this stuff, you’ll have a career advantage. + +But first, some background. + +### BATNA + +Many geeks think negotiation is like a role-playing game: roll the die, add your charisma score, and if the result is high enough you’re convincing. Geeks who think that way usually have low confidence in their “charisma score”, and they blame that for their struggle with things like asking for payrises. + +Charisma isn’t totally irrelevant, but the good news for geeks is that there’s a nerdy thing that’s much more important for negotiation: BATNA, or Best Alternative To Negotiated Agreement. Despite the jargony name, it’s a very simple idea: it’s about analysing the best outcome for both sides in a negotiation, assuming that at least one side says no to the other. Although most people don’t know it’s called “BATNA”, it’s the core of how any agreement works (or doesn’t work). + +It’s easy to explain with an example. Imagine you buy a couch for $500, but when you take it home, you discover that it doesn’t fit the place you wanted to put it. A silly mistake, but thankfully the shop offers you a full refund if you return it. Just as you’re taking it back to the shop, you meet a stranger who says they want a couch like that, and they offer to buy it. What’s the price? If you ask for $1000,000, the deal won’t happen because their BATNA is that they go to the shop and buy one themselves for $500. If they offer $1 to buy, your BATNA is that you go to the shop and get the $500 refund. You’ll only come to an agreement if the price is something like $500. If transporting the couch to the shop costs significant time and money, you’ll accept less than $500 because your BATNA is worth $500 minus the cost of transport. On the other hand, if the stranger needs to cover up a stained carpet before the landlord does an inspection in half an hour, they’ll be willing to pay a heavy premium because their BATNA is so bad. + +You can’t expect a negotiation to go well unless you’ve considered the BATNA of both sides. + +### Employment and Self-Employment + +Most people of a certain socioeconomic class believe that the ideal, “proper” career is salaried, full-time employment at someone else’s business. Many people in this class never even imagine any other way to make a living, but there are alternatives. In Australia, like other countries, you’re free to register your own business number and then do whatever it is that people will pay for. That includes sitting at a desk and working on software and computer systems, or other work that’s more commonly done as an employee. + +So why is salaried employment so popular? As someone who’s done both kinds of employment, one answer is obvious: stability. You can be (mostly) sure about exactly how much money you’ll make in the next six months when you have a salary. The next obvious answer is simplicity: as long as you meet the minimum bar of “work” done ([whatever “work” means][1]), the company promises to look after you. You don’t have to think about where your next dollar comes from, or about marketing, or insurances, or accounting, or even how to find people to socialise with. + +That sums up the main reasons to like salaried employment (not that they’re bad reasons). I sometimes hear claims about other benefits of salaried employment, but they’re typically things that you can buy. If you’re self-employed and your work isn’t paying you enough to have the same lifestyle as you could under a salary (doing the same work) that means you’re not billing high enough. A lot of people make that mistake when they quit a salaried job for self-employment, but it’s still just a mistake. + +### Asking for that Payrise + +Let’s say you’ve been working as a salaried employee at a company for a while. As a curious, self-motivated person who regularly reads essays by nerds on the internet, you’ve learned a lot in that time. You’ve applied your new skills to your work, and proven yourself to be a much more valuable employee than when you were first hired. Is it time to ask for a payrise? You practise your most charismatic phrasing, and approach your manager with your d20 in hand. The response is that you’re doing great, and they’d love to give you a payrise, but the rules say + + 1. You can’t get a payrise unless you’ve been working for more than N years + 2. You can’t get more than one payrise in N years + 3. That inflation adjustment on your salary counted as a payrise, so you can’t ask for a payrise now + 4. You can’t be paid more than [Peter][2] + 5. We need more time to see if you’re ready, so keep up the great work for another year or so and we’ll consider it then + + + +The thing to realise is that all these rules are completely arbitrary. If the company had a genuine motivation to give you a payrise, the rules would vanish. To see that, try replacing “payrise” with “workload increase”. Software projects are extremely expensive, require skill, and have a high failure rate. Software work therefore carries a non-trivial amount of responsibility, so you might argue that employers should be very conservative about increasing how much involvement someone has in a project. But I’ve never heard an employer say anything like, “Great job on getting that last task completed ahead of schedule, but we need more time to see if you’re ready to increase your workload. Just take a break until the next scheduled task, and if you do well at that one, too, maybe we can start giving you more work to do.” + +If you’re hearing feedback that you’re doing well, but there are various arbitrary reasons you can’t get rewarded for it, that’s a strong sign you’re being paid below market rates. Now, the term “market rates” gets used pretty loosely, so let me be super clear: that means someone else would agree to pay you more if you asked. + +Note that I’m not claiming that your manager is evil. At most larger companies, your manager really can’t do much against the company rules. I’m not writing this to call companies evil, either, because that won’t help you or me to get any payrises. What _will_ help is understanding why companies can afford to make payrises difficult. + +### Getting that Payrise + +You’ve probably seen this coming: it’s all about BATNA, and how you can’t expect your employer to agree to something that’s worse than their BATNA. So, what’s their BATNA? What happens if you ask for a payrise, and they say no? + +Sometimes you see a story online about someone who was burning themselves out working super hard as an obviously vital member of a team. This person asks for a small payrise and gets rejected for some silly reason. Shortly after that, they tell their employer that they have a much bigger offer from another company. Suddenly the reason for rejecting the payrise evaporates, and the employer comes up with a counteroffer, but it’s too late: the worker leaves for a better job. The original employer is left wailing and gnashing their teeth. If only companies appreciated their employees more! + +These stories are like hero stories in the movies. They tickle our sense of justice, but aren’t exactly representative of normal life. The reality is that most employees would just go back to their desks if they’re told, “No.” Sure, they’ll grumble, and they’ll upvote the next “Tech workers are underappreciated!” post on Reddit, but to many companies this is a completely acceptable BATNA. + +In short, the main bargaining chip a salaried employee has is quitting, but that negates the reasons to be a salaried employee in the first place. + +When you’re negotiating a contract with a new potential employer, however, the situation is totally different. Whatever conditions you ask for will be compared against the BATNA of searching for someone else who has your skills. Any reasonable request has a much higher chance of being accepted. + +### The Job Security Tax + +Now, something might be bothering you: despite what I’ve said, people _do_ get payrises. But all I’ve argued is that companies can make payrises difficult, not impossible. Sure, salaried employees might not quit when they’re a little underpaid. (They might not even realise they’re underpaid.) But if the underpayment gets big and obvious enough, maybe they will, so employers have to give out payrises eventually. Occasional payrises also make a good carrot for encouraging employees to keep working harder. + +At the scale of a large company, it’s just a matter of tuning. Payrises can be delayed a little here, and made a bit smaller there, and the company saves money. Go too far, and the employee attrition rate goes up, which is a sign to back off and start paying more again. + +Sure, the employee’s salary will tend to grow as their skills grow, but that growth will be slowed down. How much it is slowed down will depend (long term) on how strongly the employee values job security. It’s a job security tax. + +### What Should You Do? + +As I said before, I’m not going to tell you to quit (or not quit) without knowing what your situation is. + +Perhaps you read this thinking that it sounds nothing like your workplace. If so, you’re lucky to be in one of the better places. You now have solid reasons to appreciate your employer as much as they appreciate you. + +For the rest of you, I guess there are two broad options. Obviously, there’s the one I’m taking: not being a salaried employee. The other option is to understand the job security tax and try to optimise it. If you’re young and single, maybe you don’t need job security so much (at least for now). Even if you have good reasons to want job security (and there are plenty), maybe you can reduce your dependence on it by saving money in an emergency fund, and making sure your friendship group includes people who aren’t your current colleagues. That’s a good idea even if you aren’t planning to quit today — you never know what the future will be like. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2018/10/07/payrise_by_switching_jobs.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: /2017/09/14/busywork.html +[2]: https://www.youtube.com/watch?v=zBfTrjPSShs diff --git a/sources/talk/20181107 Understanding a -nix Shell by Writing One.md b/sources/talk/20181107 Understanding a -nix Shell by Writing One.md new file mode 100644 index 0000000000..acad742117 --- /dev/null +++ b/sources/talk/20181107 Understanding a -nix Shell by Writing One.md @@ -0,0 +1,412 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding a *nix Shell by Writing One) +[#]: via: (https://theartofmachinery.com/2018/11/07/writing_a_nix_shell.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Understanding a *nix Shell by Writing One +====== + +A typical *nix shell has a lot of programming-like features, but works quite differently from languages like Python or C++. This can make a lot of shell features — like process management, argument quoting and the `export` keyword — seem like mysterious voodoo. + +But a shell is just a program, so a good way to learn how a shell works is to write one. I’ve written [a simple shell that fits in a few hundred lines of commented D source][1]. Here’s a post that walks through how it works and how you could write one yourself. + +### First (Cheating) Steps + +A shell is a kind of REPL (Read Evaluate Print Loop). At its heart is just a simple loop that reads commands from the input, processes them, and returns a result: + +``` +import std.process; +import io = std.stdio; + +enum kPrompt = "> "; + +void main() +{ + io.write(kPrompt); + foreach (line; io.stdin.byLineCopy()) + { + // "Cheating" by using the existing shell for now + auto result = executeShell(line); + io.write(result.output); + io.write(kPrompt); + } +} + +$ dmd shell.d +$ ./shell +> head /usr/share/dict/words +A +a +aa +aal +aalii +aam +Aani +aardvark +aardwolf +Aaron +> # Press Ctrl+D to quit +> +$ +``` + +If you try out this code out for yourself, you’ll soon notice that you don’t have any nice editing features like tab completion or command history. The popular Bash shell uses a library called [GNU Readline][2] for that. You can get most of the features of Readline when playing with these toy examples just by running them under [rlwrap][3] (probably already in your system’s package manager). + +### DIY Command Execution (First Attempt) + +That first example demonstrated the absolute basic structure of a shell, but it cheated by passing commands directly to the shell already running on the system. Obviously, that doesn’t explain anything about how a real shell processes commands. + +The basic idea, though, is very simple. Nearly everything that gets called a “shell command” (e.g., `ls` or `head` or `grep`) is really just a program on the filesystem. The shell just has to run it. At the operating system level, running a program is done using the `execve` system call (or one of its alternatives). For portability and convenience, the normal way to make a system call is to use one of the wrapper functions in the C library. Let’s try using `execv()`: + +``` +import core.sys.posix.stdio; +import core.sys.posix.unistd; + +import io = std.stdio; +import std.string; + +enum kPrompt = "> "; + +void main() +{ + io.write(kPrompt); + foreach (line; io.stdin.byLineCopy()) + { + runCommand(line); + io.write(kPrompt); + } +} + +void runCommand(string cmd) +{ + // Need to convert D string to null-terminated C string + auto cmdz = cmd.toStringz(); + + // We need to pass execv an array of program arguments + // By convention, the first element is the name of the program + + // C arrays don't carry a length, just the address of the first element. + // execv starts reading memory from the first element, and needs a way to + // know when to stop. Instead of taking a length value as an argument, + // execv expects the array to end with a null as a stopping marker. + + auto argsz = [cmdz, null]; + auto error = execv(cmdz, argsz.ptr); + if (error) + { + perror(cmdz); + } +} +``` + +Here’s a sample run: + +``` +> ls +ls: No such file or directory +> head +head: No such file or directory +> grep +grep: No such file or directory +> ಠ_ಠ +ಠ_ಠ: No such file or directory +> +``` + +Okay, so that’s not working so well. The problem is that that the `execve` call isn’t as smart as a shell: it just literally executes the program it’s told to. In particular, it has no smarts for finding the programs that implement `ls` or `head`. For now, let’s do the finding ourselves, and then give `execve` the full path to the command: + +``` +$ which ls +/bin/ls +$ ./shell +> /bin/ls +shell shell.d shell.o +$ +``` + +This time the `ls` command worked, but our shell quit and we dropped straight back into the system’s shell. What’s going on? Well, `execve` really is a single-purpose call: it doesn’t spawn a new process for running the program separately from the current program, it _replaces_ the current program. (The toy shell actually quit when `ls` started, not when it finished.) Creating a new process is done with a different system call: traditionally `fork`. This isn’t how programming languages normally work, so it might seem like weird and annoying behaviour, but it’s actually really useful. Decoupling process creation from program execution allows a lot of flexibility, as will become clearer later. + +### Fork and Exec + +To keep the shell running, we’ll use the `fork()` C function to create a new process, and then make that new process `execv()` the program that implements the command. (On modern GNU/Linux systems, `fork()` is actually a wrapper around a system call called `clone`, but it still behaves like the classic `fork` system call.) + +`fork()` duplicates the current process. We get a second process that’s running the same program, at the same point, with a copy of everything in memory and all the same open files. Both the original process (parent) and the duplicate (child) keep running normally. Of course, we want the parent process to keep running the shell, and the child to `execv()` the command. The `fork()` function helps us differentiate them by returning zero in the child and a non-zero value in the parent. (This non-zero value is the process ID of the child.) + +Let’s try it out in a new version of the `runCommand()` function: + +``` +int runCommand(string cmd) +{ + // fork() duplicates the process + auto pid = fork(); + // Both the parent and child keep running from here as if nothing happened + // pid will be < 0 if forking failed for some reason + // Otherwise pid == 0 for the child and != 0 for the parent + if (pid < 0) + { + perror("Can't create a new process"); + exit(1); + } + if (pid == 0) + { + // Child process + auto cmdz = cmd.toStringz(); + auto argsz = [cmdz, null]; + execv(cmdz, argsz.ptr); + + // Only get here if exec failed + perror(cmdz); + exit(1); + } + // Parent process + // This toy shell can only run one command at a time + // All the parent does is wait for the child to finish + int status; + wait(&status); + // This is the exit code of the child + // (Conventially zero means okay, non-zero means error) + return WEXITSTATUS(status); +} +``` + +Here it is in action: + +``` +> /bin/ls +shell shell.d shell.o +> /bin/uname +Linux +> +``` + +Progress! But it still doesn’t feel like a real shell if we have to tell it exactly where to find each command. + +### PATH + +If you try using `which` to find the implementations of various commands, you might notice they’re all in the same small set of directories. The list of directories that contains commands is stored in an environment variable called `PATH`. It looks something like this: + +``` +$ echo $PATH +/home/user/bin:/home/user/local/bin:/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/games/bin +``` + +As you can see, it’s a list of directories separated by colons. If you ask a shell to run `ls`, it’s supposed to search each directory in this list for a program called `ls`. The search should be done in order starting from the first directory, so a personal implementation of `ls` in `/home/user/bin` could override the one in `/bin`. Production-ready shells cache this lookup. + +`PATH` is only used by default. If we type in a path to a program, that program will be used directly. + +Here’s a simple implemention of a smarter conversion of a command name to a C string that points to the executable. It returns a null if the command can’t be found. + +``` +const(char*) findExecutable(string cmd) +{ + if (cmd.canFind('/')) + { + if (exists(cmd)) return cmd.toStringz(); + return null; + } + + foreach (dir; environment["PATH"].splitter(":")) + { + import std.path : buildPath; + auto candidate = buildPath(dir, cmd); + if (exists(candidate)) return candidate.toStringz(); + } + return null; +} +``` + +Here’s what the shell looks like now: + +``` +> ls +shell shell.d shell.o +> uname +Linux +> head shell.d +head shell.d: No such file or directory +> +``` + +### Complex Commands + +That last command failed because the toy shell doesn’t handle program arguments yet, so it tries to find a command literally called “head shell.d”. + +If you look back at the implementation of `runCommand()`, you’ll see that `execv()` takes a C array of arguments, as well as the path to the program to run. All we have to do is process the command to make the array `["head", "shell.d", null]`. Something like this would do it: + +``` +// Key difference: split the command into pieces +auto args = cmd.split(); + +auto cmdz = findExecutable(args[0]); +if (cmdz is null) +{ + io.stderr.writef("%s: No such file or directory\n", args[0]); + // 127 means "Command not found" + // http://tldp.org/LDP/abs/html/exitcodes.html + exit(127); +} +auto argsz = args.map!(toStringz).array; +argsz ~= null; +auto error = execv(cmdz, argsz.ptr); +``` + +That makes simple arguments work, but we quickly get into problems: + +``` +> head -n 5 shell.d +import core.sys.posix.fcntl; +import core.sys.posix.stdio; +import core.sys.posix.stdlib; +import core.sys.posix.sys.wait; +import core.sys.posix.unistd; +> echo asdf +asdf +> echo $HOME +$HOME +> ls *.d +ls: cannot access '*.d': No such file or directory +> ls '/home/user/file with spaces.txt' +ls: cannot access "'/home/user/file": No such file or directory +ls: cannot access 'with': No such file or directory +ls: cannot access "spaces.txt'": No such file or directory +> +``` + +As you might guess by looking at the above, shells like a POSIX Bourne shell (or Bash) do a _lot_ more than just `split()`. Take the `echo $HOME` example. It’s a common idiom to use `echo` for viewing environment variables (like `HOME`), but `echo` itself doesn’t actually do any environment variable handling. A POSIX shell processes a command like `echo $HOME` into an array like `["echo", "/home/user", null]` and passes it to `echo`, which does nothing but reflect its arguments back to the terminal. + +A POSIX shell also handles glob patterns like `*.d`. That’s why glob patterns work with _any_ command in *nix (unlike MS-DOS, for example): the commands don’t even see the globs. + +The command `ls '/home/user/file with spaces.txt'` got split into `["ls", "'/home/user/file", "with", "spaces.txt'", null]`. Any useful shell lets you use quoting and escaping to prevent any processing (like splitting into arguments) that you don’t want. Once again, quotes are completely handled by the shell; commands don’t even see them. Also, unlike most programming languages, everything is a string in shell, so there’s no difference between `head -n 5 shell.d` and `head -n '5' shell.d` — both turn into `["head", "-n", "5", "shell.d", null]`. + +There’s something you might notice from that last example: the shell can’t treat flags like `-n 5` differently from positional arguments like `shell.d` because `execve` only takes a single array of all arguments. So that means argument types are one thing that programs _do_ have to figure out for themselves, which explains [the clichéd inteview question about why quotes won’t help you delete a file called `-`][4] (i.e., the quotes are processed before the `rm` command sees them). + +A POSIX shell supports quite complex constructs like `while` loops and pipelines, but the toy shell only supports simple commands. + +### Tweaking the Child Process + +I said earlier that decoupling `fork` from `exec` allows extra flexibility. Let me give a couple of examples. + +#### I/O Redirection + +A key design principle of Unix is that commands should be agnostic about where their input and output are from, so that user input/output can be replaced with file input/output, or even input/output of other commands. E.g.: + +``` +sort events.txt | head -n 10 > /tmp/top_ten_events.txt +``` + +How does it work? Take the `head` command. The shell forks off a new child process. The child is a duplicate of the parent, so it inherits the same standard input and output. However, the child can replace its own standard input with a pipe shared with the process for `sort`, and replace its own standard output with a file handle for `/tmp/top_ten_events.txt`. After calling `execv()`, the process will become a `head` process that blindly reads/writes to/from whatever standard I/O it has. + +Getting down to the low-level details, *nix systems represent all file handles with so-called “file descriptors”, which are just integers as far as user programs are concerned, but point to data structures inside the operating system kernel. Standard input is file descriptor 0, and standard output is file descriptor 1. Replacing standard output for `head` looks something like this (minus error handling): + +``` +// The fork happens somewhere back here +// Now running in the child process + +// Open the new file (no control over the file descriptor) +auto new_fd = open("/tmp/top_ten_events.txt", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); +// Copy the open file into file #1 (standard output) +dup2(new_fd, 1); +// Close the spare file descriptor +close(new_fd); + +// The exec happens somewhere down here +``` + +The pipeline works in the same kind of way, except instead of using `open()` to open a file, we use `pipe()` to create _two_ connected file descriptors, and then let `sort` use one, and `head` use the other. + +#### Environment Variables + +If you’ve ever had to deploy something using a command line, there’s a good chance you’ve had to set some of these configuration variables. Each process carries its own set of environment variables, so you can override, say, `AUDIODEV` for one running program without affecting others. The C standard library provides functions for manipulating environment variables, but they’re not actually managed by the operating system kernel — the [C runtime][5] manages them using the same user-space memory that other program variables use. That means they also get copied to child processes on a `fork`. The runtime and the kernel co-operate to preserve them on `execve`. + +There’s no reason we can’t manipulate the environment variables the child process ends up using. POSIX shells support this: just put any variable assignments you want directly in front of the command. + +``` +$ uname +Linux +$ # LD_DEBUG is an environment variable for enabling linker debugging +$ # (Doesn't work on all systems.) +$ LD_DEBUG=statistics uname +12128: +12128: runtime linker statistics: +12128: total startup time in dynamic loader: 2591152 cycles +12128: time needed for relocation: 816752 cycles (31.5%) +12128: number of relocations: 153 +12128: number of relocations from cache: 3 +12128: number of relative relocations: 1304 +12128: time needed to load objects: 1196148 cycles (46.1%) +Linux +$ # LD_DEBUG was only set for uname +$ echo $LD_DEBUG + +$ # Pop quiz: why doesn't this print "bar"? +$ FOO=bar echo $FOO + +$ +``` + +These temporary environment variables are useful and easy to implement. + +### Builtins + +It’s great that the fork/exec pattern lets us reconfigure the child process as much as we like without affecting the parent shell. But some commands _need_ to affect the shell. A good example is the `cd` command for changing the current working directory. It would be pointless if it ran in a child process, changed its own working directory, then just quit, leaving the shell unchanged. + +The simple solution to this problem is builtins. I said that most shell commands are implemented as external programs on the filesystem. Well, some aren’t — they’re handled directly by the shell itself. Before searching PATH for a command implementation, the shell just checks if it has it’s own built-in implementation. A neat way to code this is [the function pointer approach I described in a previous post][6]. + +You can read [a list of Bash builtins in the Advanced Bash-Scripting Guide][7]. Some, like `cd`, are builtins because they’re highly coupled to the shell. Others, like `echo`, have built-in implementations for performance reasons (most systems also have a standalone `echo` program). + +There’s one builtin that confuses a lot of people: `export`. It makes sense if you realise that the POSIX shell scripting language has its own variables that are totally separate from environment variables. A variable assignment is just a shell variable by default, and `export` makes it into an environment variable (when spawning child processes, at least). The difference is that the C runtime doesn’t know anything about shell variables, so they get lost on `execve`. + +``` +$ uname +Linux +$ # Let's try setting LD_DEBUG +$ LD_DEBUG=statistics +$ # It has no effect because that's actually just a shell variable +$ uname +Linux +$ # Let's try making into an environment variable: +$ export LD_DEBUG +$ uname +12128: +12128: runtime linker statistics: +12128: total startup time in dynamic loader: 2591152 cycles +12128: time needed for relocation: 816752 cycles (31.5%) +12128: number of relocations: 153 +12128: number of relocations from cache: 3 +12128: number of relative relocations: 1304 +12128: time needed to load objects: 1196148 cycles (46.1%) +Linux +$ # Now every non-builtin will dump debugging info +$ # Let's stop that for sanity's sake +$ unset LD_DEBUG +$ +``` + +### Putting it Together + +A POSIX-compliant shell does a lot more stuff (like signal handling and job management) but that’s enough to understand how to write an MVP *nix shell. You can see all the pieces together by checking out [the complete working example in my repository][1]. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2018/11/07/writing_a_nix_shell.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://gitlab.com/sarneaud/toyshell +[2]: https://tiswww.case.edu/php/chet/readline/rltop.html +[3]: https://github.com/hanslub42/rlwrap +[4]: https://unix.stackexchange.com/questions/1519/how-do-i-delete-a-file-whose-name-begins-with-hyphen-a-k-a-dash-or-minus +[5]: /2017/06/04/what_is_the_d_runtime.html#what-about-c--does-c-really-have-a-runtime-too +[6]: /2018/04/02/inheritance_and_polymorphism.html +[7]: https://www.tldp.org/LDP/abs/html/internal.html diff --git a/sources/talk/20181205 5 reasons to give Linux for the holidays.md b/sources/talk/20181205 5 reasons to give Linux for the holidays.md index 71d65741ed..2bcd6d642c 100644 --- a/sources/talk/20181205 5 reasons to give Linux for the holidays.md +++ b/sources/talk/20181205 5 reasons to give Linux for the holidays.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (mokshal) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (5 reasons to give Linux for the holidays) diff --git a/sources/talk/20181205 Unfortunately, Garbage Collection isn-t Enough.md b/sources/talk/20181205 Unfortunately, Garbage Collection isn-t Enough.md new file mode 100644 index 0000000000..0c08320139 --- /dev/null +++ b/sources/talk/20181205 Unfortunately, Garbage Collection isn-t Enough.md @@ -0,0 +1,44 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unfortunately, Garbage Collection isn't Enough) +[#]: via: (https://theartofmachinery.com/2018/12/05/gc_not_enough.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Unfortunately, Garbage Collection isn't Enough +====== + +Here’s a little story of some mysterious server failures I had to debug a year ago. The servers would run okay for a while, then eventually start crashing. After that, trying to run practically anything on the machines failed with “No space left on device” errors, but the filesystem only reported a few gigabytes of files on the ~20GB disks. + +The problem turned out to be caused by a log shipper. This was a Ruby app that read in log files, sent the data to a remote server, and deleted the old files. The bug was that the open log files weren’t being explicitly closed. The app was letting Ruby’s automatic garbage collector clean up the `File` objects, instead. Trouble is, `File` objects don’t use much memory, so the log shipper could theoretically keep millions of log files open before a collection was needed. + +*nix filesystems decouple filenames from file data. File data on disk can have multiple filenames pointing to it (i.e., hard links), and the data is only deleted when the last reference is removed. An open file descriptor counts as a reference, so if you delete a file while a program is reading it, the filename disappears from the directory listing, but the file data stays until the program closes it. That’s what was happening with the log shipper. The `du` (“disk usage”) command finds files using directory listings, so it didn’t see the gigabytes of file data for the thousands of log files the shipper had open. Those files only appeared after running `lsof` (“list open files”). + +Of course, the same kind of bug happens with other things. A couple of months ago I had to deal with a Java app that was breaking in production after a few days because it leaked network connections. + +Once upon a time, I wrote most of my code in C and then C++. In those days, I thought manual resource management was enough. How hard could it be? Every `malloc()` needs a `free()`, and every `open()` needs a `close()`. Simple. Except not all programs are simple, so manual resource management became a straitjacket. Then one day I discovered reference counting and garbage collection. I thought that solved all my problems, and I stopped caring about resource management completely. Once again, that was okay for simple programs, but not all programs are simple. + +Relying on garbage collection doesn’t work because it only solves the _memory_ management problem, and complex programs have to deal with a lot more than just memory. There’s a popular meme that responds to that by saying that [memory is 95% of your resource problems][1]. Well, you could say that all resources are 0% of your problems — until you run out of one of them. Then that resource becomes 100% of your problems. + +But that kind of thinking still treats resources as a special case. The deeper problem is that as programs get more complex, everything tends to become a resource. For example, take a calendar program. A complex calendar program allows multiple users to manage multiple, shareable calendars, with events that can be shared across calendars. Any piece of data will eventually have multiple parts of the program depending on it being up-to-date and accurate. So all dynamic data needs an owner, and not just for memory management. As more features are added, more parts of the program will need to update data. If you’re sane, you’ll only allow one part of the program to update data at a time, so the right and responsibility to update data becomes a limited resource, itself. Modelling mutable data with immutable datastructures doesn’t make these problems disappear; it just translates them into a different paradigm. + +Planning the ownership and lifespan of resources is an inescapable part of designing complex software. It’s easier if you exploit some common patterns. One pattern is fungible resources. An example is an immutable string “foo”, which is semantically the same as any other immutable string “foo”. This kind of resource doesn’t need a pre-determined lifespan or ownership. In fact, to keep the system as simple as possible, it’s better to have _no_ pre-determined lifespan or ownership. Another pattern is resources that are non-fungible, but have a deterministic lifespan. This includes network connections, as well as more abstract things like the ownership of a piece of data. It’s sanest to explicitly enforce the lifespan of these things in code. + +Notice that automatic garbage collection is really good for implementing the first pattern, but not the second, while manual resource management techniques (like RAII) are great for implementing the second pattern, but terrible for the first. The two approaches become complements in complex programs. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2018/12/05/gc_not_enough.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://yosefk.com/c++fqa/dtor.html#fqa-11.1 diff --git a/sources/talk/20181220 D in the Browser with Emscripten, LDC and bindbc-sdl (translation).md b/sources/talk/20181220 D in the Browser with Emscripten, LDC and bindbc-sdl (translation).md new file mode 100644 index 0000000000..b4dc33b434 --- /dev/null +++ b/sources/talk/20181220 D in the Browser with Emscripten, LDC and bindbc-sdl (translation).md @@ -0,0 +1,276 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (D in the Browser with Emscripten, LDC and bindbc-sdl (translation)) +[#]: via: (https://theartofmachinery.com/2018/12/20/emscripten_d.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +D in the Browser with Emscripten, LDC and bindbc-sdl (translation) +====== + +Here’s a tutorial about using Emscripten to run D code in a normal web browser. It’s uses a different approach from the [Dscripten game demo][1] and the [dscripten-tools][2] toolchain that’s based on it. + + * Instead of porting the D runtime, it uses a lightweight, runtimeless `-betterC` build. + * It uses Docker to manage the Emscripten installation. + + + +LDC has recently gained support for [compiling directly to WebAssembly][3], but (unlike the Emscripten approach) that doesn’t automatically get you libraries. + +You can find [the complete working code on Github][4]. `./run.sh` starts a shell in a Docker image that contains the development environment. `dub build --build=release` generates the HTML and JavaScript assets and puts them into the `dist/` directory. + +[This tutorial is translated from a Japanese post by outlandkarasu][5], who deserves all the credit for figuring this stuff out. + +### Background + +#### What’s Emscripten? + +[Emscripten][6] is a compiler toolchain for asm.js and WebAssembly that comes with ported versions of the libc and SDL2 C libraries. It can compile regular Linux-based applications in languages like C to code that can run in a browser. + +### How do you use Emscripten with D? + +Emscripten is a toolchain designed for C/C++, but the C/C++ part is just a frontend. The toolchain actually compiles LLVM intermediate representation (IR). You can generate LLVM IR bitcode from D using [LDC][7], so it should be possible to feed that through Emscripten and run D in a browser, just like C/C++. + +#### Gotchas using Emscripten + +Ideally that’s all it would take, but there are some things that require special attention (or trial and error). + + 1. D runtime library features like GC and Phobos can’t be used without an Emscripten port. + 2. It’s not enough to just produce LLVM IR. The code needs to meet Emscripten’s requirements. + * It needs to use ported libraries. + * Pointer sizes and data structure binary layouts need to match. + 3. Emscripten bugs need to be worked around. + * Debug information is particularly problematic. + + + +### Implementation + +#### Plan of attack + +Here’s the plan for making D+Emscripten development work: + + 1. Use `-betterC` and the `@nogc` and `nothrow` attributes to avoid D runtime features. + 2. Use SDL2 functions directly by statically compiling with [`bindbc-sdl`][8]. + 3. Keep on trying. + + + +#### Environment setup + +Emscripten is based on LLVM, clang and various other libraries, and is hard to set up, so I decided to [do the job with Docker][9]. I wrote a Dockerfile that would also add LDC and other tools at `docker build` time: + +``` +FROM trzeci/emscripten-slim:sdk-tag-1.38.21-64bit + +# Install D and tools, and enable them in the shell by adding them to .bashrc +RUN apt-get -y update && \ + apt-get -y install vim sudo curl && \ + sudo -u emscripten /bin/sh -c "curl -fsS https://dlang.org/install.sh | bash -s ldc-1.12.0" && \ + (echo 'source $(~/dlang/install.sh ldc -a)' >> /home/emscripten/.bashrc) + +# dub settings (explained later) +ADD settings.json /var/lib/dub/settings.json +``` + +Docker makes these big toolchains pretty easy :) + +#### Coding + +Here’s a basic demo that displays an image: + +``` +// Import SDL2 and SDL_image +// Both work with Emscripten +import bindbc.sdl; +import bindbc.sdl.image; +import core.stdc.stdio : printf; // printf works in Emscripten, too + +// Function declarations for the main loop +alias em_arg_callback_func = extern(C) void function(void*) @nogc nothrow; +extern(C) void emscripten_set_main_loop_arg(em_arg_callback_func func, void *arg, int fps, int simulate_infinite_loop) @nogc nothrow; +extern(C) void emscripten_cancel_main_loop() @nogc nothrow; + +// Log output +void logError(size_t line = __LINE__)() @nogc nothrow { + printf("%d:%s\n", line, SDL_GetError()); +} + +struct MainLoopArguments { + SDL_Renderer* renderer; + SDL_Texture* texture; +} + +// Language features restricted with @nogc and nothrow +extern(C) int main(int argc, const char** argv) @nogc nothrow { + // Initialise SDL + if(SDL_Init(SDL_INIT_VIDEO) != 0) { + logError(); + return -1; + } + scope(exit) SDL_Quit(); + + // Initialise SDL_image (with PNG support) + if(IMG_Init(IMG_INIT_PNG) != IMG_INIT_PNG) { + logError(); + return -1; + } + scope(exit) IMG_Quit(); + + // Make the window and its renderer + SDL_Window* window; + SDL_Renderer* renderer; + if(SDL_CreateWindowAndRenderer(640, 480, SDL_WINDOW_SHOWN, &window, &renderer) != 0) { + logError(); + return -1; + } + scope(exit) { + SDL_DestroyRenderer(renderer); + SDL_DestroyWindow(window); + } + + // Load image file + auto dman = IMG_Load("images/dman.png"); + if(!dman) { + logError(); + return -1; + } + scope(exit) SDL_FreeSurface(dman); + + // Make a texture from the image + auto texture = SDL_CreateTextureFromSurface(renderer, dman); + if(!texture) { + logError(); + return -1; + } + scope(exit) SDL_DestroyTexture(texture); + + // Start the image main loop + auto arguments = MainLoopArguments(renderer, texture); + emscripten_set_main_loop_arg(&mainLoop, &arguments, 60, 1); + return 0; +} + +extern(C) void mainLoop(void* p) @nogc nothrow { + // Get arguments + auto arguments = cast(MainLoopArguments*) p; + auto renderer = arguments.renderer; + auto texture = arguments.texture; + + // Clear background + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00); + SDL_RenderClear(renderer); + + // Texture image + SDL_RenderCopy(renderer, texture, null, null); + SDL_RenderPresent(renderer); + + // End of loop iteration + emscripten_cancel_main_loop(); +} +``` + +#### Building + +Now building is the tricky bit. + +##### `dub.json` + +Here’s the `dub.json` I made through trial and error. It runs the whole build from D to WebAssembly. + +``` +{ + "name": "emdman", + "authors": [ + "outland.karasu@gmail.com" + ], + "description": "A minimal emscripten D man demo.", + "copyright": "Copyright © 2018, outland.karasu@gmail.com", + "license": "BSL-1.0", + "dflags-ldc": ["--output-bc", "-betterC"], // Settings for bitcode output + "targetName": "app.bc", + "dependencies": { + "bindbc-sdl": "~>0.4.1" + }, + "subConfigurations": { + "bindbc-sdl": "staticBC" // Statically-linked, betterC build + }, + "versions": ["BindSDL_Image"], // Use SDL_image + + // Run the Emscripten compiler after generating bitcode + // * Disable optimisations + // * Enable WebAssembly + // * Use SDL+SDL_image (with PNG) + // * Set web-only as the environment + // * Embed image file(s) + // * Generate HTML for running in browser + "postBuildCommands": ["emcc -v -O0 -s WASM=1 -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"png\"]' -s ENVIRONMENT=web --embed-file images -o dist/index.html app.bc"] +} +``` + +##### Switch to 32b (x86) code generation + +Compiling with 64b “worked” but I got a warning about different data layouts: + +``` +warning: Linking two modules of different data layouts: '/tmp/emscripten_temp_WwvmL5_archive_contents/mulsc3_20989819.c.o' is 'e-p:32:32-i64:64-v128:32:128-n32-S128' whereas '/src/app.bc' is 'e-m:e-i64:64-f80:128-n8:16:32:64-S128' + +warning: Linking two modules of different target triples: /tmp/emscripten_temp_WwvmL5_archive_contents/mulsc3_20989819.c.o' is 'asmjs-unknown-emscripten' whereas '/src/app.bc' is 'x86_64-unknown-linux-gnu' +``` + +Apparently Emscripten is basically for 32b code. Using mismatched pointer sizes sounds like a pretty bad idea, so I added this `/var/lib/dub/settings.json` to the Dockerfile: + +``` +{ + "defaultArchitecture": "x86", // Set code generation to 32b + "defaultCompiler": "ldc" // Use LDC by default +} +``` + +There’s an [open issue for documenting `dub`’s `settings.json`][10]. + +##### Remove debug information + +Emscripten gave the following error when I ran a normal build with `dub`: + +``` +shared:ERROR: Failed to run llvm optimizations: +``` + +It looks like there’s [an issue related to debugging information][11]. I worked around it by using `dub --build=release`. + +### Results + +After lots of trial and error, I finally succeeded in getting my demo to run in a browser. Here’s how it looks: + +![Meet D-Man \(Demo\)][12] + +The Emscripten+D dev environment isn’t as stable as a normal dev environment. For example, rendering didn’t work if I used `SDL_LowerBlit` instead. But here’s D-Man in a browser. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2018/12/20/emscripten_d.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://github.com/Ace17/dscripten +[2]: https://github.com/CyberShadow/dscripten-tools +[3]: https://wiki.dlang.org/Generating_WebAssembly_with_LDC +[4]: https://github.com/outlandkarasu-sandbox/emdman +[5]: https://qiita.com/outlandkarasu@github/items/15e0f4b6d1b2a0eab846 +[6]: http://kripken.github.io/emscripten-site/ +[7]: https://wiki.dlang.org/LDC +[8]: https://github.com/BindBC/bindbc-sdl +[9]: https://hub.docker.com/r/trzeci/emscripten/ +[10]: https://github.com/dlang/dub/issues/1463 +[11]: https://github.com/kripken/emscripten/issues/4078 +[12]: /images/emscripten_d/d-man-browser.png diff --git a/sources/talk/20190105 Why Sorting is O(N log N).md b/sources/talk/20190105 Why Sorting is O(N log N).md new file mode 100644 index 0000000000..34a1d3bf97 --- /dev/null +++ b/sources/talk/20190105 Why Sorting is O(N log N).md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why Sorting is O(N log N)) +[#]: via: (https://theartofmachinery.com/2019/01/05/sorting_is_nlogn.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Why Sorting is O(N log N) +====== + +Any decent algorithms textbook will explain how fast sorting algorithms like quicksort and heapsort are, but it doesn’t take crazy maths to prove that they’re as asymptotically fast as you can possibly get. + +### A pedantic note about notation + +Most computer scientists use big-O notation to mean “asymptotically equal, up to a constant scaling factor”, which isn’t quite what it means to other mathematicians. Sorry, I’ll use big-O like in CS textbooks, but at least I won’t mix it with other mathematical notation. + +## Comparison-based sorting + +Let’s look at the special case of algorithms that compare values two at a time (like quicksort and heapsort, and most other popular algorithms). The ideas can be extended to all sorting algorithms later. + +### A simple counting argument for the worst case + +Suppose you have an array of four elements, all different, in random order. Can you sort it by comparing just one pair of elements? Obviously not, but here’s one good reason that proves you can’t: By definition, to sort the array, you need to how to rearrange the elements to put them in order. In other words, you need to know which permutation is needed. How many possible permutations are there? The first element could be moved to one of four places, the second one could go to one of the remaining three, the third element has two options, and the last element has to take the one remaining place. So there are (4 \times 3 \times 2 \times 1 = 4! = 24) possible permutations to choose from, but there are only two possible results from comparing two different things: “BIGGER” and “SMALLER”. If you made a list of all the possible permutations, you might decide that “BIGGER” means you need permutation #8 and “SMALLER” means you need permutation #24, but there’s no way you could know when you need the other 22 permutations. + +With two comparisons, you have (2 \times 2 = 4) possible outputs, which still isn’t enough. You can’t sort every possible shuffled array unless you do at least five comparisons ((2^{5} = 32)). If (W(N)) is the worst-case number of comparisons needed to sort (N) different elements using some algorithm, we can say + +[2^{W(N)} \geq N!] + +Taking a logarithm base 2, + +[W(N) \geq \log_{2}{N!}] + +Asymptotically, (N!) grows like (N^{N}) (see also [Stirling’s formula][1]), so + +[W(N) \succeq \log N^{N} = N\log N] + +And that’s an (O(N\log N)) limit on the worst case just from counting outputs. + +### Average case from information theory + +We can get a stronger result if we extend that counting argument with a little information theory. Here’s how we could use a sorting algorithm as a code for transmitting information: + + 1. I think of a number — say, 15 + 2. I look up permutation #15 from the list of permutations of four elements + 3. I run the sorting algorithm on this permutation and record all the “BIGGER” and “SMALLER” comparison results + 4. I transmit the comparison results to you in binary code + 5. You re-enact my sorting algorithm run, step by step, referring to my list of comparison results as needed + 6. Now that you know how I rearranged my array to make it sorted, you can reverse the permutation to figure out my original array + 7. You look up my original array in the permutation list to figure out I transmitted the number 15 + + + +Okay, it’s a bit strange, but it could be done. That means that sorting algorithms are bound by the same laws as normal encoding schemes, including the theorem proving there’s no universal data compressor. I transmitted one bit per comparison the algorithm does, so, on average, the number of comparisons must be at least the number of bits needed to represent my data, according to information theory. More technically, [the average number of comparisons must be at least the Shannon entropy of my input data, measured in bits][2]. Entropy is a mathematical measure of the information content, or unpredictability, of something. + +If I have an array of (N) elements that could be in any possible order without bias, then entropy is maximised and is (\log_{2}{N!}) bits. That proves that (O(N\log N)) is an optimal average for a comparison-based sort with arbitrary input. + +That’s the theory, but how do real sorting algorithms compare? Below is a plot of the average number of comparisons needed to sort an array. I’ve compared the theoretical optimum against naïve quicksort and the [Ford-Johnson merge-insertion sort][3], which was designed to minimise comparisons (though it’s rarely faster than quicksort overall because there’s more to life than minimising comparisons). Since it was developed in 1959, merge-insertion sort has been tweaked to squeeze a few more comparisons out, but the plot shows it’s already almost optimal. + +![Plot of average number of comparisons needed to sort randomly shuffled arrays of length up to 100. Bottom line is theoretical optimum. Within about 1% is merge-insertion sort. Naïve quicksort is within about 25% of optimum.][4] + +It’s nice when a little theory gives such a tight practical result. + +### Summary so far + +Here’s what’s been proven so far: + + 1. If the array could start in any order, at least (O(N\log N)) comparisons are needed in the worst case + 2. The average number of comparisons must be at least the entropy of the array, which is (O(N\log N)) for random input + + + +Note that #2 allows comparison-based sorting algorithms to be faster than (O(N\log N)) if the input is low entropy (in other words, more predictable). Merge sort is close to (O(N)) if the input contains many sorted subarrays. Insertion sort is close to (O(N)) if the input is an array that was sorted before being perturbed a bit. None of them beat (O(N\log N)) in the worst case unless some array orderings are impossible as inputs. + +## General sorting algorithms + +Comparison-based sorts are an interesting special case in practice, but there’s nothing theoretically special about [`CMP`][5] as opposed to any other instruction on a computer. Both arguments above can be generalised to any sorting algorithm if you note a couple of things: + + 1. Most computer instructions have more than two possible outputs, but still have a limited number + 2. The limited number of outputs means that one instruction can only process a limited amount of entropy + + + +That gives us the same (O(N\log N)) lower bound on the number of instructions. Any physically realisable computer can only process a limited number of instructions at a time, so that’s an (O(N\log N)) lower bound on the time required, as well. + +### But what about “faster” algorithms? + +The most useful practical implication of the general (O(N\log N)) bound is that if you hear about any asymptotically faster algorithm, you know it must be “cheating” somehow. There must be some catch that means it isn’t a general purpose sorting algorithm that scales to arbitrarily large arrays. It might still be a useful algorithm, but it’s a good idea to read the fine print closely. + +A well-known example is radix sort. It’s often called an (O(N)) sorting algorithm, but the catch is that it only works if all the numbers fit into (k) bits, and it’s really (O({kN})). + +What does that mean in practice? Suppose you have an 8-bit machine. You can represent (2^{8} = 256) different numbers in 8 bits, so if you have an array of thousands of numbers, you’re going to have duplicates. That might be okay for some applications, but for others you need to upgrade to at least 16 bits, which can represent (2^{16} = 65,536) numbers distinctly. 32 bits will support (2^{32} = 4,294,967,296) different numbers. As the size of the array goes up, the number of bits needed will tend to go up, too. To represent (N) different numbers distinctly, you’ll need (k \geq \log_{2}N). So, unless you’re okay with lots of duplicates in your array, (O({kN})) is effectively (O(N\log N)). + +The need for (O(N\log N)) of input data in the general case actually proves the overall result by itself. That argument isn’t so interesting in practice because we rarely need to sort billions of integers on a 32-bit machine, and [if anyone’s hit the limits of a 64-bit machine, they haven’t told the rest of us][6]. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/01/05/sorting_is_nlogn.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: http://hyperphysics.phy-astr.gsu.edu/hbase/Math/stirling.html +[2]: https://en.wikipedia.org/wiki/Shannon%27s_source_coding_theorem +[3]: https://en.wikipedia.org/wiki/Merge-insertion_sort +[4]: /images/sorting_is_nlogn/sorting_algorithms_num_comparisons.svg +[5]: https://c9x.me/x86/html/file_module_x86_id_35.html +[6]: https://sortbenchmark.org/ diff --git a/sources/talk/20190131 OOP Before OOP with Simula.md b/sources/talk/20190131 OOP Before OOP with Simula.md index cae9d9bd3a..aca160ad2d 100644 --- a/sources/talk/20190131 OOP Before OOP with Simula.md +++ b/sources/talk/20190131 OOP Before OOP with Simula.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (warmfrog) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/talk/20190208 Which programming languages should you learn.md b/sources/talk/20190208 Which programming languages should you learn.md deleted file mode 100644 index 31cef16f03..0000000000 --- a/sources/talk/20190208 Which programming languages should you learn.md +++ /dev/null @@ -1,46 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Which programming languages should you learn?) -[#]: via: (https://opensource.com/article/19/2/which-programming-languages-should-you-learn) -[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) - -Which programming languages should you learn? -====== -Learning a new programming language is a great way to get ahead in your career. But which one? -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0) - -If you want to get started or get ahead in your programming career, learning a new language is a smart idea. But the huge number of languages in active use invites the question: Which programming language is the best one to know? To answer that, let's start with a simplifying question: What sort of programming do you want to do? - -If you want to do web programming on the client side, then the specialized languages HTML, CSS, and JavaScript—in one of its seemingly infinite dialects—are de rigueur. - -If you want to do web programming on the server side, the options include all of the familiar general-purpose languages: C++, Golang, Java, C#, Node.js, Perl, Python, Ruby, and so on. As a matter of course, server-side programs interact with datastores, such as relational and other databases, which means query languages such as SQL may come into play. - -If you're writing native apps for mobile devices, knowing the target platform is important. For Apple devices, Swift has supplanted Objective C as the language of choice. For Android devices, Java (with dedicated libraries and toolsets) remains the dominant language. There are special languages such as Xamarin, used with C#, that can generate platform-specific code for Apple, Android, and Windows devices. - -What about general-purpose languages? There are various choices within the usual pigeonholes. Among the dynamic or scripting languages (e.g., Perl, Python, and Ruby), there are newer offerings such as Node.js. Java and C#, which are more alike than their fans like to admit, remain the dominant statically compiled languages targeted at a virtual machine (the JVM and CLR, respectively). Among languages that compile into native executables, C++ is still in the mix, along with later arrivals such as Golang and Rust. General-purpose functional languages abound (e.g., Clojure, Haskell, Erlang, F#, Lisp, and Scala), often with passionately devoted communities. It's worth noting that object-oriented languages such as Java and C# have added functional constructs (in particular, lambdas), and the dynamic languages have had functional constructs from the start. - -Let me end with a pitch for C, which is a small, elegant, and extensible language not to be confused with C++. Modern operating systems are written mostly in C, with the rest in assembly language. The standard libraries on any platform are likewise mostly in C. For example, any program that issues the Hello, world! greeting does so through a call to the C library function named **write**. - -C serves as a portable assembly language, exposing details about the underlying system that other high-level languages deliberately hide. To understand C is thus to gain a better grasp of how programs contend for the shared system resources (processors, memory, and I/O devices) required for execution. C is at once high-level and close-to-the-metal, so unrivaled in performance—except, of course, for assembly language. Finally, C is the lingua franca among programming languages, and almost every general-purpose language supports C calls in one form or another. - -For a modern introduction to C, consider my book [C Programming: Introducing Portable Assembler][1]. No matter how you go about it, learn C and you'll learn a lot more than just another programming language. - -What programming languages do you think are important to know? Do you agree or disagree with these recommendations? Let us know in the comments! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/which-programming-languages-should-you-learn - -作者:[Marty Kalin][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/mkalindepauledu -[b]: https://github.com/lujun9972 -[1]: https://www.amazon.com/dp/1977056954?ref_=pe_870760_150889320 diff --git a/sources/talk/20190211 Introducing kids to computational thinking with Python.md b/sources/talk/20190211 Introducing kids to computational thinking with Python.md deleted file mode 100644 index c877d3c212..0000000000 --- a/sources/talk/20190211 Introducing kids to computational thinking with Python.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (WangYueScream ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Introducing kids to computational thinking with Python) -[#]: via: (https://opensource.com/article/19/2/break-down-stereotypes-python) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Introducing kids to computational thinking with Python -====== -Coding program gives low-income students the skills, confidence, and knowledge to break free from economic and societal disadvantages. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_kid_education.png?itok=3lRp6gFa) - -When the [Parkman Branch][1] of the Detroit Public Library was flooded with bored children taking up all the computers during summer break, the library saw it not as a problem, rather an opportunity. They started a coding club, the [Parkman Coders][2], led by [Qumisha Goss][3], a librarian who is leveraging the power of Python to introduce disadvantaged children to computational thinking. - -When she started the Parkman Coders program about four years ago, "Q" (as she is known) didn't know much about coding. Since then, she's become a specialist in library instruction and technology and a certified Raspberry Pi instructor. - -The program began by using [Scratch][4], but the students got bored with the block coding interface, which they regarded as "baby stuff." She says, "I knew we need to make a change to something that was still beginner friendly, but that would be more challenging for them to continue to hold their attention." At this point, she started teaching them Python. - -Q first saw Python while playing a game with dungeons and skeleton monsters on [Code.org][5]. She began to learn Python by reading books like [Python Programming: An Introduction to Computer Science][6] and [Python for Kids][7]. She also recommends [Automate the Boring Stuff with Python][8] and [Lauren Ipsum: A Story about Computer Science and Other Improbable Things][9]. - -### Setting up a Raspberry Pi makerspace - -Q decided to use [Raspberry Pi][10] computers to avoid the possibility that the students might be able to hack into the library system's computers, which weren't arranged in a way conducive to a makerspace anyway. The Pi's affordability, plus its flexibility and the included free software, lent more credibility to her decision. - -While the coder program was the library's effort keep the peace and create a learning space that would engage the children, it quickly grew so popular that it ran out of space, computers, and adequate electrical outlets in a building built in 1921. They started with 10 Raspberry Pi computers shared among 20 children, but the library obtained funding from individuals, companies including Microsoft, the 4H, and the Detroit Public Library Foundation to get more equipment and expand the program. - -Currently, about 40 children participate in each session and they have enough Raspberry Pi's for one device per child and some to give away. Many of the Parkman Coders come from low socio-economic backgrounds and don't have a computer at home, so the library provides them with donated Chromebooks. - -Q says, "when kids demonstrate that they have a good understanding of how to use a Raspberry Pi or a [Microbit][11] and have been coming to programs regularly, we give them equipment to take home with them. This process is very challenging, however, because [they may not] have internet access at home [or] all the peripheral things they need like monitors, keyboards, and mice." - -### Learning life skills and breaking stereotypes with Python - -Q says, "I believe that the mainstays of learning computer science are learning critical thinking and problem-solving skills. My hope is that these lessons will stay with the kids as they grow and pursue futures in whatever field they choose. In addition, I'm hoping to inspire some pride in creatorship. It's a very powerful feeling to know 'I made this thing,' and once they've had these successes early, I hope they will approach new challenges with zeal." - -She also says, "in learning to program, you have to learn to be hyper-vigilant about spelling and capitalization, and for some of our kids, reading is an issue. To make sure that the program is inclusive, we spell aloud during our lessons, and we encourage kids to speak up if they don't know a word or can't spell it correctly." - -Q also tries to give extra attention to children who need it. She says, "if I recognize that someone has a more severe problem, we try to get them paired with a tutor at our library outside of program time, but still allow them to come to the program. We want to help them without discouraging them from participating." - -Most importantly, the Parkman Coders program seeks to help every child realize that each has a unique skill set and abilities. Most of the children are African-American and half are girls. Q says, "we live in a world where we grow up with societal stigmas that frequently limit our own belief of what we can accomplish." She believes that children need a nonjudgmental space where "they can try new things, mess up, and discover." - -The environment Q and the Parkman Coders program creates helps the participants break away from economic and societal disadvantages. She says that the secret sauce is to "make sure you have a welcoming space so anyone can come and that your space is forgiving and understanding. Let people come as they are, and be prepared to teach and to learn; when people feel comfortable and engaged, they want to stay." - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/break-down-stereotypes-python - -作者:[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://detroitpubliclibrary.org/locations/parkman -[2]: https://www.dplfound.org/single-post/2016/05/15/Parkman-Branch-Coders -[3]: https://www.linkedin.com/in/qumisha-goss-b3bb5470 -[4]: https://scratch.mit.edu/ -[5]: http://Code.org -[6]: https://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1887902996 -[7]: https://nostarch.com/pythonforkids -[8]: https://automatetheboringstuff.com/ -[9]: https://nostarch.com/laurenipsum -[10]: https://www.raspberrypi.org/ -[11]: https://microbit.org/guide/ diff --git a/sources/talk/20190228 Why CLAs aren-t good for open source.md b/sources/talk/20190228 Why CLAs aren-t good for open source.md deleted file mode 100644 index ca39619762..0000000000 --- a/sources/talk/20190228 Why CLAs aren-t good for open source.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why CLAs aren't good for open source) -[#]: via: (https://opensource.com/article/19/2/cla-problems) -[#]: author: (Richard Fontana https://opensource.com/users/fontana) - -Why CLAs aren't good for open source -====== -Few legal topics in open source are as controversial as contributor license agreements. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/write-hand_0.jpg?itok=Uw5RJD03) - -Few legal topics in open source are as controversial as [contributor license agreements][1] (CLAs). Unless you count the special historical case of the [Fedora Project Contributor Agreement][2] (which I've always seen as an un-CLA), or, like [Karl Fogel][3], you classify the [DCO][4] as a [type of CLA][5], today Red Hat makes no use of CLAs for the projects it maintains. - -It wasn't always so. Red Hat's earliest projects followed the traditional practice I've called "inbound=outbound," in which contributions to a project are simply provided under the project's open source license with no execution of an external, non-FOSS contract required. But in the early 2000s, Red Hat began experimenting with the use of contributor agreements. Fedora started requiring contributors to sign a CLA based on the widely adapted [Apache ICLA][6], while a Free Software Foundation-derived copyright assignment agreement and a pair of bespoke CLAs were inherited from the Cygnus and JBoss acquisitions, respectively. We even took [a few steps][7] towards adopting an Apache-style CLA across the rapidly growing set of Red Hat-led projects. - -This came to an end, in large part because those of us on the Red Hat legal team heard and understood the concerns and objections raised by Red Hat engineers and the wider technical community. We went on to become de facto leaders of what some have called the anti-CLA movement, marked notably by our [opposition to Project Harmony][8] and our [efforts][9] to get OpenStack to replace its CLA with the DCO. (We [reluctantly][10] sign tolerable upstream project CLAs out of practical necessity.) - -### Why CLAs are problematic - -Our choice not to use CLAs is a reflection of our values as an authentic open source company with deep roots in the free software movement. Over the years, many in the open source community have explained why CLAs, and the very similar mechanism of copyright assignment, are a bad policy for open source. - -One reason is the red tape problem. Normally, open source development is characterized by frictionless contribution, which is enabled by inbound=outbound without imposition of further legal ceremony or process. This makes it relatively easy for new contributors to get involved in a project, allowing more effective growth of contributor communities and driving technical innovation upstream. Frictionless contribution is a key part of the advantage open source development holds over proprietary alternatives. But frictionless contribution is negated by CLAs. Having to sign an unusual legal agreement before a contribution can be accepted creates a bureaucratic hurdle that slows down development and discourages participation. This cost persists despite the growing use of automation by CLA-using projects. - -CLAs also give rise to an asymmetry of legal power among a project's participants, which also discourages the growth of strong contributor and user communities around a project. With Apache-style CLAs, the company or organization leading the project gets special rights that other contributors do not receive, while those other contributors must shoulder certain legal obligations (in addition to the red tape burden) from which the project leader is exempt. The problem of asymmetry is most severe in copyleft projects, but it is present even when the outbound license is permissive. - -When assessing the arguments for and against CLAs, bear in mind that today, as in the past, the vast majority of the open source code in any product originates in projects that follow the inbound=outbound practice. The use of CLAs by a relatively small number of projects causes collateral harm to all the others by signaling that, for some reason, open source licensing is insufficient to handle contributions flowing into a project. - -### The case for CLAs - -Since CLAs continue to be a minority practice and originate from outside open source community culture, I believe that CLA proponents should bear the burden of explaining why they are necessary or beneficial relative to their costs. I suspect that most companies using CLAs are merely emulating peer company behavior without critical examination. CLAs have an understandable, if superficial, appeal to risk-averse lawyers who are predisposed to favor greater formality, paper, and process regardless of the business costs. Still, some arguments in favor of CLAs are often advanced and deserve consideration. - -**Easy relicensing:** If administered appropriately, Apache-style CLAs give the project steward effectively unlimited power to sublicense contributions under terms of the steward's choice. This is sometimes seen as desirable because of the potential need to relicense a project under some other open source license. But the value of easy relicensing has been greatly exaggerated by pointing to a few historical cases involving major relicensing campaigns undertaken by projects with an unusually large number of past contributors (all of which were successful without the use of a CLA). There are benefits in relicensing being hard because it results in stable legal expectations around a project and encourages projects to consult their contributor communities before undertaking significant legal policy changes. In any case, most inbound=outbound open source projects never attempt to relicense during their lifetime, and for the small number that do, relicensing will be relatively painless because typically the number of past contributors to contact will not be large. - -**Provenance tracking:** It is sometimes claimed that CLAs enable a project to rigorously track the provenance of contributions, which purportedly has some legal benefit. It is unclear what is achieved by the use of CLAs in this regard that is not better handled through such non-CLA means as preserving Git commit history. And the DCO would seem to be much better suited to tracking contributions, given that it is normally used on a per-commit basis, while CLAs are signed once per contributor and are administratively separate from code contributions. Moreover, provenance tracking is often described as though it were a benefit for the public, yet I know of no case where a project provides transparent, ready public access to CLA acceptance records. - -**License revocation:** Some CLA advocates warn of the prospect that a contributor may someday attempt to revoke a past license grant. To the extent that the concern is about largely judgment-proof individual contributors with no corporate affiliation, it is not clear why an Apache-style CLA provides more meaningful protection against this outcome compared to the use of an open source license. And, as with so many of the legal risks raised in discussions of open source legal policy, this appears to be a phantom risk. I have heard of only a few purported attempts at license revocation over the years, all of which were resolved quickly when the contributor backed down in the face of community pressure. - -**Unauthorized employee contribution:** This is a special case of the license revocation issue and has recently become a point commonly raised by CLA advocates. When an employee contributes to an upstream project, normally the employer owns the copyrights and patents for which the project needs licenses, and only certain executives are authorized to grant such licenses. Suppose an employee contributed proprietary code to a project without approval from the employer, and the employer later discovers this and demands removal of the contribution or sues the project's users. This risk of unauthorized contributions is thought to be minimized by use of something like the [Apache CCLA][11] with its representations and signature requirement, coupled with some adequate review process to ascertain that the CCLA signer likely was authorized to sign (a step which I suspect is not meaningfully undertaken by most CLA-using companies). - -Based on common sense and common experience, I contend that in nearly all cases today, employee contributions are done with the actual or constructive knowledge and consent of the employer. If there were an atmosphere of high litigation risk surrounding open source software, perhaps this risk should be taken more seriously, but litigation arising out of open source projects remains remarkably uncommon. - -More to the point, I know of no case where an allegation of copyright or patent infringement against an inbound=outbound project, not stemming from an alleged open source license violation, would have been prevented by use of a CLA. Patent risk, in particular, is often cited by CLA proponents when pointing to the risk of unauthorized contributions, but the patent license grants in Apache-style CLAs are, by design, quite narrow in scope. Moreover, corporate contributions to an open source project will typically be few in number, small in size (and thus easily replaceable), and likely to be discarded as time goes on. - -### Alternatives - -If your company does not buy into the anti-CLA case and cannot get comfortable with the simple use of inbound=outbound, there are alternatives to resorting to an asymmetric and administratively burdensome Apache-style CLA requirement. The use of the DCO as a complement to inbound=outbound addresses at least some of the concerns of risk-averse CLA advocates. If you must use a true CLA, there is no need to use the Apache model (let alone a [monstrous derivative][10] of it). Consider the non-specification core of the [Eclipse Contributor Agreement][12]—essentially the DCO wrapped inside a CLA—or the Software Freedom Conservancy's [Selenium CLA][13], which merely ceremonializes an inbound=outbound contribution policy. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/2/cla-problems - -作者:[Richard Fontana][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/fontana -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/article/18/3/cla-vs-dco-whats-difference -[2]: https://opensource.com/law/10/6/new-contributor-agreement-fedora -[3]: https://www.red-bean.com/kfogel/ -[4]: https://developercertificate.org -[5]: https://producingoss.com/en/contributor-agreements.html#developer-certificate-of-origin -[6]: https://www.apache.org/licenses/icla.pdf -[7]: https://www.freeipa.org/page/Why_CLA%3F -[8]: https://opensource.com/law/11/7/trouble-harmony-part-1 -[9]: https://wiki.openstack.org/wiki/OpenStackAndItsCLA -[10]: https://opensource.com/article/19/1/cla-proliferation -[11]: https://www.apache.org/licenses/cla-corporate.txt -[12]: https://www.eclipse.org/legal/ECA.php -[13]: https://docs.google.com/forms/d/e/1FAIpQLSd2FsN12NzjCs450ZmJzkJNulmRC8r8l8NYwVW5KWNX7XDiUw/viewform?hl=en_US&formkey=dFFjXzBzM1VwekFlOWFWMjFFRjJMRFE6MQ#gid=0 diff --git a/sources/talk/20190311 Discuss everything Fedora.md b/sources/talk/20190311 Discuss everything Fedora.md deleted file mode 100644 index 5795fbf3f7..0000000000 --- a/sources/talk/20190311 Discuss everything Fedora.md +++ /dev/null @@ -1,45 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Discuss everything Fedora) -[#]: via: (https://fedoramagazine.org/discuss-everything-fedora/) -[#]: author: (Ryan Lerch https://fedoramagazine.org/introducing-flatpak/) - -Discuss everything Fedora -====== -![](https://fedoramagazine.org/wp-content/uploads/2019/03/fedora-discussion-816x345.jpg) - -Are you interested in how Fedora is being developed? Do you want to get involved, or see what goes into making a release? You want to check out [Fedora Discussion][1]. It is a relatively new place where members of the Fedora Community meet to discuss, ask questions, and interact. Keep reading for more information. - -Note that the Fedora Discussion system is mainly aimed at contributors. If you have questions on using Fedora, check out [Ask Fedora][2] (which is being migrated in the future). - -![][3] - -Fedora Discussion is a forum and discussion site that uses the [Discourse open source discussion platform][4]. - -There are already several categories useful for Fedora users, including [Desktop][5] (covering Fedora Workstation, Fedora Silverblue, KDE, XFCE, and more) and the [Server, Cloud, and IoT][6] category . Additionally, some of the [Fedora Special Interest Groups (SIGs) have discussions as well][7]. Finally, the [Fedora Friends][8] category helps you connect with other Fedora users and Community members by providing discussions about upcoming meetups and hackfests. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/discuss-everything-fedora/ - -作者:[Ryan Lerch][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/introducing-flatpak/ -[b]: https://github.com/lujun9972 -[1]: https://discussion.fedoraproject.org/ -[2]: https://ask.fedoraproject.org -[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/discussion-screenshot-1024x663.png -[4]: https://www.discourse.org/about -[5]: https://discussion.fedoraproject.org/c/desktop -[6]: https://discussion.fedoraproject.org/c/server -[7]: https://discussion.fedoraproject.org/c/sigs -[8]: https://discussion.fedoraproject.org/c/friends diff --git a/sources/talk/20190314 A Look Back at the History of Firefox.md b/sources/talk/20190314 A Look Back at the History of Firefox.md deleted file mode 100644 index f4118412b4..0000000000 --- a/sources/talk/20190314 A Look Back at the History of Firefox.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A Look Back at the History of Firefox) -[#]: via: (https://itsfoss.com/history-of-firefox) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -A Look Back at the History of Firefox -====== - -The Firefox browser has been a mainstay of the open-source community for a long time. For many years it was the default web browser on (almost) all Linux distros and the lone obstacle to Microsoft’s total dominance of the internet. This browser has roots that go back all the way to the very early days of the internet. Since this week marks the 30th anniversary of the internet, there is no better time to talk about how Firefox became the browser we all know and love. - -### Early Roots - -In the early 1990s, a young man named [Marc Andreessen][1] was working on his bachelor’s degree in computer science at the University of Illinois. While there, he started working for the [National Center for Supercomputing Applications][2]. During that time [Sir Tim Berners-Lee][3] released an early form of the web standards that we know today. Marc [was introduced][4] to a very primitive web browser named [ViolaWWW][5]. Seeing that the technology had potential, Marc and Eric Bina created an easy to install browser for Unix named [NCSA Mosaic][6]). The first alpha was released in June 1993. By September, there were ports to Windows and Macintosh. Mosaic became very popular because it was easier to use than other browsing software. - -In 1994, Marc graduated and moved to California. He was approached by Jim Clark, who had made his money selling computer hardware and software. Clark had used Mosaic and saw the financial possibilities of the internet. Clark recruited Marc and Eric to start an internet software company. The company was originally named Mosaic Communications Corporation, however, the University of Illinois did not like [their use of the name Mosaic][7]. As a result, the company name was changed to Netscape Communications Corporation. - -The company’s first project was an online gaming network for the Nintendo 64, but that fell through. The first product they released was a web browser named Mosaic Netscape 0.9, subsequently renamed Netscape Navigator. Internally, the browser project was codenamed mozilla, which stood for “Mosaic killer”. An employee created a cartoon of a [Godzilla like creature][8]. They wanted to take out the competition. - -![Early Firefox Mascot][9]Early Mozilla mascot at Netscape - -They succeed mightily. At the time, one of the biggest advantages that Netscape had was the fact that its browser looked and functioned the same on every operating system. Netscape described this as giving everyone a level playing field. - -As usage of Netscape Navigator increase, the market share of NCSA Mosaic cratered. In 1995, Netscape went public. [On the first day][10], the stock started at $28, jumped to $75 and ended the day at $58. Netscape was without any rivals. - -But that didn’t last for long. In the summer of 1994, Microsoft released Internet Explorer 1.0, which was based on Spyglass Mosaic which was based on NCSA Mosaic. The [browser wars][11] had begun. - -Over the next few years, Netscape and Microsoft competed for dominance of the internet. Each added features to compete with the other. Unfortunately, Internet Explorer had an advantage because it came bundled with Windows. On top of that, Microsoft had more programmers and money to throw at the problem. Toward the end of 1997, Netscape started to run into financial problems. - -### Going Open Source - -![Mozilla Firefox][12] - -In January 1998, Netscape open-sourced the code of the Netscape Communicator 4.0 suite. The [goal][13] was to “harness the creative power of thousands of programmers on the Internet by incorporating their best enhancements into future versions of Netscape’s software. This strategy is designed to accelerate development and free distribution by Netscape of future high-quality versions of Netscape Communicator to business customers and individuals.” - -The project was to be shepherded by the newly created Mozilla Organization. However, the code from Netscape Communicator 4.0 proved to be very difficult to work with due to its size and complexity. On top of that, several parts could not be open sourced because of licensing agreements with third parties. In the end, it was decided to rewrite the browser from scratch using the new [Gecko][14]) rendering engine. - -In November 1998, Netscape was acquired by AOL for [stock swap valued at $4.2 billion][15]. - -Starting from scratch was a major undertaking. Mozilla Firefox (initially nicknamed Phoenix) was created in June 2002 and it worked on multiple operating systems, such as Linux, Mac OS, Microsoft Windows, and Solaris. - -The following year, AOL announced that they would be shutting down browser development. The Mozilla Foundation was subsequently created to handle the Mozilla trademarks and handle the financing of the project. Initially, the Mozilla Foundation received $2 million in donations from AOL, IBM, Sun Microsystems, and Red Hat. - -In March 2003, Mozilla [announced pl][16][a][16][ns][16] to separate the suite into stand-alone applications because of creeping software bloat. The stand-alone browser was initially named Phoenix. However, the name was changed due to a trademark dispute with the BIOS manufacturer Phoenix Technologies, which had a BIOS-based browser named trademark dispute with the BIOS manufacturer Phoenix Technologies. Phoenix was renamed Firebird only to run afoul of the Firebird database server people. The browser was once more renamed to the Firefox that we all know. - -At the time, [Mozilla said][17], “We’ve learned a lot about choosing names in the past year (more than we would have liked to). We have been very careful in researching the name to ensure that we will not have any problems down the road. We have begun the process of registering our new trademark with the US Patent and Trademark office.” - -![Mozilla Firefox 1.0][18]Firefox 1.0 : [Picture Credit][19] - -The first official release of Firefox was [0.8][20] on February 8, 2004. 1.0 followed on November 9, 2004. Version 2.0 and 3.0 followed in October 2006 and June 2008 respectively. Each major release brought with it many new features and improvements. In many respects, Firefox pulled ahead of Internet Explorer in terms of features and technology, but IE still had more users. - -That changed with the release of Google’s Chrome browser. In the months before the release of Chrome in September 2008, Firefox accounted for 30% of all [browser usage][21] and IE had over 60%. According to StatCounter’s [January 2019 report][22], Firefox accounts for less than 10% of all browser usage, while Chrome has over 70%. - -Fun Fact - -Contrary to popular belief, the logo of Firefox doesn’t feature a fox. It’s actually a [Red Panda][23]. In Chinese, “fire fox” is another name for the red panda. - -### The Future - -As noted above, Firefox currently has the lowest market share in its recent history. There was a time when a bunch of browsers were based on Firefox, such as the early version of the [Flock browser][24]). Now most browsers are based on Google technology, such as Opera and Vivaldi. Even Microsoft is giving up on browser development and [joining the Chromium band wagon][25]. - -This might seem like quite a downer after the heights of the early Netscape years. But don’t forget what Firefox has accomplished. A group of developers from around the world have created the second most used browser in the world. They clawed 30% market share away from Microsoft’s monopoly, they can do it again. After all, they have us, the open source community, behind them. - -The fight against the monopoly is one of the several reasons [why I use Firefox][26]. Mozilla regained some of its lost market-share with the revamped release of [Firefox Quantum][27] and I believe that it will continue the upward path. - -What event from Linux and open source history would you like us to write about next? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][28]. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/history-of-firefox - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Marc_Andreessen -[2]: https://en.wikipedia.org/wiki/National_Center_for_Supercomputing_Applications -[3]: https://en.wikipedia.org/wiki/Tim_Berners-Lee -[4]: https://www.w3.org/DesignIssues/TimBook-old/History.html -[5]: http://viola.org/ -[6]: https://en.wikipedia.org/wiki/Mosaic_(web_browser -[7]: http://www.computinghistory.org.uk/det/1789/Marc-Andreessen/ -[8]: http://www.davetitus.com/mozilla/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/Mozilla_boxing.jpg?ssl=1 -[10]: https://www.marketwatch.com/story/netscape-ipo-ignited-the-boom-taught-some-hard-lessons-20058518550 -[11]: https://en.wikipedia.org/wiki/Browser_wars -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?resize=800%2C450&ssl=1 -[13]: https://web.archive.org/web/20021001071727/wp.netscape.com/newsref/pr/newsrelease558.html -[14]: https://en.wikipedia.org/wiki/Gecko_(software) -[15]: http://news.cnet.com/2100-1023-218360.html -[16]: https://web.archive.org/web/20050618000315/http://www.mozilla.org/roadmap/roadmap-02-Apr-2003.html -[17]: https://www-archive.mozilla.org/projects/firefox/firefox-name-faq.html -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/firefox-1.jpg?ssl=1 -[19]: https://www.iceni.com/blog/firefox-1-0-introduced-2004/ -[20]: https://en.wikipedia.org/wiki/Firefox_version_history -[21]: https://en.wikipedia.org/wiki/Usage_share_of_web_browsers -[22]: http://gs.statcounter.com/browser-market-share/desktop/worldwide/#monthly-201901-201901-bar -[23]: https://en.wikipedia.org/wiki/Red_panda -[24]: https://en.wikipedia.org/wiki/Flock_(web_browser -[25]: https://www.windowscentral.com/microsoft-building-chromium-powered-web-browser-windows-10 -[26]: https://itsfoss.com/why-firefox/ -[27]: https://itsfoss.com/firefox-quantum-ubuntu/ -[28]: http://reddit.com/r/linuxusersgroup -[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/mozilla-firefox.jpg?fit=800%2C450&ssl=1 diff --git a/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md b/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md new file mode 100644 index 0000000000..02f7e3fcac --- /dev/null +++ b/sources/talk/20190319 Hello World Marketing (or, How I Find Good, Boring Software).md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Hello World Marketing (or, How I Find Good, Boring Software)) +[#]: via: (https://theartofmachinery.com/2019/03/19/hello_world_marketing.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Hello World Marketing (or, How I Find Good, Boring Software) +====== + +Back in 2001 Joel Spolsky wrote his classic essay [“Good Software Takes Ten Years. Get Used To it”][1]. Nothing much has changed since then: software is still taking around a decade of development to get good, and the industry is still getting used to that fact. Unfortunately, the industry has investors who want to see hockey stick growth rates on software that’s a year old or less. The result is an antipattern I like to call “Hello World Marketing”. Once you start to notice it, you see it everywhere, and it’s a huge red flag when choosing software tools. + + +Of course, by “Hello World”, I’m referring to the programmer’s traditional first program: the one that just displays the message “Hello World”. The aim isn’t to make a useful program; it’s to make a minimal starting point. + +Hello World Marketing is about doing the same thing, but pretending that it’s useful. You’re supposed to be distracted into admiring how neatly a tool solves trivial problems, and forget about features you’ll need in real applications. HWM emphasises what can be done in the first five minutes, and downplays what you might need after several months. HWMed software is optimised for looking good in demos, and sounding exciting in blog posts and presentations. + +For a good example, see Nemil Dalal’s [great series of articles about the early marketing for MongoDB][2]. Notice the heavy use of hackathons, and that a lot of the marketing was about how “SQL looks like COBOL”. Now, I can criticise SQL, too, but if `SELECT` and `WHERE` are serious problems for an application, there are already hundreds of solutions like [SQLAlchemy][3] and [LINQ][4] — solutions that don’t compromise on more advanced features of traditional databases. On the other hand, if you were wondering about those advanced features, you could read vomity-worthy, hand-wavey pieces like “[Living in the post-transactional database future][5]”. + +### How I Find Good, Boring Software + +Obviously, one way to avoid HWM is to stick to software that’s much more than ten years old, and has a good reputation. But sometimes that’s not possible because the tools for a problem only came out during the last decade. Also, sometimes newer tools really do bring new benefits. + +However, it’s much harder to rely on reputation for newer software because “good reputation” often just means “popular”, which often just means “current fad”. Thankfully, there’s a simple and effective trick to avoid being dazzled by hype: just look elsewhere. Instead of looking at the marketing for the core features, look at the things that are usually forgotten. Here are the kinds of things I look at: + +#### Backups and Disaster Recovery + +Backup support is both super important and regularly an afterthought. + +The minimum viable product is full data dump/import functionality, but longer term it’s nice to have things like incremental backups. Some vendors will try to tell you to just copy the data files from disk, but this isn’t guaranteed to give you a consistent snapshot if the software is running live. + +There’s no point backing up data if you can’t restore it, and restoration is the difficult part. Yet many people never test the restoration (until they actually need it). About five years ago I was working with a team that had started using a new, cutting-edge, big-data database. The database looked pretty good, but I suggested we do an end-to-end test of the backup support. We loaded a cluster with one of the multi-terabyte datasets we had, did a backup, wiped the data in the cluster and then tried to restore it. Turns out we were the first people to actually try to restore a dataset of that size — the backup “worked”, but the restoration caused the cluster to crash and burn. We filed a bug report with the original database developers and they fixed it. + +Backup processes that work on small test datasets but fail on large production datasets is a recurring theme. I always recommend testing on production-sized datasets, and testing again as production data grows. + +For batch jobs, a related concept is restartability. If you’re copying large amounts of data from one place to another, and the job gets interrupted in the middle, what happens? Can you keep going from the middle? Alternatively, can you safely retry by starting from the beginning? + +#### Configuration + +A lot of HWMed software can only be configured using a GUI or web UI because that’s what’s obvious and looks good in demos and docs. For one thing, this usually means there’s no good way to back up or restore the configuration. So if a team of people use a shared instance over a year or so, forget about trying to restore it if (or when) it breaks. It’s also much more work to keep multiple deployments consistent (e.g., for dev, testing and prod environments) using separate GUIs. In practice, it just doesn’t happen. + +I prefer a well-commented config file for software I deploy, if nothing else because it can be checked into source control, and I know I can reproduce the deployment using nothing but what’s checked into source control. If something is configured using a UI, I look for a config export/import function. Even then, that feature is often an afterthought, and often imcomplete, so it’s worth testing if it’s possible to deploy the software without ever needing to manually tweak something in the UI. + +There seems to be a recent trend for software to be configured using a REST API instead. Honestly, this is the worst of both config files and GUI-based config, and most of the time people end up using [hacky ways to put the config into a file instead][6]. + +#### Upgrades + +Life would be much easier if everything were static; software upgrade support makes everything more complicated. It’s also not usually shown in demos, so the first upgrade often ends the honeymoon with shiny, new software. + +For HA distributed systems, you’ll need support for graceful shutdown and a certain amount of forward _and_ backwards compatibility (because you’ll have multiple versions running during upgrades). It’s a common mistake to forget about downgrade support. + +Distributed systems are simpler when components have independent replicas that don’t communicate with each other. Anything with clustering (or, worse, consensus algorithms) is often extra tricky to upgrade, and worth testing. + +Things that support horizontal scaling don’t necessarily support rescaling without downtime. This is especially true whenever sharding is involved because live resharding isn’t trivial. + +Here’s a story from a certain popular container app platform. Demos showed how easy it was to launch an app on the platform, and then showed how easy it was to scale it to multiple replicas. What they didn’t show was the upgrade process: When you pushed a new version of your app, the first thing the platform did was _shut down all running instances of it_. Then it would upload the code to a build server and start building it — meaning downtime for however long the build took, plus the time needed to roll out the new version (if it worked). This problem has been fixed in newer releases of the platform. + +#### Security + +Even if software has no built-in access control, all-or-nothing access control is easy to implement (e.g., using a reverse proxy with HTTP basic auth). The harder problem is fine-grained access control. Sometimes you don’t care, but in some environments it makes a big difference to what features you can even use. + +Some immature software has a quick-and-dirty implementation of user-based access control, typically with a GUI for user management. For everything except the core business tool, this isn’t very useful. For human users, every project I’ve worked on has either been with a small team that just shared a single username/password, or with a large team that wanted integration with OpenID Connect, or LDAP, or whatever centralised single-sign-on (SSO) system was used by the organisation. No one wants to manually manage credentials for every tool, every time someone joins or leaves. Similarly, credentials for applications or other non-human users are better generated using an automatable approach — like a config file or API. + +Immature implementations of access control are often missing anything like user groups, but managing permissions at the user level is a time waster. Some SSO integrations only integrate users, not groups, which is a “so close yet so far” when it comes to avoiding permissions busywork. + +#### Others + +I talked about ignoring the hype, but there’s one good signal you can get from the marketing: whether the software is branded as “enterprise” software. Enterprise software is normally bought by someone other than the end user, so it’s usually pleasant to buy but horrible to use. The only exceptions I know of are enterprise versions of normal consumer software, and enterprise software that the buyer will also have to use. Be warned: even if a company sells enterprise software alongside consumer software, there’s no guarantee that they’re just different versions of the same product. Often they’ll be developed by separate teams with different priorities. + +A lot of the stuff in this post can be checked just by skimming through the documentation. If a tool stores data, but the documentation doesn’t mention backups, there probably isn’t any backup suppport. Even if there is and it’s just not documented, that’s not exactly a good sign either. So, sure, documentation quality is worth evaluating by itself. On the other hand, sometimes the documentation is better than the product, so I never trust a tool until I’ve actually tried it out. + +When I first saw Python, I knew that it was a terrible programming language because of the way it used whitespace indentation. Yeah, that was stupid. Later on I learned that 1) the syntax wasn’t a big deal, especially when I’m already indenting C-like languages in the same way, and 2) a lot of practical problems can be solved just by gluing libraries together with a few dozen lines of Python, and that was really useful. We often have strong opinions about syntax that are just prejudice. Syntax can matter, but it’s less important than how the tool integrates with the rest of the system. + +### Weighing Pros and Cons + +You never need to do deep analysis to detect the most overhyped products. Just check a few of these things and they’ll fail spectacularly. + +Even with software that looks solid, I still like to do more tests before entrusting a serious project with it. That’s not because I’m looking for excuses to nitpick and use my favourite tool instead. New tools often really do bring new benefits. But it’s much better to understand the pros and cons of new software, and to use it because the pros outweigh the cons, not because of how slick the Hello World demo is. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/03/19/hello_world_marketing.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://www.joelonsoftware.com/2001/07/21/good-software-takes-ten-years-get-used-to-it/ +[2]: https://www.nemil.com/mongo/ +[3]: https://www.sqlalchemy.org/ +[4]: https://msdn.microsoft.com/en-us/library/bb308959.aspx +[5]: https://www.mongodb.com/post/36151042528/post-transactional-future +[6]: /2017/07/15/use_terraform_with_vault.html diff --git a/sources/talk/20190322 How to save time with TiDB.md b/sources/talk/20190322 How to save time with TiDB.md deleted file mode 100644 index 534c04de1f..0000000000 --- a/sources/talk/20190322 How to save time with TiDB.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to save time with TiDB) -[#]: via: (https://opensource.com/article/19/3/how-save-time-tidb) -[#]: author: (Morgan Tocker https://opensource.com/users/morgo) - -How to save time with TiDB -====== - -TiDB, an open source-compatible, cloud-based database engine, simplifies many of MySQL database administrators' common tasks. - -![Team checklist][1] - -Last November, I wrote about key [differences between MySQL and TiDB][2], an open source-compatible, cloud-based database engine, from the perspective of scaling both solutions in the cloud. In this follow-up article, I'll dive deeper into the ways [TiDB][3] streamlines and simplifies administration. - -If you come from a MySQL background, you may be used to doing a lot of manual tasks that are either not required or much simpler with TiDB. - -The inspiration for TiDB came from the founders managing sharded MySQL at scale at some of China's largest internet companies. Since requirements for operating a large system at scale are a key concern, I'll look at some typical MySQL database administrator (DBA) tasks and how they translate to TiDB. - -[![TiDB architecture][4]][5] - -In [TiDB's architecture][5]: - - * SQL processing is separated from data storage. The SQL processing (TiDB) and storage (TiKV) components independently scale horizontally. - * PD (Placement Driver) acts as the cluster manager and stores metadata. - * All components natively provide high availability, with PD and TiKV using the [Raft consensus algorithm][6]. - * You can access your data via either MySQL (TiDB) or Spark (TiSpark) protocols. - - - -### Adding/fixing replication slaves - -**tl;dr:** It doesn't happen in the same way as in MySQL. - -Replication and redundancy of data are automatically managed by TiKV. You also don't need to worry about creating initial backups to seed replicas, as _both_ the provisioning and replication are handled for you. - -Replication is also quorum-based using the Raft consensus algorithm, so you don't have to worry about the inconsistency problems surrounding failures that you do with asynchronous replication (the default in MySQL and what many users are using). - -TiDB does support its own binary log, so it can be used for asynchronous replication between clusters. - -### Optimizing slow queries - -**tl;dr:** Still happens in TiDB - -There is no real way out of optimizing slow queries that have been introduced by development teams. - -As a mitigating factor though, if you need to add breathing room to your database's capacity while you work on optimization, the TiDB's architecture allows you to horizontally scale. - -### Upgrades and maintenance - -**tl;dr:** Still required, but generally easier - -Because the TiDB server is stateless, you can roll through an upgrade and deploy new TiDB servers. Then you can remove the older TiDB servers from the load balancer pool, shutting down them once connections have drained. - -Upgrading PD is also quite straightforward since only the PD leader actively answers requests at a time. You can perform a rolling upgrade and upgrade PD's non-leader peers one at a time, and then change the leader before upgrading the final PD server. - -For TiKV, the upgrade is marginally more complex. If you want to remove a node, I recommend first setting it to be a follower on each of the regions where it is currently a leader. After that, you can bring down the node without impacting your application. If the downtime is brief, TiKV will recover with its regional peers from the Raft log. In a longer downtime, it will need to re-copy data. This can all be managed for you, though, if you choose to deploy using Ansible or Kubernetes. - -### Manual sharding - -**tl;dr:** Not required - -Manual sharding is mainly a pain on the part of the application developers, but as a DBA, you might have to get involved if the sharding is naive or has problems such as hotspots (many workloads do) that require re-balancing. - -In TiDB, re-sharding or re-balancing happens automatically in the background. The PD server observes when data regions (TiKV's term for chunks of data in key-value form) get too small, too big, or too frequently accessed. - -You can also explicitly configure PD to store regions on certain TiKV servers. This works really well when combined with MySQL partitioning. - -### Capacity planning - -**tl;dr:** Much easier - -Capacity planning on a MySQL database can be a little bit hard because you need to plan your physical infrastructure requirements two to three years from now. As data grows (and the working set changes), this can be a difficult task. I wouldn't say it completely goes away in the cloud either, since changing a master server's hardware is always hard. - -TiDB splits data into approximately 100MiB chunks that it distributes among TiKV servers. Because this increment is much smaller than a full server, it's much easier to move around and redistribute data. It's also possible to add new servers in smaller increments, which is easier on planning. - -### Scaling - -**tl;dr:** Much easier - -This is related to capacity planning and sharding. When we talk about scaling, many people think about very large _systems,_ but that is not exclusively how I think of the problem: - - * Scaling is being able to start with something very small, without having to make huge investments upfront on the chance it could become very large. - * Scaling is also a people problem. If a system requires too much internal knowledge to operate, it can become hard to grow as an engineering organization. The barrier to entry for new hires can become very high. - - - -Thus, by providing automatic sharding, TiDB can scale much easier. - -### Schema changes (DDL) - -**tl;dr:** Mostly better - -The data definition language (DDL) supported in TiDB is all online, which means it doesn't block other reads or writes to the system. It also doesn't block the replication stream. - -That's the good news, but there are a couple of limitations to be aware of: - - * TiDB does not currently support all DDL operations, such as changing the primary key or some "change data type" operations. - * TiDB does not currently allow you to chain multiple DDL changes in the same command, e.g., _ALTER TABLE t1 ADD INDEX (x), ADD INDEX (y)_. You will need to break these queries up into individual DDL queries. - - - -This is an area that we're looking to improve in [TiDB 3.0][7]. - -### Creating one-off data dumps for the reporting team - -**tl;dr:** May not be required - -DBAs loathe manual tasks that create one-off exports of data to be consumed by another team, perhaps in an analytics tool or data warehouse. - -This is often required when the types of queries that are be executed on the dataset are analytical. TiDB has hybrid transactional/analytical processing (HTAP) capabilities, so in many cases, these queries should work fine. If your analytics team is using Spark, you can also use the [TiSpark][8] connector to allow them to connect directly to TiKV. - -This is another area we are improving with [TiFlash][7], a column store accelerator. We are also working on a plugin system to support external authentication. This will make it easier to manage access by the reporting team. - -### Conclusion - -In this post, I looked at some common MySQL DBA tasks and how they translate to TiDB. If you would like to learn more, check out our [TiDB Academy course][9] designed for MySQL DBAs (it's free!). - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/how-save-time-tidb - -作者:[Morgan Tocker][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/morgo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/article/18/11/key-differences-between-mysql-and-tidb -[3]: https://github.com/pingcap/tidb -[4]: https://opensource.com/sites/default/files/uploads/tidb_architecture.png (TiDB architecture) -[5]: https://pingcap.com/docs/architecture/ -[6]: https://raft.github.io/ -[7]: https://pingcap.com/blog/tidb-3.0-beta-stability-at-scale/ -[8]: https://github.com/pingcap/tispark -[9]: https://pingcap.com/tidb-academy/ diff --git a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md b/sources/talk/20190327 Why DevOps is the most important tech strategy today.md deleted file mode 100644 index 288977e789..0000000000 --- a/sources/talk/20190327 Why DevOps is the most important tech strategy today.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why DevOps is the most important tech strategy today) -[#]: via: (https://opensource.com/article/19/3/devops-most-important-tech-strategy) -[#]: author: (Kelly AlbrechtWilly-Peter Schaub https://opensource.com/users/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht) - -Why DevOps is the most important tech strategy today -====== -Clearing up some of the confusion about DevOps. -![CICD with gears][1] - -Many people first learn about [DevOps][2] when they see one of its outcomes and ask how it happened. It's not necessary to understand why something is part of DevOps to implement it, but knowing that—and why a DevOps strategy is important—can mean the difference between being a leader or a follower in an industry. - -Maybe you've heard some the incredible outcomes attributed to DevOps, such as production environments that are so resilient they can handle thousands of releases per day while a "[Chaos Monkey][3]" is running around randomly unplugging things. This is impressive, but on its own, it's a weak business case, essentially burdened with [proving a negative][4]: The DevOps environment is resilient because a serious failure hasn't been observed… yet. - -There is a lot of confusion about DevOps and many people are still trying to make sense of it. Here's an example from someone in my LinkedIn feed: - -> Recently attended few #DevOps sessions where some speakers seemed to suggest #Agile is a subset of DevOps. Somehow, my understanding was just the opposite. -> -> Would like to hear your thoughts. What do you think is the relationship between Agile and DevOps? -> -> 1. DevOps is a subset of Agile -> 2. Agile is a subset of DevOps -> 3. DevOps is an extension of Agile, starts where Agile ends -> 4. DevOps is the new version of Agile -> - - -Tech industry professionals have been weighing in on the LinkedIn post with a wide range of answers. How would you respond? - -### DevOps' roots in lean and agile - -DevOps makes a lot more sense if we start with the strategies of Henry Ford and the Toyota Production System's refinements of Ford's model. Within this history is the birthplace of lean manufacturing, which has been well studied. In [_Lean Thinking_][5], James P. Womack and Daniel T. Jones distill it into five principles: - - 1. Specify the value desired by the customer - 2. Identify the value stream for each product providing that value and challenge all of the wasted steps currently necessary to provide it - 3. Make the product flow continuously through the remaining value-added steps - 4. Introduce pull between all steps where continuous flow is possible - 5. Manage toward perfection so that the number of steps and the amount of time and information needed to serve the customer continually falls - - - -Lean seeks to continuously remove waste and increase the flow of value to the customer. This is easily recognizable and understood through a core tenet of lean: single piece flow. We can do a number of activities to learn why moving single pieces at a time is magnitudes faster than batches of many pieces; the [Penny Game][6] and the [Airplane Game][7] are two of them. In the Penny Game, if a batch of 20 pennies takes two minutes to get to the customer, they get the whole batch after waiting two minutes. If you move one penny at a time, the customer gets the first penny in about five seconds and continues getting pennies until the 20th penny arrives approximately 25 seconds later. - -This is a huge difference, but not everything in life is as simple and predictable as the penny in the Penny Game. This is where agile comes in. We certainly see lean principles on high-performing agile teams, but these teams need more than lean to do what they do. - -To be able to handle the unpredictability and variance of typical software development tasks, agile methodology focuses on awareness, deliberation, decision, and action to adjust course in the face of a constantly changing reality. For example, agile frameworks (like scrum) increase awareness with ceremonies like the daily standup and the sprint review. If the scrum team becomes aware of a new reality, the framework allows and encourages them to adjust course if necessary. - -For teams to make these types of decisions, they need to be self-organizing in a high-trust environment. High-performing agile teams working this way achieve a fast flow of value while continuously adjusting course, removing the waste of going in the wrong direction. - -### Optimal batch size - -To understand the power of DevOps in software development, it helps to understand the economics of batch size. Consider the following U-curve optimization illustration from Donald Reinertsen's _[Principles of Product Development Flow][8]:_ - -![U-curve optimization illustration of optimal batch size][9] - -This can be explained with an analogy about grocery shopping. Suppose you need to buy some eggs and you live 30 minutes from the store. Buying one egg (far left on the illustration) at a time would mean a 30-minute trip each time. This is your _transaction cost_. The _holding cost_ might represent the eggs spoiling and taking up space in your refrigerator over time. The _total cost_ is the _transaction cost_ plus your _holding cost_. This U-curve explains why, for most people, buying a dozen eggs at a time is their _optimal batch size_. If you lived next door to the store, it'd cost you next to nothing to walk there, and you'd probably buy a smaller carton each time to save room in your refrigerator and enjoy fresher eggs. - -This U-curve optimization illustration can shed some light on why productivity increases significantly in successful agile transformations. Consider the effect of agile transformation on decision making in an organization. In traditional hierarchical organizations, decision-making authority is centralized. This leads to larger decisions made less frequently by fewer people. An agile methodology will effectively reduce an organization's transaction cost for making decisions by decentralizing the decisions to where the awareness and information is the best known: across the high-trust, self-organizing agile teams. - -The following animation shows how reducing transaction cost shifts the optimal batch size to the left. You can't understate the value to an organization in making faster decisions more frequently. - -![U-curve optimization illustration][10] - -### Where does DevOps fit in? - -Automation is one of the things DevOps is most known for. The previous illustration shows the value of automation in great detail. Through automation, we reduce our transaction costs to nearly zero, essentially getting our testing and deployments for free. This lets us take advantage of smaller and smaller batch sizes of work. Smaller batches of work are easier to understand, commit to, test, review, and know when they are done. These smaller batch sizes also contain less variance and risk, making them easier to deploy and, if something goes wrong, to troubleshoot and recover from. With automation combined with a solid agile practice, we can get our feature development very close to single piece flow, providing value to customers quickly and continuously. - -More traditionally, DevOps is understood as a way to knock down the walls of confusion between the dev and ops teams. In this model, development teams develop new features, while operations teams keep the system stable and running smoothly. Friction occurs because new features from development introduce change into the system, increasing the risk of an outage, which the operations team doesn't feel responsible for—but has to deal with anyway. DevOps is not just trying to get people working together, it's more about trying to make more frequent changes safely in a complex environment. - -We can look to [Ron Westrum][11] for research about achieving safety in complex organizations. In researching why some organizations are safer than others, he found that an organization's culture is predictive of its safety. He identified three types of culture: Pathological, Bureaucratic, and Generative. He found that the Pathological culture was predictive of less safety and the Generative culture was predictive of more safety (e.g., far fewer plane crashes or accidental hospital deaths in his main areas of research). - -![Three types of culture identified by Ron Westrum][12] - -Effective DevOps teams achieve a Generative culture with lean and agile practices, showing that speed and safety are complementary, or two sides of the same coin. By reducing the optimal batch sizes of decisions and features to become very small, DevOps achieves a faster flow of information and value while removing waste and reducing risk. - -In line with Westrum's research, change can happen easily with safety and reliability improving at the same time. When an agile DevOps team is trusted to make its own decisions, we get the tools and techniques DevOps is most known for today: automation and continuous delivery. Through this automation, transaction costs are reduced further than ever, and a near single piece lean flow is achieved, creating the potential for thousands of decisions and releases per day, as we've seen happen in high-performing DevOps organizations. - -### Flow, feedback, learning - -DevOps doesn't stop there. We've mainly been talking about DevOps achieving a revolutionary flow, but lean and agile practices are further amplified through similar efforts that achieve faster feedback loops and faster learning. In the [_DevOps Handbook_][13], the authors explain in detail how, beyond its fast flow, DevOps achieves telemetry across its entire value stream for fast and continuous feedback. Further, leveraging the [kaizen][14] bursts of lean and the [retrospectives][15] of scrum, high-performing DevOps teams will continuously drive learning and continuous improvement deep into the foundations of their organizations, achieving a lean manufacturing revolution in the software product development industry. - -### Start with a DevOps assessment - -The first step in leveraging DevOps is, either after much study or with the help of a DevOps consultant and coach, to conduct an assessment across a suite of dimensions consistently found in high-performing DevOps teams. The assessment should identify weak or non-existent team norms that need improvement. Evaluate the assessment's results to find quick wins—focus areas with high chances for success that will produce high-impact improvement. Quick wins are important for gaining the momentum needed to tackle more challenging areas. The teams should generate ideas that can be tried quickly and start to move the needle on the DevOps transformation. - -After some time, the team should reassess on the same dimensions to measure improvements and identify new high-impact focus areas, again with fresh ideas from the team. A good coach will consult, train, mentor, and support as needed until the team owns its own continuous improvement and achieves near consistency on all dimensions by continually reassessing, experimenting, and learning. - -In the [second part][16] of this article, we'll look at results from a DevOps survey in the Drupal community and see where the quick wins are most likely to be found. - -* * * - -_Rob_ _Bayliss and Kelly Albrecht will present[DevOps: Why, How, and What][17] and host a follow-up [Birds of a][18]_ [_Feather_][18] _[discussion][18] at [DrupalCon 2019][19] in Seattle, April 8-12._ - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/devops-most-important-tech-strategy - -作者:[Kelly AlbrechtWilly-Peter Schaub][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/ksalbrecht/users/brentaaronreed/users/wpschaub/users/wpschaub/users/ksalbrecht -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) -[2]: https://opensource.com/resources/devops -[3]: https://github.com/Netflix/chaosmonkey -[4]: https://en.wikipedia.org/wiki/Burden_of_proof_(philosophy)#Proving_a_negative -[5]: https://www.amazon.com/dp/B0048WQDIO/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[6]: https://youtu.be/5t6GhcvKB8o?t=54 -[7]: https://www.shmula.com/paper-airplane-game-pull-systems-push-systems/8280/ -[8]: https://www.amazon.com/dp/B00K7OWG7O/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1 -[9]: https://opensource.com/sites/default/files/uploads/batch_size_optimal_650.gif (U-curve optimization illustration of optimal batch size) -[10]: https://opensource.com/sites/default/files/uploads/batch_size_650.gif (U-curve optimization illustration) -[11]: https://en.wikipedia.org/wiki/Ron_Westrum -[12]: https://opensource.com/sites/default/files/uploads/information_flow.png (Three types of culture identified by Ron Westrum) -[13]: https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002/ref=sr_1_3?keywords=DevOps+handbook&qid=1553197361&s=books&sr=1-3 -[14]: https://en.wikipedia.org/wiki/Kaizen -[15]: https://www.scrum.org/resources/what-is-a-sprint-retrospective -[16]: https://opensource.com/article/19/3/where-drupal-community-stands-devops-adoption -[17]: https://events.drupal.org/seattle2019/sessions/devops-why-how-and-what -[18]: https://events.drupal.org/seattle2019/bofs/devops-getting-started -[19]: https://events.drupal.org/seattle2019 diff --git a/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md b/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md new file mode 100644 index 0000000000..f0f0190742 --- /dev/null +++ b/sources/talk/20190328 Continuous response- The essential process we-re ignoring in DevOps.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Continuous response: The essential process we're ignoring in DevOps) +[#]: via: (https://opensource.com/article/19/3/continuous-response-devops) +[#]: author: (Randy Bias https://opensource.com/users/randybias) + +Continuous response: The essential process we're ignoring in DevOps +====== +You probably practice CI and CD, but if you aren't thinking about +continuous response, you aren't really doing DevOps. +![CICD with gears][1] + +Continuous response (CR) is an overlooked link in the DevOps process chain. The two other major links—[continuous integration (CI) and continuous delivery (CD)][2]—are well understood, but CR is not. Yet, CR is the essential element of follow-through required to make customers happy and fulfill the promise of greater speed and agility. At the heart of the DevOps movement is the need for greater velocity and agility to bring businesses into our new digital age. CR plays a pivotal role in enabling this. + +### Defining CR + +We need a crisp definition of CR to move forward with breaking it down. To put it into context, let's revisit the definitions of continuous integration (CI) and continuous delivery (CD). Here are Gartner's definitions when I wrote this them down in 2017: + +> [Continuous integration][3] is the practice of integrating, building, testing, and delivering functional software on a scheduled, repeatable, and automated basis. +> +> Continuous delivery is a software engineering approach where teams keep producing valuable software in short cycles while ensuring that the software can be reliably released at any time. + +I propose the following definition for CR: + +> Continuous response is a practice where developers and operators instrument, measure, observe, and manage their deployed software looking for changes in performance, resiliency, end-user behavior, and security posture and take corrective actions as necessary. + +We can argue about whether these definitions are 100% correct. They are good enough for our purposes, which is framing the definition of CR in rough context so we can understand it is really just the last link in the chain of a holistic cycle. + +![The holistic DevOps cycle][4] + +What is this multi-colored ring, you ask? It's the famous [OODA Loop][5]. Before continuing, let's touch on what the OODA Loop is and why it's relevant to DevOps. We'll keep it brief though, as there is already a long history between the OODA Loop and DevOps. + +#### A brief aside: The OODA Loop + +At the heart of core DevOps thinking is using the OODA Loop to create a proactive process for evolving and responding to changing environments. A quick [web search][6] makes it easy to learn the long history between the OODA Loop and DevOps, but if you want the deep dive, I highly recommend [The Tao of Boyd: How to Master the OODA Loop][7]. + +Here is the "evolved OODA Loop" presented by John Boyd: + +![OODA Loop][8] + +The most important thing to understand about the OODA Loop is that it's a cognitive process for adapting to and handling changing circumstances. + +The second most important thing to understand about the OODA Loop is, since it is a thought process that is meant to evolve, it depends on driving feedback back into the earlier parts of the cycle as you iterate. + +As you can see in the diagram above, CI, CD, and CR are all their own isolated OODA Loops within the overall DevOps OODA Loop. The key here is that each OODA Loop is an evolving thought process for how test, release, and success are measured. Simply put, those who can execute on the OODA Loop fastest will win. + +Put differently, DevOps wants to drive speed (executing the OODA Loop faster) combined with agility (taking feedback and using it to constantly adjust the OODA Loop). This is why CR is a vital piece of the DevOps process. We must drive production feedback into the DevOps maturation process. The DevOps notion of Culture, Automation, Measurement, and Sharing ([CAMS][9]) partially but inadequately captures this, whereas CR provides a much cleaner continuation of CI/CD in my mind. + +### Breaking CR down + +CR has more depth and breadth than CI or CD. This is natural, given that what we're categorizing is the post-deployment process by which our software is taking a variety of actions from autonomic responses to analytics of customer experience. I think, when it's broken down, there are three key buckets that CR components fall into. Each of these three areas forms a complete OODA Loop; however, the level of automation throughout the OODA Loop varies significantly. + +The following table will help clarify the three areas of CR: + +CR Type | Purpose | Examples +---|---|--- +Real-time | Autonomics for availability and resiliency | Auto-scaling, auto-healing, developer-in-the-loop automated responses to real-time failures, automated root-cause analysis +Analytic | Feature/fix pipeline | A/B testing, service response times, customer interaction models +Predictive | History-based planning | Capacity planning, hardware failure prediction models, cost-basis analysis + +_Real-time CR_ is probably the best understood of the three. This kind of CR is where our software has been instrumented for known issues and can take an immediate, automated response (autonomics). Examples of known issues include responding to high or low demand (e.g., elastic auto-scaling), responding to expected infrastructure resource failures (e.g., auto-healing), and responding to expected distributed application failures (e.g., circuit breaker pattern). In the future, we will see machine learning (ML) and similar technologies applied to automated root-cause analysis and event correlation, which will then provide a path towards "no ops" or "zero ops" operational models. + +_Analytic CR_ is still the most manual of the CR processes. This kind of CR is focused primarily on observing end-user experience and providing feedback to the product development cycle to add features or fix existing functionality. Examples of this include traditional A/B website testing, measuring page-load times or service-response times, post-mortems of service failures, and so on. + +_Predictive CR_ , due to the resurgence of AI and ML, is one of the innovation areas in CR. It uses historical data to predict future needs. ML techniques are allowing this area to become more fully automated. Examples include automated and predictive capacity planning (primarily for the infrastructure layer), automated cost-basis analysis of service delivery, and real-time reallocation of infrastructure resources to resolve capacity and hardware failure issues before they impact the end-user experience. + +### Diving deeper on CR + +CR, like CI or CD, is a DevOps process supported by a set of underlying tools. CI and CD are not Jenkins, unit tests, or automated deployments alone. They are a process flow. Similarly, CR is a process flow that begins with the delivery of new code via CD, which open source tools like [Spinnaker][10] give us. CR is not monitoring, machine learning, or auto-scaling, but a diverse set of processes that occur after code deployment, supported by a variety of tools. CR is also different in two specific ways. + +First, it is different because, by its nature, it is broader. The general software development lifecycle (SDLC) process means that most [CI/CD processes][11] are similar. However, code running in production differs from app to app or service to service. This means that CR differs as well. + +Second, CR is different because it is nascent. Like CI and CD before it, the process and tools existed before they had a name. Over time, CI/CD became more normalized and easier to scope. CR is new, hence there is lots of room to discuss what's in or out. I welcome your comments in this regard and hope you will run with these ideas. + +### CR: Closing the loop on DevOps + +DevOps arose because of the need for greater service delivery velocity and agility. Essentially, DevOps is an extension of agile software development practices to an operational mindset. It's a direct response to the flexibility and automation possibilities that cloud computing affords. However, much of the thinking on DevOps to date has focused on deploying the code to production and ends there. But our jobs don't end there. As professionals, we must also make certain our code is behaving as expected, we are learning as it runs in production, and we are taking that learning back into the product development process. + +This is where CR lives and breathes. DevOps without CR is the same as saying there is no OODA Loop around the DevOps process itself. It's like saying that operators' and developers' jobs end with the code being deployed. We all know this isn't true. Customer experience is the ultimate measurement of our success. Can people use the software or service without hiccups or undue friction? If not, we need to fix it. CR is the final link in the DevOps chain that enables delivering the truest customer experience. + +If you aren't thinking about continuous response, you aren't doing DevOps. Share your thoughts on CR, and tell me what you think about the concept and the definition. + +* * * + +_This article is based on[The Essential DevOps Process We're Ignoring: Continuous Response][12], which originally appeared on the Cloudscaling blog under a [CC BY 4.0][13] license and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/continuous-response-devops + +作者:[Randy Bias][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/randybias +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc (CICD with gears) +[2]: https://opensource.com/article/18/8/what-cicd +[3]: https://www.gartner.com/doc/3187420/guidance-framework-continuous-integration-continuous +[4]: https://opensource.com/sites/default/files/uploads/holistic-devops-cycle-smaller.jpeg (The holistic DevOps cycle) +[5]: https://en.wikipedia.org/wiki/OODA_loop +[6]: https://www.google.com/search?q=site%3Ablog.b3k.us+ooda+loop&rlz=1C5CHFA_enUS730US730&oq=site%3Ablog.b3k.us+ooda+loop&aqs=chrome..69i57j69i58.8660j0j4&sourceid=chrome&ie=UTF-8#q=devops+ooda+loop&* +[7]: http://www.artofmanliness.com/2014/09/15/ooda-loop/ +[8]: https://opensource.com/sites/default/files/uploads/ooda-loop-2-1.jpg (OODA Loop) +[9]: https://itrevolution.com/devops-culture-part-1/ +[10]: https://www.spinnaker.io +[11]: https://opensource.com/article/18/12/cicd-tools-sysadmins +[12]: http://cloudscaling.com/blog/devops/the-essential-devops-process-were-ignoring-continuous-response/ +[13]: https://creativecommons.org/licenses/by/4.0/ diff --git a/sources/talk/20190328 Why do organizations have open secrets.md b/sources/talk/20190328 Why do organizations have open secrets.md new file mode 100644 index 0000000000..8a4c8c0017 --- /dev/null +++ b/sources/talk/20190328 Why do organizations have open secrets.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why do organizations have open secrets?) +[#]: via: (https://opensource.com/open-organization/19/3/open-secrets-bystander-effect) +[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger/users/maryjo) + +Why do organizations have open secrets? +====== +Everyone sees something, but no one says anything—that's the bystander +effect. And it's damaging your organizational culture. +![][1] + +[The five characteristics of an open organization][2] must work together to ensure healthy and happy communities inside our organizations. Even the most transparent teams, departments, and organizations require equal doses of additional open principles—like inclusivity and collaboration—to avoid dysfunction. + +The "open secrets" phenomenon illustrates the limitations of transparency when unaccompanied by additional open values. [A recent article in Harvard Business Review][3] explored the way certain organizational issues—widely apparent but seemingly impossible to solve—lead to discomfort in the workforce. Authors Insiya Hussain and Subra Tangirala performed a number of studies, and found that the more people in an organization who knew about a particular "secret," be it a software bug or a personnel issue, the less likely any one person would be to report the issue or otherwise _do_ something about it. + +Hussain and Tangirala explain that so-called "open secrets" are the result of a [bystander effect][4], which comes into play when people think, "Well, if _everyone_ knows, surely _I_ don't need to be the one to point it out." The authors mention several causes of this behavior, but let's take a closer look at why open secrets might be circulating in your organization—with an eye on what an open leader might do to [create a safe space for whistleblowing][5]. + +### 1\. Fear + +People don't want to complain about a known problem only to have their complaint be the one that initiates the quality assurance, integrity, or redress process. What if new information emerges that makes their report irrelevant? What if they are simply _wrong_? + +At the root of all bystander behavior is fear—fear of repercussions, fear of losing reputation or face, or fear that the very thing you've stood up against turns out to be a non-issue for everyone else. Going on record as "the one who reported" carries with it a reputational risk that is very intimidating. + +The first step to ensuring that your colleagues report malicious behavior, code, or _whatever_ needs reporting is to create a fear-free workplace. We're inundated with the idea that making a mistake is bad or wrong. We're taught that we have to "protect" our reputations. However, the qualities of a good and moral character are _always_ subjective. + +_Tip for leaders_ : Reward courage and strength every time you see it, regardless of whether you deem it "necessary." For example, if in a meeting where everyone except one person agrees on something, spend time on that person's concerns. Be patient and kind in helping that person change their mind, and be open minded about that person being able to change yours. Brains work in different ways; never forget that one person might have a perspective that changes the lay of the land. + +### 2\. Policies + +Usually, complaint procedures and policies are designed to ensure fairness towards all parties involved in the complaint. Discouraging false reporting and ensuring such fairness in situations like these is certainly a good idea. But policies might actually deter people from standing up—because a victim might be discouraged from reporting an experience if the formal policy for reporting doesn't make them feel protected. Standing up to someone in a position of power and saying "Your behavior is horrid, and I'm not going to take it" isn't easy for anyone, but it's particularly difficult for marginalized groups. + +The "open secrets" phenomenon illustrates the limitations of transparency when unaccompanied by additional open values. + +To ensure fairness to all parties, we need to adjust for victims. As part of making the decision to file a report, a victim will be dealing with a variety of internal fears. They'll wonder what might happen to their self-worth if they're put in a situation where they have to talk to someone about their experience. They'll wonder if they'll be treated differently if they're the one who stands up, and how that will affect their future working environments and relationships. Especially in a situation involving an open secret, asking a victim to be strong is asking them to have to trust that numerous other people will back them up. This fear shouldn't be part of their workplace experience; it's just not fair. + +Remember that if one feels responsible for a problem (e.g., "Crap, that's _my code_ that's bringing down the whole server!"), then that person might feel fear at pointing out the mistake. _The important thing is dealing with the situation, not finding someone to blame._ Policies that make people feel personally protected—no matter what the situation—are absolutely integral to ensuring the organization deals with open secrets. + +_Tip for leaders_ : Make sure your team's or organization's policy regarding complaints makes anonymous reporting possible. Asking a victim to "go on record" puts them in the position of having to defend their perspective. If they feel they're the victim of harassment, they're feeling as if they are harassed _and_ being asked to defend their experience. This means they're doing double the work of the perpetrator, who only has to defend themselves. + +### 3\. Marginalization + +Women, LGBTQ people, racial minorities, people with physical disabilities, people who are neuro-atypical, and other marginalized groups often find themselves in positions that them feel routinely dismissed, disempowered, disrespected—and generally dissed. These feelings are valid (and shouldn't be too surprising to anyone who has spent some time looking at issues of diversity and inclusion). Our emotional safety matters, and we tend to be quite protective of it—even if it means letting open secrets go unaddressed. + +Marginalized groups have enough worries weighing on them, even when they're _not_ running the risk of damaging their relationships with others at work. Being seen and respected in both an organization and society more broadly is difficult enough _without_ drawing potentially negative attention. + +Policies that make people feel personally protected—no matter what the situation—are absolutely integral to ensuring the organization deals with open secrets. + +Luckily, in recent years attitudes towards marginalized groups have become visible, and we as a society have begun to talk about our experiences as "outliers." We've also come to realize that marginalized groups aren't actually "outliers" at all; we can thank the colorful, beautiful internet for that. + +_Tip for leaders_ : Diversity and inclusion plays a role in dispelling open secrets. Make sure your diversity and inclusion practices and policies truly encourage a diverse workplace. + +### Model the behavior + +The best way to create a safe workplace and give people the ability to call attention to pervasive problems found within it is to _model the behaviors that you want other people to display_. Dysfunction occurs in cultures that don't pay attention to and value the principles upon which they are built. In order to discourage bystander behavior, transparent, inclusive, adaptable and collaborative communities must create policies that support calling attention to open secrets and then empathetically dealing with whatever the issue may be. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/3/open-secrets-bystander-effect + +作者:[Laura Hilliger][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/laurahilliger/users/maryjo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_secret_ingredient_520x292.png?itok=QbKzJq-N +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://hbr.org/2019/01/why-open-secrets-exist-in-organizations +[4]: https://www.psychologytoday.com/us/basics/bystander-effect +[5]: https://opensource.com/open-organization/19/2/open-leaders-whistleblowers diff --git a/sources/talk/20190331 Codecademy vs. The BBC Micro.md b/sources/talk/20190331 Codecademy vs. The BBC Micro.md new file mode 100644 index 0000000000..e4720315cc --- /dev/null +++ b/sources/talk/20190331 Codecademy vs. The BBC Micro.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Codecademy vs. The BBC Micro) +[#]: via: (https://twobithistory.org/2019/03/31/bbc-micro.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +Codecademy vs. The BBC Micro +====== + +In the late 1970s, the computer, which for decades had been a mysterious, hulking machine that only did the bidding of corporate overlords, suddenly became something the average person could buy and take home. An enthusiastic minority saw how great this was and rushed to get a computer of their own. For many more people, the arrival of the microcomputer triggered helpless anxiety about the future. An ad from a magazine at the time promised that a home computer would “give your child an unfair advantage in school.” It showed a boy in a smart blazer and tie eagerly raising his hand to answer a question, while behind him his dim-witted classmates look on sullenly. The ad and others like it implied that the world was changing quickly and, if you did not immediately learn how to use one of these intimidating new devices, you and your family would be left behind. + +In the UK, this anxiety metastasized into concern at the highest levels of government about the competitiveness of the nation. The 1970s had been, on the whole, an underwhelming decade for Great Britain. Both inflation and unemployment had been high. Meanwhile, a series of strikes put London through blackout after blackout. A government report from 1979 fretted that a failure to keep up with trends in computing technology would “add another factor to our poor industrial performance.”1 The country already seemed to be behind in the computing arena—all the great computer companies were American, while integrated circuits were being assembled in Japan and Taiwan. + +In an audacious move, the BBC, a public service broadcaster funded by the government, decided that it would solve Britain’s national competitiveness problems by helping Britons everywhere overcome their aversion to computers. It launched the _Computer Literacy Project_ , a multi-pronged educational effort that involved several TV series, a few books, a network of support groups, and a specially built microcomputer known as the BBC Micro. The project was so successful that, by 1983, an editor for BYTE Magazine wrote, “compared to the US, proportionally more of Britain’s population is interested in microcomputers.”2 The editor marveled that there were more people at the Fifth Personal Computer World Show in the UK than had been to that year’s West Coast Computer Faire. Over a sixth of Great Britain watched an episode in the first series produced for the _Computer Literacy Project_ and 1.5 million BBC Micros were ultimately sold.3 + +[An archive][1] containing every TV series produced and all the materials published for the _Computer Literacy Project_ was put on the web last year. I’ve had a huge amount of fun watching the TV series and trying to imagine what it would have been like to learn about computing in the early 1980s. But what’s turned out to be more interesting is how computing was _taught_. Today, we still worry about technology leaving people behind. Wealthy tech entrepreneurs and governments spend lots of money trying to teach kids “to code.” We have websites like Codecademy that make use of new technologies to teach coding interactively. One would assume that this approach is more effective than a goofy ’80s TV series. But is it? + +### The Computer Literacy Project + +The microcomputer revolution began in 1975 with the release of [the Altair 8800][2]. Only two years later, the Apple II, TRS-80, and Commodore PET had all been released. Sales of the new computers exploded. In 1978, the BBC explored the dramatic societal changes these new machines were sure to bring in a documentary called “Now the Chips Are Down.” + +The documentary was alarming. Within the first five minutes, the narrator explains that microelectronics will “totally revolutionize our way of life.” As eerie synthesizer music plays, and green pulses of electricity dance around a magnified microprocessor on screen, the narrator argues that the new chips are why “Japan is abandoning its ship building, and why our children will grow up without jobs to go to.” The documentary goes on to explore how robots are being used to automate car assembly and how the European watch industry has lost out to digital watch manufacturers in the United States. It castigates the British government for not doing more to prepare the country for a future of mass unemployment. + +The documentary was supposedly shown to the British Cabinet.4 Several government agencies, including the Department of Industry and the Manpower Services Commission, became interested in trying to raise awareness about computers among the British public. The Manpower Services Commission provided funds for a team from the BBC’s education division to travel to Japan, the United States, and other countries on a fact-finding trip. This research team produced a report that cataloged the ways in which microelectronics would indeed mean major changes for industrial manufacturing, labor relations, and office work. In late 1979, it was decided that the BBC should make a ten-part TV series that would help regular Britons “learn how to use and control computers and not feel dominated by them.”5 The project eventually became a multimedia endeavor similar to the _Adult Literacy Project_ , an earlier BBC undertaking involving both a TV series and supplemental courses that helped two million people improve their reading. + +The producers behind the _Computer Literacy Project_ were keen for the TV series to feature “hands-on” examples that viewers could try on their own if they had a microcomputer at home. These examples would have to be in BASIC, since that was the language (really the entire shell) used on almost all microcomputers. But the producers faced a thorny problem: Microcomputer manufacturers all had their own dialects of BASIC, so no matter which dialect they picked, they would inevitably alienate some large fraction of their audience. The only real solution was to create a new BASIC—BBC BASIC—and a microcomputer to go along with it. Members of the British public would be able to buy the new microcomputer and follow along without worrying about differences in software or hardware. + +The TV producers and presenters at the BBC were not capable of building a microcomputer on their own. So they put together a specification for the computer they had in mind and invited British microcomputer companies to propose a new machine that met the requirements. The specification called for a relatively powerful computer because the BBC producers felt that the machine should be able to run real, useful applications. Technical consultants for the _Computer Literacy Project_ also suggested that, if it had to be a BASIC dialect that was going to be taught to the entire nation, then it had better be a good one. (They may not have phrased it exactly that way, but I bet that’s what they were thinking.) BBC BASIC would make up for some of BASIC’s usual shortcomings by allowing for recursion and local variables.6 + +The BBC eventually decided that a Cambridge-based company called Acorn Computers would make the BBC Micro. In choosing Acorn, the BBC passed over a proposal from Clive Sinclair, who ran a company called Sinclair Research. Sinclair Research had brought mass-market microcomputing to the UK in 1980 with the Sinclair ZX80. Sinclair’s new computer, the ZX81, was cheap but not powerful enough for the BBC’s purposes. Acorn’s new prototype computer, known internally as the Proton, would be more expensive but more powerful and expandable. The BBC was impressed. The Proton was never marketed or sold as the Proton because it was instead released in December 1981 as the BBC Micro, also affectionately called “The Beeb.” You could get a 16k version for £235 and a 32k version for £335. + +In 1980, Acorn was an underdog in the British computing industry. But the BBC Micro helped establish the company’s legacy. Today, the world’s most popular microprocessor instruction set is the ARM architecture. “ARM” now stands for “Advanced RISC Machine,” but originally it stood for “Acorn RISC Machine.” ARM Holdings, the company behind the architecture, was spun out from Acorn in 1990. + +![Picture of the BBC Micro.][3] _A bad picture of a BBC Micro, taken by me at the Computer History Museum +in Mountain View, California._ + +### The Computer Programme + +A dozen different TV series were eventually produced as part of the _Computer Literacy Project_ , but the first of them was a ten-part series known as _The Computer Programme_. The series was broadcast over ten weeks at the beginning of 1982. A million people watched each week-night broadcast of the show; a quarter million watched the reruns on Sunday and Monday afternoon. + +The show was hosted by two presenters, Chris Serle and Ian McNaught-Davis. Serle plays the neophyte while McNaught-Davis, who had professional experience programming mainframe computers, plays the expert. This was an inspired setup. It made for [awkward transitions][4]—Serle often goes directly from a conversation with McNaught-Davis to a bit of walk-and-talk narration delivered to the camera, and you can’t help but wonder whether McNaught-Davis is still standing there out of frame or what. But it meant that Serle could voice the concerns that the audience would surely have. He can look intimidated by a screenful of BASIC and can ask questions like, “What do all these dollar signs mean?” At several points during the show, Serle and McNaught-Davis sit down in front of a computer and essentially pair program, with McNaught-Davis providing hints here and there while Serle tries to figure it out. It would have been much less relatable if the show had been presented by a single, all-knowing narrator. + +The show also made an effort to demonstrate the many practical applications of computing in the lives of regular people. By the early 1980s, the home computer had already begun to be associated with young boys and video games. The producers behind _The Computer Programme_ sought to avoid interviewing “impressively competent youngsters,” as that was likely “to increase the anxieties of older viewers,” a demographic that the show was trying to attract to computing.7 In the first episode of the series, Gill Nevill, the show’s “on location” reporter, interviews a woman that has bought a Commodore PET to help manage her sweet shop. The woman (her name is Phyllis) looks to be 60-something years old, yet she has no trouble using the computer to do her accounting and has even started using her PET to do computer work for other businesses, which sounds like the beginning of a promising freelance career. Phyllis says that she wouldn’t mind if the computer work grew to replace her sweet shop business since she enjoys the computer work more. This interview could instead have been an interview with a teenager about how he had modified _Breakout_ to be faster and more challenging. But that would have been encouraging to almost nobody. On the other hand, if Phyllis, of all people, can use a computer, then surely you can too. + +While the show features lots of BASIC programming, what it really wants to teach its audience is how computing works in general. The show explains these general principles with analogies. In the second episode, there is an extended discussion of the Jacquard loom, which accomplishes two things. First, it illustrates that computers are not based only on magical technology invented yesterday—some of the foundational principles of computing go back two hundred years and are about as simple as the idea that you can punch holes in card to control a weaving machine. Second, the interlacing of warp and weft threads is used to demonstrate how a binary choice (does the weft thread go above or below the warp thread?) is enough, when repeated over and over, to produce enormous variation. This segues, of course, into a discussion of how information can be stored using binary digits. + +Later in the show there is a section about a steam organ that plays music encoded in a long, segmented roll of punched card. This time the analogy is used to explain subroutines in BASIC. Serle and McNaught-Davis lay out the whole roll of punched card on the floor in the studio, then point out the segments where it looks like a refrain is being repeated. McNaught-Davis explains that a subroutine is what you would get if you cut out those repeated segments of card and somehow added an instruction to go back to the original segment that played the refrain for the first time. This is a brilliant explanation and probably one that stuck around in people’s minds for a long time afterward. + +I’ve picked out only a few examples, but I think in general the show excels at demystifying computers by explaining the principles that computers rely on to function. The show could instead have focused on teaching BASIC, but it did not. This, it turns out, was very much a conscious choice. In a retrospective written in 1983, John Radcliffe, the executive producer of the _Computer Literacy Project_ , wrote the following: + +> If computers were going to be as important as we believed, some genuine understanding of this new subject would be important for everyone, almost as important perhaps as the capacity to read and write. Early ideas, both here and in America, had concentrated on programming as the main route to computer literacy. However, as our thinking progressed, although we recognized the value of “hands-on” experience on personal micros, we began to place less emphasis on programming and more on wider understanding, on relating micros to larger machines, encouraging people to gain experience with a range of applications programs and high-level languages, and relating these to experience in the real world of industry and commerce…. Our belief was that once people had grasped these principles, at their simplest, they would be able to move further forward into the subject. + +Later, Radcliffe writes, in a similar vein: + +> There had been much debate about the main explanatory thrust of the series. One school of thought had argued that it was particularly important for the programmes to give advice on the practical details of learning to use a micro. But we had concluded that if the series was to have any sustained educational value, it had to be a way into the real world of computing, through an explanation of computing principles. This would need to be achieved by a combination of studio demonstration on micros, explanation of principles by analogy, and illustration on film of real-life examples of practical applications. Not only micros, but mini computers and mainframes would be shown. + +I love this, particularly the part about mini-computers and mainframes. The producers behind _The Computer Programme_ aimed to help Britons get situated: Where had computing been, and where was it going? What can computers do now, and what might they do in the future? Learning some BASIC was part of answering those questions, but knowing BASIC alone was not seen as enough to make someone computer literate. + +### Computer Literacy Today + +If you google “learn to code,” the first result you see is a link to Codecademy’s website. If there is a modern equivalent to the _Computer Literacy Project_ , something with the same reach and similar aims, then it is Codecademy. + +“Learn to code” is Codecademy’s tagline. I don’t think I’m the first person to point this out—in fact, I probably read this somewhere and I’m now ripping it off—but there’s something revealing about using the word “code” instead of “program.” It suggests that the important thing you are learning is how to decode the code, how to look at a screen’s worth of Python and not have your eyes glaze over. I can understand why to the average person this seems like the main hurdle to becoming a professional programmer. Professional programmers spend all day looking at computer monitors covered in gobbledygook, so, if I want to become a professional programmer, I better make sure I can decipher the gobbledygook. But dealing with syntax is not the most challenging part of being a programmer, and it quickly becomes almost irrelevant in the face of much bigger obstacles. Also, armed only with knowledge of a programming language’s syntax, you may be able to _read_ code but you won’t be able to _write_ code to solve a novel problem. + +I recently went through Codecademy’s “Code Foundations” course, which is the course that the site recommends you take if you are interested in programming (as opposed to web development or data science) and have never done any programming before. There are a few lessons in there about the history of computer science, but they are perfunctory and poorly researched. (Thank heavens for [this noble internet vigilante][5], who pointed out a particularly egregious error.) The main focus of the course is teaching you about the common structural elements of programming languages: variables, functions, control flow, loops. In other words, the course focuses on what you would need to know to start seeing patterns in the gobbledygook. + +To be fair to Codecademy, they offer other courses that look meatier. But even courses such as their “Computer Science Path” course focus almost exclusively on programming and concepts that can be represented in programs. One might argue that this is the whole point—Codecademy’s main feature is that it gives you little interactive programming lessons with automated feedback. There also just isn’t enough room to cover more because there is only so much you can stuff into somebody’s brain in a little automated lesson. But the producers at the BBC tasked with kicking off the _Computer Literacy Project_ also had this problem; they recognized that they were limited by their medium and that “the amount of learning that would take place as a result of the television programmes themselves would be limited.”8 With similar constraints on the volume of information they could convey, they chose to emphasize general principles over learning BASIC. Couldn’t Codecademy replace a lesson or two with an interactive visualization of a Jacquard loom weaving together warp and weft threads? + +I’m banging the drum for “general principles” loudly now, so let me just explain what I think they are and why they are important. There’s a book by J. Clark Scott about computers called _But How Do It Know?_ The title comes from the anecdote that opens the book. A salesman is explaining to a group of people that a thermos can keep hot food hot and cold food cold. A member of the audience, astounded by this new invention, asks, “But how do it know?” The joke of course is that the thermos is not perceiving the temperature of the food and then making a decision—the thermos is just constructed so that cold food inevitably stays cold and hot food inevitably stays hot. People anthropomorphize computers in the same way, believing that computers are digital brains that somehow “choose” to do one thing or another based on the code they are fed. But learning a few things about how computers work, even at a rudimentary level, takes the homunculus out of the machine. That’s why the Jacquard loom is such a good go-to illustration. It may at first seem like an incredible device. It reads punch cards and somehow “knows” to weave the right pattern! The reality is mundane: Each row of holes corresponds to a thread, and where there is a hole in that row the corresponding thread gets lifted. Understanding this may not help you do anything new with computers, but it will give you the confidence that you are not dealing with something magical. We should impart this sense of confidence to beginners as soon as we can. + +Alas, it’s possible that the real problem is that nobody wants to learn about the Jacquard loom. Judging by how Codecademy emphasizes the professional applications of what it teaches, many people probably start using Codecademy because they believe it will help them “level up” their careers. They believe, not unreasonably, that the primary challenge will be understanding the gobbledygook, so they want to “learn to code.” And they want to do it as quickly as possible, in the hour or two they have each night between dinner and collapsing into bed. Codecademy, which after all is a business, gives these people what they are looking for—not some roundabout explanation involving a machine invented in the 18th century. + +The _Computer Literacy Project_ , on the other hand, is what a bunch of producers and civil servants at the BBC thought would be the best way to educate the nation about computing. I admit that it is a bit elitist to suggest we should laud this group of people for teaching the masses what they were incapable of seeking out on their own. But I can’t help but think they got it right. Lots of people first learned about computing using a BBC Micro, and many of these people went on to become successful software developers or game designers. [As I’ve written before][6], I suspect learning about computing at a time when computers were relatively simple was a huge advantage. But perhaps another advantage these people had is shows like _The Computer Programme_ , which strove to teach not just programming but also how and why computers can run programs at all. After watching _The Computer Programme_ , you may not understand all the gobbledygook on a computer screen, but you don’t really need to because you know that, whatever the “code” looks like, the computer is always doing the same basic thing. After a course or two on Codecademy, you understand some flavors of gobbledygook, but to you a computer is just a magical machine that somehow turns gobbledygook into running software. That isn’t computer literacy. + +_If you enjoyed this post, more like it come out every four weeks! Follow[@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> FINALLY some new damn content, amirite? +> +> Wanted to write an article about how Simula bought us object-oriented programming. It did that, but early Simula also flirted with a different vision for how OOP would work. Wrote about that instead! +> +> — TwoBitHistory (@TwoBitHistory) [February 1, 2019][9] + + 1. Robert Albury and David Allen, Microelectronics, report (1979). ↩ + + 2. Gregg Williams, “Microcomputing, British Style”, Byte Magazine, 40, January 1983, accessed on March 31, 2019, . ↩ + + 3. John Radcliffe, “Toward Computer Literacy,” Computer Literacy Project Achive, 42, accessed March 31, 2019, [https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards Computer Literacy.pdf][10]. ↩ + + 4. David Allen, “About the Computer Literacy Project,” Computer Literacy Project Archive, accessed March 31, 2019, . ↩ + + 5. ibid. ↩ + + 6. Williams, 51. ↩ + + 7. Radcliffe, 11. ↩ + + 8. Radcliffe, 5. ↩ + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2019/03/31/bbc-micro.html + +作者:[Two-Bit History][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://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/ +[2]: /2018/07/22/dawn-of-the-microcomputer.html +[3]: /images/beeb.jpg +[4]: https://twitter.com/TwoBitHistory/status/1112372000742404098 +[5]: https://twitter.com/TwoBitHistory/status/1111305774939234304 +[6]: /2018/09/02/learning-basic.html +[7]: https://twitter.com/TwoBitHistory +[8]: https://twobithistory.org/feed.xml +[9]: https://twitter.com/TwoBitHistory/status/1091148050221944832?ref_src=twsrc%5Etfw +[10]: https://computer-literacy-project.pilots.bbcconnectedstudio.co.uk/media/Towards%20Computer%20Literacy.pdf diff --git a/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md b/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md new file mode 100644 index 0000000000..bad5611f3d --- /dev/null +++ b/sources/talk/20190401 How Kubeflow is evolving without ksonnet.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Kubeflow is evolving without ksonnet) +[#]: via: (https://opensource.com/article/19/4/kubeflow-evolution) +[#]: author: (Jonathan Gershater (Red Hat) https://opensource.com/users/jgershat/users/jgershat) + +How Kubeflow is evolving without ksonnet +====== +There are big differences in how open source communities handle change compared to closed source vendors. +![Chat bubbles][1] + +Many software projects depend on modules that are run as separate open source projects. When one of those modules loses support (as is inevitable), the community around the main project must determine how to proceed. + +This situation is happening right now in the [Kubeflow][2] community. Kubeflow is an evolving open source platform for developing, orchestrating, deploying, and running scalable and portable machine learning workloads on [Kubernetes][3]. Recently, the primary supporter of the Kubeflow component [ksonnet][4] announced that it would [no longer support][5] the software. + +When a piece of software loses support, the decision-making process (and the outcome) differs greatly depending on whether the software is open source or closed source. + +### A cellphone analogy + +To illustrate the differences in how an open source community and a closed source/single software vendor proceed when a component loses support, let's use an example from hardware design. + +Suppose you buy cellphone Model A and it stops working. When you try to get it repaired, you discover the manufacturer is out of business and no longer offering support. Since the cellphone's design is proprietary and closed, no other manufacturers can support it. + +Now, suppose you buy cellphone Model B, it stops working, and its manufacturer is also out of business and no longer offering support. However, Model B's design is open, and another company is in business manufacturing, repairing and upgrading Model B cellphones. + +This illustrates one difference between software written using closed and open source principles. If the vendor of a closed source software solution goes out of business, support disappears with the vendor, unless the vendor sells the software's design and intellectual property. But, if the vendor of an open source solution goes out of business, there is no intellectual property to sell. By the principles of open source, the source code is available for anyone to use and modify, under license, so another vendor can continue to maintain the software. + +### How Kubeflow is evolving without ksonnet + +The ramification of ksonnet's backers' decision to cease development illustrates Kubeflow's open and collaborative design process. Kubeflow's designers have several options, such as replacing ksonnet, adopting and developing ksonnet, etc. Because Kubeflow is an open source project, all options are discussed in the open on the Kubeflow mailing list. Some of the community's suggestions include: + +> * Should we look at projects that are CNCF/Apache projects e.g. [helm][6] +> * I would opt for back to the basics. KISS. How about plain old jsonnet + kubectl + makefile/scripts ? Thats how e.g. the coreos [prometheus operator][7] does it. It would also lower the entry barrier (no new tooling) and let vendors of k8s (gke, openshift, etc) easily build on top of that. +> * I vote for using a simple, _programmatic_ context, be it manual jsonnet + kubectl, or simple Python scripts + Python K8s client, or any tool be can build on top of these. +> + + +The members of the mailing list are discussing and debating alternatives to ksonnet and will arrive at a decision to continue development. What I love about the open source way of adapting is that it's done communally. Unlike closed source software, which is often designed by one vendor, the organizations that are members of an open source project can collaboratively steer the project in the direction they best see fit. As Kubeflow evolves, it will benefit from an open, collaborative decision-making framework. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/kubeflow-evolution + +作者:[Jonathan Gershater (Red Hat)][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/jgershat/users/jgershat +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles) +[2]: https://www.kubeflow.org/ +[3]: https://github.com/kubernetes +[4]: https://ksonnet.io/ +[5]: https://blogs.vmware.com/cloudnative/2019/02/05/welcoming-heptio-open-source-projects-to-vmware/ +[6]: https://landscape.cncf.io +[7]: https://github.com/coreos/prometheus-operator/tree/master/contrib/kube-prometheus diff --git a/sources/talk/20190402 Making computer science curricula as adaptable as our code.md b/sources/talk/20190402 Making computer science curricula as adaptable as our code.md new file mode 100644 index 0000000000..150034a20b --- /dev/null +++ b/sources/talk/20190402 Making computer science curricula as adaptable as our code.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Making computer science curricula as adaptable as our code) +[#]: via: (https://opensource.com/open-organization/19/4/adaptable-curricula-computer-science) +[#]: author: (Amarachi Achonu https://opensource.com/users/amarach1/users/johnsontanner3) + +Making computer science curricula as adaptable as our code +====== +No two computer science students are alike—so teachers need curricula +that are open and adaptable. +![][1] + +Educators in elementary computer science face a lack of adaptable curricula. Calls for more modifiable, non-rigid curricula are therefore enticing—assuming that such curricula could benefit teachers by increasing their ability to mold resources for individual classrooms and, ultimately, produce better teaching experiences and learning outcomes. + +Our team at [CSbyUs][2] noticed this scarcity, and we've created an open source web platform to facilitate more flexible, adaptable, and tested curricula for computer science educators. The mission of the CSbyUs team has always been utilizing open source technology to improve pedagogy in computer science, which includes increasing support for teachers. Therefore, this project primarily seeks to use open source principles—and the benefits inherent in them—to expand the possibilities of modern curriculum-making and support teachers by increasing access to more adaptable curricula. + +### Rigid, monotonous, mundane + +Why is the lack of adaptable curricula a problem for computer science education? Rigid curricula dominates most classrooms today, primarily through monotonous and routinely distributed lesson plans. Many of these plans are developed without the capacity for dynamic use and application to different classroom atmospheres. In contrast, an _adaptable_ curriculum is one that would _account_ for dynamic and changing classroom environments. + +An adaptable curriculum means freedom and more options for educators. This is especially important in elementary-level classrooms, where instructors are introducing students to computer science for the first time, and in classrooms with higher populations of groups typically underrepresented in the field of computer science. Here especially, it's advantageous for instructors to have access to curricula that explicitly consider diverse classroom landscapes and grants the freedom necessary to adapt to specific student populations. + +### Making it adaptable + +This kind of adaptability is certainly at work at CSbyUs. Hayley Barton—a member of both the organization's curriculum-making team and its teaching team, and a senior at Duke University majoring in Economics and minoring in Computer Science and Spanish—recently demonstrated the benefits of adaptable curricula during an engagement in the field. Reflecting on her teaching experiences, Barton describes a major reason why curriculum adaptation is necessary in computer science classrooms. "We are seeing the range of students that we work with," she says, "and trying to make the curriculum something that can be tailored to different students." + +An adaptable curriculum means freedom and more options for educators. + +A more adaptable curriculum is necessary for truly challenging students, Barton continues. + +The need for change became most evident to Barton when working students to make their own preliminary apps. Barton collaborated with students who appeared to be at different levels of focus and attention. On the one hand, a group of more advanced students took well to the style of a demonstrative curriculum and remained attentive and engaged to the task. On the other hand, another group of students seemed to have more trouble focusing in the classroom or even being motivated to engage with topics of computer science skills. Witnessing this difference among students, it became important that curriculum would need to be adaptable in multiple ways to be able to engage more students at their level. + +"We want to challenge every student without making it too challenging for any individual student," Barton says. "Thinking about those things definitely feeds into how I'm thinking about the curriculum in terms of making it accessible for all the students." + +As a curriculum-maker, she subsequently uses experiences like this to make changes to the original curriculum. + +"If those other students have one-on-one time themselves, they could be doing even more amazing things with their apps," says Barton. + +Taking this advice, Barton would potentially incorporate into the curriculum more emphasis on cultivating students' sense of ownership in computer science, since this is important to their focus and productivity. For this, students may be afforded that sense of one-on-one time. The result will affect the next round of teachers who use the curriculum. + +For these changes to be effective, the onus is on teachers to notice the dynamics of the classroom. In the future, curriculum adaptation may depend on paying particular attention to and identifying these subtle differences of style of curriculum. Identifying and commenting about these subtleties allows the possibility of applying a different strategy, and these are the changes that are applied to the curriculum. + +Curriculum adaptation should be iterative, as it involves learning from experience, returning to the drawing board, making changes, and finally, utilizing the curriculum again. + +"We've gone through a lot of stages of development," Barton says. "The goal is to have this kind of back and forth, where the curriculum is something that's been tested, where we've used our feedback, and also used other research that we've done, to make it something that's actually impactful." + +Hayley's "back and forth" process is an iterative process of curriculum-making. Between utilizing curricula and modifying curricula, instructors like Hayley can take a once-rigid curriculum and mold it to any degree that the user sees fit—again and again. This iterative process depends on tests performed first in the classroom, and it depends on the teacher's rationale and reflection on how curricula uniquely pans out for them. + +Adaptability of curriculum is the most important principle on which the CSbyUs platform is built. Much like Hayley's process of curriculum-making, curriculum adaptation should be _iterative_ , as it involves learning from experience, returning to the drawing board, making changes, and finally, utilizing the curriculum again. Once launched, the CSbyUS website will document this iterative process. + +The open-focused pedagogy behind the CSByUs platform, then, brings to life the flexibility inherent in the process of curriculum adaptation. First, it invites and collects the valuable first-hand perspectives of real educators working with real curricula to produce real learning. Next, it capitalizes on an iterative processes of development—one familiar to open source programmers—to enable modifications to curriculum (and the documentation of those modifications). Finally, it transforms the way teachers encounter curricula by helping them make selections from different versions of both modified curriculum and "the original." Our platform's open source strategy is crucial to cultivating a hub of flexible curricula for educators. + +Open source practices can be a key difference in making rigid curricula more moldable for educators. Furthermore, since this approach effectively melds open source technologies with open-focused pedagogy, open pedagogy can potentially provide flexibility for educators teaching various curriculum across disciplines. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/adaptable-curricula-computer-science + +作者:[Amarachi Achonu][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/amarach1/users/johnsontanner3 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolserieshe_rh_051x_0.png?itok=gIzbmxuI +[2]: https://csbyus.herokuapp.com/ diff --git a/sources/talk/20190405 D as a C Replacement.md b/sources/talk/20190405 D as a C Replacement.md new file mode 100644 index 0000000000..36b60bb278 --- /dev/null +++ b/sources/talk/20190405 D as a C Replacement.md @@ -0,0 +1,247 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (D as a C Replacement) +[#]: via: (https://theartofmachinery.com/2019/04/05/d_as_c_replacement.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +D as a C Replacement +====== + +Sircmpwn (the main developer behind the [Sway Wayland compositor][1]) recently wrote a blog post about how he thinks [Rust is not a good C replacement][2]. I don’t know if he’d like the [D programming language][3] either, but it’s become a C replacement for me. + +### My C to D Story + +My story is like a lot of systems programmers’ stories. At one time, C was my go-to language for most programming. One day I realised that most of my C programs kept reimplementing things from C++: dynamic arrays, better strings, polymorphic classes, etc. So I tried using C++ instead, and at first I loved it. RAII and classes and generics made programming fun again. Even better was the promise that if I read all these books on C++, and learned to master things like template metaprogramming, I’d become an almighty god of systems programming and my code would be amazing. But learning more eventually had the opposite effect: (in hindsight) my code actually got worse, and I fell out of love. I remember reading Scott Meyer’s Effective C++ and realising it was really more about _ineffective_ C++ — and that most of my C++ code until then was broken. Let’s face it: C might be fiddly to use, but it has a kind of elegance, and “elegant” is rarely a word you hear when C++ is involved. + +Apparently, a lot of ex-C C++ programmers end up going back to C. In my case, I discovered D. It’s also not perfect, but I use it because it feels to me a lot more like the `C += 1` that C++ was meant to be. Here’s an example that’s very superficial, but I think is representative. Take this simple C program: + +``` +#include + +int main() +{ + printf("1 + 1 = %d!\n", 1 + 1); + return 0; +} +``` + +Here’s a version using the C++ standard library: + +``` +#include + +int main() +{ + std::cout << "1 + 1 = " << 1 + 1 << "!" << std::endl; + return 0; +} +``` + +Here’s an idiomatic D version: + +``` +import std.stdio; + +void main() +{ + writef("1 + 1 = %d!\n", 1 + 1); +} +``` + +As I said, it’s a superficial example, but I think it shows a general difference in philosophy between C++ and D. (If I wanted to make the difference even clearer, I’d use an example that needed `iomanip` in C++.) + +Update: Unlike in C, [D’s format strings can work with custom types][4]. Stefan Rohe has also pointed out that [D supports compile-time checking of format strings][5] using its metaprogramming features — unlike C which does it through built-in compiler special casing that can’t be used with custom code. + +This [article about C++ member function pointers][6] happens to also be a good explanation of the origins of D. It’s a good read if you’re a programming language nerd like me, but here’s my TL;DR for everyone else: C++ member function pointers are supposed to feel like a low-level feature (like normal function pointers are), but the complexity and diversity of implementations means they’re really high level. The complexity of the implementations is because of the subtleties of the rules about what you can do with them. The author explains the implementations from several C++ compilers, including what’s “easily [his] favorite implementation”: the elegantly simple Digital Mars C++ implementation. (“Why doesn’t everyone else do it this way?”) The DMC compiler was written by Walter Bright, who invented D. + +D has classes and templates and other core features of C++, but designed by someone who has spent a heck of a lot of time thinking about the C++ spec and how things could be simpler. Walter once said that his experiences implementing C++ templates made him consider not including them in D at all, until he realised they didn’t need to be so complex. + +Here’s a quick tour of D from the point of view of incrementally improving C. + +### `-betterC` + +D compilers support a `-betterC` switch that disables [the D runtime][7] and all high-level features that depend on it. The example C code above can be translated directly into betterC: + +``` +import core.stdc.stdio; + +extern(C): + +int main() +{ + printf("1 + 1 = %d!\n", 1 + 1); + return 0; +} + +$ dmd -betterC example.d +$ ./example +1 + 1 = 2! +``` + +The resulting binary looks a lot like the equivalent C binary. In fact, if you rewrote a C library in betterC, it could still link to code that had been compiled against the C version, and work without changes. Walter Bright wrote a good article walking through all [the changes needed to convert a real C program to betterC][8]. + +You don’t actually need the `-betterC` switch just to write C-like code in D. It’s only needed in special cases where you simply can’t have the D runtime. But let me point out some of my favourite D features that still work with `-betterC`. + +#### `static assert()` + +This allows verifying some assumption at compile time. + +``` +static assert(kNumInducers < 16); +``` + +Systems code often makes assumptions about alignment or structure size or other things. With `static assert`, it’s possible to not only document these assumptions, but trigger a compilation error if someone breaks them by adding a struct member or something. + +#### Slices + +Typical C code is full of pointer/length pairs, and it’s a common bug for them to go out of sync. Slices are a simple and super-useful abstraction for a range of memory defined by a pointer and length. Instead of code like this: + +``` +buffer_p += offset; +buffer_len -= offset; // Got to update both +``` + +You can use this much-less-bug-prone alternative: + +``` +buffer = buffer[offset..$]; +``` + +A slice is nothing but a pointer/length pair with first-class syntactic support. + +Update: [Walter Bright has written more about pointer/length pair problem in C][9]. + +#### Compile Time Function Evaluation (CTFE) + +[Many functions can be evaluated at compile time.][10] + +``` +long factorial(int n) pure +{ + assert (n >= 0 && n <= 20); + long ret = 1; + foreach (j; 2..n+1) ret *= j; + return ret; +} + +// Statically allocated array +// Size is calculated at compile time +Permutation[factorial(kNumThings)] permutation_table; +``` + +#### `scope` Guards + +Code in one part of a function is often coupled to cleanup code in a later part. Failing to match this code up correctly is another common source of bugs (especially when multiple control flow paths are involved). D’s scope guards make it simple to get this stuff right: + +``` +p = malloc(128); +// free() will be called when the current scope exits +scope (exit) free(p); +// Put whatever if statements, or loops, or early returns you like here +``` + +You can even have multiple scope guards in a scope, or have nested scopes. The cleanup routines will be called when needed, in the right order. + +D also supports RAII using struct destructors. + +#### `const` and `immutable` + +It’s a popular myth that `const` in C and C++ is useful for compiler optimisations. Walter Bright has complained that every time he thought of a new `const`-based optimisation for C++, he eventually discovered it didn’t work in real code. So he made some changes to `const` semantics for D, and added `immutable`. You can read more in the [D `const` FAQ][11]. + +#### `pure` + +Functional purity can be enforced. I’ve written about [some of the benefits of the `pure` keyword before][12]. + +#### `@safe` + +SafeD is a subset of D that forbids risky language features like pointer typecasts and inline assembly. Code marked `@safe` is enforced by the compiler to not use these features, so that risky code can be limited to the small percentage of the application that needs it. You can [read more about SafeD in this article][13]. + +#### Metaprogramming + +Like I hinted earlier, metaprogramming has got a bad reputation among some C++ programmers. But [D has the advantage of making metaprogramming less interesting][14], so D programmers tend to just do it when it’s useful, and not as a fun puzzle. + +D has great support for [compile-time reflection][15]. In most cases, compile-time reflection can solve the same problems as run-time reflection, but with compile-time guarantees. Compile-time reflection can also be used to implement run-time reflection where it’s truly needed. + +Need the names of an enumerated type as an array? + +``` +enum State +{ + stopped, + starting, + running, + stopping, +} + +string[] state_names = [__traits(allMembers, State)]; +``` + +Thanks to D’s metaprogramming, the standard library has many nice, type-safe tools, like this [compile-time checked bit flag enum][16]. + +I’ve written more about [using metaprogramming in `-betterC` code][17]. + +#### No Preprocessor + +Okay, this a non-feature as a feature, but D has no equivalent to C’s preprocessor. All its sane use-cases are replaced with native language features, like [manifest constants][18] and [templates][19]. That includes proper [modules][20] support, which means D can break free of the limitations of that old `#include` hack. + +### Normal D + +C-like D code can be written and compiled as normal D code without the `-betterC` switch. The difference is that normal D code is linked to the D runtime, which supports higher-level features, the most obvious ones being garbage collection and object-oriented classes. Some people have confused the D runtime with something like the Java virtual machine, so I once wrote [an article explaining exactly what it is][7] (spoiler: it’s like the C and C++ runtimes, but with more features). + +Even with the runtime, compiled D is not much different from compiled C++. Sometimes I like to write throwaway code to, say, experiment with a new Linux system call or something. I used to think the best language for that is plain old C, but now I always use D. + +D doesn’t natively support `#include`ing C code, but for nice APIs that don’t have a lot of preprocessor craziness (like most of Linux) I usually just write [ad-hoc bindings][21]. Many popular C libraries have maintained D bindings, which can be found in the [Dub registry][22], or in [the Derelict project][23], or in the newer [BindBC project][24]. There are also tools for automated bindings, including the awesome [dpp tool][25] that brings `#include` support directly to D code. + +Update: This post has got a lot of attention from people who’ve never heard of D before. If you’re interested in learning D, I recommend + + * [The DLang Tour][26] for a quick dive into the language + * [Ali Çehreli’s Programming in D book][27] if you prefer something in-depth + * [The D forum Learn group][28] or [IRC channel][29] to get answers to your questions + + + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/04/05/d_as_c_replacement.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://swaywm.org/ +[2]: https://drewdevault.com/2019/03/25/Rust-is-not-a-good-C-replacement.html +[3]: https://dlang.org +[4]: https://wiki.dlang.org/Defining_custom_print_format_specifiers +[5]: https://dlang.org/phobos/std_format.html#format +[6]: https://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible +[7]: /2017/06/04/what_is_the_d_runtime.html +[8]: https://dlang.org/blog/2018/06/11/dasbetterc-converting-make-c-to-d/ +[9]: https://www.digitalmars.com/articles/b44.html +[10]: https://dlang.org/spec/function.html#interpretation +[11]: https://dlang.org/articles/const-faq.html +[12]: /2016/03/28/dirtying_pure_functions_can_be_useful.html +[13]: https://dlang.org/blog/2016/09/28/how-to-write-trusted-code-in-d/ +[14]: https://epi.github.io/2017/03/18/less_fun.html +[15]: https://dlang.org/spec/traits.html +[16]: https://dlang.org/phobos/std_typecons.html#BitFlags +[17]: /2018/08/13/inheritance_and_polymorphism_2.html +[18]: https://dlang.org/spec/enum.html#manifest_constants +[19]: https://tour.dlang.org/tour/en/basics/templates +[20]: https://ddili.org/ders/d.en/modules.html +[21]: https://wiki.dlang.org/Bind_D_to_C +[22]: https://code.dlang.org/ +[23]: https://github.com/DerelictOrg +[24]: https://github.com/BindBC +[25]: https://github.com/atilaneves/dpp +[26]: https://tour.dlang.org/ +[27]: https://ddili.org/ders/d.en/index.html +[28]: https://forum.dlang.org/group/learn +[29]: irc://irc.freenode.net/d diff --git a/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md b/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md new file mode 100644 index 0000000000..2d2f4d5c05 --- /dev/null +++ b/sources/talk/20190410 Anti-lasers could give us perfect antennas, greater data capacity.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Anti-lasers could give us perfect antennas, greater data capacity) +[#]: via: (https://www.networkworld.com/article/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Anti-lasers could give us perfect antennas, greater data capacity +====== +Anti-lasers get close to providing a 100% efficient signal channel for data, say engineers. +![Guirong Hao / Valery Brozhinsky / Getty Images][1] + +Playing laser light backwards could adjust data transmission signals so that they perfectly match receiving antennas. The fine-tuning of signals like this, not achieved with such detail before, could create more capacity for ever-increasing data demand. + +"Imagine, for example, that you could adjust a cell phone signal exactly the right way, so that it is perfectly absorbed by the antenna in your phone," says Stefan Rotter of the Institute for Theoretical Physics of Technische Universität Wien (TU Wien) in a [press release][2]. + +Rotter is talking about “Random Anti-Laser,” a project he has been a part of. The idea behind it is that if one could time-reverse a laser, then the laser (right now considered the best light source ever built) becomes the best available light absorber. Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. + +**[ Related:[What is 5G wireless? How it will change networking as we know it?][3] ]** + +“The easiest way to think about this process is in terms of a movie showing a conventional laser sending out laser light, which is played backwards,” the TU Wein article says. The anti-laser is the exact opposite of the laser — instead of sending specific colors perfectly when energy is applied, it receives specific colors perfectly. + +Perfect absorption of a signal wave would mean that all of the data-carrying energy is absorbed by the receiving device, thus it becomes 100% efficient. + +Counter-intuitively, it’s the random scattering of light in all directions that’s behind the engineering. However, the Vienna, Austria, university group performs precise calculations on those scattering, splitting signals. That lets the researchers harness the light. + +### How the anti-laser technology works + +The microwave-based, experimental device the researchers have built in the lab to prove the idea doesn’t just potentially apply to cell phones; wireless internet of things (IoT) devices would also get more data throughput. How it works: The device consists of an antenna-containing chamber encompassed by cylinders, all arranged haphazardly, the researchers explain. The cylinders distribute an elaborate, arbitrary wave pattern “similar to [throwing] stones in a puddle of water, at which water waves are deflected.” + +Measurements then take place to identify exactly how the signals return. The team involved, which also includes collaborators from the University of Nice, France, then “characterize the random structure and calculate the wave front that is completely swallowed by the central antenna at the right absorption strength.” Ninety-nine point eight percent is absorbed, making it remarkably and virtually perfect. Data throughput, range, and other variables thus improve. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][4] ]** + +Achieving perfect antennas has been pretty much only theoretically possible for engineers to date. Reflected energy (RF back into the transmitter from antenna inefficiencies) has always been an issue in general. Reflections from surfaces, too, have been always been a problem. + +“Think about a mobile phone signal that is reflected several times before it reaches your cell phone,” Rotter says. It’s not easy to get the tuning right — as the antennas’ physical locations move, reflected surfaces become different. + +### Scattering lasers + +Scattering, similar to that used in this project, is becoming more important in communications overall. “Waves that are being scattered in a complex way are really all around us,” the group says. + +An example is random-lasers (which the group’s anti-laser is based on) that unlike traditional lasers, do not use reflective surfaces but trap scattered light and then “emit a very complicated, system-specific laser field when supplied with energy.” The anti-random-laser developed by Rotter and his group simply reverses that in time: + +“Instead of a light source that emits a specific wave depending on its random inner structure, it is also possible to build the perfect absorber.” The anti-random-laser. + +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/3386879/anti-lasers-could-give-us-perfect-antennas-greater-data-capacity.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/data_cubes_transformation_conversion_by_guirong_hao_gettyimages-1062387214_plus_abstract_binary_by_valerybrozhinsky_gettyimages-865457032_3x2_2400x1600-100790211-large.jpg +[2]: https://www.tuwien.ac.at/en/news/news_detail/article/126574/ +[3]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md b/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md new file mode 100644 index 0000000000..b5d5c21ee6 --- /dev/null +++ b/sources/talk/20190412 Gov-t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Gov’t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software) +[#]: via: (https://www.networkworld.com/article/3388646/gov-t-warns-on-vpn-security-bug-in-cisco-palo-alto-f5-pulse-software.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Gov’t warns on VPN security bug in Cisco, Palo Alto, F5, Pulse software +====== +VPN packages from Cisco, Palo Alto, F5 and Pusle may improperly secure tokens and cookies +![Getty Images][1] + +The Department of Homeland Security has issued a warning that some [VPN][2] packages from Cisco, Palo Alto, F5 and Pusle may improperly secure tokens and cookies, allowing nefarious actors an opening to invade and take control over an end user’s system. + +The DHS’s Cybersecurity and Infrastructure Security Agency (CISA) [warning][3] comes on the heels of a notice from Carnegie Mellon's CERT that multiple VPN applications store the authentication and/or session cookies insecurely in memory and/or log files. + +**[Also see:[What to consider when deploying a next generation firewall][4]. Get regularly scheduled insights by [signing up for Network World newsletters][5]]** + +“If an attacker has persistent access to a VPN user's endpoint or exfiltrates the cookie using other methods, they can replay the session and bypass other authentication methods,” [CERT wrote][6]. “An attacker would then have access to the same applications that the user does through their VPN session.” + +According to the CERT warning, the following products and versions store the cookie insecurely in log files: + + * Palo Alto Networks GlobalProtect Agent 4.1.0 for Windows and GlobalProtect Agent 4.1.10 and earlier for macOS0 ([CVE-2019-1573][7]) + * Pulse Secure Connect Secure prior to 8.1R14, 8.2, 8.3R6, and 9.0R2. + + + +The following products and versions store the cookie insecurely in memory: + + * Palo Alto Networks GlobalProtect Agent 4.1.0 for Windows and GlobalProtect Agent 4.1.10 and earlier for macOS0. + * Pulse Secure Connect Secure prior to 8.1R14, 8.2, 8.3R6, and 9.0R2. + * Cisco AnyConnect 4.7.x and prior. + + + +CERT says that Palo Alto Networks GlobalProtect version 4.1.1 [patches][8] this vulnerability. + +In the CERT warning F5 stated it has been aware of the insecure memory storage since 2013 and has not yet been patched. More information can be found [here][9]. F5 also stated it has been aware of the insecure log storage since 2017 and fixed it in version 12.1.3 and 13.1.0 and onwards. More information can be found [here][10]. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][11] ]** + +CERT said it is unaware of any patches at the time of publishing for Cisco AnyConnect and Pulse Secure Connect Secure. + +CERT credited the [National Defense ISAC Remote Access Working Group][12] for reporting the vulnerability. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388646/gov-t-warns-on-vpn-security-bug-in-cisco-palo-alto-f5-pulse-software.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/10/broken-chain_metal_link_breach_security-100777433-large.jpg +[2]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[3]: https://www.us-cert.gov/ncas/current-activity/2019/04/12/Vulnerability-Multiple-VPN-Applications +[4]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://www.kb.cert.org/vuls/id/192371/ +[7]: https://nvd.nist.gov/vuln/detail/CVE-2019-1573 +[8]: https://securityadvisories.paloaltonetworks.com/Home/Detail/146 +[9]: https://support.f5.com/csp/article/K14969 +[10]: https://support.f5.com/csp/article/K45432295 +[11]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[12]: https://ndisac.org/workinggroups/ +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md new file mode 100644 index 0000000000..e893c86d53 --- /dev/null +++ b/sources/talk/20190415 Nyansa-s Voyance expands to the IoT.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nyansa’s Voyance expands to the IoT) +[#]: via: (https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Nyansa’s Voyance expands to the IoT +====== + +![Brandon Mowinkel \(CC0\)][1] + +Nyansa announced today that their flagship Voyance product can now apply its AI-based secret sauce to [IoT][2] devices, over and above the networking equipment and IT endpoints it could already manage. + +Voyance – a network management product that leverages AI to automate the discovery of devices on the network and identify unusual behavior – has been around for two years now, and Nyansa says that it’s being used to observe a total of 25 million client devices operating across roughly 200 customer networks. + +**More on IoT:** + + * [Most powerful Internet of Things companies][3] + * [10 Hot IoT startups to watch][4] + * [The 6 ways to make money in IoT][5] + * [][6] [Blockchain, service-centric networking key to IoT success][7] + * [Getting grounded in IoT networking and security][8] + * [Building IoT-ready networks must become a priority][9] + * [What is the Industrial IoT? [And why the stakes are so high]][10] + + + +It’s a software-only product (available either via public SaaS or private cloud) that works by scanning a customer’s network and identifying every device attached to it, then establishing a behavioral baseline that will let it flag suspicious actions (e.g., sending a lot more data than other devices of its kind, connecting to unusual servers) and even perform automated root-cause analysis of network issues. + +The process doesn’t happen instantaneously, particularly the creation of the baseline, but it’s designed to be minimally invasive to existing network management frameworks and easy to implement. + +Nyansa said that the medical field has been one of the key targets for the newly IoT-enabled iteration of Voyance, and one early customer – Baptist Health, a Florida-based healthcare company that runs four hospitals and several other clinics and practices – said that Voyance IoT has offered a new level of visibility into the business’ complex array of connected diagnostic and treatment machines. + +“In the past we didn’t have the ability to identify security concerns in this way, related to rogue devices on the enterprise network, and now we’re able to do that,” said CISO Thad Phillips. + +While spiraling network complexity isn’t an issue confined to the IoT, there’s a strong argument that the number and variety of devices connected to an IoT-enabled network represent a new challenge to network management, particularly in light of the fact that many such devices aren’t particularly secure. + +“They’re not manufactured by networking vendors or security vendors, so for a performance standpoint, they have a lot of quirks … and on the security side, that’s sort of a big problem there as well,” said Anand Srinivas, Nyansa’s co-founder and CTO. + +Enabling the Voyance platform to identify and manage IoT devices along with traditional endpoints seems to be mostly a matter of adding new device signatures to the system, but Enterprise Management Associates research director Shamus McGillicuddy said that, while the system’s designed for automation and ease of use, AIOps products like Voyance do need to be managed to make sure that they’re functioning correctly. + +“Anything based on machine learning is going to take a while to make sure it understands your environment and you might have to retrain it,” he said. “There’s always going to be more and more things connecting to IP networks, and it’s just going to be a question of building up a database.” + +Voyance IoT is available now. Pricing starts at $16,000 per year, and goes up with the number of total devices managed. (Current Voyance users can manage up to 100 IoT devices at no additional cost.) + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388301/nyansa-s-voyance-expands-to-the-iot.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/geometric_architecture_ceiling_structure_lines_connections_networks_perspective_by_brandon_mowinkel_cc0_via_unsplash_2400x1600-100788530-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md new file mode 100644 index 0000000000..8a44c56ca7 --- /dev/null +++ b/sources/talk/20190416 Two tools to help visualize and simplify your data-driven operations.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two tools to help visualize and simplify your data-driven operations) +[#]: via: (https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all) +[#]: author: (Kent McNeil, Vice President of Software, Ciena Blue Planet ) + +Two tools to help visualize and simplify your data-driven operations +====== +Amidst the rising complexity of networks, and influx of data, service providers are striving to keep operational complexity under control. Blue Planet’s Kent McNeil explains how they can turn this challenge into a huge opportunity, and in fact reduce operational effort by exploiting state-of-the-art graph database visualization and delta-based federation technologies. +![danleap][1] + +**Build the picture: Visualize your data** + +The Internet of Things (IoT), 5G, smart technology, virtual reality – all these applications guarantee one thing for communications service providers (CSPs): more data. As networks become increasingly overwhelmed by mounds of data, CSPs are on the hunt for ways to make the most of the intelligence collected and are looking for ways to monetize their services, provide more customizable offerings, and enhance their network performance. + +Customer analytics has gone some way towards fulfilling this need for greater insights, but with the rise in the volume and variety of consumer and IoT applications, the influx of data will increase at a phenomenal rate. The data includes not only customer-related data, but also device and network data, adding complexity to the picture. CSPs must harness this information to understand the relationships between any two things, to understand the connections within their data and to ultimately, leverage it for a better customer experience. + +**See the upward graphical trend with graph databases** + +Traditional relational databases certainly have their use, but graph databases offer a novel perspective. The visual representation between the component parts enables CSPs to understand and analyze the characteristics, as well as to act in a timely manner when confronted with any discrepancies. + +Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +The use of graph databases has started to become more mainstream, as businesses see the benefits. IBM conducted a generic industry study, entitled “The State of Graph Databases Worldwide”, which found that people are moving to graph databases for speed, performance enhancement of applications, and streamlined operations. Ways in which businesses are using, or are planning to use, graph technology is highest for network and IT operations, followed by master data management. Performance is a key factor for CSPs, as is personalization, which enables support for more tailored service offerings. + +Another advantage of graph databases for CSPs is that of unravelling the complexity of network inventory in a clear, visualized picture – this capability gives CSPs a competitive advantage as speed and performance become increasingly paramount. This need for speed and reliability will increase tenfold as IoT continues its impressive global ramp-up. Operational complexity also grows as the influx of generated data produced by IoT will further challenge the scalability of existing operational environments. Graph databases can help CSPs tackle this new challenge, ensuring the data is not just stored, but also processed and analyzed. It enables complex network questions to be asked and answered, ensuring that CSPs are not sidelined as “dumb pipes” in the IoT movement. + +**Change the tide of data with delta-based federation** + +New data, updated data, corrected data, deleted data – all needs to be managed, in line with regulations, and instantaneously. But this capability does not exist in the reality of many CSP’s Operational Support Systems (OSS). Many still battle with updating data and relying on full uploads of network inventory in order to perform key service fulfillment and assurance tasks. This method is time-intensive and risky due to potential conflicts and inaccuracies. With data being accessed from a variety of systems, CSPs must have a way to effectively hone in on only what is required. + +Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +A delta-based federation model ensures that an accurate picture is presented, and only essential changes are conducted reliably and quickly. This simplified method filters the delta changes, reducing the time involved in updating, and minimizing the system load and risks. A validation process takes place to catch any errors or issues with the data, so CSPs can apply checks and retain control over modifications. Integrating network data into one simplified system limits the impact on the legacy OSS systems. This allows each OSS to continue its specific role, yet to feed data into a single interface, hence enabling teams to see the complete picture and gain efficiencies while launching new services or pinpointing and resolving service and network issues. + +**Ride the wave** + +25 billion connected things are predicted by Gartner on a global scale by 2021 and CSPs are already struggling with the current levels of data, which Gartner estimates at 14.2 billion in 2019. Over the last decade, CSPs have faced significant rises in the levels of data consumed as demand for new services and higher bandwidth applications has taken off. This data wave is set to continue and CSPs have two important tools at their disposal helping them ride the wave. Firstly, CSPs have specialist, legacy OSS already in place which they can leverage as a basis for integrating data and implementing optimized systems. Secondly, they can utilize new technologies in database inventory management: graph databases and delta-based federation. The advantages of effectively integrating network data, visualizing it, and creating a clear map of the inter-connections, enable CSPs to make critical decisions more quickly and accurately, resulting in most optimized and informed service operations. + +[Watch this video to learn more about Blue Planet][2] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389756/two-tools-to-help-visualize-and-simplify-your-data-driven-operations.html#tk.rss_all + +作者:[Kent McNeil, Vice President of Software, Ciena Blue Planet][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://images.idgesg.net/images/article/2019/04/istock-165721901-100793858-large.jpg +[2]: https://www.blueplanet.com/resources/IT-plus-network-now-a-powerhouse-combination.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVideo&utm_medium=sponsoredpost4 diff --git a/sources/talk/20190416 What SDN is and where it-s going.md b/sources/talk/20190416 What SDN is and where it-s going.md new file mode 100644 index 0000000000..381c227b65 --- /dev/null +++ b/sources/talk/20190416 What SDN is and where it-s going.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What SDN is and where it’s going) +[#]: via: (https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +What SDN is and where it’s going +====== +Software-defined networking (SDN) established a foothold in cloud computing, intent-based networking, and network security, with Cisco, VMware, Juniper and others leading the charge. +![seedkin / Getty Images][1] + +Hardware reigned supreme in the networking world until the emergence of software-defined networking (SDN), a category of technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. + +SDN's origins can be traced to a research collaboration between Stanford University and the University of California at Berkeley that ultimately yielded the [OpenFlow][2] protocol in the 2008 timeframe. + +**[Learn more about the[difference between SDN and NFV][3]. Get regularly scheduled insights by [signing up for Network World newsletters][4]]** + +OpenFlow is only one of the first SDN canons, but it's a key component because it started the networking software revolution. OpenFlow defined a programmable network protocol that could help manage and direct traffic among routers and switches no matter which vendor made the underlying router or switch. + +In the years since its inception, SDN has evolved into a reputable networking technology offered by key vendors including Cisco, VMware, Juniper, Pluribus and Big Switch. The Open Networking Foundation develops myriad open-source SDN technologies as well. + +"Datacenter SDN no longer attracts breathless hype and fevered expectations, but the market is growing healthily, and its prospects remain robust," wrote Brad Casemore, IDC research vice president, data center networks, in a recent report, [_Worldwide Datacenter Software-Defined Networking Forecast, 2018–2022_][5]*. "*Datacenter modernization, driven by the relentless pursuit of digital transformation and characterized by the adoption of cloudlike infrastructure, will help to maintain growth, as will opportunities to extend datacenter SDN overlays and fabrics to multicloud application environments." + +SDN will be increasingly perceived as a form of established, conventional networking, Casemore said. + +IDC estimates that the worldwide data center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017–2022 period. The market generated revenue of nearly $5.15 billion in 2017, up more than 32.2% from 2016. + +In 2017, the physical network represented the largest segment of the worldwide datacenter SDN market, accounting for revenue of nearly $2.2 billion, or about 42% of the overall total revenue. In 2022, however, the physical network is expected to claim about $3.65 billion in revenue, slightly less than the $3.68 billion attributable to network virtualization overlays/SDN controller software but more than the $3.18 billion for SDN applications. + +“We're now at a point where SDN is better understood, where its use cases and value propositions are familiar to most datacenter network buyers and where a growing number of enterprises are finding that SDN offerings offer practical benefits,” Casemore said. “With SDN growth and the shift toward software-based network automation, the network is regaining lost ground and moving into better alignment with a wave of new application workloads that are driving meaningful business outcomes.” + +### **What is SDN? ** + +The idea of programmability is the basis for the most precise definition of what SDN is: technology that separates the control plane management of network devices from the underlying data plane that forwards network traffic. + +IDC broadens that definition of SDN by stating: “Datacenter SDN architectures feature software-defined overlays or controllers that are abstracted from the underlying network hardware, offering intent-or policy-based management of the network as a whole. This results in a datacenter network that is better aligned with the needs of application workloads through automated (thereby faster) provisioning, programmatic network management, pervasive application-oriented visibility, and where needed, direct integration with cloud orchestration platforms.” + +The driving ideas behind the development of SDN are myriad. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources, everywhere from the data center to the campus or wide area network. + +Separating the control and data planes is the most common way to think of what SDN is, but it is much more than that, said Mike Capuano, chief marketing officer for [Pluribus][6]. + +“At its heart SDN has a centralized or distributed intelligent entity that has an entire view of the network, that can make routing and switching decisions based on that view,” Capuano said. “Typically, network routers and switches only know about their neighboring network gear. But with a properly configured SDN environment, that central entity can control everything, from easily changing policies to simplifying configuration and automation across the enterprise.” + +### How does SDN support edge computing, IoT and remote access? + +A variety of networking trends have played into the central idea of SDN. Distributing computing power to remote sites, moving data center functions to the [edge][7], adopting cloud computing, and supporting [Internet of Things][8] environments – each of these efforts can be made easier and more cost efficient via a properly configured SDN environment. + +Typically in an SDN environment, customers can see all of their devices and TCP flows, which means they can slice up the network from the data or management plane to support a variety of applications and configurations, Capuano said. So users can more easily segment an IoT application from the production world if they want, for example. + +Some SDN controllers have the smarts to see that the network is getting congested and, in response, pump up bandwidth or processing to make sure remote and edge components don’t suffer latency. + +SDN technologies also help in distributed locations that have few IT personnel on site, such as an enterprise branch office or service provider central office, said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. + +“Naturally these places require remote and centralized delivery of connectivity, visibility and security. SDN solutions that centralize and abstract control and automate workflows across many places in the network, and their devices, improve operational reliability, speed and experience,” Bushong said. + +### **How does SDN support intent-based networking?** + +Intent-based networking ([IBN][9]) has a variety of components, but basically is about giving network administrators the ability to define what they want the network to do, and having an automated network management platform create the desired state and enforce policies to ensure what the business wants happens. + +“If a key tenet of SDN is abstracted control over a fleet of infrastructure, then the provisioning paradigm and dynamic control to regulate infrastructure state is necessarily higher level,” Bushong said. “Policy is closer to declarative intent, moving away from the minutia of individual device details and imperative and reactive commands.” + +IDC says that intent-based networking “represents an evolution of SDN to achieve even greater degrees of operational simplicity, automated intelligence, and closed-loop functionality.” + +For that reason, IBN represents a notable milestone on the journey toward autonomous infrastructure that includes a self-driving network, which will function much like the self-driving car, producing desired outcomes based on what network operators and their organizations wish to accomplish, Casemore stated. + +“While the self-driving car has been designed to deliver passengers safely to their destination with minimal human intervention, the self-driving network, as part of autonomous datacenter infrastructure, eventually will achieve similar outcomes in areas such as network provisioning, management, and troubleshooting — delivering applications and data, dynamically creating and altering network paths, and providing security enforcement with minimal need for operator intervention,” Casemore stated. + +While IBN technologies are relatively young, Gartner says by 2020, more than 1,000 large enterprises will use intent-based networking systems in production, up from less than 15 in the second quarter of 2018. + +### **How does SDN help customers with security?** + +SDN enables a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low security network that does not touch any sensitive information. Another segment could have much more fine-grained remote access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. + +“For example, if a customer has an IoT group it doesn’t feel is all that mature with regards to security, via the SDN controller you can segment that group off away from the critical high-value corporate traffic,” Capuano stated. “SDN users can roll out security policies across the network from the data center to the edge and if you do all of this on top of white boxes, deployments can be 30 – 60 percent cheaper than traditional gear.” + +The ability to look at a set of workloads and see if they match a given security policy is a key benefit of SDN, especially as data is distributed, said Thomas Scheibe, vice president of product management for Cisco’s Nexus and ACI product lines. + +"The ability to deploy a whitelist security model like we do with ACI [Application Centric Infrastructure] that lets only specific entities access explicit resources across your network fabric is another key security element SDN enables," Scheibe said. + +A growing number of SDN platforms now support [microsegmentation][11], according to Casemore. + +“In fact, micro-segmentation has developed as a notable use case for SDN. As SDN platforms are extended to support multicloud environments, they will be used to mitigate the inherent complexity of establishing and maintaining consistent network and security policies across hybrid IT landscapes,” Casemore said. + +### **What is SDN’s role in cloud computing?** + +SDN’s role in the move toward [private cloud][12] and [hybrid cloud][13] adoption seems a natural. In fact, big SDN players such as Cisco, Juniper and VMware have all made moves to tie together enterprise data center and cloud worlds. + +Cisco's ACI Anywhere package would, for example, let policies configured through Cisco's SDN APIC (Application Policy Infrastructure Controller) use native APIs offered by a public-cloud provider to orchestrate changes within both the private and public cloud environments, Cisco said. + +“As organizations look to scale their hybrid cloud environments, it will be critical to leverage solutions that help improve productivity and processes,” said [Bob Laliberte][14], a senior analyst with Enterprise Strategy Group, in a recent [Network World article][15]. “The ability to leverage the same solution, like Cisco’s ACI, in your own private-cloud environment as well as across multiple public clouds will enable organizations to successfully scale their cloud environments.” + +Growth of public and private clouds and enterprises' embrace of distributed multicloud application environments will have an ongoing and significant impact on data center SDN, representing both a challenge and an opportunity for vendors, said IDC’s Casemore. + +“Agility is a key attribute of digital transformation, and enterprises will adopt architectures, infrastructures, and technologies that provide for agile deployment, provisioning, and ongoing operational management. In a datacenter networking context, the imperative of digital transformation drives adoption of extensive network automation, including SDN,” Casemore said. + +### Where does SD-WAN fit in? + +The software-defined wide area network ([SD-WAN][16]) is a natural application of SDN that extends the technology over a WAN. While the SDN architecture is typically the underpinning in a data center or campus, SD-WAN takes it a step further. + +At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network edge location and have a software management platform that can turn up new sites, prioritize traffic and set security policies. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +[SD-WAN][17] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Anand Oswal, senior vice president of engineering in Cisco’s Enterprise Networking Business, said a Network World [article][18] earlier this year. + +It's a profoundly hot market with tons of players including [Cisco][19], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. + +IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/what-is-sdn_2_where-is-it-going_arrows_fork-in-the-road-100793314-large.jpg +[2]: https://www.networkworld.com/article/2202144/data-center-faq-what-is-openflow-and-why-is-it-needed.html +[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.idc.com/getdoc.jsp?containerId=US43862418 +[6]: https://www.networkworld.com/article/3192318/pluribus-recharges-expands-software-defined-network-platform.html +[7]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[8]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[9]: https://www.networkworld.com/article/3202699/what-is-intent-based-networking.html +[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[11]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[12]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[13]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[14]: https://www.linkedin.com/in/boblaliberte90/ +[15]: https://www.networkworld.com/article/3336075/cisco-serves-up-flexible-data-center-options.html +[16]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[17]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[18]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[19]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html diff --git a/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md new file mode 100644 index 0000000000..db534e4457 --- /dev/null +++ b/sources/talk/20190417 Cisco Talos details exceptionally dangerous DNS hijacking attack.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco Talos details exceptionally dangerous DNS hijacking attack) +[#]: via: (https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco Talos details exceptionally dangerous DNS hijacking attack +====== +Cisco Talos says state-sponsored attackers are battering DNS to gain access to sensitive networks and systems +![Peshkova / Getty][1] + +Security experts at Cisco Talos have released a [report detailing][2] what it calls the “first known case of a domain name registry organization that was compromised for cyber espionage operations.” + +Talos calls ongoing cyber threat campaign “Sea Turtle” and said that state-sponsored attackers are abusing DNS to harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect, which displays unique knowledge on how to manipulate DNS, Talos stated. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +By obtaining control of victims’ DNS, the attackers can change or falsify any data on the Internet, illicitly modify DNS name records to point users to actor-controlled servers; users visiting those sites would never know, Talos reported. + +DNS, routinely known as the Internet’s phonebook, is part of the global internet infrastructure that translates between familiar names and the numbers computers need to access a website or send an email. + +### Threat to DNS could spread + +At this point Talos says Sea Turtle isn't compromising organizations in the U.S. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated. + +Talos reports that the ongoing operation likely began as early as January 2017 and has continued through the first quarter of 2019. “Our investigation revealed that approximately 40 different organizations across 13 different countries were compromised during this campaign,” Talos stated. “We assess with high confidence that this activity is being carried out by an advanced, state-sponsored actor that seeks to obtain persistent access to sensitive networks and systems.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][7] ]** + +Talos says the attackers directing the Sea Turtle campaign show signs of being highly sophisticated and have continued their attacks despite public reports of their activities. In most cases, threat actors typically stop or slow down their activities once their campaigns are publicly revealed suggesting the Sea Turtle actors are unusually brazen and may be difficult to deter going forward, Talos stated. + +In January the Department of Homeland Security (DHS) [issued an alert][8] about this activity, warning that an attacker could redirect user traffic and obtain valid encryption certificates for an organization’s domain names. + +At that time the DHS’s [Cybersecurity and Infrastructure Security Agency][9] said in its [Emergency Directive][9] that it was tracking a series of incidents targeting DNS infrastructure. CISA wrote that it “is aware of multiple executive branch agency domains that were impacted by the tampering campaign and has notified the agencies that maintain them.” + +### DNS hijacking + +CISA said that attackers have managed to intercept and redirect web and mail traffic and could target other networked services. The agency said the attacks start with compromising user credentials of an account that can make changes to DNS records. Then the attacker alters DNS records, like Address, Mail Exchanger, or Name Server records, replacing the legitimate address of the services with an address the attacker controls. + +To achieve their nefarious goals, Talos stated the Sea Turtle accomplices: + + * Use DNS hijacking through the use of actor-controlled name servers. + * Are aggressive in their pursuit targeting DNS registries and a number of registrars, including those that manage country-code top-level domains (ccTLD). + + + * Use Let’s Encrypts, Comodo, Sectigo, and self-signed certificates in their man-in-the-middle (MitM) servers to gain the initial round of credentials. + + + * Steal victim organization’s legitimate SSL certificate and use it on actor-controlled servers. + + + +Such actions also distinguish Sea Turtle from an earlier DNS exploit known as DNSpionage, which [Talos ​reported][10]​ on in November 2018. + +Talos noted “with high confidence” that these operations are distinctly different and independent from the operations performed by [DNSpionage.][11] + +In that report, Talos said a DNSpionage campaign utilized two fake, malicious websites containing job postings that were used to compromise targets via malicious Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated Let's Encrypt certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][12] free of charge to the user, Talos said. + +The Sea Turtle campaign gained initial access either by exploiting known vulnerabilities or by sending spear-phishing emails. Talos said it believes the attackers have exploited multiple known common vulnerabilities and exposures (CVEs) to either gain initial access or to move laterally within an affected organization. Talos research further shows the following known exploits of Sea Turtle include: + + * CVE-2009-1151​: PHP code injection vulnerability affecting phpMyAdmin + * CVE-2014-6271​: RCE affecting GNU bash system, specifically the SMTP (this was part of the ​Shellshock​ CVEs) + * CVE-2017-3881​: RCE by unauthenticated user with elevated privileges Cisco switches + * CVE-2017-6736​: Remote Code Exploit (RCE) for Cisco integrated Service Router 2811 + * CVE-2017-12617​: RCE affecting Apache web servers running Tomcat + * CVE-2018-0296​: ​Directory​ traversal allowing unauthorized access to Cisco Adaptive Security Appliances (ASAs) and firewalls + * CVE-2018-7600​: RCE for Website built with Drupal, aka “Drupalgeddon” + + + +“As with any initial access involving a sophisticated actor, we believe this list of CVEs to be incomplete,” Talos stated. “The actor in question can leverage known vulnerabilities as they encounter a new threat surface. This list only represents the observed behavior of the actor, not their complete capabilities.” + +Talos says that the Sea Turtle campaign continues to be highly successful for several reasons. “First, the actors employ a unique approach to gain access to the targeted networks. Most traditional security products such as IDS and IPS systems are not designed to monitor and log DNS requests,” Talos stated. “The threat actors were able to achieve this level of success because the DNS domain space system added security into the equation as an afterthought. Had more ccTLDs implemented security features such as registrar locks, attackers would be unable to redirect the targeted domains.” + +Talos said the attackers also used previously undisclosed techniques such as certificate impersonation. “This technique was successful in part because the SSL certificates were created to provide confidentiality, not integrity. The attackers stole organizations’ SSL certificates associated with security appliances such as [Cisco's Adaptive Security Appliance] to obtain VPN credentials, allowing the actors to gain access to the targeted network, and have long-term persistent access, Talos stated. + +### Cisco Talos DNS attack mitigation strategy + +To protect against Sea Turtle, Cisco recommends: + + * Use a registry lock service, which will require an out-of-band message before any changes can occur to an organization's DNS record. + * If your registrar does not offer a registry-lock service, Talos recommends implementing multi-factor authentication, such as ​DUO​, to access your organization's DNS records. + * If you suspect you were targeted by this type of intrusion, Talos recommends instituting a network-wide password reset, preferably from a computer on a trusted network. + * Apply patches, especially on internet-facing machines. Network administrators can monitor passive DNS records on their domains to check for abnormalities. + + + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/02/man-in-boat-surrounded-by-sharks_risk_fear_decision_attack_threat_by-peshkova-getty-100786972-large.jpg +[2]: https://blog.talosintelligence.com/2019/04/seaturtle.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[8]: https://www.networkworld.com/article/3336201/batten-down-the-dns-hatches-as-attackers-strike-feds.html +[9]: https://cyber.dhs.gov/ed/19-01/ +[10]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[11]: https://krebsonsecurity.com/tag/dnspionage/ +[12]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190417 Clearing up confusion between edge and cloud.md b/sources/talk/20190417 Clearing up confusion between edge and cloud.md new file mode 100644 index 0000000000..722051e8a7 --- /dev/null +++ b/sources/talk/20190417 Clearing up confusion between edge and cloud.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Clearing up confusion between edge and cloud) +[#]: via: (https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Clearing up confusion between edge and cloud +====== +The benefits of edge computing are not just hype; however, that doesn’t mean you should throw cloud computing initiatives to the wind. +![iStock][1] + +Edge computing and cloud computing are sometimes discussed as if they’re mutually exclusive approaches to network infrastructure. While they may function in different ways, utilizing one does not preclude the use of the other. + +Indeed, [Futurum Research][2] found that, among companies that have deployed edge projects, only 15% intend to separate these efforts from their cloud computing initiatives — largely for security or compartmentalization reasons. + +So then, what’s the difference, and how do edge and cloud work together? + +**Location, location, location** + +Moving data and processing to the cloud, as opposed to on-premises data centers, has enabled the business to move faster, more efficiently, less expensively — and in many cases, more securely. + +Yet cloud computing is not without challenges, particularly: + + * Users will abandon a graphics-heavy website if it doesn’t load quickly. So, imagine the lag for compute-heavy processing associated artificial intelligence or machine learning functions. + + * The strength of network connectivity is crucial for large data sets. As enterprises increasingly generate data, particularly with the adoption of Internet of Things (IoT), traditional cloud connections will be insufficient. + + + + +To make up for the lack of speed and connectivity with cloud, processing for mission-critical applications will need to occur closer to the data source. Maybe that’s a robot on the factory floor, digital signage at a retail store, or an MRI machine in a hospital. That’s edge computing, which reduces the distance the data must travel and thereby boosts the performance and reliability of applications and services. + +**One doesn’t supersede the other** + +That said, the benefits gained by edge computing don’t negate the need for cloud. In many cases, IT will now become a decision-maker in terms of best usage for each. For example, edge might make sense for devices running processing-power-hungry apps such as IoT, artificial intelligence, and machine learning. And cloud will work for apps where time isn’t necessarily of the essence, like inventory or big-data projects. + +> “By being able to triage the types of data processing on the edge versus that heading to the cloud, we can keep both systems running smoothly – keeping our customers and employees safe and happy,” [writes Daniel Newman][3], principal analyst for Futurum Research. + +And in reality, edge will require cloud. “To enable digital transformation, you have to build out the edge computing side and connect it with the cloud,” [Tony Antoun][4], senior vice president of edge and digital at GE Digital, told _Automation World_. “It’s a journey from the edge to the cloud and back, and the cycle keeps continuing. You need both to enrich and boost the business and take advantage of different points within this virtual lifecycle.” + +**Ensuring resiliency of cloud and edge** + +Both edge and cloud computing require careful consideration to the underlying processing power. Connectivity and availability, no matter the application, are always critical measures. + +But especially for the edge, it will be important to have a resilient architecture. Companies should focus on ensuring security, redundancy, connectivity, and remote management capabilities. + +Discover how your edge and cloud computing environments can coexist at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389364/clearing-up-confusion-between-edge-and-cloud.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-612507606-100793995-large.jpg +[2]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[3]: https://futurumresearch.com/edge-computing-data-centers/ +[4]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md new file mode 100644 index 0000000000..71ddf70826 --- /dev/null +++ b/sources/talk/20190417 Startup MemVerge combines DRAM and Optane into massive memory pool.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Startup MemVerge combines DRAM and Optane into massive memory pool) +[#]: via: (https://www.networkworld.com/article/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Startup MemVerge combines DRAM and Optane into massive memory pool +====== +MemVerge bridges two technologies that are already a bridge. +![monsitj / Getty Images][1] + +A startup called MemVerge has announced software to combine regular DRAM with Intel’s Optane DIMM persistent memory into a single clustered storage pool and without requiring any changes to applications. + +MemVerge has been working with Intel in developing this new hardware platform for close to two years. It offers what it calls a Memory-Converged Infrastructure (MCI) to allow existing apps to use Optane DC persistent memory. It's architected to integrate seamlessly with existing applications. + +**[ Read also:[Mass data fragmentation requires a storage rethink][2] ]** + +Optane memory is designed to sit between high-speed memory and [solid-state drives][3] (SSDs) and acts as a cache for the SSD, since it has speed comparable to DRAM but SSD persistence. With Intel’s new Xeon Scalable processors, this can make up to 4.5TB of memory available to a processor. + +Optane runs in one of two modes: Memory Mode and App Direct Mode. In Memory Mode, the Optane memory functions like regular memory and is not persistent. In App Direct Mode, it functions as the SSD cache but apps don’t natively support it. They need to be tweaked to function properly in Optane memory. + +As it was explained to me, apps aren’t designed for persistent storage because the data is already in memory on powerup rather than having to load it from storage. So, the app has to know memory doesn’t go away and that it does not need to shuffle data back and forth between storage and memory. Therefore, apps natively don’t work in persistent memory. + +### Why didn't Intel think of this? + +All of which really begs a question I can’t get answered, at least not immediately: Why didn’t Intel think of this when it created Optane in the first place? + +MemVerge has what it calls Distributed Memory Objects (DMO) hypervisor technology to provide a logical convergence layer to run data-intensive workloads at memory speed with guaranteed data consistency across multiple systems. This allows Optane memory to process and derive insights from the enormous amounts of data in real time. + +That’s because MemVerge’s technology makes random access as fast as sequential access. Normally, random access is slower than sequential because of all the jumping around with random access vs. reading one sequential file. But MemVerge can handle many small files as fast as it handles one large file. + +MemVerge itself is actually software, with a single API for both DRAM and Optane. It’s also available via a hyperconverged server appliance that comes with 2 Cascade Lake processors, up to 512 GB DRAM, 6TB of Optane memory, and 360TB of NVMe physical storage capacity. + +However, all of this is still vapor. MemVerge doesn’t expect to ship a beta product until at least June. + +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/3389358/startup-memverge-combines-dram-and-optane-into-massive-memory-pool.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg +[2]: https://www.networkworld.com/article/3323580/mass-data-fragmentation-requires-a-storage-rethink.html +[3]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md new file mode 100644 index 0000000000..4f96f34b2b --- /dev/null +++ b/sources/talk/20190417 Want to the know future of IoT- Ask the developers.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Want to the know future of IoT? Ask the developers!) +[#]: via: (https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Want to the know future of IoT? Ask the developers! +====== +A new survey of IoT developers reveals that connectivity, performance, and standards are growing areas of concern as IoT projects hit production. +![Avgust01 / Getty Images][1] + +It may be a cliché that software developers rule the world, but if you want to know the future of an important technology, it pays to look at what the developers are doing. With that in mind, there are some real, on-the-ground insights for the entire internet of things (IoT) community to be gained in a new [survey of more than 1,700 IoT developers][2] (pdf) conducted by the [Eclipse Foundation][3]. + +### IoT connectivity concerns + +Perhaps not surprisingly, security topped the list of concerns, easily outpacing other IoT worries. But that's where things begin to get interesting. More than a fifth (21%) of IoT developers cited connectivity as a challenge, followed by data collection and analysis (19%), performance (18%), privacy (18%), and standards (16%). + +Connectivity rose to second place after being the number three IoT concern for developers last year. Worries over security and data collection and analysis, meanwhile, actually declined slightly year over year. (Concerns over performance, privacy, and standards also increased significantly from last year.) + +**[ Learn more:[Download a PDF bundle of five essential articles about IoT in the enterprise][4] ]** + +“If you look at the list of developers’ top concerns with IoT in the survey,” said [Mike Milinkovich][5], executive director of the Eclipse Foundation via email, “I think connectivity, performance, and standards stand out — those are speaking to the fact that the IoT projects are getting real, that they’re getting out of sandboxes and into production.” + +“With connectivity in IoT,” Milinkovich continued, “everything seems straightforward until you have a sensor in a corner somewhere — narrowband or broadband — and physical constraints make it hard to connect." + +He also cited a proliferation of incompatible technologies that is driving developer concerns over connectivity. + +![][6] + +### IoT standards and interoperability + +Milinkovich also addressed one of [my personal IoT bugaboos: interoperability][7]. “Standards is a proxy for interoperability” among products from different vendors, he explained, which is an “elusive goal” in industrial IoT (IIoT). + +**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][8] ]** + +“IIoT is about breaking down the proprietary silos and re-tooling the infrastructure that’s been in our factories and logistics for many years using OSS standards and implementations — standard sets of protocols as opposed to vendor-specific protocols,” he said. + +That becomes a big issue when you’re deploying applications in the field and different manufacturers are using different protocols or non-standard extensions to existing protocols and the machines can’t talk to each other. + +**[ Also read:[Interoperability is the key to IoT success][7] ]** + +“This ties back to the requirement of not just having open standards, but more robust implementations of those standards in open source stacks,” Milinkovich said. “To keep maturing, the market needs not just standards, but out-of-the-box interoperability between devices.” + +“Performance is another production-grade concern,” he said. “When you’re in development, you think you know the bottlenecks, but then you discover the real-world issues when you push to production.” + +### Cloudy developments for IoT + +The survey also revealed that in some ways, IoT is very much aligned with the larger technology community. For example, IoT use of public and hybrid cloud architectures continues to grow. Amazon Web Services (AWS) (34%), Microsoft Azure (23%), and Google Cloud Platform (20%) are the leading IoT cloud providers, just as they are throughout the industry. If anything, AWS’ lead may be smaller in the IoT space than it is in other areas, though reliable cloud-provider market share figures are notoriously hard to come by. + +But Milinkovich sees industrial IoT as “a massive opportunity for hybrid cloud” because many industrial IoT users are very concerned about minimizing latency with their factory data, what he calls “their gold.” He sees factories moving towards hybrid cloud environments, leveraging “modern infrastructure technology like Kubernetes, and building around open protocols like HTTP and MQTT while getting rid of the older proprietary protocols.” + +### How IoT development is different + +In some ways, the IoT development world doesn’t seem much different than wider software development. For example, the top IoT programming languages mirror [the popularity of those languages][9] over all, with C and Java ruling the roost. (C led the way on constrained devices, while Java was the top choice for gateway and edge nodes, as well as the IoT cloud.) + +![][10] + +But Milinkovich noted that when developing for embedded or constrained devices, the programmer’s interface to a device could be through any number of esoteric hardware connectors. + +“You’re doing development using emulators and simulators, and it’s an inherently different and more complex interaction between your dev environment and the target for your application,” he said. “Sometimes hardware and software are developed in tandem, which makes it even more complicated.” + +For example, he explained, building an IoT solution may bring in web developers working on front ends using JavaScript and Angular, while backend cloud developers control cloud infrastructure and embedded developers focus on building software to run on constrained devices. + +No wonder IoT developers have so many things to worry about. + +**More about IoT:** + + * [What is the IoT? How the internet of things works][11] + * [What is edge computing and how it’s changing the network][12] + * [Most powerful Internet of Things companies][13] + * [10 Hot IoT startups to watch][14] + * [The 6 ways to make money in IoT][15] + * [What is digital twin technology? [and why it matters]][16] + * [Blockchain, service-centric networking key to IoT success][17] + * [Getting grounded in IoT networking and security][4] + * [Building IoT-ready networks must become a priority][18] + * [What is the Industrial IoT? [And why the stakes are so high]][19] + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3389877/want-to-the-know-future-of-iot-ask-the-developers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg +[2]: https://drive.google.com/file/d/17WEobD5Etfw5JnoKC1g4IME_XCtPNGGc/view +[3]: https://www.eclipse.org/ +[4]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[5]: https://blogs.eclipse.org/post/mike-milinkovich/measuring-industrial-iot%E2%80%99s-evolution +[6]: https://images.idgesg.net/images/article/2019/04/top-developer-concerns-2019-eclipse-foundation-100793974-large.jpg +[7]: https://www.networkworld.com/article/3204529/interoperability-is-the-key-to-iot-success.html +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava +[9]: https://blog.newrelic.com/technology/popular-programming-languages-2018/ +[10]: https://images.idgesg.net/images/article/2019/04/top-iot-programming-languages-eclipse-foundation-100793973-large.jpg +[11]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[12]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[13]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[14]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[15]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[16]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[17]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md new file mode 100644 index 0000000000..4a82248cde --- /dev/null +++ b/sources/talk/20190418 -Fiber-in-air- 5G network research gets funding.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ('Fiber-in-air' 5G network research gets funding) +[#]: via: (https://www.networkworld.com/article/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +'Fiber-in-air' 5G network research gets funding +====== +A consortium of tech companies and universities plan to aggressively investigate the exploitation of D-Band to develop a new variant of 5G infrastructure. +![Peshkova / Getty Images][1] + +Wireless transmission at data rates of around 45gbps could one day be commonplace, some engineers say. “Fiber-in-air” is how the latest variant of 5G infrastructure is being described. To get there, a Britain-funded consortium of chip makers, universities, and others intend to aggressively investigate the exploitation of D-Band. That part of the radio spectrum is at 151-174.8 GHz in millimeter wavelengths (mm-wave) and hasn’t been used before. + +The researchers intend to do it by riffing on a now roughly 70-year-old gun-like electron-sending device that can trace its roots back through the annals of radio history: The Traveling Wave Tube, or TWT, an electron gun-magnet-combo that was used in the development of television and still brings space images back to Earth. + +**[ Also read:[The time of 5G is almost here][2] ]** + +D-Band, the spectrum the researchers want to use, has the advantage that it’s wide, so theoretically it should be good for fast, copious data rates. The problem with it though, and the reason it hasn’t thus far been used, is that it’s subject to monkey-wrenching from atmospheric conditions such as rain, explains IQE, a semiconductor wafer and materials producer involved in the project, in a [press release][3]. The team says attenuation is fixable, though. Their solution is the now-aging TWTs. + +The group, which includes BT, Filtronic, Glasgow University, Intel, Nokia Bell Labs, Optocap, and Teledyne e2v, has secured funding of the equivalent of $1.12 million USD from the U.K.’s [Engineering and Physical Sciences Research Council (EPSRC)][4]. That’s the principal public funding body for engineering science research there. + +### Tapping the power of TWTs + +The DLINK system, as the team calls it, will use a high-power vacuum TWT with a special, newly developed tunneling diode and a modulator. Two bands of 10 GHz, each will deliver the throughput, [explains Lancaster University on its website][5]. The tubes are, in fact, special amplifiers that produce 10 Watts. That’s 10 times what an equivalent solid-state solution would likely produce at the same spot in the band, they say. Energy is basically sent from the electron beam to an electric field generated by the input signal. + +Despite TWTs being around for eons, “no D-band TWTs are available in the market.” The development of one is key to these fiber-in-air speeds, the researchers say. + +They will include “unprecedented data rate and transmission distance,” IQE writes. + +The TWT device, although used extensively in space wireless communications since its invention in the 1950s, is overlooked as a significant contributor to global communications systems, say a group of French researchers working separately from this project, who recently argue that TWTs should be given more recognition. + +TWT’s are “the unsung heroes of space exploration,” the Aix-Marseille Université researchers say in [an article on publisher Springer’s website][6]. Springer is promoting the group's 2019-published [paper][7] in the European Physical Journal H in which they delve into the history of the simple electron gun and magnet device. + +“Its role in the history of wireless communications and in the space conquest is significant, but largely ignored,” they write in their paper. + +They will be pleased to hear it maybe isn’t going away anytime soon. + +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/3389881/extreme-5g-network-research-gets-funding.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/abstract_data_coding_matrix_structure_network_connections_by_peshkova_gettyimages-897683944_2400x1600-100788487-large.jpg +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://www.iqep.com/media/2019/03/iqe-partners-in-key-wireless-communications-project-for-5g-infrastructure-(1)/ +[4]: https://epsrc.ukri.org/ +[5]: http://wp.lancs.ac.uk/dlink/ +[6]: https://www.springer.com/gp/about-springer/media/research-news/all-english-research-news/traveling-wave-tubes--the-unsung-heroes-of-space-exploration/16578434 +[7]: https://link.springer.com/article/10.1140%2Fepjh%2Fe2018-90023-1 +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md new file mode 100644 index 0000000000..8be9e14ada --- /dev/null +++ b/sources/talk/20190423 Open architecture and open source - The new wave for SD-WAN.md @@ -0,0 +1,186 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open architecture and open source – The new wave for SD-WAN?) +[#]: via: (https://www.networkworld.com/article/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Open architecture and open source – The new wave for SD-WAN? +====== +As networking continues to evolve, you certainly don't want to break out a forklift every time new technologies are introduced. Open architecture would allow you to replace the components of a system, and give you more flexibility to control your own networking destiny. +![opensource.com \(CC BY-SA 2.0\)][1] + +I recently shared my thoughts about the [role of open source in networking][2]. I discussed two significant technological changes that we have witnessed. I call them waves, and these waves will redefine how we think about networking and security. + +The first wave signifies that networking is moving to the software so that it can run on commodity off-the-shelf hardware. The second wave is the use of open source technologies, thereby removing the barriers to entry for new product innovation and rapid market access. This is especially supported in the SD-WAN market rush. + +Seemingly, we are beginning to see less investment in hardware unless there is a specific segment that needs to be resolved. But generally, software-based platforms are preferred as they bring many advantages. It is evident that there has been a technology shift. We have moved networking from hardware to software and this shift has positive effects for users, enterprises and service providers. + +**[ Don’t miss[customer reviews of top remote access tools][3] and see [the most powerful IoT companies][4] . | Get daily insights by [signing up for Network World newsletters][5]. ]** + +### Performance (hardware vs software) + +There has always been a misconception that the hardware-based platforms are faster due to the hardware acceleration that exists in the network interface controller (NIC). However, this is a mistaken belief. Nowadays, software platforms can reach similar performance levels as compared to hardware-based platforms. + +Initially, people viewed hardware as a performance-based vehicle but today this does not hold true anymore. Even the bigger vendors are switching to software-based platforms. We are beginning to see this almost everywhere in networking. + +### SD-WAN and open source + +SD-WAN really took off quite rapidly due to the availability of open source. It enabled the vendors to leverage all the available open source components and then create their solution on top. By and large, SD-WAN vendors used the open source as the foundation of their solution and then added additional proprietary code over the baseline. + +However, even when using various open source components, there is still a lot of work left for these vendors to make it to a complete SD-WAN solution, even for reaching a baseline of centrally managed routers with flexible network architecture control, not to talk about complete feature set of SD-WAN. + +The result of the work done by these vendors is still closed products so the fact they are using open source components in their products is merely a time-to-market advantage but not a big benefit to the end users (enterprises) or service providers launching hosted services with these products. They are still limited in flexibility and vendor diversity is only achieved through a multi-vendor strategy which in practice means launching multiple silo services each based on a different SD-WAN vendor without real selection of the technologies that make each of the SD-WAN services they launch. + +I recently came across a company called [Flexiwan][6], their goal is to fundamentally change this limitation of SD-WAN by offering a full open source solution that, as they say, “includes integration points in the core of the system that allow for 3rd party logic to be integrated in an efficient way.” They call this an open architecture, which, in practical terms, means a service provider or enterprise can integrate his own application logic into the core of the SD-WAN router…or select best of breed sub-technologies or applications instead of having these dictated by the vendor himself. I believe there is the possibility of another wave of SD-WAN with a fully open source and open architecture to SD-WAN. + +This type of architecture brings many benefits to users, enterprises and service providers, especially when compared to the typical lock-in of bigger vendors, such as Cisco and VMware. + +With an open source open architecture, it’s easier to control the versions and extend more flexibility by using the software offered by different providers. It offers the ability to switch providers, not to mention being easier to install and upgrade the versions. + +### SD-WAN, open source and open architecture + +An SD-WAN solution that is an open source with open architecture provides a modular and decomposed type of SD-WAN. This enables the selection of elements to provide a solution. + +For example, enterprises and service providers can select the best-of-breed technologies from independent vendors, such as deep packet inspection (DPI), security, wide area network (WAN) optimization, session border controller (SBC), VoIP and other traffic specific optimization logic. + +Some SD-WAN vendors define an open architecture in such a way that they just have a set of APIs, for example, northbound APIs, to enable one to build management or do service chaining. This is one approach to an open architecture but in fact, it’s pretty limited since it does not bring the full benefits that an open architecture should offer. + +### Open source and the fear of hacking + +However, when I think about an open source and open architecture for SD-WAN, the first thing that comes to mind is bad actors. What about the code? If it’s an open source, the bad actor can find vulnerabilities, right? + +The community is a powerful force and will fix any vulnerability. Also with open source, the vendor, who is the one responsible for the open source component will fix the vulnerability much faster than a closed solution, where you are unaware of the vulnerability until a fix is released. + +### The SD-WAN evolution + +Before we go any further, let’s examine the history of SD-WAN and its origins, how we used to connect from the wide area network (WAN) to other branches via private or public links. + +SD-WAN offers the ability to connect your organization to a WAN. This could be connecting to the Internet or other branches, to optimally deliver applications with a good user-experience. Essentially, SD-WAN allows the organizations to design the architecture of their network dynamically by means of software. + +### In the beginning, there was IPSec + +It started with IPSec. Around two decades back, in 1995, the popular design was that of mesh architecture. As a result, we had a lot of point-to-point connections. Firstly, mesh architectures with IPSec VPNs are tiresome to manage as there is a potential for 100s of virtual private network (VPN) configurations. + +Authentically, IPSec started with two fundamental goals. The first was the tunneling protocol that would allow organizations to connect the users or other networks to their private network. This enabled the enterprises to connect to networks that they did not have a direct route to. + +The second goal of IPSec was to encrypt packets at the network layer and therefore securing the data in motion. Let’s face it: at that time, IPSec was terrible for complicated multi-site interconnectivity and high availability designs. If left to its defaults, IPSec is best suited for static designs. + +This was the reason why we had to step in the next era where additional functionality was added to IPSec. For example, IPSec had issues in supporting routing protocols using multicast. To overcome this, IPSec over generic routing encapsulation (GRE) was introduced. + +### The next era of SD-WAN + +During the journey to 2008, one could argue that the next era of WAN connectivity was when additional features were added to IPSec. At this time IPSec became known as a “Swiss army knife.” It could do many things but not anything really well. + +Back then, you could create multiple links, but it failed to select the traffic over these links other than by using simple routing. You needed to add a routing protocol. For advanced agile architectures, IPSec had to be incorporated with other higher-level protocols. + +Features were then added based on measuring the quality. Link quality features were added to analyze any delay, drops and to select alternative links for your applications. We began to add tunnels, multi-links and to select the traffic based on the priority, not just based on the routing. + +The most common way to the tunnel was to have IPSec over GRE. You have the GRE tunnel that enables you to send any protocol end-to-end by using IPSec for the encryption. All this functionality was added to achieve and create dynamic tunnels over IPSec and to optimize the IPSec tunnels. + +This was a move in the right direction, but it was still complex. It was not centrally managed and was error-prone with complex configurations that were unable to manage large deployments. IPSec had far too many limitations, so in the mid-2000s early SD-WAN vendors started cropping up. Some of these vendors enabled the enterprises to aggregate many separate digital subscriber lines (DSL) links into one faster logical link. At the same time, others added time stamps and/or sequence numbers to packets to improve the network performance and security when running over best effort (internet) links. + +International WAN connectivity was a popular focus since the cost delta between the Internet and private multiprotocol label switching (MPLS) was 10x+ different. Primarily, enterprises wanted the network performance and security of MPLS without having to pay a premium for it. + +Most of these solutions sat in-front or behind a traditional router from companies like Cisco. Evidently, just like WAN Optimization vendors, these were additional boxes/solutions that enterprises added to their networks. + +### The next era of SD-WAN, circa 2012 + +It was somewhere in 2012 that we started to see the big rush to the SD-WAN market. Vendors such as Velocloud, Viptela and a lot of the other big players in the SD-WAN market kicked off with the objective of claiming some of the early SD-WAN success and going after the edge router market with a full feature router replacement and management simplicity. + +Open source networking software and other open source components for managing the traffic enabled these early SD-WAN vendors to lay a foundation where a lot of the code base was open source. They would then “glue” it together and add their own additional features. + +Around this time, Intel was driving data plane development kit (DPDK) and advanced encryption standard (AES) instruction set, which enabled that software to run on commodity hardware. The SD-WAN solutions were delivered as closed solutions where each solution used its own set of features. The features and technologies chosen for each vendor were different and not compatible with each other. + +### The recent era of SD-WAN, circa 2017 + +A tipping point in 2017 was the gold rush for SD-WAN deployments. Everyone wanted to have SD-WAN as fast as possible. + +The SD-WAN market has taken off, as seen by 50 vendors with competing, proprietary solutions and market growth curves with a CAGR of 100%. There is a trend of big vendors like Cisco, Vmware and Oracle acquiring startups to compete in this new market. + +As a result, Cisco, which is the traditional enterprise market leader in WAN routing solutions felt threatened since its IWAN solution, which had been around since 2008, was too complex (a 900-page configuration and operations manual). Besides, its simple solution based on the Meraki acquisition was not feature-rich enough for the large enterprises. + +With their acquisition of Viptela, Cisco currently has a 13% of the market share, and for the first time in decades, it is not the market leader. The large cloud vendors, such as Google and Facebook are utilizing their own technology for routing within their very large private networks. + +At some point between 2012 and 2017, we witnessed the service providers adopting SD-WAN. This introduced the onset and movement of managed SD-WAN services. As a result, the service providers wanted to have SD-WAN on the menu for their customers. But there were many limitations in the SD-WAN market, as it was offered as a closed-box solution, giving the service providers limited control. + +At this point surfaced an expectation of change, as service providers and enterprises looked for more control. Customers can get better functionality from a multi-vendor approach than from a single vendor. + +### Don’t forget DIY SD-WAN + +Up to 60% of service providers and enterprises within the USA are now looking at DIY SD-WAN. A DIY SD-WAN solution is not where the many pieces of open source are taken and caste into something. The utmost focus is on the solution that can be self-managed but buy from a vendor. + +Today, the majority of the market is looking for managed solutions and the upper section that has the expertise wants to be equipped with more control options. + +### SD-WAN vendors attempting everything + +There is a trend that some vendors try to do everything with SD-WAN. As a result, whether you are an enterprise or a service provider, you are locked into a solution that is dictated by the SD-WAN vendor. + +The SD-WAN vendors have made the supplier choice or developed what they think is relevant. Evidently, some vendors are using stacks and software development kits (SDKs) that they purchased, for example, for deep packet inspection (DPI). + +Ultimately, you are locked into a specific solution that the vendor has chosen for you. If you are a service provider, you might disapprove of this limitation and if you are an enterprise with specific expertise, you might want to zoom in for more control. + +### All-in-one security vendors + +Many SD-WAN vendors promote themselves as security companies. But would you prefer to buy a security solution from an SD-WAN vendor or from an experienced vendor, such as Checkpoint? + +Both: enterprise and service providers want to have a choice, but with an integrated black box security solution, you don't have a choice. The more you integrate and throw into the same box, the stronger the vendor lock-in is and the weaker the flexibility. + +Essentially, with this approach, you are going for the lowest common denominator instead of the highest. Ideally, the technology of the services that you deploy on your network requires expertise. One vendor cannot be an expert in everything. + +An open architecture lies in a place for experts in different areas to join together and add their own specialist functionality. + +### Encrypted traffic + +As a matter of fact, what is not encrypted today will be encrypted tomorrow. The vendor of the application can perform intelligent things that the SD-WAN vendor cannot because they control both sides. Hence, if you can put something inside the SD-WAN edge device, they can make smart decisions even if the traffic is encrypted. + +But in the case of traditional SD-WANs, there needs to be a corporation with a content provider. However, with an open architecture, you can integrate anything, and nothing prevents the integration. A lot of traffic is encrypted and it's harder to manage encrypted traffic. However, an open architecture would allow the content providers to manage the traffic more effectively. + +### 2019 and beyond: what is an open architecture? + +Cloud providers and enterprises have discovered that 90% of the user experience and security problems arise due to the network: between where the cloud provider resides and where the end-user consumes the application. + +Therefore, both cloud providers and large enterprise with digital strategies are focusing on building their solutions based on open source stacks. Having a viable open source SD-WAN solution is the next step in the SD-WAN evolution, where it moves to involve the community in the solution. This is similar to what happens with containers and tools. + +Now, since we’re in 2019, are we going to witness a new era of SD-WAN? Are we moving to the open architecture with an open source SD-WAN solution? An open architecture should be the core of the SD-WAN infrastructure, where additional technologies are integrated inside the SD-WAN solution and not only complementary VNFs. There is an interface and native APIs that allow you to integrate logic into the router. This way, the router will be able to intercept and act according to the traffic. + +So, if I’m a service provider and have my own application, I would want to write logic that would be able to communicate with my application. Without an open architecture, the service providers can’t really offer differentiation and change the way SD-WAN makes decisions and interacts with the traffic of their applications. + +There is a list of various technologies that you need to be an expert in to be able to integrate. And each one of these technologies can be a company, for example, DPI, VoIP optimization, and network monitoring to name a few. An open architecture will allow you to pick and choose these various elements as per your requirements. + +Networking is going through a lot of changes and it will continue to evolve with the passage of time. As a result, you wouldn’t want something that forces you to break out a forklift each time new technologies are introduced. Primarily, open architecture allows you to replace the components of the system and add code or elements that handle specific traffic and applications. + +### Open source + +Open source gives you more flexibility to control your own destiny. It offers the ability to select your own services that you want to be applied to your system. It provides security in the sense that if something happens to the vendor or there is a vulnerability in the system, you know that you are backed by the community that can fix such misadventures. + +From the perspective of the business model, it makes a more flexible and cost-effective system. Besides, with open source, the total cost of ownership will also be lower. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][7]** + +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/3390151/open-architecture-and-open-source-the-new-wave-for-sd-wan.html#tk.rss_all + +作者:[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://images.techhive.com/images/article/2017/03/6554314981_7f95641814_o-100714680-large.jpg +[2]: https://www.networkworld.com/article/3338143/the-role-of-open-source-in-networking.html +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[6]: https://flexiwan.com/sd-wan-open-source/ +[7]: /contributor-network/signup.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md new file mode 100644 index 0000000000..e202384558 --- /dev/null +++ b/sources/talk/20190424 Cisco- DNSpionage attack adds new tools, morphs tactics.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco: DNSpionage attack adds new tools, morphs tactics) +[#]: via: (https://www.networkworld.com/article/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco: DNSpionage attack adds new tools, morphs tactics +====== +Cisco's Talos security group says DNSpionage tools have been upgraded to be more stealthy +![Calvin Dexter / Getty Images][1] + +The group behind the Domain Name System attacks known as DNSpionage have upped their dark actions with new tools and malware to focus their attacks and better hide their activities. + +Cisco Talos security researchers, who discovered [DNSpionage][2] in November, this week warned of new exploits and capabilities of the nefarious campaign. + +**More about DNS:** + + * [DNS in the cloud: Why and why not][3] + * [DNS over HTTPS seeks to make internet use more private][4] + * [How to protect your infrastructure from DNS cache poisoning][5] + * [ICANN housecleaning revokes old DNS security key][6] + + + +“The threat actor's ongoing development of DNSpionage malware shows that the attacker continues to find new ways to avoid detection. DNS tunneling is a popular method of exfiltration for some actors and recent examples of DNSpionage show that we must ensure DNS is monitored as closely as an organization's normal proxy or weblogs,” [Talos wrote][7]. “DNS is essentially the phonebook of the internet, and when it is tampered with, it becomes difficult for anyone to discern whether what they are seeing online is legitimate.” + +In Talos’ initial report, researchers said a DNSpionage campaign targeted various businesses in the Middle East as well as United Arab Emirates government domains. It also utilized two malicious websites containing job postings that were used to compromise targets via crafted Microsoft Office documents with embedded macros. The malware supported HTTP and DNS communication with the attackers. + +In a separate DNSpionage campaign, the attackers used the same IP address to redirect the DNS of legitimate .gov and private company domains. During each DNS compromise, the actor carefully generated “Let's Encrypt” certificates for the redirected domains. These certificates provide X.509 certificates for [Transport Layer Security (TLS)][8] free of charge to the user, Talos said. + +This week Cisco said DNSpionage actors have created a new remote administrative tool that supports HTTP and DNS communication with the attackers' command and control (C2). + +“In our previous post concerning DNSpionage, we showed that the malware author used malicious macros embedded in a Microsoft Word document. In the new sample from Lebanon identified at the end of February, the attacker used an Excel document with a similar macro.” + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][9] ]** + +Talos wrote: “The malware supports HTTP and DNS communication to the C2 server. The HTTP communication is hidden in the comments in the HTML code. This time, however, the C2 server mimics the GitHub platform instead of Wikipedia. While the DNS communication follows the same method we described in our previous article, the developer added some new features in this latest version and, this time, the actor removed the debug mode.” + +Talos added that the domain used for the C2 campaign is “bizarre.” + +“The previous version of DNSpionage attempted to use legitimate-looking domains in an attempt to remain undetected. However, this newer version uses the domain ‘coldfart[.]com,’ which would be easier to spot than other APT campaigns which generally try to blend in with traffic more suitable to enterprise environments. The domain was also hosted in the U.S., which is unusual for any espionage-style attack.” + +Talos researchers said they discovered that DNSpionage added a reconnaissance phase, that ensures the payload is being dropped on specific targets rather than indiscriminately downloaded on every machine. + +This level of attack also returns information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system, Talos wrote. This information is key to helping the malware select the victims only and attempts to avoid researchers or sandboxes. Again, it shows the actor's improved abilities, as they now fingerprint the victim. + +This new tactic indicates an improved level of sophistication and is likely in response to the significant amount of public interest in the campaign. + +Talos noted that there have been several other public reports of DNSpionage attacks, and in January, the U.S. Department of Homeland Security issued an [alert][10] warning users about this threat activity. + +“In addition to increased reports of threat activity, we have also discovered new evidence that the threat actors behind the DNSpionage campaign continue to change their tactics, likely in an attempt to improve the efficacy of their operations,” Talos stated. + +In April, Cisco Talos identified an undocumented malware developed in .NET. On the analyzed samples, the malware author left two different internal names in plain text: "DropperBackdoor" and "Karkoff." + +“The malware is lightweight compared to other malware due to its small size and allows remote code execution from the C2 server. There is no obfuscation and the code can be easily disassembled,” Talos wrote. + +The Karkoff malware searches for two specific anti-virus platforms: Avira and Avast and will work around them. + +“The discovery of Karkoff also shows the actor is pivoting and is increasingly attempting to avoid detection while remaining very focused on the Middle Eastern region,” Talos wrote. + +Talos distinguished DNSpionage from another DNS attack method, “[Sea Turtle][11]”, it detailed this month. Sea Turtle involves state-sponsored attackers that are abusing DNS to target organizations and harvest credentials to gain access to sensitive networks and systems in a way that victims are unable to detect. This displays unique knowledge about how to manipulate DNS, Talos stated. + +By obtaining control of victims’ DNS, attackers can change or falsify any data victims receive from the Internet, illicitly modify DNS name records to point users to actor-controlled servers and users visiting those sites would never know, Talos reported. + +“While this incident is limited to targeting primarily national security organizations in the Middle East and North Africa, and we do not want to overstate the consequences of this specific campaign, we are concerned that the success of this operation will lead to actors more broadly attacking the global DNS system,” Talos stated about Sea Turtle. + +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/3390666/cisco-dnspionage-attack-adds-new-tools-morphs-tactics.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/02/cyber_attack_threat_danger_breach_hack_security_by_calvindexter_gettyimages-860363294_2400x800-100788395-large.jpg +[2]: https://blog.talosintelligence.com/2018/11/dnspionage-campaign-targets-middle-east.html +[3]: https://www.networkworld.com/article/3273891/hybrid-cloud/dns-in-the-cloud-why-and-why-not.html +[4]: https://www.networkworld.com/article/3322023/internet/dns-over-https-seeks-to-make-internet-use-more-private.html +[5]: https://www.networkworld.com/article/3298160/internet/how-to-protect-your-infrastructure-from-dns-cache-poisoning.html +[6]: https://www.networkworld.com/article/3331606/security/icann-housecleaning-revokes-old-dns-security-key.html +[7]: https://blog.talosintelligence.com/2019/04/dnspionage-brings-out-karkoff.html +[8]: https://www.networkworld.com/article/2303073/lan-wan-what-is-transport-layer-security-protocol.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[10]: https://www.us-cert.gov/ncas/alerts/AA19-024A +[11]: https://www.networkworld.com/article/3389747/cisco-talos-details-exceptionally-dangerous-dns-hijacking-attack.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 How data storage will shift to blockchain.md b/sources/talk/20190424 How data storage will shift to blockchain.md new file mode 100644 index 0000000000..b31653e0f7 --- /dev/null +++ b/sources/talk/20190424 How data storage will shift to blockchain.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How data storage will shift to blockchain) +[#]: via: (https://www.networkworld.com/article/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +How data storage will shift to blockchain +====== +Move over cloud and traditional in-house enterprise data center storage, distributed storage based on blockchain may be arriving imminently. +![Cybrain / Getty Images][1] + +If you thought cloud storage was digging in its heels to become the go-to method for storing data, and at the same time grabbing share from own-server, in-house storage, you may be interested to hear that some think both are on the way out. Instead organizations will use blockchain-based storage. + +Decentralized blockchain-based file storage will be more secure, will make it harder to lose data, and will be cheaper than anything seen before, say organizations actively promoting the slant on encrypted, distributed technology. + +**[ Read also:[Why blockchain (might be) coming to an IoT implementation near you][2] ]** + +### Storing transactional data in a blockchain + +China company [FileStorm][3], which describes itself in marketing materials as the first [Interplanetary File Storage][4] (IPFS) platform on blockchain, says the key to making it all work is to only store the transactional data in blockchain. The actual data files, such as large video files, are distributed in IPFS. + +IPFS is a distributed, peer-to-peer file storage protocol. File parts come from multiple computers all at the same time, supposedly making the storage hardy. FileStorm adds blockchain on top of it for a form of transactional indexing. + +“Blockchain is designed to store transactions forever, and the data can never be altered, thus a trustworthy system is created,” says Raymond Fu, founder of FileStorm and chief product officer of MOAC, the underlying blockchain system used, in a video on the FileStorm website. + +“The blocks are used to store only small transactional data,” he says. You can’t store the large files on it. Those are distributed. Decentralized data storage platforms are needed for added decentralized blockchain, he says. + +YottaChain, another blockchain storage start-up project is coming at the whole thing from a slightly different angle. It claims its non-IPFS system is more secure partly because it performs deduplication after encryption. + +“Data is 10,000 times more secure than [traditional] centralized storage,” it says on its [website][5]. Deduplication eliminates duplicated or redundant data. + +### Disrupting data storage + +“Blockchain will disrupt data storage,” [says BlockApps separately][6]. The blockchain backend platform provider says advantages to this new generation of storage include that decentralizing data provides more security and privacy. That's due in part because it's harder to hack than traditional centralized storage. That the files are spread piecemeal among nodes, conceivably all over the world, makes it impossible for even the participating node to view the contents of the complete file, it says. + +Sharding, which is the term for the breaking apart and node-spreading of the actual data, is secured through keys. Markets can award token coins for mining, and coins can be spent to gain storage. Excess storage can even be sold. And cryptocurrencies have been started to “incentivize usage and to create a market for buying and selling decentralized storage,” BlockApps explains. + +The final parts of this new storage mix are that lost files are minimized because data can be duplicated simply — the data sets, for example, can be stored multiple times for error correction — and costs are reduced due to efficiencies. + +Square Tech (Shenzhen) Co., which makes blockchain file storage nodes, says in its marketing materials that it intends to build service centers globally to monitor its nodes in real time. Interestingly, another area the company has gotten involved in is the internet of things (IoT), and [it says][7] it wants “to unite the technical resources, capital, and human resources of the IoT industry and blockchain.” Perhaps we end up with a form of the internet of storage things? + +“The entire cloud computing industry will be disrupted by blockchain technology in just a few short years,” says BlockApps. Dropbox and Amazon “may even become overpriced and obsolete if they do not find ways to integrate with the advances.” + +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/3390722/how-data-storage-will-shift-to-blockchain.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_cybrain_gettyimages-926677890_2400x1600-100788435-large.jpg +[2]: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html +[3]: http://filestorm.net/ +[4]: https://ipfs.io/ +[5]: https://www.yottachain.io/ +[6]: https://blockapps.net/blockchain-disrupt-data-storage/ +[7]: http://www.sikuaikeji.com/ +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md new file mode 100644 index 0000000000..c948f458ce --- /dev/null +++ b/sources/talk/20190424 No, drone delivery still isn-t ready for prime time.md @@ -0,0 +1,91 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (No, drone delivery still isn’t ready for prime time) +[#]: via: (https://www.networkworld.com/article/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +No, drone delivery still isn’t ready for prime time +====== +Despite incremental progress and limited regulatory approval in the U.S. and Australia, drone delivery still isn’t a viable option in the vast majority of use cases. +![Sorry imKirk \(CC0\)][1] + +April has a been a big month for drone delivery. First, [Alphabet’s Wing Aviation drones got approval from Australia’s Civil Aviation Safety Authority (CASA)][2], for public deliveries in the country, and this week [Wing earned Air Carrier Certification from the U.S. Federal Aviation Administration][3]. These two regulatory wins got lot of people got very excited. Finally, the conventional wisdom exulted, drone delivery is actually becoming a reality. + +Not so fast. + +### Drone delivery still in pilot/testing mode + +Despite some small-scale successes and the first signs of regulatory acceptance, drone delivery remains firmly in the carefully controlled pilot/test phase (and yes, I know drones don’t carry pilots). + +**[ Also read:[Coffee drone delivery: Ideas this bad could kill the internet of things][4] ]** + +For example, despite getting FAA approval to begin commercial deliveries, Wing is still working up beginning delivery trials to test the technology and gather information in Virginia later this year. + +But what about that public approval from CASA for deliveries outside Canberra? That’s [a real business][5] now, right? + +Well, yes and no. + +On the “yes” side, the Aussie approval reportedly came after 18 months of tests, 70,000 flights, and more than 3,000 actual deliveries of products from local coffee shops and pharmacies. So, at least some people somewhere in the world are actually getting stuff dropped at their doors by drones. + +In the “no” column, however, goes the fact that the approval covers only about 100 suburban homes, though more are planned to be added “in the coming weeks and months.” More importantly, the approval includes strict limits on when and where the drones can go. No crossing main roads, no nighttime deliveries, and prohibitions to stay away from people. And drone-eligible customers need a safety briefing! + +### Safety briefings required for customers + +That still sounds like a small-scale test, not a full-scale commercial roll-out. And while I think drone-safety classes are probably a good idea – and the testing period apparently passed without any injuries – even the perceived _need_ for them is not be a great advertisement for rapid expansion of drone deliveries. + +Ironically, though, a bigger issue than protecting people from the drones, perhaps, is protecting the drones from people. Instructions to stay 2 to 5 meters away from folks will help, but as I’ve previously addressed, these things are already seen as attractive nuisances and vandalism targets. Further raising the stakes, many local residents were said to be annoyed at the noise created by the drones. Now imagine those contraptions buzzing right by you all loaded down with steaming hot coffee or delicious ice cream. + +And even with all those caveats, no one is talking about the key factors in making drone deliveries a viable business: How much will those deliveries cost and who will pay? For a while, the desire to explore the opportunity will drive investment, but that won’t last forever. If drone deliveries aren’t cost effective for businesses, they won’t spread very far. + +From the customer perspective, most drone delivery tests are not yet charging for the service. If and when they start carrying fees as well as purchases, the novelty factor will likely entice many shoppers to pony up to get their items airlifted directly to their homes. But that also won’t last. Drone delivery will have to demonstrate that it’s better — faster, cheaper, or more reliable — than the existing alternatives to find its niche. + +### Drone deliveries are fast, commercial roll-out will be slow + +Long term, I have no doubt that drone delivery will eventually become an accepted part of the transportation infrastructure. I don’t necessarily buy into Wing’s prediction of an AU $40 million drone delivery market in Australia coming to pass anytime soon, but real commercial operations seem inevitable. + +It’s just going to be more limited than many proponents claim, and it’s likely to take a lot longer than expected to become mainstream. For example, despite ongoing testing, [Amazon has already missed Jeff Bezos’ 2018 deadline to begin commercial drone deliveries][6], and we haven’t heard much about [Walmart’s drone delivery plans][7] lately. And while tests by a number of companies continue in locations ranging from Iceland and Finland to the U.K. and the U.S. have created a lot of interest, they have not yet translated into widespread availability. + +Apart from the issue of how much consumers really want their stuff delivered by an armada of drones (a [2016 U.S. Post Office study][8] found that 44% of respondents liked the idea, while 34% didn’t — and 37% worried that drone deliveries might not be safe), a lot has to happen before that vision becomes reality. + +At a minimum, successful implementations of full-scale commercial drone delivery will require better planning, better-thought-out business cases, more rugged and efficient drone technology, and significant advances in flight control and autonomous flight. Like drone deliveries themselves, all that stuff is coming; it just hasn’t arrived yet. + +**More about drones and the internet of things:** + + * [Drone defense -- powered by IoT -- is now a thing][9] + * [Ideas this bad could kill the Internet of Things][4] + * [10 reasons Amazon's drone delivery plan still won't fly][10] + * [Amazon’s successful drone delivery test doesn’t really prove anything][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/3390677/drone-delivery-not-ready-for-prime-time.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/drone_mountains_by_sorry_imkirk_cc0_via_unsplash_1200x800-100763763-large.jpg +[2]: https://medium.com/wing-aviation/wing-launches-commercial-air-delivery-service-in-canberra-5da134312474 +[3]: https://medium.com/wing-aviation/wing-becomes-first-certified-air-carrier-for-drones-in-the-us-43401883f20b +[4]: https://www.networkworld.com/article/3301277/ideas-this-bad-could-kill-the-internet-of-things.html +[5]: https://wing.com/australia/canberra +[6]: https://www.businessinsider.com/jeff-bezos-predicted-amazon-would-be-making-drone-deliveries-by-2018-2018-12?r=US&IR=T +[7]: https://www.networkworld.com/article/2999828/walmart-delivery-drone-plans.html +[8]: https://www.uspsoig.gov/sites/default/files/document-library-files/2016/RARC_WP-17-001.pdf +[9]: https://www.networkworld.com/article/3309413/drone-defense-powered-by-iot-is-now-a-thing.html +[10]: https://www.networkworld.com/article/2900317/10-reasons-amazons-drone-delivery-plan-still-wont-fly.html +[11]: https://www.networkworld.com/article/3185478/amazons-successful-drone-delivery-test-doesnt-really-prove-anything.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md b/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md new file mode 100644 index 0000000000..ce0a408ae6 --- /dev/null +++ b/sources/talk/20190426 Profiling D-s Garbage Collection with Bpftrace.md @@ -0,0 +1,412 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Profiling D's Garbage Collection with Bpftrace) +[#]: via: (https://theartofmachinery.com/2019/04/26/bpftrace_d_gc.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Profiling D's Garbage Collection with Bpftrace +====== + +Recently I’ve been playing around with using [`bpftrace`][1] to trace and profile D’s garbage collector. Here are some examples of the cool stuff that’s possible. + +### What is `bpftrace`? + +It’s a high-level debugging tool based on Linux’s eBPF. “eBPF” stands for “extended Berkely packet filter”, but that’s just a historical name and doesn’t mean much today. It’s really a virtual machine (like the [JVM][2]) that sits inside the Linux kernel and runs code in a special eBPF instruction set similar to normal machine code. Users are expected to write short programs in high-level languages (including C and others) that get compiled to eBPF and loaded into the kernel on the fly to do interesting things. + +As you might guess, eBPF is powerful for instrumenting a running kernel, but it also supports instrumenting user-space programs. + +### What you need + +First you need a Linux kernel. Sorry BSD, Mac OS and Windows users. (But some of you can use [DTrace][3].) + +Also, not just any Linux kernel will work. This stuff is relatively new, so you’ll need a modern kernel with BPF-related features enabled. You might need to use the newest (or even testing) version of a distro. Here’s how to check if your kernel meets the requirements: + +``` +$ uname -r +4.19.27-gentoo-r1sub +$ # 4.9+ recommended by bpftrace +$ zgrep CONFIG_UPROBES /proc/config.gz +CONFIG_UPROBES=y +$ # Also need +$ # CONFIG_BPF=y +$ # CONFIG_BPF_SYSCALL=y +$ # CONFIG_BPF_JIT=y +$ # CONFIG_HAVE_EBPF_JIT=y +$ # CONFIG_BPF_EVENTS=y +``` + +Of course, [you also need to install the `bpftrace` tool itself][4]. + +### `bpftrace` D “Hello World” + +Here’s a quick test you can do to make sure you’ve got everything working. First, let’s make a Hello World D binary: + +``` +$ pwd +/tmp/ +$ cat hello.d +import std.stdio; + +void main() +{ + writeln("Hello World"); +} +$ dmd hello.d +$ ./hello +Hello World +$ +``` + +Now let’s `bpftrace` it. `bpftrace` uses a high-level language that’s obviously inspired by AWK. I’ll explain enough to understand the post, but you can also check out the [`bpftrace` reference guide][5] and [one-liner tutorial][6]. The minimum you need to know is that a bpftrace program is a list of `event:name /filter predicate/ { program(); code(); }` blocks that define code snippets to be run on events. + +This time I’m only using Linux uprobes, which trigger on functions in user-space programs. The syntax is `uprobe:/path/to/binary:functionName`. One gotcha is that D “[mangles][7]” (encodes) function names before inserting them into the binary. If we want to trigger on the D code’s `main()` function, we need to use the mangled name: `_Dmain`. (By the way, `nm program | grep ' _D.*functionName'` is one quick trick for finding mangled names.) + +Run this `bpftrace` invocation in a terminal as root user: + +``` +# bpftrace -e 'uprobe:/tmp/hello:_Dmain { printf("D Hello World run with process ID %d\n", pid); }' +Attaching 1 probe... +``` + +While this is running, it’ll print a message every time the D Hello World program is executed by any user in any terminal. Press `Ctrl+C` to quit. + +All `bpftrace` code can be run directly from the command line like in the example above. But to make things easier to read from now on, I’ll make neatly formatted scripts. + +### Tracing some real code + +I’m using [D-Scanner][8], the D code analyser, as an example of a simple but non-trivial D workload. One nice thing about `bpftrace` and uprobes is that no modification of the program is needed. I’m just using a normal build of the `dscanner` tool, and using the [D runtime source code][9] as a codebase to analyse. + +Before using `bpftrace`, let’s try using [the profiling that’s built into the D GC implementation itself][10]: + +``` +$ dscanner --DRT-gcopt=profile:1 --etags +... + Number of collections: 85 + Total GC prep time: 0 milliseconds + Total mark time: 17 milliseconds + Total sweep time: 6 milliseconds + Total page recovery time: 3 milliseconds + Max Pause Time: 1 milliseconds + Grand total GC time: 28 milliseconds +GC summary: 35 MB, 85 GC 28 ms, Pauses 17 ms < 1 ms +``` + +(If you can make a custom build, you can also use [the D runtime GC API to get stats][11].) + +There’s one more gotcha when using `bpftrace` on `dscanner` to trace GC functions: the binary file we specify for the uprobe needs to be the binary file that actually contains the GC functions. That could be the D binary itself, or it could be a shared D runtime library. Try running `ldd /path/to/d_program` to list any linked shared libraries, and if the output contains `druntime`, use that full path when specifying uprobes. My `dscanner` binary doesn’t link to a shared D runtime, so I just use the full path to `dscanner`. (Running `which dscanner` gives `/usr/local/bin/dscanner` for me.) + +Anyway, all the GC functions live in a `gc` module, so their mangled names start with `_D2gc`. Here’s a `bpftrace` invocation that tallies GC function calls. For convenience, it also includes a uretprobe to automatically exit when `main()` returns. The output is sorted to make it a little easier to read. + +``` +# cat dumpgcfuncs.bt +uprobe:/usr/local/bin/dscanner:_D2gc* +{ + @[probe] = count(); +} + +uretprobe:/usr/local/bin/dscanner:_Dmain +{ + exit(); +} +# bpftrace dumpgcfuncs.bt | sort + +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC10freeNoSyncMFNbNiPvZv]: 31 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC10initializeFKCQCd11gcinterface2GCZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC11queryNoSyncMFNbPvZS4core6memory8BlkInfo_]: 44041 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC11removeRangeMFNbNiPvZv]: 2 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC12extendNoSyncMFNbPvmmxC8TypeInfoZm]: 251946 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC14collectNoStackMFNbZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC18fullCollectNoStackMFNbZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC4freeMFNbNiPvZv]: 31 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC5queryMFNbPvZS4core6memory8BlkInfo_]: 47704 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6__ctorMFZCQBzQBzQBxQCiQBn]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6callocMFNbmkxC8TypeInfoZPv]: 80 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6extendMFNbPvmmxC8TypeInfoZm]: 251946 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv]: 12423 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_]: 948995 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC7getAttrMFNbPvZ2goFNbPSQClQClQCjQCu3GcxQBbZk]: 5615 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC7getAttrMFNbPvZk]: 5615 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC8addRangeMFNbNiPvmxC8TypeInfoZv]: 2 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs10freeNoSyncMFNbNiPvZvS_DQDsQDsQDqQEb8freeTimelS_DQErQErQEpQFa8numFreeslTQCdZQEbMFNbNiKQCrZv]: 31 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs11queryNoSyncMFNbPvZS4core6memory8BlkInfo_S_DQEmQEmQEkQEv9otherTimelS_DQFmQFmQFkQFv9numOtherslTQDaZQExMFNbKQDmZQDn]: 44041 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12extendNoSyncMFNbPvmmxC8TypeInfoZmS_DQEfQEfQEdQEo10extendTimelS_DQFhQFhQFfQFq10numExtendslTQCwTmTmTxQDaZQFdMFNbKQDrKmKmKxQDvZm]: 251946 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12mallocNoSyncMFNbmkKmxC8TypeInfoZPvS_DQEgQEgQEeQEp10mallocTimelS_DQFiQFiQFgQFr10numMallocslTmTkTmTxQCzZQFcMFNbKmKkKmKxQDsZQDl]: 961498 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs18fullCollectNoStackMFNbZ2goFNbPSQEaQEaQDyQEj3GcxZmTQvZQDfMFNbKQBgZm]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs7getAttrMFNbPvZ2goFNbPSQDqQDqQDoQDz3GcxQBbZkS_DQEoQEoQEmQEx9otherTimelS_DQFoQFoQFmQFx9numOtherslTQCyTQDlZQFdMFNbKQDoKQEbZk]: 5615 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool10allocPagesMFNbmZm]: 5597 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool13updateOffsetsMFNbmZv]: 10745 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15LargeObjectPool7getInfoMFNbPvZS4core6memory8BlkInfo_]: 3844 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15SmallObjectPool7getInfoMFNbPvZS4core6memory8BlkInfo_]: 40197 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw15SmallObjectPool9allocPageMFNbhZPSQChQChQCfQCq4List]: 15022 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx10smallAllocMFNbhKmkZ8tryAllocMFNbZb]: 955967 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx10smallAllocMFNbhKmkZPv]: 955912 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11ToScanStack4growMFNbZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm]: 85 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11removeRangeMFNbNiPvZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx23updateCollectThresholdsMFNbZv]: 84 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx4markMFNbNlPvQcZv]: 253 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx5sweepMFNbZm]: 84 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7markAllMFNbbZ14__foreachbody3MFNbKSQCm11gcinterface5RangeZi]: 85 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7markAllMFNbbZv]: 85 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7newPoolMFNbmbZPSQBtQBtQBrQCc4Pool]: 6 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx7recoverMFNbZm]: 84 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8addRangeMFNbNiPvQcxC8TypeInfoZv]: 2 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZ15tryAllocNewPoolMFNbZb]: 5 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZ8tryAllocMFNbZb]: 5616 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8bigAllocMFNbmKmkxC8TypeInfoZPv]: 5586 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx8isMarkedMFNbNlPvZi]: 635 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx9allocPageMFNbhZPSQBuQBuQBsQCd4List]: 15024 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw4Pool10initializeMFNbmbZv]: 6 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw4Pool12freePageBitsMFNbmKxG4mZv]: 16439 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC4termMFZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl5protoQo7ProtoGC8addRangeMFNbNiPvmxC8TypeInfoZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc4impl6manualQp8ManualGC10initializeFKCQBp11gcinterface2GCZv]: 1 +@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr6insertMFNbNiPQBxZb]: 6 +@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr8findPoolMFNaNbNiPvZPQCe]: 302268 +@[uprobe:/usr/local/bin/dscanner:_D2gc9pooltable__T9PoolTableTSQBc4impl12conservativeQBy4PoolZQBr8minimizeMFNaNbNjZAPQCd]: 30 +Attaching 231 probes... +``` + +All these functions are in [`src/gc/`][12], and most of the interesting ones here are in [`src/gc/impl/conservative/`][13]. There are 85 calls to `_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm`, which [`ddemangle`][14] translates to `nothrow ulong gc.impl.conservative.gc.Gcx.fullcollect(bool)`. That matches up with the report from `--DRT-gcopt=profile:1`. + +The heart of the `bpftrace` program is `@[probe] = count();`. `@` prefixes a global variable, in this case a variable with an empty name (allowed by `bpftrace`). We’re using the variable as a map (like an associative array in D), and indexing it with `probe`, a built-in variable containing the name of the uprobe that was triggered. The tally is kept using the magic `count()` function. + +### Garbage collection timings + +How about something more interesting, like generating a profile of collection timings? This time, to get more data, I won’t make `bpftrace` exit as soon as the `dscanner` exits. I’ll keep it running and run `dscanner` 100 times before quitting `bpftrace` with `Ctrl+C`: + +``` +# cat gcprofile.bt +uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm +{ + @t = nsecs; +} + +uretprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm / @t / +{ + @gc_times = hist(nsecs - @t); +} +# bpftrace gcprofile.bt +Attaching 2 probes... +^C + +@gc_times: +[64K, 128K) 138 |@ | +[128K, 256K) 1367 |@@@@@@@@@@ | +[256K, 512K) 6687 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| +[512K, 1M) 7 | | +[1M, 2M) 301 |@@ | +``` + +Et voila! A log-scale histogram of the `nsecs` timestamp difference between entering and exiting `fullcollect()`. The times are in nanoseconds, so we see that most collections are taking less than half a millisecond, but we have tail cases that take 1-2ms. + +### Function arguments + +`bpftrace` provides `arg0`, `arg1`, `arg2`, etc. built-in variables for accessing the arguments to a traced function. There are a couple of complications with using them with D code, however. + +The first is that (at the binary level) `dmd` makes `extern(D)` functions (i.e., normal D functions) take arguments in the reverse order of `extern(C)` functions (that `bpftrace` is expecting). Suppose you have a simple three-argument function. If it’s using the C calling convention, `bpftrace` will recognise the first argument as `arg0`. If it’s using the D calling convention, however, it’ll be picked up as `arg2`. + +``` +extern(C) void cfunc(int arg0, int arg1, int arg2) +{ + // ... +} + +// (extern(D) is the default) +extern(D) void dfunc(int arg2, int arg1, int arg0) +{ + // ... +} +``` + +If you look at [the D ABI spec][15], you’ll notice that (just like in C++) there can be a couple of hidden arguments if the function is more complex. If `dfunc` above returned a large struct, there can be an extra hidden argument for implementing [copy elision][16], which means the first argument would actually be `arg3`, and `arg0` would be the hidden argument. If `dfunc` were also a member function, it would have a hidden `this` argument, which would bump up the first argument to `arg4`. + +To get the hang of this, you might need to experiment with tracing function calls with known arguments. + +### Allocation sizes + +Let’s get a histogram of the memory allocation request sizes. Looking at the list of GC functions traced earlier, and comparing it with the GC source code, it looks like we need to trace these functions and grab the `size` argument: + +``` +class ConservativeGC : GC +{ + // ... + void *malloc(size_t size, uint bits, const TypeInfo ti) nothrow; + void *calloc(size_t size, uint bits, const TypeInfo ti) nothrow; + BlkInfo qalloc( size_t size, uint bits, const TypeInfo ti) nothrow; + // ... +} +``` + +As class member functions, they have a hidden `this` argument as well. The last one, `qalloc()`, returns a struct, so it also has a hidden argument for copy elision. So `size` is `arg3` for the first two functions, and `arg4` for `qalloc()`. Time to run a trace: + +``` +# cat allocsizeprofile.bt +uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv, +uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6callocMFNbmkxC8TypeInfoZPv +{ + @ = hist(arg3); +} + +uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_ +{ + @ = hist(arg4); +} + +uretprobe:/usr/local/bin/dscanner:_Dmain +{ + exit(); +} +# bpftrace allocsizeprofile.bt +Attaching 4 probes... +@: +[2, 4) 2489 | | +[4, 8) 9324 |@ | +[8, 16) 46527 |@@@@@ | +[16, 32) 206324 |@@@@@@@@@@@@@@@@@@@@@@@ | +[32, 64) 448020 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@| +[64, 128) 147053 |@@@@@@@@@@@@@@@@@ | +[128, 256) 88072 |@@@@@@@@@@ | +[256, 512) 2519 | | +[512, 1K) 1830 | | +[1K, 2K) 3749 | | +[2K, 4K) 1668 | | +[4K, 8K) 256 | | +[8K, 16K) 2533 | | +[16K, 32K) 312 | | +[32K, 64K) 239 | | +[64K, 128K) 209 | | +[128K, 256K) 164 | | +[256K, 512K) 124 | | +[512K, 1M) 48 | | +[1M, 2M) 30 | | +[2M, 4M) 7 | | +[4M, 8M) 1 | | +[8M, 16M) 2 | | +``` + +So, we have a lot of small allocations, with a very long tail of larger allocations. Remember, size is on a log scale, so that long tail represents a very skewed distribution. + +### Small allocation hotspots + +Now for something more complex. Suppose we’re profiling our code and looking for low-hanging fruit for reducing the number of memory allocations. Code that makes a lot of small allocations tends to be a good candidate for this kind of refactoring. `bpftrace` lets us grab stack traces, which can be used to see what part of the main program caused an allocation. + +As of writing, there’s one little complication because of a limitation of `bpftrace`’s stack trace handling: it can only show meaningful function symbol names (as opposed to raw memory addresses) if `bpftrace` quits while the target program is still running. There’s [an open bug report for improving this behaviour][17], but in the meantime I just made sure `dscanner` took a long time, and that I shut down `bpftrace` first. + +Here’s how to grab the top three stack traces that lead to small (<16B) memory allocations with `qalloc()`: + +``` +# cat smallallocs.bt +uprobe:/usr/local/bin/dscanner:_D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_ +{ + if (arg4 < 16) + { + @[ustack] = count(); + } +} + +END +{ + print(@, 3); + clear(@); +} +# bpftrace smallallocs.bt +Attaching 2 probes... +^C@[ + _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 + _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 + _d_arraysetlengthT+248 + _D8dscanner8analysis25label_var_same_name_check17LabelVarNameCheck9pushScopeMFZv+29 + _D8dscanner8analysis25label_var_same_name_check17LabelVarNameCheck9__mixin175visitMFxC6dparse3ast6ModuleZv+21 + _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+11343 + _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 + _Dmain+3618 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _d_run_main+463 + main+16 + __libc_start_main+235 + 0x41fd89415541f689 +]: 450 +@[ + _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 + _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 + _d_arrayappendcTX+1944 + _D8dscanner8analysis10unmodified16UnmodifiedFinder9pushScopeMFZv+61 + _D8dscanner8analysis10unmodified16UnmodifiedFinder5visitMFxC6dparse3ast6ModuleZv+21 + _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+11343 + _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 + _Dmain+3618 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _d_run_main+463 + main+16 + __libc_start_main+235 + 0x41fd89415541f689 +]: 450 +@[ + _D2gc4impl12conservativeQw14ConservativeGC6qallocMFNbmkxC8TypeInfoZS4core6memory8BlkInfo_+0 + _D2rt8lifetime12__arrayAllocFNaNbmxC8TypeInfoxQlZS4core6memory8BlkInfo_+236 + _d_arrayappendcTX+1944 + _D8dscanner8analysis3run7analyzeFAyaxC6dparse3ast6ModulexSQCeQBy6config20StaticAnalysisConfigKS7dsymbol11modulecache11ModuleCacheAxS3std12experimental5lexer__T14TokenStructureThVQFpa305_0a20202020737472696e6720636f6d6d656e743b0a20202020737472696e6720747261696c696e67436f6d6d656e743b0a0a20202020696e74206f70436d702873697a655f7420692920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202069662028696e646578203c2069292072657475726e202d313b0a202020202020202069662028696e646578203e2069292072657475726e20313b0a202020202020202072657475726e20303b0a202020207d0a0a20202020696e74206f70436d702872656620636f6e737420747970656f66287468697329206f746865722920636f6e73742070757265206e6f7468726f77204073616665207b0a202020202020202072657475726e206f70436d70286f746865722e696e646578293b0a202020207d0aZQYobZCQZv9container6rbtree__T12RedBlackTreeTSQBGiQBGd4base7MessageVQBFza62_20612e6c696e65203c20622e6c696e65207c7c2028612e6c696e65203d3d20622e6c696e6520262620612e636f6c756d6e203c20622e636f6c756d6e2920Vbi1ZQGt+680 + _D8dscanner8analysis3run7analyzeFAAyaxSQBlQBf6config20StaticAnalysisConfigQBoKS6dparse5lexer11StringCacheKS7dsymbol11modulecache11ModuleCachebZb+337 + _Dmain+3618 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+40 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+139 + _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+32 + _d_run_main+463 + main+16 + __libc_start_main+235 + 0x41fd89415541f689 +]: 450 +``` + +It looks like a lot of the small allocations are due to a red-black tree in `ModuleCache`. + +### What’s next? + +I think these examples already show that `bpftrace` is a pretty powerful tool. There’s a lot more that can done, and I highly recommended reading [Brendan Gregg’s eBPF tutorials][18]. + +I used uprobes to trace arbitrary functions in the D runtime. The pro of this is the freedom to do anything, but the cons are that I had to refer to the D runtime source code and manually deal with the D ABI. There’s also no guarantee that a script I write today will work with future versions of the runtime. Linux also supports making well-defined tracepoints in user code using a feature called [USDT][19]. That should let D code export stable tracepoints that can be used without worrying about the D ABI. I might do more experiments in future. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/04/26/bpftrace_d_gc.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://github.com/iovisor/bpftrace +[2]: https://en.wikipedia.org/wiki/Java_virtual_machine +[3]: http://dtrace.org/blogs/about/ +[4]: https://github.com/iovisor/bpftrace/blob/master/INSTALL.md +[5]: https://github.com/iovisor/bpftrace/blob/master/docs/reference_guide.md +[6]: https://github.com/iovisor/bpftrace/blob/master/docs/tutorial_one_liners.md +[7]: https://dlang.org/spec/abi.html#name_mangling +[8]: https://github.com/dlang-community/D-Scanner +[9]: https://github.com/dlang/druntime/ +[10]: https://dlang.org/spec/garbage.html#gc_config +[11]: https://dlang.org/phobos/core_memory.html#.GC.stats +[12]: https://github.com/dlang/druntime/tree/v2.081.1/src/gc +[13]: https://github.com/dlang/druntime/tree/v2.081.1/src/gc/impl/conservative +[14]: https://github.com/dlang/tools +[15]: https://dlang.org/spec/abi.html#parameters +[16]: https://en.wikipedia.org/wiki/Copy_elision +[17]: https://github.com/iovisor/bpftrace/issues/246 +[18]: http://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html +[19]: https://lwn.net/Articles/753601/ diff --git a/sources/talk/20190429 Cisco goes all in on WiFi 6.md b/sources/talk/20190429 Cisco goes all in on WiFi 6.md new file mode 100644 index 0000000000..decd25500a --- /dev/null +++ b/sources/talk/20190429 Cisco goes all in on WiFi 6.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco goes all in on WiFi 6) +[#]: via: (https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco goes all in on WiFi 6 +====== +Cisco rolls out Catalyst and Meraki WiFi 6-based access points, Catalyst 9000 switch +![undefined / Getty Images][1] + +Cisco has taken the wraps off a family of WiFi 6 access points, roaming technology and developer-community support all to make wireless a solid enterprise equal with the wired world. + +“Best-effort’ wireless for enterprise customers doesn’t cut it any more. There’s been a change in customer expectations that there will be an uninterrupted unplugged experience,” said Scott Harrell, senior vice president and general manager of enterprise networking at Cisco. **“ **It is now a wireless-first world.** ”** + +**More about 802.11ax (Wi-Fi 6)** + + * [Why 802.11ax is the next big thing in wireless][2] + * [FAQ: 802.11ax Wi-Fi][3] + * [Wi-Fi 6 (802.11ax) is coming to a router near you][4] + * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][5] + * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][6] + + + +Bringing a wireless-first enterprise world together is one of the drivers behind a new family of WiFi 6-based access points (AP) for Cisco’s Catalyst and Meraki portfolios. WiFi 6 (802.11ax) is designed for high-density public or private environments. But it also will be beneficial in internet of things (IoT) deployments, and in offices that use bandwidth-hogging applications like videoconferencing. + +The Cisco Catalyst 9100 family and Meraki [MR 45/55][7] WiFi-6 access points are built on Cisco silicon and communicate via pre-802.1ax protocols. The silicon in these access points now acts a rich sensor providing IT with insights about what is going on the wireless network in real-time, and that enables faster reactions to problems and security concerns, Harrell said. + +Aside from WiFi 6, the boxes include support for visibility and communications with Zigbee, BLE and Thread protocols. The Catalyst APs support uplink speeds of 2.5 Gbps, in addition to 100 Mbps and 1 Gbps. All speeds are supported on Category 5e cabling for an industry first, as well as 10GBASE-T (IEEE 802.3bz) cabling, Cisco said. + +Wireless traffic aggregates to wired networks so and the wired network must also evolve. Technology like multi-gigabit Ethernet must be driven into the access layer, which in turn drives higher bandwidth needs at the aggregation and core layers, [Harrell said][8]. + +Handling this influx of wireless traffic was part of the reason Cisco also upgraded its iconic Catalyst 6000 with the [Catalyst 9600 this week][9]. The 9600 brings with it support for Cat 6000 features such as support for MPLS, virtual switching and IPv6, while adding or bolstering support for wireless netowrks as well as Intent-based networking (IBN) and security segmentation. The 9600 helps fill out the company’s revamped lineup which includes the 9200 family of access switches, the 9500 aggregation switch and 9800 wireless controller. + +“WiFi doesn’t exist in a vacuum – how it connects to the enterprise and the data center or the Internet is key and in Cisco’s case that key is now the 9600 which has been built to handle the increased traffic,” said Lee Doyle, principal analyst with Doyle Research. + +The new 9600 ties in with the recently [released Catalyst 9800][10], which features 40Gbps to 100Gbps performance, depending on the model, hot-patching to simplify updates and eliminate update-related downtime, Encrypted Traffic Analytics (ETA), policy-based micro- and macro-segmentation and Trustworthy solutions to detect malware on wired or wireless connected devices, Cisco said. + +All Catalyst 9000 family members support other Cisco products such as [DNA Center][11] , which controls automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise wired and wireless networks. + +The new APs are pre-standard, but other vendors including Aruba, NetGear and others are also selling pre-standard 802.11ax devices. Cisco getting into the market solidifies the validity of this strategy, said Brandon Butler, a senior research analyst with IDC. + +Many experts [expect the standard][12] to be ratified late this year. + +“We expect to see volume shipments of WiFi 6 products by early next year and it being the de facto WiFi standard by 2022.” + +On top of the APs and 9600 switch, Cisco extended its software development community – [DevNet][13] – to offer WiFi 6 learning labs, sandboxes and developer resources. + +The Cisco Catalyst and Meraki access platforms are open and programmable all the way down to the chipset level, allowing applications to take advantage of network programmability, Cisco said. + +Cisco also said it had added more vendors to now include Apple, Samsung, Boingo, Presidio and Intel for its ongoing [OpenRoaming][14] project. OpenRoaming, which is in beta promises to let users move seamlessly between wireless networks and LTE without interruption. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/cisco_catalyst_wifi_coffee-cup_coffee-beans_-100794990-large.jpg +[2]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[3]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[4]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[5]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[6]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://meraki.cisco.com/lib/pdf/meraki_datasheet_MR55.pdf +[8]: https://blogs.cisco.com/news/unplugged-and-uninterrupted +[9]: https://www.networkworld.com/article/3391580/venerable-cisco-catalyst-6000-switches-ousted-by-new-catalyst-9600.html +[10]: https://www.networkworld.com/article/3321000/cisco-links-wireless-wired-worlds-with-new-catalyst-9000-switches.html +[11]: https://www.networkworld.com/article/3280988/cisco/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[12]: https://www.networkworld.com/article/3336263/is-jumping-ahead-to-wi-fi-6-the-right-move.html +[13]: https://developer.cisco.com/wireless/?utm_campaign=colaunch-wireless19&utm_source=pressrelease&utm_medium=ciscopress-wireless-main +[14]: https://www.cisco.com/c/en/us/solutions/enterprise-networks/802-11ax-solution/openroaming.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md new file mode 100644 index 0000000000..abc1d7dd0c --- /dev/null +++ b/sources/talk/20190430 Measuring the edge- Finding success with edge deployments.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Measuring the edge: Finding success with edge deployments) +[#]: via: (https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +Measuring the edge: Finding success with edge deployments +====== +To make the most of edge computing investments, it’s important to first understand objectives and expectations. +![iStock][1] + +Edge computing deployments are well underway as companies seek to better process the wealth of data being generated, for example, by Internet of Things (IoT) devices. + +So, what are the results? Plus, how can you ensure success with your own edge projects? + +**Measurements of success** + +The [use cases for edge computing deployments][2] vary widely, as do the business drivers and, ultimately, the benefits. + +Whether they’re seeking improved network or application performance, real-time data analytics, a better customer experience, or other efficiencies, enterprises are accomplishing their goals. Based on two surveys — one by [_Automation World_][3] and another by [Futurum Research][4] — respondents have reported: + + * Decreased network downtime + * Increased productivity + * Increased profitability/reduced costs + * Improved business processes + + + +Basically, success metrics can be bucketed into two categories: direct value propositions and cost reductions. In the former, companies are seeking results that measure revenue generation — such as improved digital experiences with customers and users. In the latter, metrics that prove the value of digitizing processes — like speed, quality, and efficacy — will demonstrate success with edge deployments. + +**Goalposts for success with edge** + +Edge computing deployments are underway. But before diving in, understand what’s driving these projects. + +According to the Futurum Research, 29% of respondents are currently investing in edge infrastructure, and 62% expect to adopt within the year. For these companies, the driving force has been the business, which expects operational efficiencies from these investments. Beyond that, there’s an expectation down the road to better align with IoT strategy. + +That being the case, it’s worth considering your business case before diving into edge. Ask: Are you seeking innovation and revenue generation amid digital transformation efforts? Or is your company looking for a low-risk, “test the waters” type of investment in edge? + +Next up, what type of edge project makes sense for your environment? Edge data centers fall into three categories: local devices for a specific purpose (e.g., an appliance for security systems or a gateway for cloud-to-premises storage); small local data centers (typically one to 10 racks for storage and processing); and regional data centers (10+ racks for large office spaces). + +Then, think about these best practices before talking with vendors: + + * Management: Especially for unmanned edge data centers, remote management is critical. You’ll need predictive alerts and a service contract that enables IT to be just as resilient as a regular data center. + * Security:Much of today’s conversation has been around data security. That starts with physical protection. Too many data breaches — including theft and employee error — are caused by physical access to IT assets. + * Standardization: There is no need to reinvent the wheel when it comes to edge data center deployments. Using standard components makes it easier for the internal IT team to deploy, manage, and maintain. + + + +Finally, consider the ecosystem. The end-to-end nature of edge requires not just technology integration, but also that all third parties work well together. A good ecosystem connects customers, partners, and vendors. + +Get further information to kickstart your edge computing environment at [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391570/measuring-the-edge-finding-success-with-edge-deployments.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-912928582-100795093-large.jpg +[2]: https://www.networkworld.com/article/3391016/edge-computing-is-in-most-industries-future.html +[3]: https://www.automationworld.com/article/technologies/cloud-computing/its-not-edge-vs-cloud-its-both +[4]: https://futurumresearch.com/edge-computing-from-edge-to-enterprise/ +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md new file mode 100644 index 0000000000..0ddef36770 --- /dev/null +++ b/sources/talk/20190501 Vapor IO provides direct, high-speed connections from the edge to AWS.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Vapor IO provides direct, high-speed connections from the edge to AWS) +[#]: via: (https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Vapor IO provides direct, high-speed connections from the edge to AWS +====== +With a direct fiber line, latency between the edge and the cloud can be dramatically reduced. +![Vapor IO][1] + +Edge computing startup Vapor IO now offers a direct connection between its edge containers to Amazon Web Services (AWS) via a high-speed fiber network link. + +The company said that connection between its Kinetic Edge containers and AWS will be provided by Crown Castle's Cloud Connect fiber network, which uses Amazon Direct Connect Services. This would help reduce network latency by essentially drawing a straight fiber line from Vapor IO's edge computing data centers to Amazon's cloud computing data centers. + +“When combined with Crown Castle’s high-speed Cloud Connect fiber, the Kinetic Edge lets AWS developers build applications that span the entire continuum from core to edge. By enabling new classes of applications at the edge, we make it possible for any AWS developer to unlock the next generation of real-time, innovative use cases,” wrote Matt Trifiro, chief marketing officer of Vapor IO, in a [blog post][2]. + +**[ Read also:[What is edge computing and how it’s changing the network][3] ]** + +Vapor IO clams that the connection will lower latency by as much as 75%. “Connecting workloads and data at the Kinetic Edge with workloads and data in centralized AWS data centers makes it possible to build edge applications that leverage the full power of AWS,” wrote Trifiro. + +Developers building applications at the Kinetic Edge will have access to the full suite of AWS cloud computing services, including Amazon Simple Storage Service (Amazon S3), Amazon Elastic Cloud Compute (Amazon EC2), Amazon Virtual Private Cloud (Amazon VPC), and Amazon Relational Database Service (Amazon RDS). + +Crown Castle is the largest provider of shared communications infrastructure in the U.S., with 40,000 cell towers and 60,000 miles of fiber, offering 1Gbps to 10Gbps private fiber connectivity between the Kinetic Edge and AWS. + +AWS Direct Connect is a essentially a private connection between Amazon's AWS customers and their the AWS data centers, so customers don’t have to rout their traffic over the public internet and compete with Netflix and YouTube, for example, for bandwidth. + +### How edge computing works + +The structure of [edge computing][3] is the reverse of the standard internet design. Rather than sending all the data up to central servers, as much processing as possible is done at the edge. This is to reduce the sheer volume of data coming upstream and thus reduce latency. + +With things like smart cars, even if 95% of data is eliminated that remaining, 5% can still be a lot, so moving it fast is essential. Vapor IO said it will shuttle workloads to Amazon’s USEAST and USWEST data centers, depending on location. + +This shows how the edge is up-ending the traditional internet design and moving more computing outside the traditional data center, although a connection upstream is still important because it allows for rapid movement of necessary data from the edge to the cloud, where it can be stored or processed. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][5] + * [How edge computing can help secure the IoT][6] + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391922/vapor-io-provides-direct-high-speed-connections-from-the-edge-to-aws.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/09/vapor-io-kinetic-edge-data-center-100771510-large.jpg +[2]: https://www.vapor.io/powering-amazon-web-services-at-the-kinetic-edge/ +[3]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[6]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md new file mode 100644 index 0000000000..d65fe448b4 --- /dev/null +++ b/sources/talk/20190501 Yet another killer cloud quarter puts pressure on data centers.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Yet another killer cloud quarter puts pressure on data centers) +[#]: via: (https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Yet another killer cloud quarter puts pressure on data centers +====== +Continued strong growth from Amazon Web Services, Microsoft Azure, and Google Cloud Platform signals even more enterprises are moving to the cloud. +![Getty Images][1] + +You’d almost think I’d get tired of [writing this story over and over and over][2]… but the ongoing growth of cloud computing is too big a trend to ignore. + +Critically, the impressive growth numbers of the three leading cloud infrastructure providers—Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform—doesn’t occur in a vacuum. It’s not just about new workloads being run in the cloud; it’s also about more and more enterprises moving existing workloads to the cloud from on-premises data centers. + +**[ Also read:[Is the cloud already killing the enterprise data center?][3] ]** + +To put these trends in perspective, let’s take a look at the results for all three vendors. + +### AWS keeps on trucking + +AWS remains by far the dominant player in the cloud infrastructure market, with a massive [$7.7 billion in quarterly sales][4] (an annual run rate of a whopping $30.8 billion). Even more remarkable, somehow AWS continues to grow revenue by almost 42% year over year. Oh, and that kind of growth is not just unique _this_ quarter; the unit has topped 40% revenue growth _every_ quarter since the beginning of 2017. (To be fair, the first quarter of 2018 saw an amazing 49% revenue growth.) + +And unlike many fast-growing tech companies, that incredible expansion isn’t being fueled by equally impressive losses. AWS earned a healthy $2.2 billion operating profit in the quarter, up 59% from the same period last year. One reason? [The company told analysts][5] it made big data center investments in 2016 and 2017, so it hasn’t had to do so more recently (it expects to boost spending on data centers later this year). The company [reportedly][6] described AWS revenue growth as “lumpy,” but it seems to me that the numbers merely vary between huge and even bigger. + +### Microsoft Azure grows even faster than AWS + +Sure, 41% growth is good, but [Microsoft’s quarterly Azure revenue][7] almost doubled that, jumping 73% year over year (fairly consistent with the previous—also stellar—quarter), helping the company exceed estimates for both sales and revenue and sparking a brief shining moment of a $1 billion valuation for the company. Microsoft doesn’t break out Azure’s sales and revenue, but [the commercial cloud business, which includes Azure as well as other cloud businesses, grew 41% in the quarter to $9.6 billion][8]. + +It’s impossible to tell exactly how big Azure is, but it appears to be growing faster than AWS, though off a much smaller base. While some analysts reportedly say Azure is growing faster than AWS was at a similar stage in its development, that may not bear much significance because the addressable cloud market is now far larger than it used be. + +According to [the New York Times][9], like AWS, Microsoft is also now reaping the benefits of heavy investments in new data centers around the world. And the Times credits Microsoft with “particular success” in [hybrid cloud installations][10], helping ease concerns among some slow-to-change enterprise about full-scale cloud adoption. + +**[ Also read:[Why hybrid cloud will turn out to be a transition strategy][11] ]** + +### Can Google Cloud Platform keep up? + +Even as the [overall quarterly numbers for Alphabet][12]—Google’s parent company—didn’t meet analysts’ revenue expectations (which sent the stock tumbling), Google Cloud Platform seems to have continued its strong growth. Alphabet doesn’t break out its cloud unit, but sales in Alphabet’s “Other Revenue” category—which includes cloud computing along with hardware—jumped 25% compared to the same period last year, hitting $5.4 billion. + +More telling, perhaps, Alphabet Chief Financial Officer Ruth Porat [reportedly][13] told analysts that "Google Cloud Platform remains one of the fastest growing businesses in Alphabet." [Porat also mentioned][14] that hiring in the cloud unit was so aggressive that it drove a 20% jump in Alphabet’s operating expenses! + +### Companies keep going cloud + +But the raw numbers tell only part of the story. All that growth means existing customers are spending more, but also that ever-increasing numbers of enterprises are abandoning their hassle and expense of running their data centers in favor of buying what they need from the cloud. + +**[ Also read:[Large enterprises abandon data centers for the cloud][15] ]** + +The New York Times quotes Amy Hood, Microsoft’s chief financial officer, explaining that, “You don’t really get revenue growth unless you have a usage growth, so this is customers deploying and using Azure.” And the Times notes that Microsoft has signed big deals with companies such as [Walgreens Boots Alliance][16] that combined Azure with other Microsoft cloud-based services. + +This growth is true in existing markets, and also includes new markets. For example, AWS just opened new regions in [Indonesia][17] and [Hong Kong][18]. + +**[ Now read:[After virtualization and cloud, what's left on premises?][19] ]** + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3292935/cloud-computing-just-had-another-kick-ass-quarter.html +[3]: https://www.networkworld.com/article/3268384/is-the-cloud-already-killing-the-enterprise-data-center.html +[4]: https://www.latimes.com/business/la-fi-amazon-earnings-cloud-computing-aws-20190425-story.html +[5]: https://www.businessinsider.com/amazon-q1-2019-earnings-aws-advertising-retail-prime-2019-4 +[6]: https://www.computerweekly.com/news/252462310/Amazon-cautions-against-reading-too-much-into-slowdown-in-AWS-revenue-growth-rate +[7]: https://www.microsoft.com/en-us/Investor/earnings/FY-2019-Q3/press-release-webcast +[8]: https://www.cnbc.com/2019/04/24/microsoft-q3-2019-earnings.html +[9]: https://www.nytimes.com/2019/04/24/technology/microsoft-earnings.html +[10]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[11]: https://www.networkworld.com/article/3238466/why-hybrid-cloud-will-turn-out-to-be-a-transition-strategy.html +[12]: https://abc.xyz/investor/static/pdf/2019Q1_alphabet_earnings_release.pdf?cache=8ac2b86 +[13]: https://www.forbes.com/sites/jilliandonfro/2019/04/29/google-alphabet-q1-earnings-2019/#52f5c8c733be +[14]: https://www.youtube.com/watch?v=31_KHdse_0Y +[15]: https://www.networkworld.com/article/3240587/large-enterprises-abandon-data-centers-for-the-cloud.html +[16]: https://www.walgreensbootsalliance.com +[17]: https://www.businesswire.com/news/home/20190403005931/en/AWS-Open-New-Region-Indonesia +[18]: https://www.apnews.com/Business%20Wire/57eaf4cb603e46e6b05b634d9751699b +[19]: https://https//www.networkworld.com/article/3232626/virtualization/extreme-virtualization-impact-on-enterprises.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md new file mode 100644 index 0000000000..00316946f6 --- /dev/null +++ b/sources/talk/20190502 Revolutionary data compression technique could slash compute costs.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Revolutionary data compression technique could slash compute costs) +[#]: via: (https://www.networkworld.com/article/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Revolutionary data compression technique could slash compute costs +====== +A new form of data compression, called Zippads, will create faster computer programs that could drastically lower the costs of computing. +![Kevin Stanchfield \(CC BY 2.0\)][1] + +There’s a major problem with today’s money-saving memory compression used for storing more data in less space. The issue is that computers store and run memory in predetermined blocks, yet many modern programs function and play out in variable chunks. + +The way it’s currently done is actually, highly inefficient. That’s because the compressed programs, which use objects rather than evenly configured slabs of data, don’t match the space used to store and run them, explain scientists working on a revolutionary new compression system called Zippads. + +The answer, they say—and something that if it works would drastically reduce those inefficiencies, speed things up, and importantly, reduce compute costs—is to compress the varied objects and not the cache lines, as is the case now. Cache lines are fixed-size blocks of memory that are transferred to memory cache. + +**[ Read also:[How to deal with backup when you switch to hyperconverged infrastructure][2] ]** + +“Objects, not cache lines, are the natural unit of compression,” writes Po-An Tsai and Daniel Sanchez in their MIT Computer Science and Artificial Intelligence Laboratory (CSAIL) [paper][3] (pdf). + +They say object-based programs — of the kind used now everyday, such as Python — should be compressed based on their programmed object size, not on some fixed value created by traditional or even state-of-the art cached methods. + +The alternative, too, isn’t to recklessly abandon object-oriented programming just because it’s inefficient at using compression. One must adapt compression to that now common object-using code. + +The scientists claim their new system can increase the compression ratio 1.63 times and improve performance by 17%. It’s the “first compressed memory hierarchy designed for object-based applications,” they say. + +### The benefits of compression + +Compression is a favored technique for making computers more efficient. The main advantage over simply adding more memory is that costs are lowered significantly—you don’t need to add increasing physical main memory hardware because you’re cramming more data into existing. + +However, to date, hardware memory compression has been best suited to more old-school large blocks of data, not the “random, fine-grained memory accesses,” the team explains. It’s not great at accessing small pieces of data, such as words, for example. + +### How the Zippads compression system works + +In Zippads, as the new system is called, stored object hierarchical levels (called “pads”) are located on-chip and are directly accessed. The different levels (pads) have changing speed grades, with newly referenced objects being placed in the fastest pad. As a pad fills up, it begins the process of evicting older, not-so-active objects and ultimately recycles the unused code that is taking up desirable fast space and isn’t being used. Cleverly, at the fast level, the code parts aren’t even compressed, but as they prove their non-usefulness they get kicked down to compressed, slow-to-access, lower-importance pads—and are brought back up as necessary. + +Zippads would “see computers that can run much faster or can run many more apps at the same speeds,” an[ MIT News][4] article says. “Each application consumes less memory, it runs faster, so a device can support more applications within its allotted memory.” Bandwidth is freed up, in other words. + +“All computer systems would benefit from this,” Sanchez, a professor of computer science and electrical engineering, says in the article. “Programs become faster because they stop being bottlenecked by memory bandwidth.” + +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/3392716/revolutionary-data-compression-technique-could-slash-compute-costs.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/memory-100787327-large.jpg +[2]: https://www.networkworld.com/article/3389396/how-to-deal-with-backup-when-you-switch-to-hyperconverged-infrastructure.html +[3]: http://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf +[4]: http://news.mit.edu/2019/hardware-data-compression-0416 +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md new file mode 100644 index 0000000000..c676e5effb --- /dev/null +++ b/sources/talk/20190506 Cisco boosts SD-WAN with multicloud-to-branch access system.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco boosts SD-WAN with multicloud-to-branch access system) +[#]: via: (https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco boosts SD-WAN with multicloud-to-branch access system +====== +Cisco's SD-WAN Cloud onRamp for CoLocation can tie branch offices to private data centers in regional corporate headquarters via colocation facilities for shorter, faster, possibly more secure connections. +![istock][1] + +Cisco is looking to give traditional or legacy wide-area network users another reason to move to the [software-defined WAN world][2]. + +The company has rolled out an integrated hardware/software package called SD-WAN Cloud onRamp for CoLocation that lets customers tie distributed multicloud applications back to a local branch office or local private data center. The idea is that a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly all the way to the data center. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +“With Cisco SD-WAN Cloud onRamp for CoLocation operating regionally, connections from colocation facilities to branches are set up and configured according to traffic loads (such as video vs web browsing vs email) SLAs (requirements for low latency/jitter), and Quality of Experience for optimizing cloud application performance,” wrote Anand Oswal, senior vice president of engineering, in Cisco’s Enterprise Networking Business in a [blog about the new service][7]. + +According to Oswal, each branch or private data center is equipped with a network interface that provides a secure tunnel to the regional colocation facility. In turn, the Cloud onRamp for CoLocation establishes secure tunnels to SaaS application platforms, multi-cloud platform services, and enterprise data centers, he stated. + +Traffic is securely routed through the Cloud onRamp for CoLocation stack which includes security features such as application-aware firewalls, URL-filtering, intrusion detection/prevention, DNS-layer security, and Advanced Malware Protection (AMP) Threat Grid, as well as other network services such as load-balancing and Wide Area Application Services, Oswal wrote. + +A typical use case for the package is an enterprise that has dozens of distributed branch offices, clustered around major cities, spread over several countries. The goal is to tie each branch to enterprise data center databases, SaaS applications, and multi-cloud services while meeting service level agreements and application quality of experience, Oswal stated. + +“With virtualized Cisco SD-WAN running on regional colocation centers, the branch workforce has access to applications and data residing in AWS, Azure, and Google cloud platforms as well as SaaS providers such as Microsoft 365 and Salesforce—transparently and securely,” Oswal said. “Distributing SD-WAN features over a regional architecture also brings processing power closer to where data is being generated—at the cloud edge.” + +The idea is that paths to designated SaaS applications will be monitored continuously for performance, and the application traffic will be dynamically routed to the best-performing path, without requiring human intervention, Oswal stated. + +For a typical configuration, a region covering a target city uses a colocation IaaS provider that hosts the Cisco Cloud onRamp for CoLocation, which includes: + + * Cisco vManage software that lets customers manage applications and provision, monitor and troubleshooting the WAN. + * [Cisco Cloud Services Platform (CSP) 5000][8] The systems are x86 Linux Kernel-based Virtual Machine (KVM) software and hardware platforms for the data center, regional hub, and colocation Network Functions Virtualization (NFV). The platforms let enterprise IT teams or service providers deploy any Cisco or third-party network virtual service with Cisco’s [Network Services Orchestrator (NSO)][9] or any other northbound management and orchestration system. + * The Cisco [Catalyst 9500 Series][10] aggregation switches. Based on an x86 CPU, the Catalyst 9500 Series is Cisco’s lead purpose-built fixed core and aggregation enterprise switching platform, built for security, IoT, and cloud. The switches come with a 4-core x86, 2.4-GHz CPU, 16-GB DDR4 memory, and 16-GB internal storage. + + + +If the features of the package sound familiar, that’s because the [Cloud onRamp for CoLocation][11] package is the second generation of a similar SD-WAN package offered by Viptela which Cisco [bought in 2017][12]. + +SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +It's a profoundly hot market with tons of players including [Cisco][13], VMware, Silver Peak, Riverbed, Aryaka, Fortinet, Nokia and Versa. IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40% yearly clip between now and then. + +[SD-WAN][14] lets networks route traffic based on centrally managed roles and rules, no matter what the entry and exit points of the traffic are, and with full security. For example, if a user in a branch office is working in Office365, SD-WAN can route their traffic directly to the closest cloud data center for that app, improving network responsiveness for the user and lowering bandwidth costs for the business. + +"SD-WAN has been a promised technology for years, but in 2019 it will be a major driver in how networks are built and re-built," Oswal said a Network World [article][15] earlier this year. + +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/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/02/istock-578801262-100750453-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://blogs.cisco.com/enterprise/cisco-sd-wan-cloud-onramp-for-colocation-multicloud +[8]: https://www.cisco.com/c/en/us/products/collateral/switches/cloud-services-platform-5000/nb-06-csp-5k-data-sheet-cte-en.html#ProductOverview +[9]: https://www.cisco.com/go/nso +[10]: https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-9500-series-switches/data_sheet-c78-738978.html +[11]: https://www.networkworld.com/article/3207751/viptela-cloud-onramp-optimizes-cloud-access.html +[12]: https://www.networkworld.com/article/3193784/cisco-grabs-up-sd-wan-player-viptela-for-610m.html?nsdr=true +[13]: https://www.networkworld.com/article/3322937/what-will-be-hot-for-cisco-in-2019.html +[14]: https://www.networkworld.com/article/3031279/sd-wan/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[15]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190507 SD-WAN is Critical for IoT.md b/sources/talk/20190507 SD-WAN is Critical for IoT.md new file mode 100644 index 0000000000..a5867d5afd --- /dev/null +++ b/sources/talk/20190507 SD-WAN is Critical for IoT.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SD-WAN is Critical for IoT) +[#]: via: (https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +SD-WAN is Critical for IoT +====== + +![istock][1] + +The Internet of Things (IoT) is everywhere and its use is growing fast. IoT is used by local governments to build smart cities. It’s used to build smart businesses. And, consumers are benefitting as it’s built into smart homes and smart cars. Industry analyst first estimates that over 20 billion IoT devices will be connected by 2020. That’s a 2.5x increase from the more than 8 billion connected devices in 2017*. + +Manufacturing companies have the highest IoT spend to date of industries while the health care market is experiencing the highest IoT growth. By 2020, 50 percent of IoT spending will be driven by manufacturing, transportation and logistics, and utilities. + +IoT growth is being fueled by the promise of analytical data insights that will ultimately yield greater efficiencies and enhanced customer satisfaction. The top use cases driving IoT growth are self-optimizing production, predictive maintenance and automated inventory management. + +From a high-level view, the IoT architecture includes sensors that collect and transmit data (i.e. temperature, speed, humidity, video feed, pressure, IR, proximity, etc.) from “things” like cars, trucks, machines, etc. that are connected over the internet. Data collected is then analyzed, translating raw data into actionable information. Businesses can then act on this information. And at more advanced levels, machine learning and AI algorithms learn and adapt to this information and automatically respond at a system level. + +IDC estimates that by 2025, over 75 billion IoT devices* will be connected. By that time, nearly a quarter of the world’s projected 163 zettabytes* (163 trillion gigabytes) of data will have been created in real-time, and the vast majority of that data will have been created by IoT devices. This massive amount of data will drive an exponential increase in traffic on the network infrastructure requiring massive scalability. Also, this increasing amount of data will require tremendous processing power to mine it and transform it into actionable intelligence. In parallel, security risks will continue to increase as there will be many more potential entry points onto the network. Lastly, management of the overall infrastructure will require better orchestration of policies as well as the means to streamline on-going operations. + +### **How does SD-WAN enable IoT business initiatives?** + +There are three key elements that an [SD-WAN][2] platform must include: + + 1. **Visibility** : Real-time visibility into the network is key. It takes the guesswork out of rapid problem resolution, enabling organizations to run more efficiently by accelerating troubleshooting and applying preventive measures. Furthermore, a CIO is able to pull metrics and see bandwidth consumed by any IoT application. + 2. **Security** : IoT traffic must be isolated from other application traffic. IT must prevent – or at least reduce – the possible attack surface that may be exposed to IoT device traffic. Also, the network must continue delivering other application traffic in the event of a melt down on a WAN link caused by a DDoS attack. + 3. **Agility** : With the increased number of connected devices, applications and users, a comprehensive, intelligent and centralized orchestration approach that continuously adapts to deliver the best experience to the business and users is critical to success. + + + +### Key Silver Peak EdgeConnect SD-WAN capabilities for IoT + +1\. Silver Peak has an [embedded real-time visibility engine][3] allowing IT to gain complete observability into the performance attributes of the network and applications in real-time. The [EdgeConnect][4] SD-WAN appliances deployed in branch offices send information to the centralized [Unity Orchestrator™][5]. Orchestrator collects the data and presents it in a comprehensive management dashboard via customizable widgets. These widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, latency and jitter and much more. Furthermore, the platform maintains weeks’ worth of data with context allowing IT to playback and see what has transpired at a specific time and location, similar to a DVR. + +![Click to read Solution Brief][6] + +2\. The second set of key capabilities center around security and end-to-end zone-based segmentation. An IoT traffic zone may be created on the LAN or branch side. IoT traffic is then mapped all the way across the WAN to the data center or cloud where the data will be processed. Zone-based segmentation is accomplished in a simplified and automated way within the Orchestrator GUI. In cases where further traffic inspection is required, IT can simply service chain to another security service. There are several key benefits realized by this approach. IT can easily and quickly apply segmentation policies; segmentation mitigates the attack surface; and IT can save on additional security investments. + +![***Click to read Solution Brief ***][7] + +3\. EdgeConnect employs machine learning at the global level where with internet sensors and third-party sensors feed into the cloud portal software. The software tracks the geolocation of all IP addresses and IP reputation, distributing signals down to the Unity Orchestrator running in each individual customer’s enterprise. In turn, it is speaking to the edge devices sitting in the branch offices. There, distributed learning is done by looking at the first packet, making an inference based on the first packet what the application is. So, if seeing that 100 times now, every time packets come from that particular IP address and turns out to be an IoT, we can make an inference that IP belongs to IoT application. In parallel, we’re using a mix of traditional techniques to validate the identification of the application. All this combined other multi-level intelligence enables simple and automated policy orchestration across a large number of devices and applications. + +![***Click to read Solution Brief ***][8] + +SD-WAN plays a foundational role as businesses continue to embrace IoT, but choosing the right SD-WAN platform is even more critical to ensuring businesses are ultimately able to fully optimize their operations. + +* Source: [IDC][9] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3393445/sd-wan-is-critical-for-iot.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-1019172426-100795551-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility +[4]: https://www.silver-peak.com/products/unity-edge-connect +[5]: https://www.silver-peak.com/products/unity-orchestrator +[6]: https://images.idgesg.net/images/article/2019/05/1_simplify-100795554-large.jpg +[7]: https://images.idgesg.net/images/article/2019/05/2_centralize-100795555-large.jpg +[8]: https://images.idgesg.net/images/article/2019/05/3_increase-100795558-large.jpg +[9]: https://www.information-age.com/data-forecast-grow-10-fold-2025-123465538/ diff --git a/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md new file mode 100644 index 0000000000..8169c594ef --- /dev/null +++ b/sources/talk/20190507 Server shipments to pick up in the second half of 2019.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Server shipments to pick up in the second half of 2019) +[#]: via: (https://www.networkworld.com/article/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Server shipments to pick up in the second half of 2019 +====== +Server sales slowed in anticipation of the new Intel Xeon processors, but they are expected to start up again before the end of the year. +![Thinkstock][1] + +Global server shipments are not expected to return to growth momentum until the third quarter or even the fourth quarter of 2019, according to Taiwan-based tech news site DigiTimes, which cited unnamed server supply chain sources. The one bright spot remains cloud providers like Amazon, Google, and Facebook, which continue their buying binge. + +Normally I’d be reluctant to cite such a questionable source, but given most of the OEMs and ODMs are based in Taiwan and DigiTimes (the article is behind a paywall so I cannot link) has shown it has connections to them, I’m inclined to believe them. + +Quanta Computer chairman Barry Lam told the publication that Quanta's shipments of cloud servers have risen steadily, compared to sharp declines in shipments of enterprise servers. Lam continued that enterprise servers command only 1-2% of the firm's total server shipments. + +**[ Also read:[Gartner: IT spending to drop due to falling equipment prices][2] ]** + +[Server shipments began to slow down in the first quarter][3] thanks in part to the impending arrival of second-generation Xeon Scalable processors from Intel. And since it takes a while to get parts and qualify them, this quarter won’t be much better. + +In its latest quarterly earnings, Intel's data center group (DCG) said sales declined 6% year over year, the first decline of its kind since the first quarter of 2012 and reversing an average growth of over 20% in the past. + +[The Osbourne Effect][4] wasn’t the sole reason. An economic slowdown in China and the trade war, which will add significant tariffs to Chinese-made products, are also hampering sales. + +DigiTimes says Inventec, Intel's largest server motherboard supplier, expects shipments of enterprise server motherboards to further lose steams for the rest of the year, while sales of data center servers are expected to grow 10-15% on year in 2019. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +It went on to say server shipments may concentrate in the second half or even the fourth quarter of the year, while cloud-based data center servers for the cloud giants will remain positive as demand for edge computing, new artificial intelligence (AI) applications, and the proliferation of 5G applications begin in 2020. + +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/3393167/server-shipments-to-pick-up-in-the-second-half-of-2019.html#tk.rss_all + +作者:[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://images.techhive.com/images/article/2017/04/2_data_center_servers-100718306-large.jpg +[2]: https://www.networkworld.com/article/3391062/it-spending-to-drop-due-to-falling-equipment-prices-gartner-predicts.html +[3]: https://www.networkworld.com/article/3332144/server-sales-projected-to-slow-while-memory-prices-drop.html +[4]: https://en.wikipedia.org/wiki/Osborne_effect +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190507 Some IT pros say they have too much data.md b/sources/talk/20190507 Some IT pros say they have too much data.md new file mode 100644 index 0000000000..a645ae52e9 --- /dev/null +++ b/sources/talk/20190507 Some IT pros say they have too much data.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Some IT pros say they have too much data) +[#]: via: (https://www.networkworld.com/article/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Some IT pros say they have too much data +====== +IT professionals have too many data sources to count, and they spend a huge amount of time wrestling that data into usable condition, a survey from Ivanti finds. +![Getty Images][1] + +A new survey has found that a growing number of IT professionals have too many data sources to even count, and they are spending more and more time just wrestling that data into usable condition. + +Ivanti, an IT asset management firm, [surveyed 400 IT professionals on their data situation][2] and found IT faces numerous challenges when it comes to siloes, data, and implementation. The key takeaway is data overload is starting to overwhelm IT managers and data lakes are turning into data oceans. + +**[ Read also:[Understanding mass data fragmentation][3] | Get daily insights [Sign up for Network World newsletters][4] ]** + +Among the findings from Ivanti's survey: + + * Fifteen percent of IT professionals say they have too many data sources to count, and 37% of professionals said they have about 11-25 different sources for data. + * More than half of IT professionals (51%) report they have to work with their data for days, weeks or more before it's actionable. + * Only 10% of respondents said the data they receive is actionable within minutes. + * One in three respondents said they have the resources to act on their data, but more than half (52%) said they only sometimes have the resources. + + + +“It’s clear from the results of this survey that IT professionals are in need of a more unified approach when working across organizational departments and resulting silos,” said Duane Newman, vice president of product management at Ivanti, in a statement. + +### The problem with siloed data + +The survey found siloed data represents a number of problems and challenges. Three key priorities suffer the most: automation (46%), user productivity and troubleshooting (42%), and customer experience (41%). The survey also found onboarding/offboarding suffers the least (20%) due to siloes, so apparently HR and IT are getting things right. + +In terms of what they want from real-time insight, about 70% of IT professionals said their security status was the top priority over other issues. Respondents were least interested in real-time insights around warranty data. + +### Data lake method a recipe for disaster + +I’ve been immersed in this subject for other publications for some time now. Too many companies are hoovering up data for the sake of collecting it with little clue as to what they will do with it later. One thing you have to say about data warehouses, the schema on write at least forces you to think about what you are collecting and how you might use it because you have to store it away in a usable form. + +The new data lake method is schema on read, meaning you filter/clean it when you read it into an application, and that’s just a recipe for disaster. If you are looking at data collected a month or a year ago, do you even know what it all is? Now you have to apply schema to data and may not even remember collecting it. + +Too many people think more data is good when it isn’t. You just drown in it. When you reach a point of having too many data sources to count, you’ve gone too far and are not going to get insight. You’re going to get overwhelmed. Collect data you know you can use. Otherwise you are wasting petabytes of disk space. + +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/3393205/some-it-pros-say-they-have-too-much-data.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/03/database_data-center_futuristic-technology-100752012-large.jpg +[2]: https://www.ivanti.com/blog/survey-it-professionals-data-sources +[3]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[4]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md new file mode 100644 index 0000000000..a5ec6212d8 --- /dev/null +++ b/sources/talk/20190509 Cisco adds AMP to SD-WAN for ISR-ASR routers.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco adds AMP to SD-WAN for ISR/ASR routers) +[#]: via: (https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco adds AMP to SD-WAN for ISR/ASR routers +====== +Cisco SD-WAN now sports Advanced Malware Protection on its popular edge routers, adding to their routing, segmentation, security, policy and orchestration capabilities. +![vuk8691 / Getty Images][1] + +Cisco has added support for Advanced Malware Protection (AMP) to its million-plus ISR/ASR edge routers, in an effort to [reinforce branch and core network malware protection][2] at across the SD-WAN. + +Cisco last year added its Viptela SD-WAN technology to the IOS XE version 16.9.1 software that runs its core ISR/ASR routers such as the ISR models 1000, 4000 and ASR 5000, in use by organizations worldwide. Cisco bought Viptela in 2017. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +The release of Cisco IOS XE offered an instant upgrade path for creating cloud-controlled SD-WAN fabrics to connect distributed offices, people, devices and applications operating on the installed base, Cisco said. At the time Cisco said that Cisco SD-WAN on edge routers builds a secure virtual IP fabric by combining routing, segmentation, security, policy and orchestration. + +With the recent release of [IOS-XE SD-WAN 16.11][7], Cisco has brought AMP and other enhancements to its SD-WAN. + +“Together with Cisco Talos [Cisco’s security-intelligence arm], AMP imbues your SD-WAN branch, core and campuses locations with threat intelligence from millions of worldwide users, honeypots, sandboxes, and extensive industry partnerships,” wrote Cisco’s Patrick Vitalone a product marketing manager in a [blog][8] about the security portion of the new software. “In total, AMP identifies more than 1.1 million unique malware samples a day." When AMP in Cisco SD-WAN spots malicious behavior it automatically blocks it, he wrote. + +The idea is to use integrated preventative engines, exploit prevention and intelligent signature-based antivirus to stop malicious attachments and fileless malware before they execute, Vitalone wrote. + +AMP support is added to a menu of security features already included in the SD-WAN software including support for URL filtering, [Cisco Umbrella][9] DNS security, Snort Intrusion Prevention, the ability to segment users across the WAN and embedded platform security, including the [Cisco Trust Anchor][10] module. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][11] ]** + +The software also supports [SD-WAN Cloud onRamp for CoLocation][12], which lets customers tie distributed multicloud applications back to a local branch office or local private data center. That way a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly to the data center. + +“The idea that this kind of security technology is now integrated into Cisco’s SD-WAN offering is a critical for Cisco and customers looking to evaluate SD-WAN offerings,” said Lee Doyle, principal analyst at Doyle Research. + +IOS-XE SD-WAN 16.11 is available now. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/09/shimizu_island_el_nido_palawan_philippines_by_vuk8691_gettyimages-155385042_1200x800-100773533-large.jpg +[2]: https://www.networkworld.com/article/3285728/what-are-the-options-for-securing-sd-wan.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://www.cisco.com/c/en/us/td/docs/routers/sdwan/release/notes/xe-16-11/sd-wan-rel-notes-19-1.html +[8]: https://blogs.cisco.com/enterprise/enabling-amp-in-cisco-sd-wan +[9]: https://www.networkworld.com/article/3167837/cisco-umbrella-cloud-service-shapes-security-for-cloud-mobile-resources.html +[10]: https://www.cisco.com/c/dam/en_us/about/doing_business/trust-center/docs/trustworthy-technologies-datasheet.pdf +[11]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[12]: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md new file mode 100644 index 0000000000..8f9db8a94b --- /dev/null +++ b/sources/talk/20190509 When it comes to uptime, not all cloud providers are created equal.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When it comes to uptime, not all cloud providers are created equal) +[#]: via: (https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +When it comes to uptime, not all cloud providers are created equal +====== +Cloud uptime is critical today, but vendor-provided data can be confusing. Here's an analysis of how AWS, Google Cloud and Microsoft Azure compare. +![Getty Images][1] + +The cloud is not just important; it's mission-critical for many companies. More and more IT and business leaders I talk to look at public cloud as a core component of their digital transformation strategies — using it as part of their hybrid cloud or public cloud implementation. + +That raises the bar on cloud reliability, as a cloud outage means important services are not available to the business. If this is a business-critical service, the company may not be able to operate while that key service is offline. + +Because of the growing importance of the cloud, it’s critical that buyers have visibility into the reliability number for the cloud providers. The challenge is the cloud providers don't disclose the disruptions in a consistent manner. In fact, some are confusing to the point where it’s difficult to glean any kind of meaningful conclusion. + +**[ RELATED:[What IT pros need to know about Azure Stack][2] and [Which cloud performs better, AWS, Azure or Google?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +### Reported cloud outage times don't always reflect actual downtime + +Microsoft Azure and Google Cloud Platform (GCP) both typically provide information on date and time, but only high-level data on the services affected and sparse information on regional impact. The problem with that is it’s difficult to get a sense of overall reliability. For instance, if Azure reports a one-hour outage that impacts five services in three regions, the website might show just a single hour. In actuality, that’s 15 hours of total downtime. + +Between Azure, GCP and Amazon Web Services (AWS), [Azure is the most obscure][5], as it provides the least amount of detail. [GCP does a better job of providing detail][6] at the service level but tends to be obscure with regional information. Sometimes it’s very clear as to what services are unavailable, and other times it’s not. + +[AWS has the most granular reporting][7], as it shows every service in every region. If an incident occurs that impacts three services, all three of those services would light up red. If those were unavailable for one hour, AWS would record three hours of downtime. + +Another inconsistency between the cloud providers is the amount of historical downtime data that is available. At one time, all three of the cloud vendors provided a one-year view into outages. GCP and AWS still do this, but Azure moved to only a [90-day view][5] sometime over the past year. + +### Azure has significantly higher downtime than GCP and AWS + +The next obvious question is who has the most downtime? To answer that, I worked with a third-party firm that has continually collected downtime information directly from the vendor websites. I have personally reviewed the information and can validate its accuracy. Based on the vendors own reported numbers, from the beginning of 2018 through May 3, 2019, AWS leads the pack with only 338 hours of downtime, followed by GCP closely at 361. Microsoft Azure has a whopping total of 1,934 hours of self-reported downtime. + +![][8] + +A few points on these numbers. First, this is an aggregation of the self-reported data from the vendors' websites, which isn’t the “true” number, as regional information or service granularity is sometimes obscured. If a service is unavailable for an hour and it’s reported for an hour on the website but it spanned five regions, correctly five hours should have been used. But for this calculation, we used only one hour because that is what was self-reported. + +Because of this, the numbers are most favorable to Microsoft because they provide the least amount of regional information. The numbers are least favorable to AWS because they provide the most granularity. Also, I believe AWS has the most services in most regions, so they have more opportunities for an outage. + +We had considered normalizing the data, but that would require a significant amount of work to destruct the downtime on a per service per region basis. I may choose to do that in the future, but for now, the vendor-reported view is a good indicator of relative performance. + +Another important point is that only infrastructure as a service (IaaS) services were used to calculate downtime. If Google Street View or Bing Maps went down, most businesses would not care, so it would have been unfair to roll those number in. + +### SLAs do not correlate to reliability + +Given the importance of cloud services today, I would like to see every cloud provider post a 12-month running total of downtime somewhere on their website so customers can do an “apples to apples” comparison. This obviously isn’t the only factor used in determining which cloud provider to use, but it is one of the more critical ones. + +Also, buyers should be aware that there is a big difference between service-level agreements (SLAs) and downtime. A cloud operator can promise anything they want, even provide a 100% SLA, but that just means they need to reimburse the business when a service isn’t available. Most IT leaders I have talked to say the few bucks they get back when a service is out is a mere fraction of what the outage actually cost them. + +### Measure twice and cut once to minimize business disruption + +If you’re reading this and you’re researching cloud services, it’s important to not just make the easy decision of buying for convenience. Many companies look at Azure because Microsoft gives away Azure credits as part of the Enterprise Agreement (EA). I’ve interviewed several companies that took the path of least resistance, but they wound up disappointed with availability and then switched to AWS or GCP later, which can have a disruptive effect. + +I’m certainly not saying to not buy Microsoft Azure, but it is important to do your homework to understand the historical performance of the services you’re considering in the regions you need them. The information on the vendor websites may not tell the full picture, so it’s important to do the necessary due diligence to ensure you understand what you’re buying before you buy it. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394341/when-it-comes-to-uptime-not-all-cloud-providers-are-created-equal.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/02/cloud_comput_connect_blue-100787048-large.jpg +[2]: https://www.networkworld.com/article/3208029/azure-stack-microsoft-s-private-cloud-platform-and-what-it-pros-need-to-know-about-it +[3]: https://www.networkworld.com/article/3319776/the-network-matters-for-public-cloud-performance.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://azure.microsoft.com/en-us/status/history/ +[6]: https://status.cloud.google.com/incident/appengine/19008 +[7]: https://status.aws.amazon.com/ +[8]: https://images.idgesg.net/images/article/2019/05/public-cloud-downtime-100795948-large.jpg +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190510 Supermicro moves production from China.md b/sources/talk/20190510 Supermicro moves production from China.md new file mode 100644 index 0000000000..21739fa416 --- /dev/null +++ b/sources/talk/20190510 Supermicro moves production from China.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Supermicro moves production from China) +[#]: via: (https://www.networkworld.com/article/3394404/supermicro-moves-production-from-china.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Supermicro moves production from China +====== +Supermicro was cleared of any activity related to the Chinese government and secret chips in its motherboards, but it is taking no chances and is moving its facilities. +![Frank Schwichtenberg \(CC BY 4.0\)][1] + +Server maker Supermicro, based in Fremont, California, is reportedly moving production out of China over customer concerns that the Chinese government had secretly inserted chips for spying into its motherboards. + +The claims were made by Bloomberg late last year in a story that cited more than 100 sources in government and private industry, including Apple and Amazon Web Services (AWS). However, Apple CEO Tim Cook and AWS CEO Andy Jassy denied the claims and called for Bloomberg to retract the article. And a few months later, the third-party investigations firm Nardello & Co examined the claims and [cleared Supermicro][2] of any surreptitious activity. + +At first it seemed like Supermicro was weathering the storm, but the story did have a negative impact. Server sales have fallen since the Bloomberg story, and the company is forecasting a near 10% decline in total revenues for the March quarter compared to the previous three months. + +**[ Also read:[Who's developing quantum computers][3] ]** + +And now, Nikkei Asian Review reports that despite the strong rebuttals, some customers remain cautious about the company's products. To address those concerns, Nikkei says Supermicro has told suppliers to [move production out of China][4], citing industry sources familiar with the matter. + +It also has the side benefit of mitigating against the U.S.-China trade war, which is only getting worse. Since the tariffs are on the dollar amount of the product, that can quickly add up even for a low-end system, as Serve The Home noted in [this analysis][5]. + +Supermicro is the world's third-largest server maker by shipments, selling primarily to cloud providers like Amazon and Facebook. It does its own assembly in its Fremont facility but outsources motherboard production to numerous suppliers, mostly China and Taiwan. + +"We have to be more self-reliant [to build in-house manufacturing] without depending only on those outsourcing partners whose production previously has mostly been in China," an executive told Nikkei. + +Nikkei notes that roughly 90% of the motherboards shipped worldwide in 2017 were made in China, but that percentage dropped to less than 50% in 2018, according to Digitimes Research, a tech supply chain specialist based in Taiwan. + +Supermicro just held a groundbreaking ceremony in Taiwan for a 800,000 square foot manufacturing plant in Taiwan and is expanding its San Jose, California, plant as well. So, they must be anxious to be free of China if they are willing to expand in one of the most expensive real estate markets in the world. + +A Supermicro spokesperson said via email, “We have been expanding our manufacturing capacity for many years to meet increasing customer demand. We are currently constructing a new Green Computing Park building in Silicon Valley, where we are the only Tier 1 solutions vendor manufacturing in Silicon Valley, and we proudly broke ground this week on a new manufacturing facility in Taiwan. To support our continued global growth, we look forward to expanding in Europe as well.” + +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/3394404/supermicro-moves-production-from-china.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/05/supermicro_-_x11sae__cebit_2016_01-100796121-large.jpg +[2]: https://www.networkworld.com/article/3326828/investigator-finds-no-evidence-of-spy-chips-on-super-micro-motherboards.html +[3]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[4]: https://asia.nikkei.com/Economy/Trade-war/Server-maker-Super-Micro-to-ditch-made-in-China-parts-on-spy-fears +[5]: https://www.servethehome.com/how-tariffs-hurt-intel-xeon-d-atom-and-amd-epyc-3000/ +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190513 HPE-s CEO lays out his technology vision.md b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md new file mode 100644 index 0000000000..c9a8de9c8a --- /dev/null +++ b/sources/talk/20190513 HPE-s CEO lays out his technology vision.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE’s CEO lays out his technology vision) +[#]: via: (https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html) +[#]: author: (Eric Knorr ) + +HPE’s CEO lays out his technology vision +====== +In an exclusive interview, HPE CEO Antonio Neri unpacks his portfolio of technology initiatives, from edge computing to tomorrow’s memory-driven architecture. +![HPE][1] + +Like Microsoft's Satya Nadella, HPE CEO Antonio Neri is a technologist with a long history of leading initiatives in his company. Meg Whitman, his former boss at HPE, showed her appreciation of Neri’s acumen by promoting him to HPE Executive Vice President in 2015 – and gave him the green light to acquire [Aruba][2], [SimpliVity][3], [Nimble Storage][4], and [Plexxi][5], all of which added key items to HPE’s portfolio. + +Neri succeeded Whitman as CEO just 16 months ago. In a recent interview with Network World, Neri’s engineering background was on full display as he explained HPE’s technology roadmap. First and foremost, he sees a huge opportunity in [edge computing][6], into which HPE is investing $4 billion over four years to further develop edge “connectivity, security, and obviously cloud and analytics.” + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][7] + * [Edge computing best practices][8] + * [How edge computing can help secure the IoT][9] + + + +Although his company abandoned its public cloud efforts in 2015, Neri is also bullish on the self-service “cloud experience,” which he asserts HPE is already implementing on-prem today in a software-defined, consumption-driven model. More fundamentally, he believes we are on the brink of a memory-driven computing revolution, where storage and memory become one and, depending on the use case, various compute engines are brought to bear on zettabytes of data. + +This interview, conducted by Network World Editor-in-Chief Eric Knorr and edited for length and clarity, digs into Neri’s technology vision. [A companion interview on CIO][10] centers on Neri’s views of innovation, management, and company culture. + +**Eric Knorr: ** Your biggest and highest profile investment so far has been in edge computing. My understanding of edge computing is that we’re really talking about mini-data centers, defined by IDC as less than 100 square feet in size. What’s the need for a $4 billion investment in that? + +**Antonio Neri:** It’s twofold. We focus first on connectivity. Think about Aruba as a platform company, a cloud-enabled company. Now we offer branch solutions and edge data center solutions that include [wireless][11], LAN, [WAN][12] connectivity and soon [5G][13]. We give you a control plane so that that connectivity experience can be seen consistently the same way. All the policy management, the provisioning and the security aspects of it. + +**Knorr:** Is 5G a big focus? + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][14] ]** + +**Neri:** It’s a big focus for us. What customers are telling us is that it’s hard to get 5G inside the building. How you do hand off between 5G and Wi-Fi and give them the same experience? Because the problem is that we have LAN, wireless, and WAN already fully integrated into the control plane, but 5G sits over here. If you are an enterprise, you have to manage these two pipes independently. + +With the new spectrum, though, they are kind of comingling anyway. [Customers ask] why don’t you give me [a unified] experience on top of that, with all this policy management and cloud-enablement, so I can provision the right connectivity for the right use case? A sensor can use a lower radio access or [Bluetooth][15] or other type of connectivity because you don’t need persistent connectivity and you don’t have the power to do it. + +In some cases, you just put a SIM on it, and you have 5G, but in another one it’s just wireless connectivity. Wi-Fi connectivity is significantly lower cost than 5G. The use cases will dictate what type of connectivity you need, but the reality is they all want one experience. And we can do that because we have a great platform and a great partnership with MSPs, telcos, and providers. + +**Knorr:** So it sounds like much of your investment is going into that integration. + +**Neri:** The other part is how we provide the ability to provision the right cloud computing at the edge for the right use cases. Think about, for example, a manufacturing floor. We can converge the OT and IT worlds through a converged infrastructure aspect that digitizes the analog process into a digital process. We bring the cloud compute in there, which is fully virtualized and containerized, we integrate Wi-Fi connectivity or LAN connectivity, and we eliminate all these analog processes that are multi-failure touchpoints because you have multiple things that have to come together. + +That’s a great example of a cloud at the edge. And maybe that small cloud is connected to a big cloud which could be in the large data center, which the customer owns – or it can be one of the largest public cloud providers. + +**Knorr:** It’s difficult to talk about the software-defined data center and private cloud without talking about [VMware][16]. Where do your software-defined solutions leave off and where does VMware begin? + +**Neri:** Where we stop is everything below the hypervisor, including the software-defined storage and things like SimpliVity. That has been the advantage we’ve had with [HPE OneView][17], so we can provision and manage the infrastructure-life-cycle and software-defined aspects at the infrastructure level. And let’s not forget security, because we’ve integrated [silicon root of trust][18] into our systems, which is a good advantage for us in the government space. + +Then above that we continue to develop capabilities. Customers want choice. That’s why [the partnership with Nutanix][19] was important. We offer an alternative to vSphere and vCloud Foundation with Nutanix Prism and Acropolis. + +**Knorr:** VMware has become the default for the private cloud, though. + +**Neri:** Obviously, VMware owns 60 percent of the on-prem virtualized environment, but more and more, containers are becoming the way to go in a cloud-native approach. For us, we own the full container stack, because we base our solution on Kubernetes. We deploy that. That’s why the partnership with Nutanix is important. With Nutanix, we offer KVM and the Prism stack and then we’re fully integrated with HPE OneView for the rest of the infrastructure. + +**Knorr:** You also offer GKE [Google [Kubernetes][20] Engine] on-prem. + +**Neri:** Correct. We’re working with Google on the next version of that. + +**Knorr:** How long do you think it will be before you start seeing Kubernetes and containers on bare metal? + +**Neri:** It’s an interesting question. Many customers tell us it’s like going back to the future. It’s like we’re paying this tax on the virtualization layer. + +**Knorr:** Exactly. + +**Neri:** I can go bare metal and containers and be way more efficient. It is a little bit back to the future. But it’s a different future. + +**Knorr:** And it makes the promise of [hybrid cloud][21] a little more real. I know HPE has been very bullish on hybrid. + +**Neri:** We have been the one to say the world would be hybrid. + +**Knorr:** But today, how hybrid is hybrid really? I mean, you have workloads in the public cloud, you have workloads in a [private cloud][22]. Can you really rope it all together into hybrid? + +**Neri:** I think you have to have portability eventually. + +**Knorr:** Eventually. It’s not really true now, though. + +**Neri:** No, not true now. If you look at it from the software brokering perspective that makes hybrid very small. We know this eventually has to be all connected, but it’s not there yet. More and more of these workloads have to go back and forth. + +If you ask me what the CIO role of the future will look like, it would be a service provider. I wake up in the morning, have a screen that says – oh, you know what? Today it’s cheaper to run that app here. I just slice it there and then it just moves. Whatever attributes on the data I want to manage and so forth – oh, today I have capacity here and by the way, why are you not using it? Slide it back here. That’s the hybrid world. + +Many people, when they started with the cloud, thought, “I’ll just virtualize everything,” but that’s not the cloud. You’re [virtualizing][23], but you have to make it self-service. Obviously, cloud-native applications have developed that are different today. That’s why containers are definitely a much more efficient way, and that’s why I agree that the bare-metal piece of this is coming back. + +**Knorr:** Do you worry about public cloud incursions into the [data center][24]? + +**Neri:** It’s happening. Of course I’m worried. But what at least gives me comfort is twofold. One is that the customer wants choice. They don’t want to be locked in. Service is important. It’s one thing to say: Here’s the system. The other is: Who’s going to maintain it for me? Who is going to run it for me? And even though you have all the automation tools in the world, somebody has to watch this thing. Our job is to bring the public-cloud experience on prem, so that the customer has that choice. + +**Knorr:** Part of that is economics. + +**Neri:** When you look at economics it’s no longer just the cost of compute anymore. What we see more and more is the cost of the data bandwidth back and forth. That’s why the first question a customer asks is: Where should I put my data? And that dictates a lot of things, because today the data transfer bill is way higher than the cost of renting a VM. + +The other thing is that when you go on the public cloud you can spin up a VM, but the problem is if you don’t shut it off, the bill keeps going. We brought, in the context of [composability][25], the ability to shut it off automatically. That’s why composability is important, because we can run, first of all, multi-workloads in the same infrastructure – whether it’s bare metal, virtualized or containerized. It’s called composable because the software layers of intelligence compose the right solutions from compute, storage, fabric and memory to that workload. When it doesn’t need it, it gives it back. + +**Knorr:** Is there any opportunity left at the hardware level to innovate? + +**Neri:** That’s why we think about memory-driven computing. Today we have a very CPU-centric approach. This is a limiting factor, and the reality is, if you believe data is the core of the architecture going forward, then the CPU can’t be the core of the architecture anymore. + +You have a bunch of inefficiency by moving data back and forth across the system, which also creates energy waste and so forth. What we are doing is basically rearchitecting this for once in 70 years. We take memory and storage and collapse the two into one, so this becomes one central pool, which is nonvolatile and becomes the core. And then we bring the right computing capability to the data. + +In an AI use case, you don’t move the data. You bring accelerators or GPUs to the data. For general purpose, you may use an X86, and maybe in video transcoding, you use an ARM-based architecture. The magic is this: You can do this on zettabytes of data and the benefit is there is no waste, very little power to keep it alive, and it’s persistent. + +We call this the Generation Z fabric, which is based on a data fabric and silicon photonics. Now we go from copper, which is generating a lot of waste and a lot of heat and energy, to silicon photonics. So we not only scale this to zettabytes, we can do massive amounts of computation by bringing the right compute at the speed that’s needed to the data – and we solve a cost and scale problem too, because copper today costs a significant amount of money, and gold-plated connectors are hundreds of dollars. + +We’re going to actually implement this capability in silicon photonics in our current architectures by the end of the year. In Synergy, for example, which is a composable blade system, at the back of the rack you can swap from Ethernet to silicon photonics. It was designed that way. We already prototyped this in a simple 2U chassis with 160 TB of memory and 2000 cores. We were able to process a billion-record database with 55 million combinations of algorithms in less than a minute. + +**Knorr:** So you’re not just focusing on the edge, but the core, too. + +**Neri:** As you go down from the cloud to the edge, that architecture actually scales to the smallest things. You can do it on a massive scale or you can do it on a small scale. We will deploy these technologies in our systems architectures now. Once the whole ecosystem is developed, because we also need an ISV ecosystem that can code applications in this new world or you’re not taking advantage of it. Also, the current Linux kernel can only handle so much memory, so you have to rewrite the kernel. We are working with two universities to do that. + +The hardware will continue to evolve and develop, but there still is a lot of innovation that has to happen. What’s holding us back, honestly, is the software. + +**Knorr:** And that’s where a lot of your investment is going? + +**Neri:** Correct. Exactly right. Systems software, not application software. It’s the system software that makes this infrastructure solution-oriented, workload-optimized, autonomous and efficient. + +Join the Network World communities on [Facebook][26] and [LinkedIn][27] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html + +作者:[Eric Knorr][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://images.idgesg.net/images/article/2019/05/antonio-neri_hpe_new-100796112-large.jpg +[2]: https://www.networkworld.com/article/2891130/aruba-networks-is-different-than-hps-failed-wireless-acquisitions.html +[3]: https://www.networkworld.com/article/3158784/hpe-buying-simplivity-for-650-million-to-boost-hyperconvergence.html +[4]: https://www.networkworld.com/article/3177376/hpe-to-pay-1-billion-for-nimble-storage-after-cutting-emc-ties.html +[5]: https://www.networkworld.com/article/3273113/hpe-snaps-up-hyperconverged-network-hcn-vendor-plexxi.html +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[10]: https://www.cio.com/article/3394598/hpe-ceo-antonio-neri-rearchitects-for-the-future.html +[11]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[12]: https://www.networkworld.com/article/3248989/what-is-a-wide-area-network-a-definition-examples-and-where-wans-are-headed.html +[13]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[14]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[15]: https://www.networkworld.com/article/3235124/internet-of-things-definitions-a-handy-guide-to-essential-iot-terms.html +[16]: https://www.networkworld.com/article/3340259/vmware-s-transformation-takes-hold.html +[17]: https://www.networkworld.com/article/2174203/hp-expands-oneview-into-vmware-environs.html +[18]: https://www.networkworld.com/article/3199826/hpe-highlights-innovation-in-software-defined-it-security-at-discover.html +[19]: https://www.networkworld.com/article/3388297/hpe-and-nutanix-partner-for-hyperconverged-private-cloud-systems.html +[20]: https://www.infoworld.com/article/3268073/what-is-kubernetes-container-orchestration-explained.html +[21]: https://www.networkworld.com/article/3268448/what-is-hybrid-cloud-really-and-whats-the-best-strategy.html +[22]: https://www.networkworld.com/article/2159885/cloud-computing-gartner-5-things-a-private-cloud-is-not.html +[23]: https://www.networkworld.com/article/3285906/whats-the-future-of-server-virtualization.html +[24]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[25]: https://www.networkworld.com/article/3266106/what-is-composable-infrastructure.html +[26]: https://www.facebook.com/NetworkWorld/ +[27]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md new file mode 100644 index 0000000000..5adf5f65a7 --- /dev/null +++ b/sources/talk/20190513 Top auto makers rely on cloud providers for IoT.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top auto makers rely on cloud providers for IoT) +[#]: via: (https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Top auto makers rely on cloud providers for IoT +====== + +For the companies looking to implement the biggest and most complex [IoT][1] setups in the world, the idea of pairing up with [AWS][2], [Google Cloud][3] or [Azure][4] seems to be one whose time has come. Within the last two months, BMW and Volkswagen have both announced large-scale deals with Microsoft and Amazon, respectively, to help operate their extensive network of operational technology. + +According to Alfonso Velosa, vice president and analyst at Gartner, part of the impetus behind those two deals is that the automotive sector fits in very well with the architecture of the public cloud. Public clouds are great at collecting and processing data from a diverse array of different sources, whether they’re in-vehicle sensors, dealerships, mechanics, production lines or anything else. + +**[ RELATED:[What hybrid cloud means in practice][5]. | Get regularly scheduled insights by [signing up for Network World newsletters][6]. ]** + +“What they’re trying to do is create a broader ecosystem. They think they can leverage the capabilities from these folks,” Velosa said. + +### Cloud providers as IoT partners + +The idea is automated analytics for service and reliability data, manufacturing and a host of other operational functions. And while the full realization of that type of service is still very much a work in progress, it has clear-cut advantages for big companies – a skilled partner handling tricky implementation work, built-in capability for sophisticated analytics and security, and, of course, the ability to scale up in a big way. + +Hence, the structure of the biggest public clouds has upside for many large-scale IoT deployments, not just the ones taking place in the auto industry. The cloud giants have vast infrastructures, with multiple points of presence all over the world. + +To continue reading this article register now + +[Get Free Access][7] + +[Learn More][8] Existing Users [Sign In][7] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395137/top-auto-makers-rely-on-cloud-providers-for-iot.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[2]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html +[3]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html +[4]: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html +[5]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: javascript:// +[8]: /learn-about-insider/ diff --git a/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md new file mode 100644 index 0000000000..e821405199 --- /dev/null +++ b/sources/talk/20190514 Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise) +[#]: via: (https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html) +[#]: author: (Rick Hamilton, Senior Vice President, Blue Planet Software ) + +Brillio and Blue Planet Partner to Bring Network Automation to the Enterprise +====== +Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most. +![Kritchanut][1] + +![][2] + +_Rick Hamilton, senior vice president of Blue Planet, a division of Ciena, explains how partnering with Brillio brings the next generation of network capabilities to enterprises—just when they need it most._ + +In February 2019, we announced that Blue Planet was evolving into a more independent division, helping us increase our focus on innovative intelligent automation solutions that help our enterprise and service provider customers accelerate and achieve their business transformation goals. + +Today we’re excited to make another leap forward in delivering these benefits to enterprises of all types via our partnership with digital transformation services and solutions leader Brillio. Together, we are co-creating intelligent cloud and network management solutions that increase service visibility and improve service assurance by effectively leveraging the convergence of cloud, IoT, and AI. + +**Accelerating digital transformation in the enterprise** + +Enterprises continue to look toward cloud services to create new and incremental revenue streams based on innovative solution offerings and on-demand product/solution delivery models, and to optimize their infrastructure investments. In fact, Gartner predicts that enterprise IT spending for cloud-based offerings will continue to grow faster than non-cloud IT offerings, making up 28% of spending by 2022, up from 19% in 2018. + +As enterprises adopt cloud, they realize there are many challenges associated with traditional approaches to operating and managing complex and hybrid multi-cloud environments. Our partnership with Brillio enables us to help these organizations across industries such as manufacturing, logistics, retail, and financial services meet their technical and business needs with high-impact solutions that improve customer experiences, drive operational efficiencies, and improve quality of service. + +This is achieved by combining the Blue Planet intelligent automation platform and the Brillio CLIP™services delivery excellence platform and user-centered design (UCD) lead solution framework. Together, we offer end-to-end visibility of application and infrastructure assets in a hybrid multi-cloud environment and provide service assurance and self-healing capabilities that improve network and service availability. + +**Partnering on research and development** + +Brillio will also partner with Blue Planet on longer-term R&D efforts. As one of a preferred product engineering services providers, Brillio will work closely with our engineering team to develop and deliver network intelligence and automation solutions to help enterprises build dynamic, programmable infrastructure that leverage analytics and automation to realize the Adaptive Network vision. + +Of course, a partnership like this is a two-way street, and we consider Brillio’s choice to work with us to be a testament to our expertise, vision, and execution. In the words of Brillio Chairman and CEO Raj Mamodia, “Blue Planet’s experience in end-to-end service orchestration coupled with Brillio’s expertise in cloudification, user-centered enterprise solutions design, and rapid software development delivers distinct advantages to the industry. Through integration of technologies like cloud, IoT, and AI into our combined solutions, our partnership spurs greater innovation and helps us address the large and growing enterprise networking automation market.” + +Co-creating intelligent hybrid cloud and network management solutions with Brillio is key to advancing enterprise digital transformation initiatives. Partnering with Brillio helps us address the plethora of challenges facing enterprises today on their digital journey. Our partnership enables Blue Planet to achieve faster time-to-market and greater efficiency in developing new solutions to enable enterprises to continue to thrive and grow. + +[Learn more about Blue Planet here][3] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394687/brillio-and-blue-planet-partner-to-bring-network-automation-to-the-enterprise.html + +作者:[Rick Hamilton, Senior Vice President, Blue Planet Software][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://images.idgesg.net/images/article/2019/05/istock-952625346-100796314-large.jpg +[2]: https://images.idgesg.net/images/article/2019/05/rick-100796315-small.jpg +[3]: https://www.blueplanet.com/?utm_campaign=X1058319&utm_source=NWW&utm_term=BPWeb_Brillio&utm_medium=sponsoredpost3Q19 diff --git a/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md new file mode 100644 index 0000000000..84a563c8bc --- /dev/null +++ b/sources/talk/20190514 Las Vegas targets transport, public safety with IoT deployments.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Las Vegas targets transport, public safety with IoT deployments) +[#]: via: (https://www.networkworld.com/article/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Las Vegas targets transport, public safety with IoT deployments +====== + +![Franck V. \(CC0\)][1] + +The city of Las Vegas’ pilot program with NTT and Dell, designed to crack down on wrong-way driving on municipal roads, is just part of the big plans that Sin City has for leveraging IoT tech in the future, according to the city's director of technology Michael Sherwood, who sat down with Network World at the IoT World conference in Silicon Valley this week. + +The system uses smart cameras and does most of its processing at the edge, according to Sherwood. The only information that gets sent back to the city’s private cloud is metadata – aggregated information about overall patterns, for decision-making and targeting purposes, not data about individual traffic incidents and wrong-way drivers. + +**[ Also see[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +It’s an important public safety consideration, he said, but it’s a small part of the larger IoT-enabled framework that the city envisions for the future. + +“Our goal is to make our data open to the public, not only for transparency purposes, but to help spur development and create new applications to make Vegas a better place to live,” said Sherwood. + +[The city’s public data repository][4] already boasts a range of relevant data, some IoT-generated, some not. And efforts to make that data store more open have already begun to bear fruit, according to Sherwood. For example, one hackathon about a year ago resulted in an Alexa app that tells users how many traffic lights are out, by tracking energy usage data via the city’s portal, among other applications. + +As with IoT in general, Sherwood said that the city’s efforts have been bolstered by an influx of operational talen. Rather than additional IT staff to run the new systems, they’ve brought in experts from the traffic department to help get the most out of the framework. + +Another idea for leveraging the city’s traffic data involves tracking the status of the curb. Given the rise of Uber and Lyft and other on-demand transportation services, linking a piece of camera-generated information like “rideshares are parked along both sides of this street” directly into a navigation app could help truck drivers avoid gridlock. + +“We’re really looking to make the roads a living source of information,” Sherwood said. + +**Safer parks** + +Las Vegas is also pursuing related public safety initiatives. One pilot project aims to make public parks safer by installing infrared cameras so authorities can tell whether people are in parks after hours without incurring undue privacy concerns, given that facial recognition is very tricky in infrared. + +It’s the test-and-see method of IoT development, according to Sherwood. + +“That’s a way of starting with an IoT project: start with one park. The cost to do something like this is not astronomical, and it allows you to gauge some other information from it,” he said. + +The city has also worked to keep the costs of these projects low or even show a returnon investment, Sherwood added. Workforce development programs could train municipal workers to do simple maintenance on smart cameras in parks or along roadways, and the economic gains made from the successful use of the systems ought to outweigh deployment and operational outlay. + +“If it’s doing it’s job, those efficiencies should cover the system’s cost,” he 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/3395536/las-vegas-targets-transport-public-safety-with-iot-deployments.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/pedestrian-walk-sign_go_start_begin_traffic-light_by-franck-v-unsplaash-100765089-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://opendata.lasvegasnevada.gov/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md new file mode 100644 index 0000000000..1ecd68fa41 --- /dev/null +++ b/sources/talk/20190514 Mobility and SD-WAN, Part 1- SD-WAN with 4G LTE is a Reality.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality) +[#]: via: (https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html) +[#]: author: (Francisca Segovia ) + +Mobility and SD-WAN, Part 1: SD-WAN with 4G LTE is a Reality +====== + +![istock][1] + +Without a doubt, 5G — the fifth generation of mobile wireless technology — is the hottest topic in wireless circles today. You can’t throw a stone without hitting 5G news. While telecommunications providers are in a heated competition to roll out 5G, it’s important to reflect on current 4G LTE (Long Term Evolution) business solutions as a preview of what we have learned and what’s possible. + +This is part one of a two-part blog series that will explore the [SD-WAN][2] journey through the evolution of these wireless technologies. + +### **Mobile SD-WAN is a reality** + +4G LTE commercialization continues to expand. According to [the GSM (Groupe Spéciale Mobile) Association][3], 710 operators have rolled out 4G LTE in 217 countries, reaching 83 percent of the world’s population. The evolution of 4G is transforming the mobile industry and is setting the stage for the advent of 5G. + +Mobile connectivity is increasingly integrated with SD-WAN, along with MPLS and broadband WAN services today. 4G LTE represents a very attractive transport alternative, as a backup or even an active member of the WAN transport mix to connect users to critical business applications. And in some cases, 4G LTE might be the only choice in locations where fixed lines aren’t available or reachable. Furthermore, an SD-WAN can optimize 4G LTE connectivity and bring new levels of performance and availability to mobile-based business use cases by selecting the best path available across several 4G LTE connections. + +### **Increasing application performance and availability with 4G LTE** + +Silver Peak has partnered with [BEC Technologies][4] to create a joint solution that enables customers to incorporate one or more low-cost 4G LTE services into any [Unity EdgeConnect™][5] SD-WAN edge platform deployment. All the capabilities of the EdgeConnect platform are supported across LTE links including packet-based link bonding, dynamic path control, path conditioning along with the optional [Unity Boost™ WAN Optimization][6] performance pack. This ensures always-consistent, always-available application performance even in the event of an outage or degraded service. + +EdgeConnect also incorporates sophisticated NAT traversal technology that eliminates the requirement for provisioning the LTE service with extra-cost static IP addresses. The Silver Peak [Unity Orchestrator™][7] management software enables the prioritization of LTE bandwidth usage based on branch and application requirements – active-active or backup-only. This solution is ideal in retail point-of-sale and other deployment use cases where always-available WAN connectivity is critical for the business. + +### **Automated SD-WAN enables innovative services** + +An example of an innovative mobile SD-WAN service is [swyMed’s DOT Telemedicine Backpack][8] powered by the EdgeConnect [Ultra Small][9] hardware platform. This integrated telemedicine solution enables first responders to connect to doctors and communicate patient vital statistics and real-time video anywhere, any time, greatly improving and expediting care for emergency patients. Using a lifesaving backpack provisioned with two LTE services from different carriers, EdgeConnect continuously monitors the underlying 4G LTE services for packet loss, latency and jitter. In the case of transport failure or brownout, EdgeConnect automatically initiates a sub-second failover so that voice, video and data connections continue without interruption over the remaining active 4G service. By bonding the two LTE links together with the EdgeConnect SD-WAN, swyMed can achieve an aggregate signal quality in excess of 90 percent, bringing mobile telemedicine to areas that would have been impossible in the past due to poor signal strength. + +To learn more about SD-WAN and the unique advantages that SD-WAN provides to enterprises across all industries, visit the [SD-WAN Explained][2] page on our website. + +### **Prepare for the 5G future** + +In summary, the adoption of 4G LTE is a reality. Service providers are taking advantage of the distinct benefits of SD-WAN to offer managed SD-WAN services that leverage 4G LTE. + +As the race for the 5G gains momentum, service providers are sure to look for ways to drive new revenue streams to capitalize on their initial investments. Stay tuned for part 2 of this 2-blog series where I will discuss how SD-WAN is one of the technologies that can help service providers to transition from 4G to 5G and enable the monetization of a new wave of managed 5G services. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3394866/mobility-and-sd-wan-part-1-sd-wan-with-4g-lte-is-a-reality.html + +作者:[Francisca Segovia][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://images.idgesg.net/images/article/2019/05/istock-952414660-100796279-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.gsma.com/futurenetworks/resources/all-ip-statistics/ +[4]: https://www.silver-peak.com/resource-center/edgeconnect-4glte-solution-bec-technologies +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/products/unity-boost +[7]: https://www.silver-peak.com/products/unity-orchestrator +[8]: https://www.silver-peak.com/resource-center/mobile-telemedicine-helps-save-lives-streaming-real-time-clinical-data-and-patient +[9]: https://www.silver-peak.com/resource-center/edgeconnect-us-ec-us-specification-sheet diff --git a/sources/talk/20190515 Extreme addresses networked-IoT security.md b/sources/talk/20190515 Extreme addresses networked-IoT security.md new file mode 100644 index 0000000000..1ad756eded --- /dev/null +++ b/sources/talk/20190515 Extreme addresses networked-IoT security.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Extreme addresses networked-IoT security) +[#]: via: (https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Extreme addresses networked-IoT security +====== +The ExtremeAI security app features machine learning that can understand typical behavior of IoT devices and alert when it finds anomalies. +![Getty Images][1] + +[Extreme Networks][2] has taken the wraps off a new security application it says will use machine learning and artificial intelligence to help customers effectively monitor, detect and automatically remediate security issues with networked IoT devices. + +The application – ExtremeAI security—features machine-learning technology that can understand typical behavior of IoT devices and automatically trigger alerts when endpoints act in unusual or unexpected ways, Extreme said. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][4] + * [How edge computing can help secure the IoT][5] + + + +Extreme said that the ExtremeAI Security application can tie into all leading threat intelligence feeds, and had close integration with its existing [Extreme Workflow Composer][6] to enable automatic threat mitigation and remediation. + +The application integrates the company’s ExtremeAnalytics application which lets customers view threats by severity, category, high-risk endpoints and geography. An automated ticketing feature integrates with variety of popular IT tools such as Slack, Jira, and ServiceNow, and the application interoperates with many popular security tools, including existing network taps, the vendor stated. + +There has been an explosion of new endpoints ranging from million-dollar smart MRI machines to five-dollar sensors, which creates a complex and difficult job for network and security administrators, said Abby Strong, vice president of product marketing for Extreme. “We need smarter, secure and more self-healing networks especially where IT cybersecurity resources are stretched to the limit.” + +Extreme is trying to address an issue that is important to enterprise-networking customers: how to get actionable, usable insights as close to real-time as possible, said Rohit Mehra, Vice President of Network Infrastructure at IDC. “Extreme is melding automation, analytics and security that can look at network traffic patterns and allow the system to take action when needed.” + +The ExtremeAI application, which will be available in October, is but one layer of IoT security Extreme offers. Already on the market, its [Defender for IoT][7] package, which includes a Defender application and adapter, lets customers monitor, set policies and isolate IoT devices across an enterprise. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +The Extreme AI and Defender packages are now part of what the company calls Extreme Elements, which is a menu of its new and existing Smart OmniEdge, Automated Campus and Agile Data Center software, hardware and services that customers can order to build a manageable, secure system. + +Aside from the applications, the Elements include Extreme Management Center, the company’s network management software; the company’s x86-based intelligent appliances, including the ExtremeCloud Appliance; and [ExtremeSwitching X465 premium][9], a stackable multi-rate gigabit Ethernet switch. + +The switch and applications are just the beginning of a very busy time for Extreme. In its [3Q earnings cal][10]l this month company CEO Ed Meyercord noted Extreme was in the “early stages of refreshing 70 percent of our products” and seven different products will become generally available this quarter – a record for Extreme, he said. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395539/extreme-addresses-networked-iot-security.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://images.idgesg.net/images/article/2019/02/iot_security_tablet_conference_digital-100787102-large.jpg +[2]: https://www.networkworld.com/article/3289508/extreme-facing-challenges-girds-for-future-networking-battles.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[5]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[6]: https://www.extremenetworks.com/product/workflow-composer/ +[7]: https://www.extremenetworks.com/product/extreme-defender-for-iot/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://community.extremenetworks.com/extremeswitching-exos-223284/extremexos-30-2-and-smart-omniedge-premium-x465-switches-are-now-available-7823377 +[10]: https://seekingalpha.com/news/3457137-extreme-networks-minus-15-percent-quarterly-miss-light-guidance +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md new file mode 100644 index 0000000000..b69109641d --- /dev/null +++ b/sources/talk/20190515 IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services) +[#]: via: (https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +IBM overhauls mainframe-software pricing, adds hybrid, private-cloud services +====== +IBM brings cloud consumption model to the mainframe, adds Docker container extensions +![Thinkstock][1] + +IBM continues to adopt new tools and practices for its mainframe customers to keep the Big Iron relevant in a cloud world. + +First of all, the company switched-up its 20-year mainframe software pricing scheme to make it more palatable to hybrid and multicloud users who might be thinking of moving workloads off the mainframe and into the cloud. + +**[ Check out[What is hybrid cloud computing][2] and learn [what you need to know about multi-cloud][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +Specifically IBM rolled out Tailored Fit Pricing for the IBM Z mainframe which offers two consumption-based pricing models that can help customers cope with ever-changing workload – and hence software – costs. + +Tailored Fit Pricing removes the need for complex and restrictive capping, which typically weakens responsiveness and can impact service level availability, IBM said. IBM’s standard monthly mainframe licensing model calculates costs as a “rolling four-hour average” (R4HA) which would determine cost based on a customer’s peak usage during the month. Customers would many time cap usage to keep costs down, experts said + +Systems can now be configured to support optimal response times and service level agreements, rather than artificially slowing down workloads to manage software licensing costs, IBM stated. + +Predicting demand for IT services can be a major challenge and in the era of hybrid and multicloud, everything is connected and workload patterns constantly change, wrote IBM’s Ross Mauri, General Manager, IBM Z in a [blog][5] about the new pricing and services. “In this environment, managing demand for IT services can be a major challenge. As more customers shift to an enterprise IT model that incorporates on-premises, private cloud and public we’ve developed a simple cloud pricing model to drive the transformation forward.” + +[Tailored Fit Pricing][6] for IBM Z comes in two flavors, the Enterprise Consumption Solution and the Enterprise Capacity Solution. + +IBM said the Enterprise Consumption model is a tailored usage-based pricing model, where customers pay only for what they use, removing the need for complex and restrictive capping, IBM said. + +The Enterprise Capacity model lets customers mix and match workloads to help maximize use of the full capacity of the platform. Charges are referenced to the overall size of the physical environment and are calculated based on the estimated mix of workloads running, while providing the flexibility to vary actual usage across workloads, IBM said. + +The software pricing changes should be a welcome benefit to customers, experts said. + +“By making access to Z mainframes more flexible and ‘cloud-like,’ IBM is making it less likely that customers will consider shifting Z workloads to other systems and environments. As cloud providers become increasingly able to support mission critical applications, that’s a big deal,” wrote Charles King, president and principal analyst for Pund-IT in a [blog][7] about the IBM changes. + +“A notable point about both models is that discounted growth pricing is offered on all workloads – whether they be 40-year old Assembler programs or 4-day old JavaScript apps. This is in contrast to previous models which primarily rewarded only brand-new applications with growth pricing. By thinking outside the Big Iron box, the company has substantially eased the pain for its largest clients’ biggest mainframe-related headaches,” King wrote. + +IBM’s Tailored Fit Pricing supports an increasing number of enterprises that want to continue to grow and build new services on top of this mission-critical platform, wrote [John McKenny][8] vice president of strategy for ZSolutions Optimization at BMC Software. “In not yet released results from the 2019 BMC State of the Mainframe Survey, 62% of the survey respondents reported that they are planning to expand MIPS/MSU consumption and are growing their mainframe workloads. For customers with no current plans for growth, the affordability and cost-competitiveness of the new pricing model will re-ignite interest in also using this platform as an integral part of their hybrid cloud strategies.” + +In addition to the pricing, IBM announced some new services that bring the mainframe closer to cloud workloads. + +First, IBM rolled out z/OS Container Extensions (zCX), which makes it possible to run Linux on Z applications that are packaged as Docker Container images on z/OS. Application developers can develop and data centers can operate popular open source packages, Linux applications, IBM software, and third-party software together with z/OS applications and data, IBM said. zCX will let customers use the latest open source tools, popular NoSQL databases, analytics frameworks, application servers, and so on within the z/OS environment. + +“With z/OS Container Extensions, customers will be able to access the most recent development tools and processes available in Linux on the Z ecosystem, giving developers the flexibility to build new, cloud-native containerized apps and deploy them on z/OS without requiring Linux or a Linux partition,” IBM’s Mauri stated. + +Big Blue also rolled out z/OS Cloud Broker which will let customers access and deploy z/OS resources and services on [IBM Cloud Private][9]. [IBM Cloud Private][10] is the company’s Kubernetes-based Platform as a Service (PaaS) environment for developing and managing containerized applications. IBM said z/OS Cloud Broker is designed to help cloud application developers more easily provision and deprovision apps in z/OS environments. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3395776/ibm-overhauls-mainframe-software-pricing-adds-hybrid-private-cloud-services.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://images.techhive.com/images/article/2015/08/thinkstockphotos-520137237-100610459-large.jpg +[2]: https://www.networkworld.com/article/3233132/cloud-computing/what-is-hybrid-cloud-computing.html +[3]: https://www.networkworld.com/article/3252775/hybrid-cloud/multicloud-mania-what-to-know.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.ibm.com/blogs/systems/ibm-z-defines-the-future-of-hybrid-cloud/ +[6]: https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?infotype=AN&subtype=CA&htmlfid=897/ENUS219-014&appname=USN +[7]: https://www.pund-it.com/blog/ibm-reinvents-the-z-mainframe-again/ +[8]: https://www.bmc.com/blogs/bmc-supports-ibm-tailored-fit-pricing-ibm-z/ +[9]: https://www.ibm.com/marketplace/cloud-private-on-z-and-linuxone +[10]: https://www.networkworld.com/article/3340043/ibm-marries-on-premises-private-and-public-cloud-data.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190516 Will 5G be the first carbon-neutral network.md b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md new file mode 100644 index 0000000000..decacfac5d --- /dev/null +++ b/sources/talk/20190516 Will 5G be the first carbon-neutral network.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Will 5G be the first carbon-neutral network?) +[#]: via: (https://www.networkworld.com/article/3395465/will-5g-be-the-first-carbon-neutral-network.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Will 5G be the first carbon-neutral network? +====== +Increased energy consumption in new wireless networks could become ecologically unsustainable. Engineers think they have solutions that apply to 5G, but all is not certain. +![Dushesina/Getty Images][1] + +If wireless networks transfer 1,000 times more data, does that mean they will use 1,000 times more energy? It probably would with the old 4G LTE wireless technologies— LTE doesn’t have much of a sleep-standby. But with 5G, we might have a more energy-efficient option. + +More customers want Earth-friendly options, and engineers are now working on how to achieve it — meaning 5G might introduce the first zero-carbon networks. It’s not all certain, though. + +**[ Related:[What is 5G wireless? And how it will change networking as we know it][2] ]** + +“When the 4G technology for wireless communication was developed, not many people thought about how much energy is consumed in transmitting bits of information,” says Emil Björnson, associate professor of communication systems at Linkoping University, [in an article on the school’s website][3]. + +Standby was never built into 4G, Björnson explains. Reasons include overbuilding — the architects wanted to ensure connections didn’t fail, so they just kept the power up. The downside to that redundancy was that almost the same amount of energy is used whether the system is transmitting data or not. + +“We now know that this is not necessary,” Björnson says. 5G networks don’t use much power during periods of low traffic, and that reduces power consumption. + +Björnson says he knows how to make future-networks — those 5G networks that one day may become the enterprise broadband replacement — super efficient even when there is heavy use. Massive-MIMO (multiple-in, multiple-out) antennas are the answer, he says. That’s hundreds of connected antennas taking advantage of multipath. + +I’ve written before about some of Björnson's Massive-MIMO ideas. He thinks [Massive-MIMO will remove all capacity ceilings from wireless networks][4]. However, he now adds calculations to his research that he claims prove that the Massive-MIMO antenna technology will also reduce power use. He and his group are actively promoting their academic theories in a paper ([pdf][5]). + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +### Nokia's plan to reduce wireless networks' CO2 emissions + +Björnson's isn’t the only 5G-aimed eco-concept out there. Nokia points out that it isn't just radios transmitting that use electricity. Cooling is actually the main electricity hog, says the telcommunications company, which is one of the world’s principal manufacturers of mobile network equipment. + +Nokia says the global energy cost of Radio Access Networks (RANs) in 2016 (the last year numbers were available), which includes base transceiver stations (BTSs) needed by mobile networks, was around $80 billion. That figure increases with more users coming on stream, something that’s probable. Of the BTS’s electricity use, about 90% “converts to waste heat,” [Harry Kuosa, a marketing executive, writes on Nokia’s blog][7]. And base station sites account for about 80% of a mobile network’s entire energy use, Nokia expands on its website. + +“A thousand-times more traffic that creates a thousand-times higher energy costs is unsustainable,” Nokia says in its [ebook][8] on the subject, “Turning the zero carbon vision into business opportunity,” and it’s why Nokia plans liquid-cooled 5G base stations among other things, including chip improvements. It says the liquid-cooling can reduce CO2 emissions by up to 80%. + +### Will those ideas work? + +Not all agree power consumption can be reduced when implementing 5G, though. Gabriel Brown of Heavy Reading, quotes [in a tweet][9] a China Mobile executive as saying that 5G BTSs will use three times as much power as 4G LTE ones because the higher frequencies used in 5G mean one needs more BTS units to provide the same geographic coverage: For physics reasons, higher frequencies equals shorter range. + +If, as is projected, 5G develops into the new enterprise broadband for the internet of things (IoT), along with associated private networks covering everything else, then these eco- and cost-important questions are going to be salient — and they need answers quickly. 5G will soon be here, and [Gartner estimates that 60% of organizations will adopt it][10]. + +**More about 5G networks:** + + * [How enterprises can prep for 5G networks][11] + * [5G vs 4G: How speed, latency and apps support differ][12] + * [Private 5G networks are coming][13] + * [5G and 6G wireless have security issues][14] + * [How millimeter-wave wireless could help support 5G and IoT][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/3395465/will-5g-be-the-first-carbon-neutral-network.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/01/4g-versus-5g_horizon_sunrise-100784230-large.jpg +[2]: https://www.networkworld.com/article/3203489/lan-wan/what-is-5g-wireless-networking-benefits-standards-availability-versus-lte.html +[3]: https://liu.se/en/news-item/okningen-av-mobildata-kraver-energieffektivare-nat +[4]: https://www.networkworld.com/article/3262991/future-wireless-networks-will-have-no-capacity-limits.html +[5]: https://arxiv.org/pdf/1812.01688.pdf +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.nokia.com/blog/nokia-has-ambitious-plans-reduce-network-power-consumption/ +[8]: https://pages.nokia.com/2364.Zero.Emissions.ebook.html?did=d000000001af&utm_campaign=5g_in_action_&utm_source=twitter&utm_medium=organic&utm_term=0dbf430c-1c94-47d7-8961-edc4f0ba3270 +[9]: https://twitter.com/Gabeuk/status/1099709788676636672?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1099709788676636672&ref_url=https%3A%2F%2Fwww.lightreading.com%2Fmobile%2F5g%2Fpower-consumption-5g-basestations-are-hungry-hungry-hippos%2Fd%2Fd-id%2F749979 +[10]: https://www.gartner.com/en/newsroom/press-releases/2018-12-18-gartner-survey-reveals-two-thirds-of-organizations-in +[11]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html +[12]: https://www.networkworld.com/article/3330603/mobile-wireless/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[13]: https://www.networkworld.com/article/3319176/mobile-wireless/private-5g-networks-are-coming.html +[14]: https://www.networkworld.com/article/3315626/network-security/5g-and-6g-wireless-technologies-have-security-issues.html +[15]: https://www.networkworld.com/article/3291323/mobile-wireless/millimeter-wave-wireless-could-help-support-5g-and-iot.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md new file mode 100644 index 0000000000..a1dafef683 --- /dev/null +++ b/sources/talk/20190517 HPE to buy Cray, offer HPC as a service.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE to buy Cray, offer HPC as a service) +[#]: via: (https://www.networkworld.com/article/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +HPE to buy Cray, offer HPC as a service +====== +High-performance computing offerings from HPE plus Cray could enable things like AI, ML, high-speed financial trading, creation digital twins for entire enterprise networks. +![Cray Inc.][1] + +HPE has agreed to buy supercomputer-maker Cray for $1.3 billion, a deal that the companies say will bring their corporate customers high-performance computing as a service to help with analytics needed for artificial intelligence and machine learning, but also products supporting high-performance storage, compute and software. + +In addition to bringing HPC capabilities that can blend with and expand HPE’s current products, Cray brings with it customers in government and academia that might be interested in HPE’s existing portfolio as well. + +**[ Now read:[Who's developing quantum computers][2] ]** + +The companies say they expect to close the cash deal by the end of next April. + +The HPC-as-a-service would be offered through [HPE GreenLake][3], the company’s public-, private-, hybrid-cloud service. Such a service could address periodic enterprise need for fast computing that might otherwise be too expensive, says Tim Zimmerman, an analyst with Gartner. + +Businesses could use the service, for example, to create [digital twins][4] of their entire networks and use them to test new code to see how it will impact the network before deploying it live, Zimmerman says. + +Cray has HPC technology that HPE Labs might be exploring on its own, but that can be brought to market in a much quicker timeframe. + +HPE says that overall, buying cray give it technologies needed for massively data-intensive workloads such as AI and ML that is used for engineering services, transaction-based trading by financial firms, pharmaceutical research and academic studies into weather and genomes, for instance, Zimmerman says. + +As HPE puts it, Cray supercomputing platforms “have the ability to handle massive data sets, converged modelling, simulation, AI and analytics workloads.” + +Cray is working on [what it says will be the world’s fastest supercomputer][5] when it’s finished in 2021, cranking out 1.5 exaflops. The current fastest supercomputer is 143.5 petaflops. [Click [here][6] to see the current top 10 fastest supercomputers.] + +In general, HPE says it hopes to create a comprehensive line of products to support HPC infrastructure including “compute, high-performance storage, system interconnects, software and services.” + +Together, the talent in the two companies and their combined technologies should be able to increase innovation, HPE says. + +Earlier this month, HPE’s CEO Antonio Neri said in [an interview with _Network World_][7] that the company will be investing $4 billion over four years in a range of technology to boost “connectivity, security, and obviously cloud and analytics.” In laying out the company’s roadmap he made no specific mention of HPC. + +HPE net revenues last fiscal year were $30.9 billion. Cray’s total revenue was $456 million, with a gross profit of $130 million. + +The acquisition will pay $35 per share for Cray stock. + +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/3396220/hpe-to-buy-cray-offer-hpc-as-a-service.html + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/the_cray_xc30_piz_daint_system_at_the_swiss_national_supercomputing_centre_via_cray_inc_3x2_978x652-100762113-large.jpg +[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[3]: https://www.networkworld.com/article/3280996/hpe-adds-greenlake-hybrid-cloud-to-enterprise-service-offerings.html +[4]: https://www.networkworld.com/article/3280225/what-is-digital-twin-technology-and-why-it-matters.html +[5]: https://www.networkworld.com/article/3373539/doe-plans-worlds-fastest-supercomputer.html +[6]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[7]: https://www.networkworld.com/article/3394879/hpe-s-ceo-lays-out-his-technology-vision.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md new file mode 100644 index 0000000000..02063687a0 --- /dev/null +++ b/sources/talk/20190517 The modern data center and the rise in open-source IP routing suites.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The modern data center and the rise in open-source IP routing suites) +[#]: via: (https://www.networkworld.com/article/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +The modern data center and the rise in open-source IP routing suites +====== +Open source enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. +![fdecomite \(CC BY 2.0\)][1] + +As the cloud service providers and search engines started with the structuring process of their business, they quickly ran into the problems of managing the networking equipment. Ultimately, after a few rounds of getting the network vendors to understand their problems, these hyperscale network operators revolted. + +Primarily, what the operators were looking for was a level of control in managing their network which the network vendors couldn’t offer. The revolution burned the path that introduced open networking, and network disaggregation to the work of networking. Let us first learn about disaggregation followed by open networking. + +### Disaggregation + +The concept of network disaggregation involves breaking-up of the vertical networking landscape into individual pieces, where each piece can be used in the best way possible. The hardware can be separated from the software, along with open or closed IP routing suites. This enables the network operators to use the best of breed for the hardware, software and the applications. + +**[ Now see[7 free network tools you must have][2]. ]** + +Networking has always been built as an appliance and not as a platform. The mindset is that the network vendor builds an appliance and as a specialized appliance, they will completely control what you can and cannot do on that box. In plain words, they will not enable anything that is not theirs. As a result, they act as gatekeepers and not gate-enablers. + +Network disaggregation empowers the network operators with the ability to lay hands on the features they need when they need them. However, this is impossible in case of non-disaggregated hardware. + +### Disaggregation leads to using best-of-breed + +In the traditional vertically integrated networking market, you’re forced to live with the software because you like the hardware, or vice-versa. But network disaggregation drives different people to develop things that matter to them. This allows multiple groups of people to connect, with each one focused on doing what he or she does the best. Switching silicon manufacturers can provide the best merchant silicon. Routing suites can be provided by those who are the best at that. And the OS vendors can provide the glue that enables all of these to work well together. + +With disaggregation, people are driven to do what they are good at. One company does the hardware, whereas another does the software and other company does the IP routing suites. Hence, today the networking world looks like more of the server world. + +### Open source + +Within this rise of the modern data center, there is another element that is driving network disaggregation; the notion of open source. Open source is “denoting software for which the original source code is made freely available, it may be redistributed and modified.” It enables passionate people to come together and fabricate work of phenomenal quality. This is in contrast to a single vendor doing everything. + +As a matter of fact, the networking world has always been very vendor driven. However, the advent of open source gives the opportunity to like-minded people rather than the vendor controlling the features. This eliminates the element of vendor lock-in, thereby enabling interesting work. Open source allows more than one company to be involved. + +### Open source in the data center + +The traditional enterprise and data center networks were primarily designed by bridging and Spanning Tree Protocol (STP). However, the modern data center is driven by IP routing and the CLOS topology. As a result, you need a strong IP routing suite. + +That was the point where the need for an open-source routing suite surfaced, the suite that can help drive the modern data center. The primary open-source routing suites are [FRRouting (FRR)][3], BIRD, GoBGP and ExaBGP. + +Open-source IP routing protocol suites are slowly but steadily gaining acceptance and are used in data centers of various sizes. Why? It is because they allow a community of developers and users to work on finding solutions to common problems. Open-source IP routing protocol suites equip them to develop the specific features that they need. It also helps the network operators to create simple designs that make sense to them, as opposed to having everything controlled by the vendor. They also enable routing suites to run on compute nodes. Kubernetes among others uses this model of running a routing protocol on a compute node. + +Today many startups are using FRR. Out of all of the IP routing suites, FRR is preferred in the data center as the primary open-source IP routing protocol suite. Some traditional network vendors have even demonstrated the use of FRR on their networking gear. + +There are lots of new features currently being developed for FRR, not just by the developers but also by the network operators. + +### Use cases for open-source routing suites + +When it comes to use-cases, where do IP routing protocol suites sit? First and foremost, if you want to do any type of routing in the disaggregated network world, you need an IP routing suite. + +Some operators are using FRR at the edge of the network as well, thereby receiving full BGP feeds. Many solutions which use Intel’s DPDK for packet forwarding use FRR as the control plane, receiving full BGP feeds. In addition, there are other vendors using FRR as the core IP routing suite for a full leaf and spine data center architecture. You can even get a version of FRR on pfSense which is a free and open source firewall. + +We need to keep in mind that reference implementations are important. Open source allows you to test at scale. But vendors don’t allow you to do that. However, with FRR, we have the ability to spin up virtual machines (VMs) or even containers by using software like Vagrant to test your network. Some vendors do offer software versions, but they are not fully feature-compatible. + +Also, with open source you do not need to wait. This empowers you with flexibility and speed which drives the modern data center. + +### Deep dive on FRRouting (FRR) + +FRR is a Linux foundation project. In a technical Linux sense, FRR is a group of daemons that work together, providing a complete routing suite that includes BGP, IS-IS, LDP, OSPF, BFD, PIM, and RIP. + +Each one of these daemons communicate with the common routing information base (RIB) daemon called Zebra in order to interface with the OS and to resolve conflicts between the multiple routing protocols providing the same information. Interfacing with the OS is used to receive the link up/down events, to add and delete routes etc. + +### FRRouting (FRR) components: Zebra + +Zebra is the RIB of the routing systems. It knows everything about the state of the system relevant to routing and is able to pass and disseminate this information to all the interested parties. + +The RIB in FRR acts just like a traditional RIB. When a route wins, it goes into the Linux kernel data plane where the forwarding occurs. All of the routing protocols run as separate processes and each of them have their source code in FRR. + +For example, when BGP starts up, it needs to know, for instance, what kind of virtual routing and forwarding (VRF) and IP interfaces are available. Zebra collects and passes this information back to the interested daemons. It passes all the relevant information about state of the machine. + +Furthermore, you can also register information with Zebra. For example, if a particular route changes, the daemon can be informed. This can also be used for reverse path forwarding (RPF). FRR doesn't need to do a pull when changes happen on the network. + +There are a myriad of ways through which you can control Linux and the state. Sometimes you have to use options like the Netlink bus and sometimes you may need to read the state in proc file system of Linux. The goal of Zebra is to gather all this data for the upper level protocols. + +### FRR supports remote data planes + +FRR also has the ability to manage the remote data planes. So, what does this mean? Typically, the data forwarding plane and the routing protocols run on the same box. Another model, adopted by Openflow and SDN for example, is one in which the data forwarding plane can be on one box while FRR runs on a different box on behalf of the first box and pushes the computed routing state on the first box. In other words, the data plane and the control plane run on different boxes. + +If you examine the traditional world, it’s like having one large chassis with different line cards with the ability to install routes in those different line cards. FRR operates with the same model which has one control plane and the capability to offer 3 boxes, if needed. It does this via the forwarding plane manager. + +### Forwarding plane manager + +Zebra can either install routes directly into the data plane of the box it is running on or use a forwarding plane manager to install routes on a remote box. When it installs a route, the forwarding plane manager abstracts the data which displays the route and the next hops. It then pushes the data to a remote system where the remote machine processes it and programs the ASIC appropriately. + +After the data is abstracted, you can use whatever protocol you want in order to push the data to the remote machine. You can even include the data in an email. + +### What is holding people back from open source? + +Since last 30 years the networking world meant that you need to go to a vendor to solve a problem. But now with open-source routing suites, such as, FRR, there is a major drift in the mindset as to how you approach troubleshooting. + +This causes the fear of not being able to use it properly because with open source you are the one who has to fix it. This at first can be scary and daunting. But it doesn’t necessarily have to be. Also, to switch to FRR on a traditional network gear, you need the vendor to enable it, but they may be reluctant as they are on competing platforms which can be another road blocker. + +### The future of FRR + +If we examine FRR from the use case perspective of the data center, FRR is feature-complete. Anyone building an IP based data center FRR has everything available. The latest 7.0 release of FRR adds Yang/NetConf, BGP Enhancements and OpenFabric. + +FRR is not just about providing features, boosting the performance or being the same as or better than the traditional network vendor’s software, it is also about simplifying the process for the end user. + +Since the modern data center is focused on automation and ease of use, FRR has made such progress that the vendors have not caught up with. FRR is very automation friendly. For example, FRR takes BGP and makes it automation-friendly without having to change the protocol. It supports BGP unnumbered that is unmatched by any other vendor suite. This is where the vendors are trying to catch up. + +Also, while troubleshooting, FRR shows peer’s and host’s names and not just the IP addresses. This allows you to understand without having spent much time. However, vendors show the peer’s IP addresses which can be daunting when you need to troubleshoot. + +FRR provides the features that you need to run an efficient network and data center. It makes easier to configure and manage the IP routing suite. Vendors just add keep adding features over features whether they are significant or not. Then you need to travel the certification paths that teach you how to twiddle 20 million nobs. How many of those networks are robust and stable? + +FRR is about supporting features that matter and not every imaginable feature. FRR is an open source project that brings like-minded people together, good work that is offered isn’t turned away. As a case in point, FRR has an open source implementation of EIGRP. + +The problem surfaces when you see a bunch of things, you think you need them. But in reality, you should try to keep the network as simple as possible. FRR is laser-focused on the ease of use and simplifying the use rather than implementing features that are mostly not needed to drive the modern data center. + +For more information and to contribute, why not join the [FRR][4] [mailing list group][4]. + +**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/3396136/the-modern-data-center-and-the-rise-in-open-source-ip-routing-suites.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://images.idgesg.net/images/article/2018/12/modular_humanoid_polyhedra_connections_structure_building_networking_by_fdecomite_cc_by_2-0_via_flickr_1200x800-100782334-large.jpg +[2]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[3]: https://frrouting.org/community/7.0-launch.html +[4]: https://frrouting.org/#participate +[5]: /contributor-network/signup.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md b/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md new file mode 100644 index 0000000000..9df4495f05 --- /dev/null +++ b/sources/talk/20190521 Enterprise IoT- Companies want solutions in these 4 areas.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Enterprise IoT: Companies want solutions in these 4 areas) +[#]: via: (https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Enterprise IoT: Companies want solutions in these 4 areas +====== +Based on customer pain points, PwC identified four areas companies are seeking enterprise solutions for, including energy use and sustainability. +![Jackie Niam / Getty Images][1] + +Internet of things (IoT) vendors and pundits like to crow about the billions and billions of connected devices that make the IoT so ubiquitous and powerful. But how much of that installed base is really relevant to the enterprise? + +To find out, I traded emails with Rob Mesirow, principal at [PwC’s Connected Solutions][2], the firm’s new one-stop-shop of IoT solutions, who suggests that consumer adoption may not paint a true picture of the enterprise opportunities. If you remove the health trackers and the smart thermostats from the market, he suggested, there are very few connected devices left. + +So, I wondered, what is actually happening on the enterprise side of IoT? What kinds of devices are we talking about, and in what kinds of numbers? + +**[ Read also:[Forget 'smart homes,' the new goal is 'autonomous buildings'][3] ]** + +“When people talk about the IoT,” Mesirow told me, “they usually focus on [consumer devices, which far outnumber business devices][4]. Yet [connected buildings currently represent only 12% of global IoT projects][5],” he noted, “and that’s without including wearables and smart home projects.” (Mesirow is talking about buildings that “use various IoT devices, including occupancy sensors that determine when people are present in a room in order to keep lighting and temperature controls at optimal levels, lowering energy costs and aiding sustainability goals. Sensors can also detect water and gas leaks and aid in predictive maintenance for HVAC systems.”) + +### 4 key enterprise IoT opportunities + +More specifically, based on customer pain points, PwC’s Connected Solutions is focusing on a few key opportunities, which Mesirow laid out in a [blog post][6] earlier this year. (Not surprisingly, the opportunities seem tied to [the group’s products][7].) + +“A lot of these solutions came directly from our customers’ request,” he noted. “We pre-qualify our solutions with customers before we build them.” + +Let’s take a look at the top four areas, along with a quick reality check on how important they are and whether the technology is ready for prime time. + +#### **1\. Energy use and sustainability** + +The IoT makes it possible to manage buildings and spaces more efficiently, with savings of 25% or more. Occupancy sensors can tell whether anyone is actually in a room, adjusting lighting and temperature to saving money and conserve energy. + +Connected buildings can also help determine when meeting spaces are available, which can boost occupancy at large businesses and universities by 40% while cutting infrastructure and maintenance costs. Other sensors, meanwhile, can detect water and gas leaks and aid in predictive maintenance for HVAC systems. + +**Reality check:** Obviously, much of this technology is not new, but there’s a real opportunity to make it work better by integrating disparate systems and adding better analytics to the data to make planning more effective. + +#### **2. Asset tracking + +** + +“Businesses can also use the IoT to track their assets,“ Mesirow told me, “which can range from trucks to hotel luggage carts to medical equipment. It can even assist with monitoring trash by alerting appropriate people when dumpsters need to be emptied.” + +Asset trackers can instantly identify the location of all kinds of equipment (saving employee time and productivity), and they can reduce the number of lost, stolen, and misplaced devices and machines as well as provide complete visibility into the location of your assets. + +Such trackers can also save employees from wasting time hunting down the devices and machines they need. For example, PwC noted that during an average hospital shift, more than one-third of nurses spend at least an hour looking for equipment such as blood pressure monitors and insulin pumps. Just as important, location tracking often improves asset optimization, reduced inventory needs, and improved customer experience. + +**Reality check:** Asset tracking offers clear value. The real question is whether a given use case is cost effective or not, as well as how the data gathered will actually be used. Too often, companies spend a lot of money and effort tracking their assets, but don’t do much with the information. + +#### **3\. Security and compliance** + +Connected solutions can create better working environments, Mesirow said. “In a hotel, for example, these smart devices can ensure that air and water quality is up to standards, provide automated pest traps, monitor dumpsters and recycling bins, detect trespassers, determine when someone needs assistance, or discover activity in an unauthorized area. Monitoring the water quality of hotel swimming pools can lower chemical and filtering costs,” he said. + +Mesirow cited an innovative use case where, in response to workers’ complaints about harassment, hotel operators—in conjunction with the [American Hotel and Lodging Association][8]—are giving their employees portable devices that alert security staff when workers request assistance. + +**Reality check:** This seems useful, but the ROI might be difficult to calculate. + +#### **4\. Customer experience** + +According to PwC, “Sensors, facial recognition, analytics, dashboards, and notifications can elevate and even transform the customer experience. … Using connected solutions, you can identify and reward your best customers by offering perks, reduced wait times, and/or shorter lines.” + +Those kinds of personalized customer experiences can potentially boost customer loyalty and increase revenue, Mesirow said, adding that the technology can also make staff deployments more efficient and “enhance safety by identifying trespassers and criminals who are tampering with company property.” + +**Reality check:** Creating a great customer experience is critical for businesses today, and this kind of personalized targeting promises to make it more efficient and effective. However, it has to be done in a way that makes customers comfortable and not creeped out. Privacy concerns are very real, especially when it comes to working with facial recognition and other kinds of surveillance technology. For example, [San Francisco recently banned city agencies from using facial recognition][9], and others may follow. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][10] + * [What is edge computing and how it’s changing the network][11] + * [Most powerful Internet of Things companies][12] + * [10 Hot IoT startups to watch][13] + * [The 6 ways to make money in IoT][14] + * [What is digital twin technology? [and why it matters]][15] + * [Blockchain, service-centric networking key to IoT success][16] + * [Getting grounded in IoT networking and security][17] + * [Building IoT-ready networks must become a priority][18] + * [What is the Industrial IoT? [And why the stakes are so high]][19] + + + +Join the Network World communities on [Facebook][20] and [LinkedIn][21] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_by_jackie_niam_gettyimages-996958260_2400x1600-100788446-large.jpg +[2]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html#get-connected +[3]: https://www.networkworld.com/article/3309420/forget-smart-homes-the-new-goal-is-autonomous-buildings.html +[4]: https://www.statista.com/statistics/370350/internet-of-things-installed-base-by-category/) +[5]: https://iot-analytics.com/top-10-iot-segments-2018-real-iot-projects/ +[6]: https://www.digitalpulse.pwc.com.au/five-unexpected-ways-internet-of-things/ +[7]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html +[8]: https://www.ahla.com/ +[9]: https://www.nytimes.com/2019/05/14/us/facial-recognition-ban-san-francisco.html +[10]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[11]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[12]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[13]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[14]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[15]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[16]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[17]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[18]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[19]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[20]: https://www.facebook.com/NetworkWorld/ +[21]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md b/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md new file mode 100644 index 0000000000..86d7bf0efe --- /dev/null +++ b/sources/talk/20190522 Experts- Enterprise IoT enters the mass-adoption phase.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Experts: Enterprise IoT enters the mass-adoption phase) +[#]: via: (https://www.networkworld.com/article/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Experts: Enterprise IoT enters the mass-adoption phase +====== +Dropping hardware prices, 5G boost business internet-of-things deployments; technical complexity encourages partnerships. +![Avgust01 / Getty Images][1] + +[IoT][2] in general has taken off quickly over the past few years, but experts at the recent IoT World highlighted that the enterprise part of the market has been particularly robust of late – it’s not just an explosion of connected home gadgets anymore. + +Donna Moore, chairwoman of the LoRa Alliance, an industry group that works to develop and scale low-power WAN technology for mass usage, said on a panel that she’s never seen growth this fast in the sector. “I’d say we’re now in the early mass adopters [stage],” she said. + +**More on IoT:** + + * [Most powerful Internet of Things companies][3] + * [10 Hot IoT startups to watch][4] + * [The 6 ways to make money in IoT][5] + * [What is digital twin technology? [and why it matters]][6] + * [Blockchain, service-centric networking key to IoT success][7] + * [Getting grounded in IoT networking and security][8] + * [Building IoT-ready networks must become a priority][9] + * [What is the Industrial IoT? [And why the stakes are so high]][10] + + + +The technology itself has pushed adoption to these heights, said Graham Trickey, head of IoT for the GSMA, a trade organization for mobile network operators. Along with price drops for wireless connectivity modules, the array of upcoming technologies nestling under the umbrella label of [5G][11] could simplify the process of connecting devices to [edge-computing][12] hardware – and the edge to the cloud or [data center][13]. + +“Mobile operators are not just providers of connectivity now, they’re farther up the stack,” he said. Technologies like narrow-band IoT and support for highly demanding applications like telehealth are all set to be part of the final 5G spec. + +### Partnerships needed to deal with IoT complexity** + +** + +That’s not to imply that there aren’t still huge tasks facing both companies trying to implement their own IoT frameworks and the creators of the technology underpinning them. For one thing, IoT tech requires a huge array of different sets of specialized knowledge. + +“That means partnerships, because you need an expert in your [vertical] area to know what you’re looking for, you need an expert in communications, and you might need a systems integrator,” said Trickey. + +Phil Beecher, the president and CEO of the Wi-SUN Alliance (the acronym stands for Smart Ubiquitous Networks, and the group is heavily focused on IoT for the utility sector), concurred with that, arguing that broad ecosystems of different technologies and different partners would be needed. “There’s no one technology that’s going to solve all these problems, no matter how much some parties might push it,” he said. + +One of the central problems – [IoT security][14] – is particularly dear to Beecher’s heart, given the consequences of successful hacks of the electrical grid or other utilities. More than one panelist praised the passage of the EU’s General Data Protection Regulation, saying that it offered concrete guidelines for entities developing IoT tech – a crucial consideration for some companies that may not have a lot of in-house expertise in that area. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397317/experts-enterprise-iot-enters-the-mass-adoption-phase.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/iot_internet_of_things_mobile_connections_by_avgust01_gettyimages-1055659210_2400x1600-100788447-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[4]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[5]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[6]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[7]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[8]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[9]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[10]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[11]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[12]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html?nsdr=true +[13]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[14]: https://www.networkworld.com/article/3269736/getting-grounded-in-iot-networking-and-security.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md b/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md new file mode 100644 index 0000000000..be8a4833cc --- /dev/null +++ b/sources/talk/20190522 The Traffic Jam Whopper project may be the coolest-dumbest IoT idea ever.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever) +[#]: via: (https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +The Traffic Jam Whopper project may be the coolest/dumbest IoT idea ever +====== +Burger King uses real-time IoT data to deliver burgers to drivers stuck in traffic — and it seems to be working. +![Mike Mozart \(CC BY 2.0\)][1] + +People love to eat in their cars. That’s why we invented the drive-in and the drive-thru. + +But despite a fast-food outlet on the corner of every major intersection, it turns out we were only scratching the surface of this idea. Burger King is taking this concept to the next logical step with its new IoT-powered Traffic Jam Whopper project. + +I have to admit, when I first heard about this, I thought it was a joke, but apparently the [Traffic Jam Whopper project is totally real][2] and has already passed a month-long test in Mexico City. While the company hasn’t specified a timeline, it plans to roll out the Traffic Jam Whopper project in Los Angeles (where else?) and other traffic-plagued megacities such as São Paulo and Shanghai. + +**[ Also read:[Is IoT in the enterprise about making money or saving money?][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +### How Burger King's Traffic Jam Whopper project works + +According to [Nations Restaurant News][5], this is how Burger King's Traffic Jam Whopper project works: + +The project uses real-time data to target hungry drivers along congested roads and highways for food delivery by couriers on motorcycles. + +The system leverages push notifications to the Burger King app and personalized messaging on digital billboards positioned along busy roads close to a Burger King restaurant. + +[According to the We Believers agency][6] that put it all together, “By leveraging traffic and drivers’ real-time data [location and speed], we adjusted our billboards’ location and content, displaying information about the remaining time in traffic to order, and personalized updates about deliveries in progress.” The menu is limited to Whopper Combos to speed preparation (though the company plans to offer a wider menu as it works out the kinks). + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][7] ]** + +The company said orders in Mexico City were delivered in an average of 15 minutes. Fortunately (or unfortunately, depending on how you look at it) many traffic jams hold drivers captive for far longer than that. + +Once the order is ready, the motorcyclist uses Google maps and GPS technology embedded into the app to locate the car that made the order. The delivery person then weaves through traffic to hand over the Whopper. (Lane-splitting is legal in California, but I have no idea if there are other potential safety or law-enforcement issues involved here. For drivers ordering burgers, at least, the Burger King app supports voice ordering. I also don’t know what happens if traffic somehow clears up before the burger arrives.) + +Here’s a video of the pilot program in Mexico City: + +#### **New technology = > new opportunities** + +Even more amazing, this is not _just_ a publicity stunt. NRN quotes Bruno Cardinali, head of marketing for Burger King Latin America and Caribbean, claiming the project boosted sales during rush hour, when app orders are normally slow: + +“Thanks to The Traffic Jam Whopper campaign, we’ve increased deliveries by 63% in selected locations across the month of April, adding a significant amount of orders per restaurant per day, just during rush hours." + +If nothing else, this project shows that creative thinking really can leverage IoT technology into new businesses. In this case, it’s turning notoriously bad traffic—pretty much required for this process to work—from a problem into an opportunity to generate additional sales during slow periods. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][8] + * [What is edge computing and how it’s changing the network][9] + * [Most powerful Internet of Things companies][10] + * [10 Hot IoT startups to watch][11] + * [The 6 ways to make money in IoT][12] + * [What is digital twin technology? [and why it matters]][13] + * [Blockchain, service-centric networking key to IoT success][14] + * [Getting grounded in IoT networking and security][15] + * [Building IoT-ready networks must become a priority][16] + * [What is the Industrial IoT? [And why the stakes are so high]][17] + + + +Join the Network World communities on [Facebook][18] and [LinkedIn][19] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396188/the-traffic-jam-whopper-project-may-be-the-coolestdumbest-iot-idea-ever.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/burger-king-gift-card-100797164-large.jpg +[2]: https://abc7news.com/food/burger-king-to-deliver-to-drivers-stuck-in-traffic/5299073/ +[3]: https://www.networkworld.com/article/3343917/the-big-picture-is-iot-in-the-enterprise-about-making-money-or-saving-money.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.nrn.com/technology/tech-tracker-burger-king-deliver-la-motorists-stuck-traffic?cid= +[6]: https://www.youtube.com/watch?v=LXNgEZV7lNg +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[8]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[9]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[10]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[11]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[12]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[13]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[14]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[15]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[16]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[17]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[18]: https://www.facebook.com/NetworkWorld/ +[19]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md b/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md new file mode 100644 index 0000000000..61ae9e656b --- /dev/null +++ b/sources/talk/20190523 Benchmarks of forthcoming Epyc 2 processor leaked.md @@ -0,0 +1,55 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Benchmarks of forthcoming Epyc 2 processor leaked) +[#]: via: (https://www.networkworld.com/article/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Benchmarks of forthcoming Epyc 2 processor leaked +====== +Benchmarks of AMD's second-generation Epyc server briefly found their way online and show the chip is larger but a little slower than the Epyc 7601 on the market now. +![Gordon Mah Ung][1] + +Benchmarks of engineering samples of AMD's second-generation Epyc server, code-named “Rome,” briefly found their way online and show a very beefy chip running a little slower than its predecessor. + +Rome is based on the Zen 2 architecture, believed to be more of an incremental improvement over the prior generation than a major leap. It’s already known that Rome would feature a 64-core, 128-thread design, but that was about all of the details. + +**[ Also read:[Who's developing quantum computers][2] ]** + +The details came courtesy of SiSoftware's Sandra PC analysis and benchmarking tool. It’s very popular and has been used by hobbyists and benchmarkers alike for more than 20 years. New benchmarks are uploaded to the Sandra database all the time, and what I suspect happened is someone running a Rome sample ran the benchmark, not realizing the results would be uploaded to the Sandra database. + +The benchmarks were from two different servers, a Dell PowerEdge R7515 and a Super Micro Super Server. The Dell product number is not on the market, so this would indicate a future server with Rome processors. The entry has since been deleted, but several sites, including the hobbyist site Tom’s Hardware Guide, managed to [take a screenshot][3]. + +According to the entry, the chip is a mid-range processor with a base clock speed of 1.4GHz, jumping up to 2.2GHz in turbo mode, with 16MB of Level 2 cache and 256MB of Level 3 cache, the latter of which is crazy. The first-generation Epyc had just 32MB of L3 cache. + +That’s a little slower than the Epyc 7601 on the market now, but when you double the number of cores in the same space, something’s gotta give, and in this case, it’s electricity. The thermal envelope was not revealed by the benchmark. Previous Epyc processors ranged from 120 watts to 180 watts. + +Sandra ranked the processor at #3 for arithmetic and #5 for multimedia processing, which makes me wonder what on Earth beat the Rome chip. Interestingly, the servers were running Windows 10, not Windows Server 2019. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][4] ]** + +Rome is expected to be officially launched at the massive Computex trade show in Taiwan on May 27 and will begin shipping in the third quarter of the year. + +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/3397081/benchmarks-of-forthcoming-epyc-2-processor-leaked.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://images.idgesg.net/images/article/2018/11/rome_2-100779395-large.jpg +[2]: https://www.networkworld.com/article/3275385/who-s-developing-quantum-computers.html +[3]: https://www.tomshardware.co.uk/amd-epyc-rome-processor-data-center,news-60265.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md b/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md new file mode 100644 index 0000000000..2638987b16 --- /dev/null +++ b/sources/talk/20190523 Cisco ties its security-SD-WAN gear with Teridion-s cloud WAN service.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco ties its security/SD-WAN gear with Teridion’s cloud WAN service) +[#]: via: (https://www.networkworld.com/article/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco ties its security/SD-WAN gear with Teridion’s cloud WAN service +====== +An agreement links Cisco Meraki MX Security/SD-WAN appliances and its Auto VPN technology to Teridion’s cloud-based WAN service that claims to accelerate TCP-based applications by up to 5X. +![istock][1] + +Cisco and Teridion have tied the knot to deliver faster enterprise [software-defined WAN][2] services. + +The agreement links [Cisco Meraki][3] MX Security/SD-WAN appliances and its Auto [VPN][4] technology which lets users quickly bring up and configure secure sessions between branches and data centers with [Teridion’s cloud-based WAN service][5]. Teridion’s service promises customers better performance and control over traffic running from remote offices over the public internet to the [data center][6]. The service features what Teridion calls “Curated Routing” which fuses WAN acceleration techniques with route optimization to speed traffic. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][7] + * [How to pick an off-site data-backup method][8] + * [SD-Branch: What it is and why you’ll need it][9] + * [What are the options for security SD-WAN?][10] + + + +For example, Teridion says its WAN service can accelerate TCP-based applications like file transfers, backups and page loads, by as much as three to five times. + +“[The service] improves network performance for UDP based applications like voice, video, RDP, and VDI. Enterprises can get carrier grade performance over broadband and dedicated internet access. Depending on the locations of the sites, [customers] can expect to see a 15 to 30 percent reduction in latency. That’s the difference between a great quality video conference and an unworkable, choppy mess” Teridion [stated][11]. + +Teridion says the Meraki integration creates an IPSec connection from the Cisco Meraki MX to the Teridion edge. “Customers create locations in the Teridion portal and apply the preconfigured Meraki template to them, or just upload a csv file if you have a lot of locations. Then, from each Meraki MX, create a 3rd party IPSec tunnel to the Teridion edge IP addresses that are generated as part of the Teridion configuration.” + +The combined Cisco Meraki and Teridion offering brings SD-WAN and security capabilities at the WAN edge that are tightly integrated with a WAN service delivered over cost-effective broadband or dedicated Internet access, said Raviv Levi, director of product management at Cisco Meraki in a statement. “This brings better reliability and consistency to the enterprise WAN across multiple sites, as well as high performance access to all SaaS applications and cloud workloads.” + +Meraki’s MX family supports everything from SD-WAN and [Wi-Fi][12] features to next-generation [firewall][13] and intrusion prevention in a single package. + +Some studies show that by 2021 over 75 percent of enterprise traffic will be SaaS-oriented, so giving branch offices SD-WAN's reliable, secure transportation options will be a necessity, Cisco said when it [upgraded the Meraki][3] boxes last year. + +Cisco Meraki isn’t the only SD-WAN service Teridion supports. The company also has agreements Citrix, Silver Peak, VMware (VeloCloud). Teridion also has partnerships with over 25 cloud partners, including Google, Amazon Web Services and Microsoft Azure. + +[Teridion for Cisco Meraki][14] is available now from authorized Teridion resellers. Pricing starts at $50 per site per month. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.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://images.idgesg.net/images/article/2018/02/istock-820219662-100749695-large.jpg +[2]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[3]: https://www.networkworld.com/article/3301169/cisco-meraki-amps-up-throughput-wi-fi-to-sd-wan-family.html +[4]: https://www.networkworld.com/article/3138952/5-things-you-need-to-know-about-virtual-private-networks.html +[5]: https://www.networkworld.com/article/3284285/teridion-enables-higher-performing-and-more-responsive-saas-applications.html +[6]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[7]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[8]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[9]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[10]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[11]: https://www.teridion.com/blog/teridion-announces-deep-integration-with-cisco-meraki-mx/ +[12]: https://www.networkworld.com/article/3318119/what-to-expect-from-wi-fi-6-in-2019.html +[13]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[14]: https://www.teridion.com/meraki +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md b/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md new file mode 100644 index 0000000000..54ddf76db3 --- /dev/null +++ b/sources/talk/20190523 Edge-based caching and blockchain-nodes speed up data transmission.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge-based caching and blockchain-nodes speed up data transmission) +[#]: via: (https://www.networkworld.com/article/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Edge-based caching and blockchain-nodes speed up data transmission +====== +Using a combination of edge-based data caches and blockchain-like distributed networks, Bluzelle claims it can significantly speed up the delivery of data across the globe. +![OlgaSalt / /getty][1] + +The combination of a blockchain-like distributed network, along with the ability to locate data at the edge will massively speed up future networks, such as those used by the internet of things (IoT), claims Bluzelle in announcing what is says is the first decentralized data delivery network (DDN). + +Distributed DDNs will be like content delivery networks (CDNs) that now cache content around the world to speed up the web, but in this case, it will be for data, the Singapore-based company explains. Distributed key-value (blockchain) networks and edge computing built into Bluzelle's system will provide significantly faster delivery than existing caching, the company claims in a press release announcing its product. + +“The future of data delivery can only ever be de-centrally distributed,” says Pavel Bains, CEO and co-founder of Bluzelle. It’s because the world requires instant access to data that’s being created at the edge, he argues. + +“But delivery is hampered by existing technology,” he says. + +**[ Also read:[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3]. ]** + +Bluzelle says decentralized caching is the logical next step to generalized data caching, used for reducing latency. “Decentralized caching expands the theory of caching,” the company writes in a [report][4] (Dropbox pdf) on its [website][5]. It says the cache must be expanded from simply being located at one unique location. + +“Using a combination of distributed networks, the edge and the cloud, [it’s] thereby increasing the transactional throughput of data,” the company says. + +This kind of thing is particularly important in consumer gaming now, where split-second responses from players around the world make or break a game experience, but it will likely be crucial for the IoT, higher-definition media, artificial intelligence, and virtual reality as they gain more of a role in digitization—including at critical enterprise applications. + +“Currently applications are limited to data caching technologies that require complex configuration and management of 10-plus-year-old technology constrained to a few data centers,” Bains says. “These were not designed to handle the ever-increasing volumes of data.” + +Bains says one of the key selling points of Bluzelle's network is that developers should be able to implement and run networks without having to also physically expand the networks manually. + +“Software developers don’t want to react to where their customers come from. Our architecture is designed to always have the data right where the customer is. This provides a superior consumer experience,” he says. + +Data caches are around now, but Bluzelle claims its system, written in C++ and available on Linux and Docker containers, among other platforms, is faster than others. It further says that if its system and a more traditional cache would connect to the same MySQL database in Virginia, say, their users will get the data three to 16 times faster than a traditional “non-edge-caching” network. Write updates to all Bluzelle nodes around the world takes 875 milliseconds (ms), it says. + +The company has been concentrating its efforts on gaming, and with a test setup in Virginia, it says it was able to deliver data 33 times faster—at 22ms to Singapore—than a normal, cloud-based data cache. That traditional cache (located near the database) took 727ms in the Bluzelle-published test. In a test to Ireland, it claims 16ms over 223ms using a traditional cache. + +An algorithm is partly the reason for the gains, the company explains. It “allows the nodes to make decisions and take actions without the need for masternodes,” the company says. Masternodes are the server-like parts of blockchain systems. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][6] + * [How edge computing can help secure the IoT][7] + + + +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/3397105/edge-based-caching-and-blockchain-nodes-speed-up-data-transmission.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/blockchain_crypotocurrency_bitcoin-by-olgasalt-getty-100787949-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://www.dropbox.com/sh/go5bnhdproy1sk5/AAC5MDoafopFS7lXUnmiLAEFa?dl=0&preview=Bluzelle+Report+-+The+Decentralized+Internet+Is+Here.pdf +[5]: https://bluzelle.com/ +[6]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[7]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[8]: https://www.facebook.com/NetworkWorld/ +[9]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md b/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md new file mode 100644 index 0000000000..829fb127f8 --- /dev/null +++ b/sources/talk/20190523 Online performance benchmarks all companies should try to achieve.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Online performance benchmarks all companies should try to achieve) +[#]: via: (https://www.networkworld.com/article/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Online performance benchmarks all companies should try to achieve +====== +With digital performance more important than ever, companies must ensure their online performance meets customers’ needs. A new ThousandEyes report can help them determine that. +![Thinkstock][1] + +There's no doubt about it: We have entered the experience economy, and digital performance is more important than ever. + +Customer experience is the top brand differentiator, topping price and every other factor. And businesses that provide a poor digital experience will find customers will actively seek a competitor. In fact, recent ZK Research found that in 2018, about two-thirds of millennials changed loyalties to a brand because of a bad experience. (Note: I am an employee of ZK Research.) + +To help companies determine if their online performance is leading, lacking, or on par with some of the top companies, ThousandEyes this week released its [2019 Digital Experience Performance Benchmark Report][2]. This document provides a comparative analysis of web, infrastructure, and network performance from the top 20 U.S. digital retail, travel, and media websites. Although this is a small sampling of companies, those three industries are the most competitive when it comes to using their digital platforms for competitive advantage. The aggregated data from this report can be used as an industry-agnostic performance benchmark that all companies should strive to meet. + +**[ Read also:[IoT providers need to take responsibility for performance][3] ]** + +The methodology of the study was for ThousandEyes to use its own platform to provide an independent view of performance. It uses active monitoring and a global network of monitoring agents to measure application and network layer performance for websites, applications, and services. The company collected data from 36 major cities scattered across the U.S. Six of the locations (Ashburn, Chicago, Dallas, Los Angeles, San Jose, and Seattle) also included vantage points connected to six major broadband ISPs (AT&T, CenturyLink, Charter, Comcast, Cox, and Verizon). This acts as a good proxy for what a user would experience. + +The test involved page load tests against the websites of the major companies in retail, media, and travel and looked at several factors, including DNS response time, round-trip latency, network time (one-way latency), HTTP response time, and page load. The averages and median times can be seen in the table below. Those can be considered the average benchmarks that all companies should try to attain. + +![][4] + +### Choice of content delivery network matters by location + +ThousandEyes' report also looked at how the various services that companies use impacts web performance. For example, the study measured the performance of the content delivery network (CDN) providers in the 36 markets. It found that in Albuquerque, Akamai and Fastly had the most latency, whereas Edgecast had the least. It also found that in Boston, all of the CDN providers were close. Companies can use this type of data to help them select a CDN. Without it, decision makers are essentially guessing and hoping. + +### CDN performance is impacted by ISP + +Another useful set of data was cross-referencing CDN performance by ISP, which lead to some fascinating information. With Comcast, Akamai, Cloudfront, Google and Incapula all had high amounts of latency. Only Edgecast and Fastly offered average latency. On the other hand, all of the CDNs worked great with CenturyLink. This tells a buyer, "If my customer base is largely in Comcast’s footprint, I should look at Edgecast or Fastly or my customers will be impacted." + +### DNS and latency directly impact page load times + +The ThousandEyes study also confirmed some points that many people believe as true but until now had no quantifiable evidence to support it. For example, it's widely accepted that DNS response time and network latency to the CDN edge correlate to web performance; the data in the report now supports that belief. ThousandEyes did some regression analysis and fancy math and found that in general, companies that were in the top quartile of HTTP performance had above-average DNS response time and network performance. There were a few exceptions, but in most cases, this is true. + +Based on all the data, the below are the benchmarks for the three infrastructure metrics gathered and is what businesses, even ones outside the three verticals studied, should hope to achieve to support a high-quality digital experience. + + * DNS response time 25 ms + * Round trip network latency 15 ms + * HTTP response time 250 ms + + + +### Operations teams need to focus on digital performance + +Benchmarking certainly provides value, but the report also offers some recommendations on how operations teams can use the data to improve digital performance. Those include: + + * **Measure site from distributed user vantage points**. There is no single point that will provide a view of digital performance everywhere. Instead, measure from a range of ISPs in different regions and take a multi-layered approach to visibility (application, network and routing). + * **Use internet performance information as a baseline**. Compare your organization's data to the baselines, and if you’re not meeting it in some markets, focus on improvement there. + * **Compare performance to industry peers**. In highly competitive industries, it’s important to understand how you rank versus the competition. Don’t be satisfied with hitting the benchmarks if your key competitors exceed them. + * **Build a strong performance stack.** The data shows that solid DNS and HTTP response times and low latency are correlated to solid page load times. Focus on optimizing those factors and consider them foundational to digital performance. + + + +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/3397322/online-performance-benchmarks-all-companies-should-try-to-achieve.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://images.idgesg.net/images/article/2017/07/racing_speed_runners_internet-speed-100728363-large.jpg +[2]: https://www.thousandeyes.com/research/digital-experience +[3]: https://www.networkworld.com/article/3340318/iot-providers-need-to-take-responsibility-for-performance.html +[4]: https://images.idgesg.net/images/article/2019/05/thousandeyes-100797290-large.jpg +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md b/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md new file mode 100644 index 0000000000..51098dad33 --- /dev/null +++ b/sources/talk/20190523 Study- Most enterprise IoT transactions are unencrypted.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Study: Most enterprise IoT transactions are unencrypted) +[#]: via: (https://www.networkworld.com/article/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Study: Most enterprise IoT transactions are unencrypted +====== +A Zscaler report finds 91.5% of IoT communications within enterprises are in plaintext and so susceptible to interference. +![HYWARDS / Getty Images][1] + +Of the millions of enterprise-[IoT][2] transactions examined in a recent study, the vast majority were sent without benefit of encryption, leaving the data vulnerable to theft and tampering. + +The research by cloud-based security provider Zscaler found that about 91.5 percent of transactions by internet of things devices took place over plaintext, while 8.5 percent were encrypted with [SSL][3]. That means if attackers could intercept the unencrypted traffic, they’d be able to read it and possibly alter it, then deliver it as if it had not been changed. + +**[ For more on IoT security, see[our corporate guide to addressing IoT security concerns][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** + +Researchers looked through one month’s worth of enterprise traffic traversing Zscaler’s cloud seeking the digital footprints of IoT devices. It found and analyzed 56 million IoT-device transactions over that time, and identified the type of devices, protocols they used, the servers they communicated with, how often communication went in and out and general IoT traffic patterns. + +The team tried to find out which devices generate the most traffic and the threats they face. It discovered that 1,015 organizations had at least one IoT device. The most common devices were set-top boxes (52 percent), then smart TVs (17 percent), wearables (8 percent), data-collection terminals (8 percent), printers (7 percent), IP cameras and phones (5 percent) and medical devices (1 percent). + +While they represented only 8 percent of the devices, data-collection terminals generated 80 percent of the traffic. + +The breakdown is that 18 percent of the IoT devices use SSL to communicate all the time, and of the remaining 82 percent, half used it part of the time and half never used it. +The study also found cases of plaintext HTTP being used to authenticate devices and to update software and firmware, as well as use of outdated crypto libraries and weak default credentials. + +While IoT devices are common in enterprises, “many of the devices are employee owned, and this is just one of the reasons they are a security concern,” the report says. Without strict policies and enforcement, these devices represent potential vulnerabilities. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][6] ]** + +Another reason employee-owned IoT devices are a concern is that many businesses don’t consider them a threat because no data is stored on them. But if the data they gather is transmitted insecurely, it is at risk. + +### 5 tips to protect enterprise IoT + +Zscaler recommends these security precautions: + + * Change default credentials to something more secure. As employees bring in devices, encourage them to use strong passwords and to keep their firmware current. + * Isolate IoT devices on networks and restrict inbound and outbound network traffic. + * Restrict access to IoT devices from external networks and block unnecessary ports from external access. + * Apply regular security and firmware updates to IoT devices, and secure network traffic. + * Deploy tools to gain visibility of shadow-IoT devices already inside the network so they can be protected. + + + +**More on IoT:** + + * [What is edge computing and how it’s changing the network][7] + * [Most powerful Internet of Things companies][8] + * [10 Hot IoT startups to watch][9] + * [The 6 ways to make money in IoT][10] + * [What is digital twin technology? [and why it matters]][11] + * [Blockchain, service-centric networking key to IoT success][12] + * [Getting grounded in IoT networking and security][13] + * [Building IoT-ready networks must become a priority][14] + * [What is the Industrial IoT? [And why the stakes are so high]][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/3396647/study-most-enterprise-iot-transactions-are-unencrypted.html + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/network_security_network_traffic_scanning_by_hywards_gettyimages-673891964_2400x1600-100796830-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3045953/5-things-you-need-to-know-about-ssl.html +[4]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[5]: https://www.networkworld.com/newsletters/signup.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[13]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[14]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[15]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[16]: https://www.facebook.com/NetworkWorld/ +[17]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190528 Analysing D Code with KLEE.md b/sources/talk/20190528 Analysing D Code with KLEE.md new file mode 100644 index 0000000000..c93f6e2b8d --- /dev/null +++ b/sources/talk/20190528 Analysing D Code with KLEE.md @@ -0,0 +1,680 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Analysing D Code with KLEE) +[#]: via: (https://theartofmachinery.com/2019/05/28/d_and_klee.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Analysing D Code with KLEE +====== + +[KLEE][1] is symbolic execution engine that can rigorously verify or find bugs in software. It’s designed for C and C++, but it’s just an interpreter for LLVM bitcode combined with theorem prover backends, so it can work with bitcode generated by `ldc2`. One catch is that it needs a compatible bitcode port of the D runtime to run normal D code. I’m still interested in getting KLEE to work with normal D code, but for now I’ve done some experiments with `-betterC` D. + +### How KLEE works + +What makes KLEE special is its support for two kinds of variables: concrete and symbolic. Concrete variables are just like the normal variables in normal code: they have a deterministic value at any given point in the program. On the other hand, symbolic variables contain a bundle of logical constraints instead of values. Take this code: + +``` +int x = klee_int("x"); +klee_assume(x >= 0); +if (x > 42) +{ + doA(x); +} +else +{ + doB(x); + assert (3 * x != 21); +} +``` + +`klee_int("x")` creates a symbolic integer that will be called “`x`” in output reports. Initially it has no contraints and can imply any value that a 32b signed integer can have. `klee_assume(x >= 0)` tells KLEE to add `x >= 0` as a constraint, so now we’re only analysing the code for non-negative 32b signed integers. On hitting the `if`, KLEE checks if both branches are possible. Sure enough, `x > 42` can be true or false even with the constraint `x >= 0`, so KLEE has to _fork_. We now have two processes being interpreted on the VM: one executing `doA()` while `x` holds the constraints `x >= 0, x > 42`, and another executing `doB()` while `x` holds the contraints `x >= 0, x <= 42`. The second process will hit the `assert` statement, and KLEE will try to prove or disprove `3 * x != 21` using the assumptions `x >= 0, x <= 42` — in this case it will disprove it and report a bug with `x = 7` as a crashing example. + +### First steps + +Here’s a toy example just to get things working. Suppose we have a function that makes an assumption for a performance optimisation. Thankfully the assumption is made explicit with `assert` and is documented with a comment. Is the assumption valid? + +``` +int foo(int x) +{ + // 17 is a prime number, so let's use it as a sentinel value for an awesome optimisation + assert (x * x != 17); + // ... + return x; +} +``` + +Here’s a KLEE test rig. The KLEE function declarations and the `main()` entry point need to have `extern(C)` linkage, but anything else can be normal D code as long as it compiles under `-betterC`: + +``` +extern(C): + +int klee_int(const(char*) name); + +int main() +{ + int x = klee_int("x"); + foo(x); + return 0; +} +``` + +It turns out there’s just one (frustrating) complication with running `-betterC` D under KLEE. In D, `assert` is handled specially by the compiler. By default, it throws an `Error`, but for compatibility with KLEE, I’m using the `-checkaction=C` flag. In C, `assert` is usually a macro that translates to code that calls some backend implementation. That implementation isn’t standardised, so of course various C libraries work differently. `ldc2` actually has built-in logic for implementing `-checkaction=C` correctly depending on the C library used. + +KLEE uses a port of [uClibc][2], which translates `assert()` to a four-parameter `__assert()` function, which conflicts with the three-parameter `__assert()` function in other implementations. `ldc2` uses LLVM’s (target) `Triple` type for choosing an `assert()` implementation configuration, but that doesn’t recognise uClibc. As a hacky workaround, I’m telling `ldc2` to compile for Musl, which “tricks” it into using an `__assert_fail()` implementation that KLEE happens to support as well. I’ve opened [an issue report][3]. + +Anyway, if we put all that code above into a file, we can compile it to KLEE-ready bitcode like this: + +``` +ldc2 -g -checkaction=C -mtriple=x86_64-linux-musl -output-bc -betterC -c first.d +``` + +`-g` is optional, but adds debug information that can be useful for later analysis. The KLEE developers recommend disabling compiler optimisations and letting KLEE do its own optimisations instead. + +Now to run KLEE: + +``` +$ klee first.bc +KLEE: output directory is "/tmp/klee-out-1" +KLEE: Using Z3 solver backend +warning: Linking two modules of different target triples: klee_int.bc' is 'x86_64-pc-linux-gnu' whereas 'first.bc' is 'x86_64--linux-musl' + +KLEE: ERROR: first.d:4: ASSERTION FAIL: x * x != 17 +KLEE: NOTE: now ignoring this error at this location + +KLEE: done: total instructions = 35 +KLEE: done: completed paths = 2 +KLEE: done: generated tests = 2 +``` + +Straight away, KLEE has found two execution paths through the program: a happy path, and a path that fails the assertion. Let’s see the results: + +``` +$ ls klee-last/ +assembly.ll +info +messages.txt +run.istats +run.stats +run.stats-journal +test000001.assert.err +test000001.kquery +test000001.ktest +test000002.ktest +warnings.txt +``` + +Here’s the example that triggers the happy path: + +``` +$ ktest-tool klee-last/test000002.ktest +ktest file : 'klee-last/test000002.ktest' +args : ['first.bc'] +num objects: 1 +object 0: name: 'x' +object 0: size: 4 +object 0: data: b'\x00\x00\x00\x00' +object 0: hex : 0x00000000 +object 0: int : 0 +object 0: uint: 0 +object 0: text: .... +``` + +Here’s the example that causes an assertion error: + +``` +$ cat klee-last/test000001.assert.err +Error: ASSERTION FAIL: x * x != 17 +File: first.d +Line: 4 +assembly.ll line: 32 +Stack: + #000000032 in _D5first3fooFiZi () at first.d:4 + #100000055 in main (=1, =94262044506880) at first.d:16 +$ ktest-tool klee-last/test000001.ktest +ktest file : 'klee-last/test000001.ktest' +args : ['first.bc'] +num objects: 1 +object 0: name: 'x' +object 0: size: 4 +object 0: data: b'\xe9&\xd33' +object 0: hex : 0xe926d333 +object 0: int : 869476073 +object 0: uint: 869476073 +object 0: text: .&.3 +``` + +So, KLEE has deduced that when `x` is 869476073, `x * x` does a 32b overflow to 17 and breaks the code. + +It’s overkill for this simple example, but `run.istats` can be opened with [KCachegrind][4] to view things like call graphs and source code coverage. (Unfortunately, coverage stats can be misleading because correct code won’t ever hit boundary check code inserted by the compiler.) + +### MurmurHash preimage + +Here’s a slightly more useful example. D currently uses 32b MurmurHash3 as its standard non-cryptographic hash function. What if we want to find strings that hash to a given special value? In general, we can solve problems like this by asserting that something doesn’t exist (i.e., a string that hashes to a given value) and then challenging the theorem prover to prove us wrong with a counterexample. + +Unfortunately, we can’t just use `hashOf()` directly without the runtime, but we can copy [the hash code from the runtime source][5] into its own module, and then import it into a test rig like this: + +``` +import dhash; + +extern(C): + +void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); +int klee_assume(ulong condition); + +int main() +{ + // Create a buffer for 8-letter strings and let KLEE manage it symbolically + char[8] s; + klee_make_symbolic(s.ptr, s.sizeof, "s"); + + // Constrain the string to be letters from a to z for convenience + foreach (j; 0..s.length) + { + klee_assume(s[j] > 'a' && s[j] <= 'z'); + } + + assert (dHash(cast(ubyte[])s) != 0xdeadbeef); + return 0; +} +``` + +Here’s how to compile and run it. Because we’re not checking correctness, we can use `-boundscheck=off` for a slight performance boost. It’s also worth enabling KLEE’s optimiser. + +``` +$ ldc2 -g -boundscheck=off -checkaction=C -mtriple=x86_64-linux-musl -output-bc -betterC -c dhash.d dhash_klee.d +$ llvm-link -o dhash_test.bc dhash.bc dhash_klee.bc +$ klee -optimize dhash_test.bc +``` + +It takes just over 4s: + +``` +$ klee-stats klee-last/ +------------------------------------------------------------------------- +| Path | Instrs| Time(s)| ICov(%)| BCov(%)| ICount| TSolver(%)| +------------------------------------------------------------------------- +|klee-last/| 168| 4.37| 87.50| 50.00| 160| 99.95| +------------------------------------------------------------------------- +``` + +And it actually works: + +``` +$ ktest-tool klee-last/test000001.ktest +ktest file : 'klee-last/test000001.ktest' +args : ['dhash_test.bc'] +num objects: 1 +object 0: name: 's' +object 0: size: 8 +object 0: data: b'psgmdxvq' +object 0: hex : 0x7073676d64787671 +object 0: int : 8175854546265273200 +object 0: uint: 8175854546265273200 +object 0: text: psgmdxvq +$ rdmd --eval 'writef("%x\n", hashOf("psgmdxvq"));' +deadbeef +``` + +For comparison, here’s a simple brute force version in plain D: + +``` +import std.stdio; + +void main() +{ + char[8] buffer; + + bool find(size_t idx) + { + if (idx == buffer.length) + { + auto hash = hashOf(buffer[]); + if (hash == 0xdeadbeef) + { + writeln(buffer[]); + return true; + } + return false; + } + + foreach (char c; 'a'..'z') + { + buffer[idx] = c; + auto is_found = find(idx + 1); + if (is_found) return true; + } + + return false; + } + + find(0); +} +``` + +This takes ~17s: + +``` +$ ldc2 -O3 -boundscheck=off hash_brute.d +$ time ./hash_brute +aexkaydh + +real 0m17.398s +user 0m17.397s +sys 0m0.001s +$ rdmd --eval 'writef("%x\n", hashOf("aexkaydh"));' +deadbeef +``` + +The constraint solver implementation is simpler to write, but is still faster because it can automatically do smarter things than calculating hashes of strings from scratch every iteration. + +### Binary search + +Now for an example of testing and debugging. Here’s an implementation of [binary search][6]: + +``` +bool bsearch(const(int)[] haystack, int needle) +{ + while (haystack.length) + { + auto mid_idx = haystack.length / 2; + if (haystack[mid_idx] == needle) return true; + if (haystack[mid_idx] < needle) + { + haystack = haystack[mid_idx..$]; + } + else + { + haystack = haystack[0..mid_idx]; + } + } + return false; +} +``` + +Does it work? Here’s a test rig: + +``` +extern(C): + +void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); +int klee_range(int begin, int end, const(char*) name); +int klee_assume(ulong condition); + +int main() +{ + // Making an array arr and an x to find in it. + // This time we'll also parameterise the array length. + // We have to apply klee_make_symbolic() to the whole buffer because of limitations in KLEE. + int[8] arr_buffer; + klee_make_symbolic(arr_buffer.ptr, arr_buffer.sizeof, "a"); + int len = klee_range(0, arr_buffer.length+1, "len"); + auto arr = arr_buffer[0..len]; + // Keeping the values in [0, 32) makes the output easier to read. + // (The binary-friendly limit 32 is slightly more efficient than 30.) + int x = klee_range(0, 32, "x"); + foreach (j; 0..arr.length) + { + klee_assume(arr[j] >= 0); + klee_assume(arr[j] < 32); + } + + // Make the array sorted. + // We don't have to actually sort the array. + // We can just tell KLEE to constrain it to be sorted. + foreach (j; 1..arr.length) + { + klee_assume(arr[j - 1] <= arr[j]); + } + + // Test against simple linear search + bool has_x = false; + foreach (a; arr[]) + { + has_x |= a == x; + } + + assert (bsearch(arr, x) == has_x); + + return 0; +} +``` + +When run in KLEE, it keeps running for a long, long time. How do we know it’s doing anything? By default KLEE writes stats every 1s, so we can watch the live progress in another terminal: + +``` +$ watch klee-stats --print-more klee-last/ +Every 2.0s: klee-stats --print-more klee-last/ + +--------------------------------------------------------------------------------------------------------------------- +| Path | Instrs| Time(s)| ICov(%)| BCov(%)| ICount| TSolver(%)| States| maxStates| Mem(MB)| maxMem(MB)| +--------------------------------------------------------------------------------------------------------------------- +|klee-last/| 5834| 637.27| 79.07| 68.75| 172| 100.00| 22| 22| 24.51| 24| +--------------------------------------------------------------------------------------------------------------------- +``` + +`bsearch()` should be pretty fast, so we should see KLEE discovering new states rapidly. But instead it seems to be stuck. [At least one fork of KLEE has heuristics for detecting infinite loops][7], but plain KLEE doesn’t. There are timeout and batching options for making KLEE work better with code that might have infinite loops, but let’s just take another look at the code. In particular, the loop condition: + +``` +while (haystack.length) +{ + // ... +} +``` + +Binary search is supposed to reduce the search space by about half each iteration. `haystack.length` is an unsigned integer, so the loop must terminate as long as it goes down every iteration. Let’s rewrite the code slightly so we can verify if that’s true: + +``` +bool bsearch(const(int)[] haystack, int needle) +{ + while (haystack.length) + { + auto mid_idx = haystack.length / 2; + if (haystack[mid_idx] == needle) return true; + const(int)[] next_haystack; + if (haystack[mid_idx] < needle) + { + next_haystack = haystack[mid_idx..$]; + } + else + { + next_haystack = haystack[0..mid_idx]; + } + // This lets us verify that the search terminates + assert (next_haystack.length < haystack.length); + haystack = next_haystack; + } + return false; +} +``` + +Now KLEE can find the bug! + +``` +$ klee -optimize bsearch.bc +KLEE: output directory is "/tmp/klee-out-2" +KLEE: Using Z3 solver backend +warning: Linking two modules of different target triples: klee_range.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' + +warning: Linking two modules of different target triples: memset.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' + +KLEE: ERROR: bsearch.d:18: ASSERTION FAIL: next_haystack.length < haystack.length +KLEE: NOTE: now ignoring this error at this location + +KLEE: done: total instructions = 2281 +KLEE: done: completed paths = 42 +KLEE: done: generated tests = 31 +``` + +Using the failing example as input and stepping through the code, it’s easy to find the problem: + +``` +/// ... +if (haystack[mid_idx] < needle) +{ + // If mid_idx == 0, next_haystack is the same as haystack + // Nothing changes, so the loop keeps repeating + next_haystack = haystack[mid_idx..$]; +} +/// ... +``` + +Thinking about it, the `if` statement already excludes `haystack[mid_idx]` from being `needle`, so there’s no reason to include it in `next_haystack`. Here’s the fix: + +``` +// The +1 matters +next_haystack = haystack[mid_idx+1..$]; +``` + +But is the code correct now? Terminating isn’t enough; it needs to get the right answer, of course. + +``` +$ klee -optimize bsearch.bc +KLEE: output directory is "/tmp/kee-out-3" +KLEE: Using Z3 solver backend +warning: Linking two modules of different target triples: klee_range.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' + +warning: Linking two modules of different target triples: memset.bc' is 'x86_64-pc-linux-gnu' whereas 'bsearch.bc' is 'x86_64--linux-musl' + +KLEE: done: total instructions = 3152 +KLEE: done: completed paths = 81 +KLEE: done: generated tests = 81 +``` + +In just under 7s, KLEE has verified every possible execution path reachable with arrays of length from 0 to 8. Note, that’s not just coverage of individual code lines, but coverage of full pathways through the code. KLEE hasn’t ruled out stack corruption or integer overflows with large arrays, but I’m pretty confident the code is correct now. + +KLEE has generated test cases that trigger each path, which we can keep and use as a faster-than-7s regression test suite. Trouble is, the output from KLEE loses all type information and isn’t in a convenient format: + +``` +$ ktest-tool klee-last/test000042.ktest +ktest file : 'klee-last/test000042.ktest' +args : ['bsearch.bc'] +num objects: 3 +object 0: name: 'a' +object 0: size: 32 +object 0: data: b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' +object 0: hex : 0x0000000000000000000000000000000001000000100000000000000000000000 +object 0: text: ................................ +object 1: name: 'x' +object 1: size: 4 +object 1: data: b'\x01\x00\x00\x00' +object 1: hex : 0x01000000 +object 1: int : 1 +object 1: uint: 1 +object 1: text: .... +object 2: name: 'len' +object 2: size: 4 +object 2: data: b'\x06\x00\x00\x00' +object 2: hex : 0x06000000 +object 2: int : 6 +object 2: uint: 6 +object 2: text: .... +``` + +But we can write our own pretty-printing code and put it at the end of the test rig: + +``` +char[256] buffer; +char* output = buffer.ptr; +output += sprintf(output, "TestCase(["); +foreach (a; arr[]) +{ + output += sprintf(output, "%d, ", klee_get_value_i32(a)); +} +sprintf(output, "], %d, %s),\n", klee_get_value_i32(x), klee_get_value_i32(has_x) ? "true".ptr : "false".ptr); +fputs(buffer.ptr, stdout); +``` + +Ugh, that would be just one format call with D’s `%(` array formatting specs. The output needs to be buffered up and printed all at once to stop output from different parallel executions getting mixed up. `klee_get_value_i32()` is needed to get a concrete example from a symbolic variable (remember that a symbolic variable is just a bundle of constraints). + +``` +$ klee -optimize bsearch.bc > tests.d +... +$ # Sure enough, 81 test cases +$ wc -l tests.d +81 tests.d +$ # Look at the first 10 +$ head tests.d +TestCase([], 0, false), +TestCase([0, ], 0, true), +TestCase([16, ], 1, false), +TestCase([0, ], 1, false), +TestCase([0, 0, ], 0, true), +TestCase([0, 0, ], 1, false), +TestCase([1, 16, ], 1, true), +TestCase([0, 0, 0, ], 0, true), +TestCase([16, 16, ], 1, false), +TestCase([1, 16, ], 3, false), +``` + +Nice! An autogenerated regression test suite that’s better than anything I would write by hand. This is my favourite use case for KLEE. + +### Change counting + +One last example: + +In Australia, coins come in 5c, 10c, 20c, 50c, $1 (100c) and $2 (200c) denominations. So you can make 70c using 14 5c coins, or using a 50c coin and a 20c coin. Obviously, fewer coins is usually more convenient. There’s a simple [greedy algorithm][8] to make a small pile of coins that adds up to a given value: just keep adding the biggest coin you can to the pile until you’ve reached the target value. It turns out this trick is optimal — at least for Australian coins. Is it always optimal for any set of coin denominations? + +The hard thing about testing optimality is that you don’t know what the correct optimal values are without a known-good algorithm. Without a constraints solver, I’d compare the output of the greedy algorithm with some obviously correct brute force optimiser, run over all possible cases within some small-enough limit. But with KLEE, we can use a different approach: comparing the greedy solution to a non-deterministic solution. + +The greedy algorithm takes the list of coin denominations and the target value as input, so (like in the previous examples) we make those symbolic. Then we make another symbolic array that represents an assignment of coin counts to each coin denomination. We don’t specify anything about how to generate this assignment, but we constrain it to be a valid assignment that adds up to the target value. It’s [non-deterministic][9]. Then we just assert that the total number of coins in the non-deterministic assignment is at least the number of coins needed by the greedy algorithm, which would be true if the greedy algorithm were universally optimal. Finally we ask KLEE to prove the program correct or incorrect. + +Here’s the code: + +``` +// Greedily break value into coins of values in denominations +// denominations must be in strictly decreasing order +int greedy(const(int[]) denominations, int value, int[] coins_used_output) +{ + int num_coins = 0; + foreach (j; 0..denominations.length) + { + int num_to_use = value / denominations[j]; + coins_used_output[j] = num_to_use; + num_coins += num_to_use; + value = value % denominations[j]; + } + return num_coins; +} + +extern(C): + +void klee_make_symbolic(void* addr, size_t nbytes, const(char*) name); +int klee_int(const(char*) name); +int klee_assume(ulong condition); +int klee_get_value_i32(int expr); + +int main(int argc, char** argv) +{ + enum kNumDenominations = 6; + int[kNumDenominations] denominations, coins_used; + klee_make_symbolic(denominations.ptr, denominations.sizeof, "denominations"); + + // We're testing the algorithm itself, not implementation issues like integer overflow + // Keep values small + foreach (d; denominations) + { + klee_assume(d >= 1); + klee_assume(d <= 1024); + } + // Make the smallest denomination 1 so that all values can be represented + // This is just for simplicity so we can focus on optimality + klee_assume(denominations[$-1] == 1); + + // Greedy algorithm expects values in descending order + foreach (j; 1..denominations.length) + { + klee_assume(denominations[j-1] > denominations[j]); + } + + // What we're going to represent + auto value = klee_int("value"); + + auto num_coins = greedy(denominations[], value, coins_used[]); + + // The non-deterministic assignment + int[kNumDenominations] nd_coins_used; + klee_make_symbolic(nd_coins_used.ptr, nd_coins_used.sizeof, "nd_coins_used"); + + int nd_num_coins = 0, nd_value = 0; + foreach (j; 0..kNumDenominations) + { + klee_assume(nd_coins_used[j] >= 0); + klee_assume(nd_coins_used[j] <= 1024); + nd_num_coins += nd_coins_used[j]; + nd_value += nd_coins_used[j] * denominations[j]; + } + + // Making the assignment valid is 100% up to KLEE + klee_assume(nd_value == value); + + // If we find a counterexample, dump it and fail + if (nd_num_coins < num_coins) + { + import core.stdc.stdio; + + puts("Counterexample found."); + + puts("Denominations:"); + foreach (ref d; denominations) + { + printf("%d ", klee_get_value_i32(d)); + } + printf("\nValue: %d\n", klee_get_value_i32(value)); + + void printAssignment(const ref int[kNumDenominations] coins) + { + foreach (j; 0..kNumDenominations) + { + printf("%d * %dc\n", klee_get_value_i32(coins[j]), klee_get_value_i32(denominations[j])); + } + } + + printf("Greedy \"optimum\": %d\n", klee_get_value_i32(num_coins)); + printAssignment(coins_used); + + printf("Better assignment for %d total coins:\n", klee_get_value_i32(nd_num_coins)); + printAssignment(nd_coins_used); + assert (false); + } + + return 0; +} +``` + +And here’s the counterexample it found after 14s: + +``` +Counterexample found. +Denominations: +129 12 10 3 2 1 +Value: 80 +Greedy "optimum": 9 +0 * 129c +6 * 12c +0 * 10c +2 * 3c +1 * 2c +0 * 1c +Better assignment for 8 total coins: +0 * 129c +0 * 12c +8 * 10c +0 * 3c +0 * 2c +0 * 1c +``` + +Note that this isn’t proven to be the new optimum; it’s just a witness that the greedy algorithm isn’t always optimal. There’s a well-known [dynamic programming][10] [solution][11] that always works. + +### What’s next? + +As I said, I’m interesting in getting this to work with full D code. I’m also interested in using [one of the floating point forks of KLEE][12] on some D because floating point is much harder to test thoroughly than integer and string code. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/05/28/d_and_klee.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://klee.github.io/ +[2]: https://www.uclibc.org/ +[3]: https://github.com/ldc-developers/ldc/issues/3078 +[4]: https://kcachegrind.github.io/html/Home.html +[5]: https://github.com/dlang/druntime/blob/4ad638f61a9b4a98d8ed6eb9f9429c0ef6afc8e3/src/core/internal/hash.d#L670 +[6]: https://www.calhoun.io/lets-learn-algorithms-an-intro-to-binary-search/ +[7]: https://github.com/COMSYS/SymbolicLivenessAnalysis +[8]: https://en.wikipedia.org/wiki/Greedy_algorithm +[9]: http://people.clarkson.edu/~alexis/PCMI/Notes/lectureB03.pdf +[10]: https://www.algorithmist.com/index.php/Dynamic_Programming +[11]: https://www.topcoder.com/community/competitive-programming/tutorials/dynamic-programming-from-novice-to-advanced/ +[12]: https://github.com/srg-imperial/klee-float diff --git a/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md b/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md new file mode 100644 index 0000000000..026b5d8e81 --- /dev/null +++ b/sources/talk/20190528 Managed WAN and the cloud-native SD-WAN.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managed WAN and the cloud-native SD-WAN) +[#]: via: (https://www.networkworld.com/article/3398476/managed-wan-and-the-cloud-native-sd-wan.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Managed WAN and the cloud-native SD-WAN +====== +The motivation for WAN transformation is clear, today organizations require: improved internet access and last mile connectivity, additional bandwidth and a reduction in the WAN costs. +![Gerd Altmann \(CC0\)][1] + +In recent years, a significant number of organizations have transformed their wide area network (WAN). Many of these organizations have some kind of cloud-presence across on-premise data centers and remote site locations. + +The vast majority of organizations that I have consulted with have over 10 locations. And it is common to have headquarters in both the US and Europe, along with remote site locations spanning North America, Europe, and Asia. + +A WAN transformation project requires this diversity to be taken into consideration when choosing the best SD-WAN vendor to satisfy both; networking and security requirements. Fundamentally, SD-WAN is not just about physical connectivity, there are many more related aspects. + +**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** + +### Motivations for transforming the WAN + +The motivation for WAN transformation is clear: Today organizations prefer improved internet access and last mile connectivity, additional bandwidth along with a reduction in the WAN costs. Replacing Multiprotocol Label Switching (MPLS) with SD-WAN has of course been the main driver for the SD-WAN evolution, but it is only a single piece of the jigsaw puzzle. + +Many SD-WAN vendors are quickly brought to their knees when they try to address security and gain direct internet access from remote site locations. The problem is how to ensure optimized cloud access that is secure, has improved visibility and predictable performance without the high costs associated with MPLS? SD-WAN is not just about connecting locations. Primarily, it needs to combine many other important network and security elements into one seamless worldwide experience. + +According to a recent report from [Cato Networks][3] into enterprise IT managers, a staggering 85% will confront use cases in 2019 that are poorly addressed or outright ignored by SD-WAN. Examples includes providing secure, Internet access from any location (50%) and improving visibility into and control over mobile access to cloud applications, such as Office 365 (46%). + +### Issues with traditional SD-WAN vendors + +First and foremost, SD-WAN unable to address the security challenges that arise during the WAN transformation. Such security challenges include protection against malware, ransomware and implementing the necessary security policies. Besides, there is a lack of visibility that is required to police the mobile users and remote site locations accessing resources in the public cloud. + +To combat this, organizations have to purchase additional equipment. There has always been and will always be a high cost associated with buying such security appliances. Furthermore, the additional tools that are needed to protect the remote site locations increase the network complexity and reduce visibility. Let’s us not forget that the variety of physical appliances require talented engineers for design, deployment and maintenance. + +There will often be a single network-cowboy. This means the network and security configuration along with the design essentials are stored in the mind of the engineer, not in a central database from where the knowledge can be accessed if the engineer leaves his or her employment. + +The physical appliance approach to SD-WAN makes it hard, if not impossible, to accommodate for the future. If the current SD-WAN vendors continue to focus just on connecting the devices with the physical appliances, they will have limited ability to accommodate for example, with the future of network IoT devices. With these factors in mind what are the available options to overcome the SD-WAN shortcomings? + +One can opt for a do it yourself (DIY) solution, or a managed service, which can fall into the category of telcos, with the improvements of either co-managed or self-managed service categories. + +### Option 1: The DIY solution + +Firstly DIY, from the experience of trying to stitch together a global network, this is not only costly but also complex and is a very constrained approach to the network transformation. We started with physical appliances decades ago and it was sufficient to an extent. The reason it worked was that it suited the requirements of the time, but our environment has changed since then. Hence, we need to accommodate these changes with the current requirements. + +Even back in those days, we always had a breachable perimeter. The perimeter-approach to networking and security never really worked and it was just a matter of time before the bad actor would penetrate the guarded walls. + +Securing a global network involves more than just firewalling the devices. A solid security perimeter requires URL filtering, anti-malware and IPS to secure the internet traffic. If you try to deploy all these functions in a single device, such as, unified threat management (UTM), you will hit scaling problems. As a result, you will be left with appliance sprawl. + +Back in my early days as an engineer, I recall stitching together a global network with a mixture of security and network appliances from a variety of vendors. It was me and just two others who used to get the job done on time and for a production network, our uptime levels were superior to most. + +However, it involved too many late nights, daily flights to our PoPs and of course the major changes required a forklift. A lot of work had to be done at that time, which made me want to push some or most of the work to a 3rd party. + +### Option 2: The managed service solution + +Today, there is a growing need for the managed service approach to SD-WAN. Notably, it simplifies the network design, deployment and maintenance activities while offloading the complexity, in line with what most CIOs are talking about today. + +Managed service provides a number of benefits, such as the elimination of backhauling to centralized cloud connectors or VPN concentrators. Evidently, backhauling is never favored for a network architect. More than often it will result in increased latency, congested links, internet chokepoints, and last-mile outages. + +Managed service can also authenticate mobile users at the local communication hub and not at a centralized point which would increase the latency. So what options are available when considering a managed service? + +### Telcos: An average service level + +Let’s be honest, telcos have a mixed track record and enterprises rely on them with caution. Essentially, you are building a network with 3rd party appliances and services that put the technical expertise outside of the organization. + +Secondly, the telco must orchestrate, monitor and manage numerous technical domains which are likely to introduce further complexity. As a result, troubleshooting requires close coordination with the suppliers which will have an impact on the customer experience. + +### Time equals money + +To resolve a query could easily take two or three attempts. It’s rare that you will get to the right person straight away. This eventually increases the time to resolve problems. Even for a minor feature change, you have to open tickets. Hence, with telcos, it increases the time required to solve a problem. + +In addition, it takes time to make major network changes such as opening new locations, which could take up to 45 days. In the same report mentioned above, 71% of the respondents are frustrated with the telco customer-service-time to resolve the problems, 73% indicated that deploying new locations requires at least 15 days and 47% claimed that “high bandwidth costs” is the biggest frustration while working with telcos. + +When it comes to lead times for projects, an engineer does not care. Does a project manager care if you have an optimum network design? No, many don’t, most just care about the timeframes. During my career, now spanning 18 years, I have never seen comments from any of my contacts saying “you must adhere to your project manager’s timelines”. + +However, out of the experience, the project managers have their ways and lead times do become a big part of your daily job. So as an engineer, 45-day lead time will certainly hit your brand hard, especially if you are an external consultant. + +There is also a problem with bandwidth costs. Telcos need to charge due to their complexity. There is always going to be a series of problems when working with them. Let’s face it, they offer an average service level. + +### Co-management and self-service management + +What is needed is a service that equips with the visibility and control of DIY to managed services. This, ultimately, opens the door to co-management and self-service management. + +Co-management allows both the telco and enterprise to make changes to the WAN. Then we have the self-service management of WAN that allows the enterprises to have sole access over the aspect of their network. + +However, these are just sticking plasters covering up the flaws. We need a managed service that not only connects locations but also synthesizes the site connectivity, along with security, mobile access, and cloud access. + +### Introducing the cloud-native approach to SD-WAN + +There should be a new style of managed services that combines the best of both worlds. It should offer the uptime, predictability and reach of the best telcos along with the cost structure and versatility of cloud providers. All such requirements can be met by what is known as the cloud-native carrier. + +Therefore, we should be looking for a platform that can connect and secure all the users and resources at scale, no matter where they are positioned. Eventually, such a platform will limit the costs and increase the velocity and agility. + +This is what a cloud-native carrier can offer you. You could say it’s a new kind of managed service, which is what enterprises are now looking for. A cloud-native carrier service brings the best of cloud services to the world of networking. This new style of managed service brings to SD-WAN the global reach, self-service, and agility of the cloud with the ability to easily migrate from MPLS. + +In summary, a cloud-native carrier service will improve global connectivity to on-premises and cloud applications, enable secure branch to internet access, and both securely and optimally integrate cloud datacenters. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][4]** + +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/3398476/managed-wan-and-the-cloud-native-sd-wan.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://images.techhive.com/images/article/2017/03/network-wan-100713693-large.jpg +[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html +[3]: https://www.catonetworks.com/news/digital-transformation-survey +[4]: /contributor-network/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md b/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md new file mode 100644 index 0000000000..8f6f46b6f2 --- /dev/null +++ b/sources/talk/20190528 Moving to the Cloud- SD-WAN Matters.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Moving to the Cloud? SD-WAN Matters!) +[#]: via: (https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Moving to the Cloud? SD-WAN Matters! +====== + +![istock][1] + +This is the first in a two-part blog series that will explore how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The focus for this installment will be on automating secure IPsec connectivity and intelligently steering traffic to cloud providers. + +Over the past several years we’ve seen a major shift in data center strategies where enterprise IT organizations are shifting applications and workloads to cloud, whether private or public. More and more, enterprises are leveraging software as-a-service (SaaS) applications and infrastructure as-a-service (IaaS) cloud services from leading providers like [Amazon AWS][3], [Google Cloud][4], [Microsoft Azure][5] and [Oracle Cloud Infrastructure][6]. This represents a dramatic shift in enterprise data traffic patterns as fewer and fewer applications are hosted within the walls of the traditional corporate data center. + +There are several drivers for the shift to IaaS cloud services and SaaS apps, but business agility tops the list for most enterprises. The traditional IT model for provisioning and deprovisioning applications is rigid and inflexible and is no longer able to keep pace with changing business needs. + +According to [LogicMonitor’s Cloud Vision 2020][7] study, more than 80 percent of enterprise workloads will run in the cloud by 2020 with more than 40 percent running on public cloud platforms. This major shift in the application consumption model is having a huge [impact on organizations and infrastructure][8]. A recent article entitled “[How Amazon Web Services is luring banks to the cloud][9],” published by CNBC, reported that some companies already have completely migrated all of their applications and IT workloads to public cloud infrastructures. An interesting fact is that while many enterprises must comply with stringent regulatory compliance mandates such as PCI-DSS or HIPAA, they still have made the move to the cloud. This tells us two things – the maturity of using public cloud services and the trust these organizations have in using them is at an all-time high. Again, it is all about speed and agility – without compromising performance, security and reliability. + +### **Is there a direct correlation between moving to the cloud and adopting SD-WAN?** + +As the cloud enables businesses to move faster, an SD-WAN architecture where top-down business intent is the driver is critical to ensuring success, especially when branch offices are geographically distributed across the globe. Traditional router-centric WAN architectures were never designed to support today’s cloud consumption model for applications in the most efficient way. With a conventional router-centric WAN approach, access to applications residing in the cloud means traversing unnecessary hops, resulting in wasted bandwidth, additional cost, added latency and potentially higher packet loss. In addition, under the existing, traditional WAN model where management tends to be rigid, complex network changes can be lengthy, whether setting up new branches or troubleshooting performance issues. This leads to inefficiencies and a costly operational model. Therefore, enterprises greatly benefit from taking a business-first WAN approach toward achieving greater agility in addition to realizing substantial CAPEX and OPEX savings. + +A business-driven SD-WAN platform is purpose-built to tackle the challenges inherent to the traditional router-centric model and more aptly support today’s cloud consumption model. This means application policies are defined based on business intent, connecting users securely and directly to applications where ever they reside without unnecessary extra hops or security compromises. For example, if the application is hosted in the cloud and is trusted, a business-driven SD-WAN can automatically connect users to it without backhauling traffic to a POP or HQ data center. Now, in general this traffic is usually going across an internet link which, on its own, may not be secure. However, the right SD-WAN platform will have a unified stateful firewall built-in for local internet breakout allowing only branch-initiated sessions to enter the branch and providing the ability to service chain traffic to a cloud-based security service if necessary, before forwarding it to its final destination. If the application is moved and becomes hosted by another provider or perhaps back to a company’s own data center, traffic must be intelligently redirected, wherever the application is being hosted. Without automation and embedded machine learning, dynamic and intelligent traffic steering is impossible. + +### **A closer look at how the Silver Peak EdgeConnect™ SD-WAN edge platform addresses these challenges: ** + +**Automate traffic steering and connectivity to cloud providers** + +An [EdgeConnect][10] virtual instance is easily spun up in any of the [leading cloud providers][11] through their respective marketplaces. For an SD-WAN to intelligently steer traffic to its destination, it requires insights into both HTTP and HTTPS traffic; it must be able to identify apps on the first packet received in order to steer traffic to the right destination in accordance with business intent. This is critical capability because once a TCP connection is NAT’d with a public IP address, it cannot be switched thus it can’t be re-routed once a connection is established. So, the ability of EdgeConnect to identify, classify and automatically steer traffic based on the first packet – and not the second or tenth packet – to the correct destination will assure application SLAs, minimize wasting expensive bandwidth and deliver the highest quality of experience. + +Another critical capability is automatic performance optimization. Irrespective of which link the traffic ends up traversing based on business intent and the unique requirements of the application, EdgeConnect automatically optimizes application performance without human intervention by correcting for out of order packets using Packet Order Correction (POC) or even under high latency conditions that can be related to distance or other issues. This is done using adaptive Forward Error Correction (FEC) and tunnel bonding where a virtual tunnel is created, resulting in a single logical overlay that traffic can be dynamically moved between the different paths as conditions change with each underlay WAN service. In this [lightboard video][12], Dinesh Fernando, a technical marketing engineer at Silver Peak, explains how EdgeConnect automates tunnel creation between sites and cloud providers, how it simplifies data transfers between multi-clouds, and how it improves application performance. + +If your business is global and increasingly dependent on the cloud, the business-driven EdgeConnect SD-WAN edge platform enables seamless multi-cloud connectivity, turning the network into a business accelerant. EdgeConnect delivers: + + 1. A consistent deployment from the branch to the cloud, extending the reach of the SD-WAN into virtual private cloud environments + 2. Multi-cloud flexibility, making it easier to initiate and distribute resources across multiple cloud providers + 3. Investment protection by confidently migrating on premise IT resources to any combination of the leading public cloud platforms, knowing their cloud-hosted instances will be fully supported by EdgeConnect + + + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397921/moving-to-the-cloud-sd-wan-matters.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-899678028-100797709-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/company/tech-partners/cloud/aws +[4]: https://www.silver-peak.com/company/tech-partners/cloud/google-cloud +[5]: https://www.silver-peak.com/company/tech-partners/cloud/microsoft-azure +[6]: https://www.silver-peak.com/company/tech-partners/cloud/oracle-cloud +[7]: https://www.logicmonitor.com/resource/the-future-of-the-cloud-a-cloud-influencers-survey/?utm_medium=pr&utm_source=businesswire&utm_campaign=cloudsurvey +[8]: http://www.networkworld.com/article/3152024/lan-wan/in-the-age-of-digital-transformation-why-sd-wan-plays-a-key-role-in-the-transition.html +[9]: http://www.cnbc.com/2016/11/30/how-amazon-web-services-is-luring-banks-to-the-cloud.html?__source=yahoo%257cfinance%257cheadline%257cheadline%257cstory&par=yahoo&doc=104135637 +[10]: https://www.silver-peak.com/products/unity-edge-connect +[11]: https://www.silver-peak.com/company/tech-partners?strategic_partner_type=69 +[12]: https://www.silver-peak.com/resource-center/automate-connectivity-to-cloud-networking-with-sd-wan diff --git a/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md b/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md new file mode 100644 index 0000000000..07f9eea10c --- /dev/null +++ b/sources/talk/20190528 With Cray buy, HPE rules but does not own the supercomputing market.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (With Cray buy, HPE rules but does not own the supercomputing market) +[#]: via: (https://www.networkworld.com/article/3397087/with-cray-buy-hpe-rules-but-does-not-own-the-supercomputing-market.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +With Cray buy, HPE rules but does not own the supercomputing market +====== +In buying supercomputer vendor Cray, HPE has strengthened its high-performance-computing technology, but serious competitors remain. +![Cray Inc.][1] + +Hewlett Packard Enterprise was already the leader in the high-performance computing (HPC) sector before its announced acquisition of supercomputer maker Cray earlier this month. Now it has a commanding lead, but there are still competitors to the giant. + +The news that HPE would shell out $1.3 billion to buy the company came just as Cray had announced plans to build three of the biggest systems yet — all exascale, and all with the same deployment time of 2021. + +Sales had been slowing for HPC systems, but our government, with its endless supply of money, came to the rescue, throwing hundreds of millions at Cray for systems to be built at Lawrence Berkeley National Laboratory, Argonne National Laboratory and Oak Ridge National Laboratory. + +**[ Read also:[How to plan a software-defined data-center network][2] ]** + +And HPE sees a big revenue opportunity in HPC, a market that was $2 billion in 1990 and now nearly $30 billion, according to Steve Conway, senior vice president with Hyperion Research, which follows the HPC market. HPE thinks the HPC market will grow to $35 billion by 2021, and it hopes to earn a big chunk of that pie. + +“They were solidly in the lead without Cray. They were already in a significant lead over the No. 2 company, Dell. This adds to their lead and gives them access to very high end of market, especially government supercomputers that sell for $300 million to $600 million each,” said Conway. + +He’s not exaggerating. Earlier this month the U.S. Department of Energy announced a contract with Cray to build Frontier, an exascale supercomputer at Oak Ridge National Laboratory, sometime in 2021, with a $600 million price tag. Frontier will be powered by AMD Epyc processors and Radeon GPUs, which must have them doing backflips at AMD. + +With Cray, HPE is sitting on a lot of technology for the supercomputing and even the high-end, non-HPC market. It had the ProLiant business, the bulk of server sales (and proof the Compaq acquisition wasn’t such a bad idea), Integrity NonStop mission-critical servers, the SGI business it acquired in in 2016, plus a variety running everything from Arm to Xeon Scalable processors. + +Conway thinks all of those technologies fit in different spaces, so he doubts HPE will try to consolidate any of it. All HPE has said so far is it will keep the supercomputer products it has now under the Cray business unit. + +But the company is still getting something it didn’t have. “It takes a certain kind of technical experience [to do HPC right] and only a few companies able to play at that level. Before this deal, HPE was not one of them,” said Conway. + +And in the process, HPE takes Cray away from its many competitors: IBM, Lenovo, Dell/EMC, Huawei (well, not so much now), Super Micro, NEC, Hitachi, Fujitsu, and Atos. + +“[The acquisition] doesn’t fundamentally change things because there’s still enough competitors that buyers can have competitive bids. But it’s gotten to be a much bigger market,” said Conway. + +Cray sells a lot to government, but Conway thinks there is a new opportunity in the ever-expanding AI race. “Because HPC is indispensable at the forefront of AI, there is a new area for expanding the market,” he said. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397087/with-cray-buy-hpe-rules-but-does-not-own-the-supercomputing-market.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://images.idgesg.net/images/article/2018/06/the_cray_xc30_piz_daint_system_at_the_swiss_national_supercomputing_centre_via_cray_inc_3x2_978x652-100762113-large.jpg +[2]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md b/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md new file mode 100644 index 0000000000..c1e0493e63 --- /dev/null +++ b/sources/talk/20190529 Cisco security spotlights Microsoft Office 365 e-mail phishing increase.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco security spotlights Microsoft Office 365 e-mail phishing increase) +[#]: via: (https://www.networkworld.com/article/3398925/cisco-security-spotlights-microsoft-office-365-e-mail-phishing-increase.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco security spotlights Microsoft Office 365 e-mail phishing increase +====== +Cisco blog follows DHS Cybersecurity and Infrastructure Security Agency (CISA) report detailing risks around Office 365 and other cloud services +![weerapatkiatdumrong / Getty Images][1] + +It’s no secret that if you have a cloud-based e-mail service, fighting off the barrage of security issues has become a maddening daily routine. + +The leading e-mail service – in [Microsoft’s Office 365][2] package – seems to be getting the most attention from those attackers hellbent on stealing enterprise data or your private information via phishing attacks. Amazon and Google see their share of phishing attempts in their cloud-based services as well. + +**[ Also see[What to consider when deploying a next generation firewall][3]. | Get regularly scheduled insights by [signing up for Network World newsletters][4]. ]** + +But attackers are crafting and launching phishing campaigns targeting Office 365 users, [wrote][5] Ben Nahorney, a Threat Intelligence Analyst focused on covering the threat landscape for Cisco Security in a blog focusing on the Office 365 phishing issue. + +Nahorney wrote of research from security vendor [Agari Data][6], that found over the last few quarters, there has been a steady increase in the number of phishing emails impersonating Microsoft. While Microsoft has long been the most commonly impersonated brand, it now accounts for more than half of all brand impersonations seen in the last quarter. + +Recently cloud security firm Avanan wrote in its [annual phishing report][7], one in every 99 emails is a phishing attack, using malicious links and attachments as the main vector. “Of the phishing attacks we analyzed, 25 percent bypassed Office 365 security, a number that is likely to increase as attackers design new obfuscation methods that take advantage of zero-day vulnerabilities on the platform,” Avanan wrote. + +The attackers attempt to steal a user’s login credentials with the goal of taking over accounts. If successful, attackers can often log into the compromised accounts, and perform a wide variety of malicious activity: Spread malware, spam and phishing emails from within the internal network; carry out tailored attacks such as spear phishing and [business email compromise][8] [a long-standing business scam that uses spear-phishing, social engineering, identity theft, e-mail spoofing], and target partners and customers, Nahorney wrote. + +Nahorney wrote that at first glance, this may not seem very different than external email-based attacks. However, there is one critical distinction: The malicious emails sent are now coming from legitimate accounts. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][9] ]** + +“For the recipient, it’s often even someone that they know, eliciting trust in a way that would not necessarily be afforded to an unknown source. To make things more complicated, attackers often leverage ‘conversation hijacking,’ where they deliver their payload by replying to an email that’s already located in the compromised inbox,” Nahorney stated. + +The methods used by attackers to gain access to an Office 365 account are fairly straightforward, Nahorney wrote. + +“The phishing campaigns usually take the form of an email from Microsoft. The email contains a request to log in, claiming the user needs to reset their password, hasn’t logged in recently or that there’s a problem with the account that needs their attention. A URL is included, enticing the reader to click to remedy the issue,” Nahorney wrote. + +Once logged in, nefarious activities can go on unnoticed as the attacker has what look like authorized credentials. + +“This gives the attacker time for reconnaissance: a chance to observe and plan additional attacks. Nor will this type of attack set off a security alert in the same way something like a brute-force attack against a webmail client will, where the attacker guesses password after password until they get in or are detected,” Nahorney stated. + +Nahorney suggested the following steps customers can take to protect email: + + * Use multi-factor authentication. If a login attempt requires a secondary authorization before someone is allowed access to an inbox, this will stop many attackers, even with phished credentials. + * Deploy advanced anti-phishing technologies. Some machine-learning technologies can use local identity and relationship modeling alongside behavioral analytics to spot deception-based threats. + * Run regular phishing exercises. Regular, mandated phishing exercises across the entire organization will help to train employees to recognize phishing emails, so that they don’t click on malicious URLs, or enter their credentials into malicious website. + + + +### Homeland Security flags Office 365, other cloud email services + +The U.S. government, too, has been warning customers of Office 365 and other cloud-based email services that they should be on alert for security risks. The US Department of Homeland Security's Cybersecurity and Infrastructure Security Agency (CISA) this month [issued a report targeting][10] Office 365 and other cloud services saying: + +“Organizations that used a third party have had a mix of configurations that lowered their overall security posture (e.g., mailbox auditing disabled, unified audit log disabled, multi-factor authentication disabled on admin accounts). In addition, the majority of these organizations did not have a dedicated IT security team to focus on their security in the cloud. These security oversights have led to user and mailbox compromises and vulnerabilities.” + +The agency also posted remediation suggestions including: + + * Enable unified audit logging in the Security and Compliance Center. + * Enable mailbox auditing for each user. + * Ensure Azure AD password sync is planned for and configured correctly, prior to migrating users. + * Disable legacy email protocols, if not required, or limit their use to specific users. + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398925/cisco-security-spotlights-microsoft-office-365-e-mail-phishing-increase.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://images.idgesg.net/images/article/2019/05/cso_phishing_social_engineering_security_threat_by_weerapatkiatdumrong_gettyimages-489433130_3x2_2400x1600-100796450-large.jpg +[2]: https://docs.microsoft.com/en-us/office365/securitycompliance/security-roadmap +[3]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://blogs.cisco.com/security/office-365-phishing-threat-of-the-month +[6]: https://www.agari.com/ +[7]: https://www.avanan.com/hubfs/2019-Global-Phish-Report.pdf +[8]: https://www.networkworld.com/article/3195072/fbi-ic3-vile-5b-business-e-mail-scam-continues-to-breed.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[10]: https://www.us-cert.gov/ncas/analysis-reports/AR19-133A +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md b/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md new file mode 100644 index 0000000000..f608db970c --- /dev/null +++ b/sources/talk/20190529 Nvidia launches edge computing platform for AI processing.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Nvidia launches edge computing platform for AI processing) +[#]: via: (https://www.networkworld.com/article/3397841/nvidia-launches-edge-computing-platform-for-ai-processing.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Nvidia launches edge computing platform for AI processing +====== +EGX platform goes to the edge to do as much processing there as possible before sending data upstream to major data centers. +![Leo Wolfert / Getty Images][1] + +Nvidia is launching a new platform called EGX Platform designed to bring real-time artificial intelligence (AI) to edge networks. The idea is to put AI computing closer to where sensors collect data before it is sent to larger data centers. + +The edge serves as a buffer to data sent to data centers. It whittles down the data collected and only sends what is relevant up to major data centers for processing. This can mean discarding more than 90% of data collected, but the trick is knowing which data to keep and which to discard. + +“AI is required in this data-driven world,” said Justin Boitano, senior director for enterprise and edge computing at Nvidia, on a press call last Friday. “We analyze data near the source, capture anomalies and report anomalies back to the mothership for analysis.” + +**[ Now read[20 hot jobs ambitious IT pros should shoot for][2]. ]** + +Boitano said we are hitting crossover where there is more compute at edge than cloud because more work needs to be done there. + +EGX comes from 14 server vendors in a range of form factors, combining AI with network, security and storage from Mellanox. Boitano said that the racks will fit in any industry-standard rack, so they will fit into edge containers from the likes of Vapor IO and Schneider Electric. + +EGX uses Nvidia’s low-power Jetson Nano processor, but also all the way up to Nvidia T4 processors that can deliver more than 10,000 trillion operations per second (TOPS) for real-time speech recognition and other real-time AI tasks. + +Nvdia is working on software stack called Nvidia Edge Stack that can be updated constantly, and the software runs in containers, so no reboots are required, just a restart of the container. EGX runs enterprise-grade Kubernetes container platforms like Red Hat Openshift. + +Edge Stack is optimized software that includes Nvidia drivers, a CUDA Kubernetes plugin, a CUDA container runtime, CUDA-X libraries and containerized AI frameworks and applications, including TensorRT, TensorRT Inference Server and DeepStream. + +The company is boasting more than 40 early adopters, including BMW Group Logistics, which uses EGX and its own Isaac robotic platforms to handle increasingly complex logistics with real-time efficiency. + +Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3397841/nvidia-launches-edge-computing-platform-for-ai-processing.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://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_by_leowolfert_gettyimages-689799380_2400x1600-100788464-large.jpg +[2]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[3]: https://www.facebook.com/NetworkWorld/ +[4]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md b/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md new file mode 100644 index 0000000000..383fac66ca --- /dev/null +++ b/sources/talk/20190529 Satellite-based internet possible by year-end, says SpaceX.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Satellite-based internet possible by year-end, says SpaceX) +[#]: via: (https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Satellite-based internet possible by year-end, says SpaceX +====== +Amazon, Tesla-associated SpaceX and OneWeb are emerging as just some of the potential suppliers of a new kind of data-friendly satellite internet service that could bring broadband IoT connectivity to most places on Earth. +![Getty Images][1] + +With SpaceX’s successful launch of an initial array of broadband-internet-carrying satellites last week, and Amazon’s surprising posting of numerous satellite engineering-related job openings on its [job board][2] this month, one might well be asking if the next-generation internet space race is finally getting going. (I first wrote about [OneWeb’s satellite internet plans][3] it was concocting with Airbus four years ago.) + +This new batch of satellite-driven internet systems, if they work and are eventually switched on, could provide broadband to most places, including previously internet-barren locations, such as rural areas. That would be good for high-bandwidth, low-latency remote-internet of things (IoT) and increasingly important edge-server connections for verticals like oil and gas and maritime. [Data could even end up getting stored in compliance-friendly outer space, too][4]. Leaky ground-based connections, also, perhaps a thing of the past. + +Of the principal new internet suppliers, SpaceX has gotten farthest along. That’s in part because it has commercial impetus. It needed to create payload for its numerous rocket projects. The Tesla electric-car-associated company (the two firms share materials science) has not only launched its first tranche of 60 satellites for its own internet constellation, called Starlink, but also successfully launched numerous batches (making up the full constellation of 75 satellites) for Iridium’s replacement, an upgraded constellation called Iridium NEXT. + +[The time of 5G is almost here][5] + +Potential competitor OneWeb launched its first six Airbus-built satellites in February. [It has plans for 900 more][6]. SpaceX has been approved for 4,365 more by the FCC, and Project Kuiper, as Amazon’s space internet project is known, wants to place 3,236 satellites in orbit, according to International Telecommunication Union filings [discovered by _GeekWire_][7] earlier this year. [Startup LeoSat, which I wrote about last year, aims to build an internet backbone constellation][8]. Facebook, too, is exploring [space-delivered internet][9]. + +### Why the move to space? + +Laser technical progress, where data is sent in open, free space, rather than via a restrictive, land-based cable or via traditional radio paths, is partly behind this space-internet rush. “Bits travel faster in free space than in glass-fiber cable,” LeoSat explained last year. Additionally, improving microprocessor tech is also part of the mix. + +One important difference from existing older-generation satellite constellations is that this new generation of internet satellites will be located in low Earth orbit (LEO). Initial Starlink satellites will be placed at about 350 miles above Earth, with later launches deployed at 710 miles. + +There’s an advantage to that. Traditional satellites in geostationary orbit, or GSO, have been deployed about 22,000 miles up. That extra distance versus LEO introduces latency and is one reason earlier generations of Internet satellites are plagued by slow round-trip times. Latency didn’t matter when GSO was introduced in 1964, and commercial satellites, traditionally, have been pitched as one-way video links, such as are used by sporting events for broadcast, and not for data. + +And when will we get to experience these new ISPs? “Starlink is targeted to offer service in the Northern U.S. and Canadian latitudes after six launches,” [SpaceX says on its website][10]. Each launch would deliver about 60 satellites. “SpaceX is targeting two to six launches by the end of this year.” + +Global penetration of the “populated world” could be obtained after 24 launches, it thinks. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398940/space-internet-maybe-end-of-year-says-spacex.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/network_iot_world-map_us_globe_nodes_global-100777483-large.jpg +[2]: https://www.amazon.jobs/en/teams/projectkuiper +[3]: https://www.itworld.com/article/2938652/space-based-internet-starts-to-get-serious.html +[4]: https://www.networkworld.com/article/3200242/data-should-be-stored-data-in-space-firm-says.html +[5]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[6]: https://www.airbus.com/space/telecommunications-satellites/oneweb-satellites-connection-for-people-all-over-the-globe.html +[7]: https://www.geekwire.com/2019/amazon-lists-scores-jobs-bellevue-project-kuiper-broadband-satellite-operation/ +[8]: https://www.networkworld.com/article/3328645/space-data-backbone-gets-us-approval.html +[9]: https://www.networkworld.com/article/3338081/light-based-computers-to-be-5000-times-faster.html +[10]: https://www.starlink.com/ +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md b/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md new file mode 100644 index 0000000000..9b65a6c8dd --- /dev/null +++ b/sources/talk/20190529 Survey finds SD-WANs are hot, but satisfaction with telcos is not.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Survey finds SD-WANs are hot, but satisfaction with telcos is not) +[#]: via: (https://www.networkworld.com/article/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Survey finds SD-WANs are hot, but satisfaction with telcos is not +====== +A recent survey of over 400 IT executives by Cato Networks found that legacy telcos might be on the outside looking in for SD-WANs. +![istock][1] + +This week SD-WAN vendor Cato Networks announced the results of its [Telcos and the Future of the WAN in 2019 survey][2]. The study was a mix of companies of all sizes, with 42% being enterprise-class (over 2,500 employees). More than 70% had a network with more than 10 locations, and almost a quarter (24%) had over 100 sites. All of the respondents have a cloud presence, and almost 80% have at least two data centers. The survey had good geographic diversity, with 57% of respondents coming from the U.S. and 24% from Europe. + +Highlights of the survey include the following key findings: + +## **SD-WANs are hot but not a panacea to all networking challenges** + +The survey found that 44% of respondents have already deployed or will deploy an SD-WAN within the next 12 months. This number is up sharply from 25% when Cato ran the survey a year ago. Another 33% are considering SD-WAN but have no immediate plans to deploy. The primary drivers for the evolution of the WAN are improved internet access (46%), increased bandwidth (39%), improved last-mile availability (38%) and reduced WAN costs (37%). It’s good to see cost savings drop to fourth in motivation, since there is so much more to SD-WAN. + +[The time of 5G is almost here][3] + +It’s interesting that the majority of respondents believe SD-WAN alone can’t address all challenges facing the WAN. A whopping 85% stated they would be confronting issues not addressed by SD-WAN alone. This includes secure, local internet breakout, improved visibility, and control over mobile access to cloud apps. This indicates that customers are looking for SD-WAN to be the foundation of the WAN but understand that other technologies need to be deployed as well. + +## **Telco dissatisfaction is high** + +The traditional telco has been a point of frustration for network professionals for years, and the survey spelled that out loud and clear. Prior to being an analyst, I held a number of corporate IT positions and found telcos to be the single most frustrating group of companies to deal with. The problem was, there was no choice. If you need MPLS services, you need a telco. The same can’t be said for SD-WANs, though; businesses have more choices. + +Respondents to the survey ranked telco service as “average.” It’s been well documented that we are now in the customer-experience era and “good enough” service is no longer good enough. Regarding pricing, 54% gave telcos a failing grade. Although price isn’t everything, this will certainly open the door to competitive SD-WAN vendors. Respondents gave the highest marks for overall experience to SaaS providers, followed by cloud computing suppliers. Global telcos scored the lowest of all vendor types. + +A look deeper explains the frustration level. The network is now mission-critical for companies, but 48% stated they are able to reach the support personnel with the right expertise to solve a problem only on a second attempt. No retailer, airline, hotel or other type of company could survive this, but telco customers had no other options for years. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][4] ]** + +Another interesting set of data points is the speed at which telcos address customer needs. Digital businesses compete on speed, but telco process is the antithesis of fast. Moves, adds and changes take at least one business day for half of the respondents. Also, 70% indicated that opening a new location takes 15 days, and 38% stated it requires 45 days or more. + +## **Security is now part of SD-WAN** + +The use of broadband, cloud access and other trends raise the bar on security for SD-WAN, and the survey confirmed that respondents are skeptical that SD-WANs could address these issues. Seventy percent believe SD-WANs can’t address malware/ransomware, and 49% don’t think SD-WAN helps with enforcing company policies on mobile users. Because of this, network professionals are forced to buy additional security tools from other vendors, but that can drive up complexity. SD-WAN vendors that have intrinsic security capabilities can use that as a point of differentiation. + +## **Managed services are critical to the growth of SD-WANs** + +The survey found that 75% of respondents are using some kind of managed service provider, versus only 25% using an appliance vendor. This latter number was 32% last year. I’m not surprised by this shift and expect it to continue. Legacy WANs were inefficient but straightforward to deploy. D-WANs are highly agile and more cost-effective, but complexity has gone through the roof. Network engineers need to factor in cloud connectivity, distributed security, application performance, broadband connectivity and other issues. Managed services can help businesses enjoy the benefits of SD-WAN while masking the complexity. + +Despite the desire to use an MSP, respondents don’t want to give up total control. Eighty percent stated they preferred self-service or co-managed models. This further explains the shift away from telcos, since they typically work with fully managed models. + +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/3398478/survey-finds-sd-wans-are-hot-but-satisfaction-with-telcos-is-not.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://images.idgesg.net/images/article/2018/02/istock-465661573-100750447-large.jpg +[2]: https://www.catonetworks.com/news/digital-transformation-survey/ +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190601 HPE Synergy For Dummies.md b/sources/talk/20190601 HPE Synergy For Dummies.md new file mode 100644 index 0000000000..1b7ddbe2e7 --- /dev/null +++ b/sources/talk/20190601 HPE Synergy For Dummies.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (HPE Synergy For Dummies) +[#]: via: (https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html) +[#]: author: (HPE https://www.networkworld.com/author/Michael-Cooney/) + +HPE Synergy For Dummies +====== + +![istock/venimo][1] + +Business must move fast today to keep up with competitive forces. That means IT must provide an agile — anytime, anywhere, any workload — infrastructure that ensures growth, boosts productivity, enhances innovation, improves the customer experience, and reduces risk. + +A composable infrastructure helps organizations achieve these important objectives that are difficult — if not impossible — to achieve via traditional means, such as the ability to do the following: + + * Deploy quickly with simple flexing, scaling, and updating + * Run workloads anywhere — on physical servers, on virtual servers, or in containers + * Operate any workload upon which the business depends, without worrying about infrastructure resources or compatibility + * Ensure the infrastructure is able to provide the right service levels so the business can stay in business + + + +In other words, IT must inherently become part of the fabric of products and services that are rapidly innovated at every company, with an anytime, anywhere, any workload infrastructure. + +**The anytime paradigm** + +For organizations that seek to embrace DevOps, collaboration is the cultural norm. Development and operations staff work side‐by‐side to support software across its entire life cycle, from initial idea to production support. + +To provide DevOps groups — as well as other stakeholders — the IT infrastructure required at the rate at which it is demanded, enterprise IT must increase its speed, agility, and flexibility to enable people anytime composition and re‐composition of resources. Composable infrastructure enables this anytime paradigm. + +**The anywhere ability** + +Bare metal and virtualized workloads are just two application foundations that need to be supported in the modern data center. Today, containers are emerging as a compelling construct, providing significant benefits for certain kinds of workloads. Unfortunately, with traditional infrastructure approaches, IT needs to build out custom, unique infrastructure to support them, at least until an infrastructure is deployed that can seamlessly handle physical, virtual, and container‐based workloads. + +Each environment would need its own hardware and software and might even need its own staff members supporting it. + +Composable infrastructure provides an environment that supports the ability to run physical, virtual, or containerized workloads. + +**Support any workload** + +Do you have a legacy on‐premises application that you have to keep running? Do you have enterprise resource planning (ERP) software that currently powers your business but that will take ten years to phase out? At the same time, do you have an emerging DevOps philosophy under which you’d like to empower developers to dynamically create computing environments as a part of their development efforts? + +All these things can be accomplished simultaneously on the right kind of infrastructure. Composable infrastructure enables any workload to operate as a part of the architecture. + +**HPE Synergy** + +HPE Synergy brings to life the architectural principles of composable infrastructure. It is a single, purpose-built platform that reduces operational complexity for workloads and increases operational velocity for applications and services. + +Download a copy of the [HPE Synergy for Dummies eBook][2] to learn how to: + + * Infuse the IT architecture with the ability to enable agility, flexibility, and speed + * Apply composable infrastructure concepts to support both traditional and cloud-native applications + * Deploy HPE Synergy infrastructure to revolutionize workload support in the data center + + + +Also, you will find more information about HPE Synergy [here][3]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399618/hpe-synergy-for-dummies.html + +作者:[HPE][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://images.idgesg.net/images/article/2019/06/istock-1026657600-100798064-large.jpg +[2]: https://www.hpe.com/us/en/resources/integrated-systems/synergy-for-dummies.html +[3]: http://hpe.com/synergy diff --git a/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md b/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md new file mode 100644 index 0000000000..97eb611ef8 --- /dev/null +++ b/sources/talk/20190601 True Hyperconvergence at Scale- HPE Simplivity With Composable Fabric.md @@ -0,0 +1,28 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric) +[#]: via: (https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html) +[#]: author: (HPE https://www.networkworld.com/author/Michael-Cooney/) + +True Hyperconvergence at Scale: HPE Simplivity With Composable Fabric +====== + +Many hyperconverged solutions only focus on software-defined storage. However, many networking functions and technologies can be consolidated for simplicity and scale in the data center. This video describes how HPE SimpliVity with Composable Fabric gives organizations the power to run any virtual machine anywhere, anytime. Read more about HPE SimpliVity [here][1]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399619/true-hyperconvergence-at-scale-hpe-simplivity-with-composable-fabric.html + +作者:[HPE][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://hpe.com/info/simplivity diff --git a/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md b/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md new file mode 100644 index 0000000000..6d955c6485 --- /dev/null +++ b/sources/talk/20190602 IoT Roundup- New research on IoT security, Microsoft leans into IoT.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT Roundup: New research on IoT security, Microsoft leans into IoT) +[#]: via: (https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT Roundup: New research on IoT security, Microsoft leans into IoT +====== +Verizon sets up widely available narrow-band IoT service, while most Americans think IoT manufacturers should ensure their products protect personal information. +As with any technology whose use is expanding at such speed, it can be tough to track exactly what’s going on in the [IoT][1] world – everything from basic usage numbers to customer attitudes to more in-depth slices of the market is constantly changing. Fortunately, the month of May brought several new pieces of research to light, which should help provide at least a partial outline of what’s really happening in IoT. + +### Internet of things polls + +Not all of the news is good. An IPSOS Mori poll performed on behalf of the Internet Society and Consumers International (respectively, an umbrella organization for open development and Internet use and a broad-based consumer advocacy group) found that, despite the skyrocketing numbers of smart devices in circulation around the world, more than half of users in large parts of the western world don’t trust those devices to safeguard their privacy. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][2] + * [What is edge computing and how it’s changing the network][3] + * [Most powerful Internet of Things companies][4] + * [10 Hot IoT startups to watch][5] + * [The 6 ways to make money in IoT][6] + * [What is digital twin technology? [and why it matters]][7] + * [Blockchain, service-centric networking key to IoT success][8] + * [Getting grounded in IoT networking and security][9] + * [Building IoT-ready networks must become a priority][10] + * [What is the Industrial IoT? [And why the stakes are so high]][11] + + + +While almost 70 percent of respondents owned connected devices, 55 percent said they didn’t feel their personal information was adequately protected by manufacturers. A further 28 percent said they had avoided using connected devices – smart home, fitness tracking and similar consumer gadgetry – primarily because they were concerned over privacy issues, and a whopping 85 percent of Americans agreed with the argument that manufacturers had a responsibility to produce devices that protected personal information. + +Those concerns are understandable, according to data from the Ponemon Institute, a tech-research organization. Its survey of corporate risk and security personnel, released in early May, found that there have been few concerted efforts to limit exposure to IoT-based security threats, and that those threats are sharply on the rise when compared to past years, with the percentage of organizations that had experienced a data breach related to unsecured IoT devices rising from 15 percent in fiscal 2017 to 26 percent in fiscal 2019. + +Beyond a lack of organizational wherewithal to address those threats, part of the problem in some verticals is technical. Security vendor Forescout said earlier this month that its research showed 40 percent of all healthcare IT environments had more than 20 different operating systems, and more than 30 percent had more than 100 – hardly an ideal situation for smooth patching and updating. + +To continue reading this article register now + +[Get Free Access][12] + +[Learn More][13] Existing Users [Sign In][12] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398607/iot-roundup-new-research-on-iot-security-microsoft-leans-into-iot.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[2]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[5]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[6]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[7]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[8]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[9]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[10]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[11]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[12]: javascript:// +[13]: /learn-about-insider/ diff --git a/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md b/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md new file mode 100644 index 0000000000..cc5aa9db7c --- /dev/null +++ b/sources/talk/20190603 It-s time for the IoT to -optimize for trust.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (It’s time for the IoT to 'optimize for trust') +[#]: via: (https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +It’s time for the IoT to 'optimize for trust' +====== +If we can't trust the internet of things (IoT) to gather accurate data and use it appropriately, IoT adoption and innovation are likely to suffer. +![Bose][1] + +One of the strengths of internet of things (IoT) technology is that it can do so many things well. From smart toothbrushes to predictive maintenance on jetliners, the IoT has more use cases than you can count. The result is that various IoT uses cases require optimization for particular characteristics, from cost to speed to long life, as well as myriad others. + +But in a recent post, "[How the internet of things will change advertising][2]" (which you should definitely read), the always-insightful Stacy Higginbotham tossed in a line that I can’t stop thinking about: “It's crucial that the IoT optimizes for trust." + +**[ Read also: Network World's[corporate guide to addressing IoT security][3] ]** + +### Trust is the IoT's most important attribute + +Higginbotham was talking about optimizing for trust as opposed to clicks, but really, trust is more important than just about any other value in the IoT. It’s more important than bandwidth usage, more important than power usage, more important than cost, more important than reliability, and even more important than security and privacy (though they are obviously related). In fact, trust is the critical factor in almost every aspect of the IoT. + +Don’t believe me? Let’s take a quick look at some recent developments in the field: + +For one thing, IoT devices often don’t take good care of the data they collect from you. Over 90% of data transactions on IoT devices are not fully encrypted, according to a new [study from security company Zscaler][4]. The [problem][5], apparently, is that many companies have large numbers of consumer-grade IoT devices on their networks. In addition, many IoT devices are attached to the companies’ general networks, and if that network is breached, the IoT devices and data may also be compromised. + +In some cases, ownership of IoT data can raise surprisingly serious trust concerns. According to [Kaiser Health News][6], smartphone sleep apps, as well as smart beds and smart mattress pads, gather amazingly personal information: “It knows when you go to sleep. It knows when you toss and turn. It may even be able to tell when you’re having sex.” And while companies such as Sleep Number say they don’t share the data they gather, their written privacy policies clearly state that they _can_. + +### **Lack of trust may lead to new laws** + +In California, meanwhile, "lawmakers are pushing for new privacy rules affecting smart speakers” such as the Amazon Echo. According to the _[LA Times][7]_ , the idea is “to ensure that the devices don’t record private conversations without permission,” requiring a specific opt-in process. Why is this an issue? Because consumers—and their elected representatives—don’t trust that Amazon, or any IoT vendor, will do the right thing with the data it collects from the IoT devices it sells—perhaps because it turns out that thousands of [Amazon employees have been listening in on what Alexa users are][8] saying to their Echo devices. + +The trust issues get even trickier when you consider that Amazon reportedly considered letting Alexa listen to users even without a wake word like “Alexa” or “computer,” and is reportedly working on [wearable devices designed to read human emotions][9] from listening to your voice. + +“The trust has been breached,” said California Assemblyman Jordan Cunningham (R-Templeton) to the _LA Times_. + +As critics of the bill ([AB 1395][10]) point out, the restrictions matter because voice assistants require this data to improve their ability to correctly understand and respond to requests. + +### **Some first steps toward increasing trust** + +Perhaps recognizing that the IoT needs to be optimized for trust so that we are comfortable letting it do its job, Amazon recently introduced a new Alexa voice command: “[Delete what I said today][11].” + +Moves like that, while welcome, will likely not be enough. + +For example, a [new United Nations report][12] suggests that “voice assistants reinforce harmful gender stereotypes” when using female-sounding voices and names like Alexa and Siri. Put simply, “Siri’s ‘female’ obsequiousness—and the servility expressed by so many other digital assistants projected as young women—provides a powerful illustration of gender biases coded into technology products, pervasive in the technology sector and apparent in digital skills education.” I'm not sure IoT vendors are eager—or equipped—to tackle issues like that. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][13] + * [What is edge computing and how it’s changing the network][14] + * [Most powerful Internet of Things companies][15] + * [10 Hot IoT startups to watch][16] + * [The 6 ways to make money in IoT][17] + * [What is digital twin technology? [and why it matters]][18] + * [Blockchain, service-centric networking key to IoT success][19] + * [Getting grounded in IoT networking and security][20] + * [Building IoT-ready networks must become a priority][21] + * [What is the Industrial IoT? [And why the stakes are so high]][22] + + + +Join the Network World communities on [Facebook][23] and [LinkedIn][24] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399817/its-time-for-the-iot-to-optimize-for-trust.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/09/bose-sleepbuds-2-100771579-large.jpg +[2]: https://mailchi.mp/iotpodcast/stacey-on-iot-how-iot-changes-advertising?e=6bf9beb394 +[3]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[4]: https://www.zscaler.com/blogs/research/iot-traffic-enterprise-rising-so-are-threats +[5]: https://www.csoonline.com/article/3397044/over-90-of-data-transactions-on-iot-devices-are-unencrypted.html +[6]: https://khn.org/news/a-wake-up-call-on-data-collecting-smart-beds-and-sleep-apps/ +[7]: https://www.latimes.com/politics/la-pol-ca-alexa-google-home-privacy-rules-california-20190528-story.html +[8]: https://www.usatoday.com/story/tech/2019/04/11/amazon-employees-listening-alexa-customers/3434732002/ +[9]: https://www.bloomberg.com/news/articles/2019-05-23/amazon-is-working-on-a-wearable-device-that-reads-human-emotions +[10]: https://leginfo.legislature.ca.gov/faces/billTextClient.xhtml?bill_id=201920200AB1395 +[11]: https://venturebeat.com/2019/05/29/amazon-launches-alexa-delete-what-i-said-today-voice-command/ +[12]: https://unesdoc.unesco.org/ark:/48223/pf0000367416.page=1 +[13]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[14]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[15]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[16]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[17]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[18]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[19]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[20]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[21]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[22]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[23]: https://www.facebook.com/NetworkWorld/ +[24]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md b/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md new file mode 100644 index 0000000000..31d127e77d --- /dev/null +++ b/sources/talk/20190604 Data center workloads become more complex despite promises to the contrary.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data center workloads become more complex despite promises to the contrary) +[#]: via: (https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Data center workloads become more complex despite promises to the contrary +====== +The data center is shouldering a greater burden than ever, despite promises of ease and the cloud. +![gorodenkoff / Getty Images][1] + +Data centers are becoming more complex and still run the majority of workloads despite the promises of simplicity of deployment through automation and hyperconverged infrastructure (HCI), not to mention how the cloud was supposed to take over workloads. + +That’s the finding of the Uptime Institute's latest [annual global data center survey][2] (registration required). The majority of IT loads still run on enterprise data centers even in the face of cloud adoption, putting pressure on administrators to have to manage workloads across the hybrid infrastructure. + +**[ Learn[how server disaggregation can boost data center efficiency][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +With workloads like artificial intelligence (AI) and machine language coming to the forefront, that means facilities face greater power and cooling challenges, since AI is extremely processor-intensive. That puts strain on data center administrators and power and cooling vendors alike to keep up with the growth in demand. + +On top of it all, everyone is struggling to get enough staff with the right skills. + +### Outages, staffing problems, lack of public cloud visibility among top concerns + +Among the key findings of Uptime's report: + + * The large, privately owned enterprise data center facility still forms the bedrock of corporate IT and is expected to be running half of all workloads in 2021. + * The staffing problem affecting most of the data center sector has only worsened. Sixty-one percent of respondents said they had difficulty retaining or recruiting staff, up from 55% a year earlier. + * Outages continue to cause significant problems for operators. Just over a third (34%) of all respondents had an outage or severe IT service degradation in the past year, while half (50%) had an outage or severe IT service degradation in the past three years. + * Ten percent of all respondents said their most recent significant outage cost more than $1 million. + * A lack of visibility, transparency, and accountability of public cloud services is a major concern for enterprises that have mission-critical applications. A fifth of operators surveyed said they would be more likely to put workloads in a public cloud if there were more visibility. Half of those using public cloud for mission-critical applications also said they do not have adequate visibility. + * Improvements in data center facility energy efficiency have flattened out and even deteriorated slightly in the past two years. The average PUE for 2019 is 1.67. + * Rack power density is rising after a long period of flat or minor increases, causing many to rethink cooling strategies. + * Power loss was the single biggest cause of outages, accounting for one-third of outages. Sixty percent of respondents said their data center’s outage could have been prevented with better management/processes or configuration. + + + +Traditionally data centers are improving their reliability through "rigorous attention to power, infrastructure, connectivity and on-site IT replication," the Uptime report says. The solution, though, is pricy. Data center operators are getting distributed resiliency through active-active data centers where at least two active data centers replicate data to each other. Uptime found up to 40% of those surveyed were using this method. + +The Uptime survey was conducted in March and April of this year, surveying 1,100 end users in more than 50 countries and dividing them into two groups: the IT managers, owners, and operators of data centers and the suppliers, designers, and consultants that service the industry. + +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/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.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://images.idgesg.net/images/article/2019/05/cso_cloud_computing_backups_it_engineer_data_center_server_racks_connections_by_gorodenkoff_gettyimages-943065400_3x2_2400x1600-100796535-large.jpg +[2]: https://uptimeinstitute.com/2019-data-center-industry-survey-results +[3]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md b/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md new file mode 100644 index 0000000000..2f68bd6f59 --- /dev/null +++ b/sources/talk/20190604 Moving to the Cloud- SD-WAN Matters- Part 2.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Moving to the Cloud? SD-WAN Matters! Part 2) +[#]: via: (https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Moving to the Cloud? SD-WAN Matters! Part 2 +====== + +![istock][1] + +This is the second installment of the blog series exploring how enterprises can realize the full transformation promise of the cloud by shifting to a business first networking model powered by a business-driven [SD-WAN][2]. The first installment explored automating secure IPsec connectivity and intelligently steering traffic to cloud providers. We also framed the direct correlation between moving to the cloud and adopting an SD-WAN. In this blog, we will expand upon several additional challenges that can be addressed with a business-driven SD-WAN when embracing the cloud: + +### Simplifying and automating security zone-based segmentation + +Securing cloud-first branches requires a robust multi-level approach that addresses following considerations: + + * Restricting outside traffic coming into the branch to sessions exclusively initiated by internal users with a built-in stateful firewall, avoiding appliance sprawl and lowering operational costs; this is referred to as the app whitelist model + * Encrypting communications between end points within the SD-WAN fabric and between branch locations and public cloud instances + * Service chaining traffic to a cloud-hosted security service like [Zscaler][3] for Layer 7 inspection and analytics for internet-bound traffic + * Segmenting traffic spanning the branch, WAN and data center/cloud + * Centralizing policy orchestration and automation of zone-based firewall, VLAN and WAN overlays + + + +A traditional device-centric WAN approach for security segmentation requires the time-consuming manual configuration of routers and/or firewalls on a device-by-device and site-by-site basis. This is not only complex and cumbersome, but it simply can’t scale to 100s or 1000s of sites. Anusha Vaidyanathan, director of product management at Silver Peak, explains how to automate end-to-end zone-based segmentation, emphasizing the advantages of a business-driven approach in this [lightboard video][4]. + +### Delivering the Highest Quality of Experience to IT teams + +The goal for enterprise IT is enabling business agility and increasing operational efficiency. The traditional router-centric WAN approach doesn’t provide the best quality of experience for IT as management and on-going network operations are manual and time consuming, device-centric, cumbersome, error-prone and inefficient. + +A business-driven SD-WAN such as the Silver Peak [Unity EdgeConnect™][5] unified SD-WAN edge platform centralizes the orchestration of business-driven policies. EdgeConnect automation, machine learning and open APIs easily integrate with third-party management tools and real-time visibility tools to deliver the highest quality of experience for IT, enabling them to reclaim nights and weekends. Manav Mishra, vice president of product management at Silver Peak, explains the latest Silver Peak innovations in this [lightboard video][6]. + +As enterprises become increasingly dependent on the cloud and embrace a multi-cloud strategy, they must address a number of new challenges: + + * A centralized approach to securely embracing the cloud and the internet + * How to extend the on-premise data center to a public cloud and migrating workloads between private and public cloud, taking application portability into account + * Deliver consistent high application performance and availability to hosted applications whether they reside in the data center, private or public clouds or are delivered as SaaS services + * A proactive way to quickly resolve complex issues that span the data center and cloud as well as multiple WAN transport services by harnessing the power of advanced visibility and analytics tools + + + +The business-driven EdgeConnect SD-WAN edge platform enables enterprise IT organizations to easily and consistently embrace the public cloud. Unified security and performance capabilities with automation deliver the highest quality of experience for both users and IT while lowering overall WAN expenditures. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398488/moving-to-the-cloud-sd-wan-matters-part-2.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/05/istock-909772962-100797711-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/company/tech-partners/zscaler +[4]: https://www.silver-peak.com/resource-center/how-to-create-sd-wan-security-zones-in-edgeconnect +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/resource-center/how-to-optimize-quality-of-experience-for-it-using-sd-wan diff --git a/sources/talk/20190604 Why Emacs.md b/sources/talk/20190604 Why Emacs.md new file mode 100644 index 0000000000..0d9b12ba1a --- /dev/null +++ b/sources/talk/20190604 Why Emacs.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why Emacs) +[#]: via: (https://saurabhkukade.github.io/Why-Emacs/) +[#]: author: (Saurabh Kukade http://saurabhkukade.github.io/) + +Why Emacs +====== +![Image of Emacs][1] + +> “Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish.” + +> -Neal Stephenson, “In the Beginning was the Command Line” + +### Introduction + +This is my first blog post about Emacs. I want to discuss step by step customization of Emacs for beginner. If you’re new to Emacs then you are in the right place, if you’re already familiar with Emacs then that is even better, I assure you that we will get to know many new things in here. + +Before getting into how to customize Emacs and what are the exciting features of Emacs I want to write about “why Emacs”. + +### Why Emacs? + +This was first question crossed my mind when one wise man asked me to try Emacs instead of VIM. Well, I am not writing this article to discuss a battle between two editors VIM and Emacs. That is a another story for another day. But Why Emacs? Well here are some things that justifies that Emacs is powerful and highly customizable. + +### 41 Years! + +Initial release year of Emacs is 1976 that means Emacs is standing and adapting changes from last 41 years. + +41 years of time for a software is huge and that makes Emacs is one of the best Software Engineering product. + +### Lisp (Emacs Lisp) + +If you are lisp programmer (lisper) then I don’t need to explain you. But for those who don’t know Lisp and its dialects like Scheme, Clojure then Lisp (and all dialects of Lips) is powerful programming language and it stands different from other languages because of its unique property of “Homoiconicity”. + +As Emacs is implemented in C and Emacs Lisp (Emacs Lisp is a dialect of the Lisp programming language) it makes Emacs what is because, + + * The simple syntax of Lisp, together with the powerful editing features made possible by that simple syntax, add up to a more convenient programming system than is practical with other languages. Lisp and extensible editors are made for each other. + + * The simplicity of Lisp syntax makes intelligent editing operations easier to implement, while the complexity of other languages discourages their users from implementing similar operations for them. + + + + +### Highly Customizable + +To any programmer, tools gives power and convenience for reading, writing and managing a code. + +Hence, if a tool is programmatic-ally customizable then that makes it even more powerful. + +Emacs has above property and in fact is itself one of best tool known for its flexibility and easy customization. Emacs provides basic commands and key configuration for editing a text. This commands and key-configuration are editable and extensible. + +Beside basic configuration, Emacs is not biased towards any specific language for customization. One can customize Emacs for any programming language or extend easily existing customization. + +Emacs provides the consistent environment for multiple programming languages, email, organizer (via org-mode), a shell/interpreter, note taking, and document writing. + +For customizing you don’t need to learn Emacs-lisp from scratch. You can use existing packages available and that’s it. Installing and managing packages in Emacs is easy, Emacs has in-built package manager for it. + +Customization is very portable, one just need to place a file or directory containing personal customization file(s) in the right place and it’s done for getting personal customization to new place. ## Huge platform Support + +Emacs supports Lisp, Ruby, Python, PHP, Java, Erlang, JavaScript, C, C++, Prolog, Tcl, AWK, PostScript, Clojure, Scala, Perl, Haskell, Elixir all of these languages and more like mysql, pgsql etc. Because of the powerful Lisp core, Emacs is easy to extend to add support for new languages if need to. + +Also one can use the built-in IRC client ERC along with BitlBee to connect to your favorite chat services, or use the Jabber package to hop on any XMPP service. + +### Org-mode + +No matter if you are programmer or not. Org mode is for everyone. Org mode lets you to plan projects and organize schedule. It can be also use for publish notes and documents to different formats, like LaTeX->pdf, html, and markdown. + +In fact, Org-mode is so awesome enough that many non-Emacs users started learn Emacs. + +### Final note + +There are number of reason to argue that Emacs is cool and awesome to use. But I just wanted you to give glimpse of why to try Emacs. In the upcoming post I will be writing step by step information to customize Emacs from scratch to awesome IDE. + +Thank you! + +Please don’t forget to comment your thoughts and suggestions below. + +-------------------------------------------------------------------------------- + +via: https://saurabhkukade.github.io/Why-Emacs/ + +作者:[Saurabh Kukade][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://saurabhkukade.github.io/ +[b]: https://github.com/lujun9972 +[1]: https://saurabhkukade.github.io/img/emacs.jpeg diff --git a/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md b/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md new file mode 100644 index 0000000000..29d2acd519 --- /dev/null +++ b/sources/talk/20190605 Cisco will use AI-ML to boost intent-based networking.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco will use AI/ML to boost intent-based networking) +[#]: via: (https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco will use AI/ML to boost intent-based networking +====== +Cisco explains how artificial intelligence and machine learning fit into a feedback loop that implements and maintain desired network conditions to optimize network performance for workloads using real-time data. +![xijian / Getty Images][1] + +Artificial Intelligence and machine learning are expected to be some of the big topics at next week’s Cisco Live event and the company is already talking about how those technologies will help drive the next generation of [Intent-Based Networking][2]. + +“Artificial intelligence will change how we manage networks, and it’s a change we need,” wrote John Apostolopoulos Cisco CTO and vice president of Enterprise Networking in a [blog][3] about how Cisco says these technologies impact the network. + +**[ Now see[7 free network tools you must have][4]. ]** + +AI is the next major step for networking capabilities, and while researchers have talked in the past about how great AI would be, now the compute power and algorithms exist to make it possible, Apostolopoulos told Network World. + +To understand how AI and ML can boost IBN, Cisco says it's necessary to understand four key factors an IBN environment needs: infrastructure, translation, activation and assurance. + +Infrastructure can be virtual or physical and include wireless access points, switches, routers, compute and storage. “To make the infrastructure do what we want, we use the translation function to convert the intent, or what we are trying to make the network accomplish, from a person or computer into the correct network and security policies. These policies then must be activated on the network,” Apostolopoulos said. + +The activation step takes the network and security polices and couples them with a deep understanding of the network infrastructure that includes both real-time and historic data about its behavior. It then activates or automates the policies across all of the network infrastructure elements, ideally optimizing for performance, reliability and security, Apostolopoulos wrote. + +Finally assurance maintains a continuous validation-and-verification loop. IBN improves on translation and assurance to form a valuable feedback loop about what’s going on in the network that wasn’t available before. ** ** + +Apostolopoulos used the example of an international company that wanted to set up a world-wide video all-hands meeting. Everyone on the call had to have high-quality, low-latency video, and also needed the capability to send high-quality video into the call when it was time for Q&A. + +“By applying machine learning and related machine reasoning, assurance can also sift through the massive amount of data related to such a global event to correctly identify if there are any problems arising. We can then get solutions to these issues – and even automatically apply solutions – more quickly and more reliably than before,” Apostolopoulos said. + +In this case, assurance could identify that the use of WAN bandwidth to certain sites is increasing at a rate that will saturate the network paths and could proactively reroute some of the WAN flows through alternative paths to prevent congestion from occurring, Apostolopoulos wrote. + +“In prior systems, this problem would typically only be recognized after the bandwidth bottleneck occurred and users experienced a drop in call quality or even lost their connection to the meeting. It would be challenging or impossible to identify the issue in real time, much less to fix it before it distracted from the experience of the meeting. Accurate and fast identification through ML and MR coupled with intelligent automation through the feedback loop is key to successful outcome.” + +Apostolopoulos said AI can accelerate the path from intent into translation and activation and then examine network and behavior data in the assurance step to make sure everything is working correctly. Activation uses the insights to drive more intelligent actions for improved performance, reliability and security, creating a cycle of network optimization. + +So what might an implementation of this look like? Applications that run on Cisco’s DNA Center may be the central component in an IBN environment. Introduced on 2017 as the heart of its IBN initiative, [Cisco DNA Center][5] features automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. + +“DNA Center can bring together AI and ML in a unified manner,” Apostolopoulos said. “It can store data from across the network and then customers can do AI and ML on that data.” + +Central to Cisco's push is being able to gather metadata about traffic as it passes without slowing the traffic, which is accomplished through the use of ASICs in its campus and data-center switches. + +“We have designed our networking gear from the ASIC, OS and software levels to gather key data via our IBN architecture, which provides unified data collection and performs algorithmic analysis across the entire network (wired, wireless, LAN, WAN, datacenter), Apostolopoulos said. “We have a massive collection of network data, including a database of problems and associated root causes, from being the world’s top enterprise network vendor over the past 20-plus years. And we have been investing for many years to create innovative network-data analysis and ML, MR, and other AI techniques to identify and solve key problems.” + +Machine learning and AI can then be applied to all that data to help network operators handle everything from policy setting and network control to security. + +“I also want to stress that the feedback the IT user gets from the IBN system with AI is not overwhelming telemetry data,” Apostolopoulos said. Instead it is valuable and actionable insights at scale, derived from immense data and behavioral analytics using AI. + +Managing and developing new AI/ML-based applications from enormous data sets beyond what Cisco already has is a key driver behind it’s the company’s Unified Compute System (UCS) server that wasa rolled out last September. While the new server, the UCS C480 ML, is powerful – it includes eight Nvidia Tesla V100-32G GPUs with 128GB of DDR4 RAM, 24 SATA hard drives and more – it is the ecosystem of vendors – Cloudera, HortonWorks and others that will end up being more important. + +[Earlier this year Cisco forecast][6] that [AI and ML][7] will significantly boost network management this year. + +“In 2019, companies will start to adopt Artificial Intelligence, in particular Machine Learning, to analyze the telemetry coming off networks to see these patterns, in an attempt to get ahead of issues from performance optimization, to financial efficiency, to security,” said [Anand Oswal][8], senior vice president of engineering in Cisco’s Enterprise Networking Business. The pattern-matching capabilities of ML will be used to spot anomalies in network behavior that might otherwise be missed, while also de-prioritizing alerts that otherwise nag network operators but that aren’t critical, Oswal said. + +“We will also start to use these tools to categorize and cluster device and user types, which can help us create profiles for use cases as well as spot outlier activities that could indicate security incursions,” he said. + +The first application of AI in network management will be smarter alerts that simply report on activities that break normal patterns, but as the technology advances it will react to more situations autonomously. The idea is to give customers more information so they and the systems can make better network decisions. Workable tools should appear later in 2019, Oswal said. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.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://images.idgesg.net/images/article/2019/05/ai-vendor-relationship-management_bar-code_purple_artificial-intelligence_hand-on-virtual-screen-100795252-large.jpg +[2]: http://www.networkworld.com/cms/article/3202699 +[3]: https://blogs.cisco.com/enterprise/improving-networks-with-ai +[4]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[5]: https://www.networkworld.com/article/3280988/cisco-opens-dna-center-network-control-and-management-software-to-the-devops-masses.html +[6]: https://www.networkworld.com/article/3332027/cisco-touts-5-technologies-that-will-change-networking-in-2019.html +[7]: https://www.networkworld.com/article/3320978/data-center/network-operations-a-new-role-for-ai-and-ml.html +[8]: https://blogs.cisco.com/author/anandoswal +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md b/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md new file mode 100644 index 0000000000..d7b22353c4 --- /dev/null +++ b/sources/talk/20190606 Cloud adoption drives the evolution of application delivery controllers.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cloud adoption drives the evolution of application delivery controllers) +[#]: via: (https://www.networkworld.com/article/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +Cloud adoption drives the evolution of application delivery controllers +====== +Application delivery controllers (ADCs) are on the precipice of shifting from traditional hardware appliances to software form factors. +![Aramyan / Getty Images / Microsoft][1] + +Migrating to a cloud computing model will obviously have an impact on the infrastructure that’s deployed. This shift has already been seen in the areas of servers, storage, and networking, as those technologies have evolved to a “software-defined” model. And it appears that application delivery controllers (ADCs) are on the precipice of a similar shift. + +In fact, a new ZK Research [study about cloud computing adoption and the impact on ADCs][2] found that, when looking at the deployment model, hardware appliances are the most widely deployed — with 55% having fully deployed or are currently testing and only 15% currently researching hardware. (Note: I am an employee of ZK Research.) + +Juxtapose this with containerized ADCs where only 34% have deployed or are testing but 24% are currently researching and it shows that software in containers will outpace hardware for growth. Not surprisingly, software on bare metal and in virtual machines showed similar although lower, “researching” numbers that support the thesis that the market is undergoing a shift from hardware to software. + +**[ Read also:[How to make hybrid cloud work][3] ]** + +The study, conducted in collaboration with Kemp Technologies, surveyed 203 respondents from the U.K. and U.S. The demographic split was done to understand regional differences. An equal number of mid and large size enterprises were looked at, with 44% being from over 5,000 employees and the other 56% from companies that have 300 to 5,000 people. + +### Incumbency helps but isn’t a fait accompli for future ADC purchases + +The primary tenet of my research has always been that incumbents are threatened when markets transition, and this is something I wanted to investigate in the study. The survey asked whether buyers would consider an alternative as they evolve their applications from legacy (mode 1) to cloud-native (mode 2). The results offer a bit of good news and bad news for the incumbent providers. Only 8% said they would definitely select a new vendor, but 35% said they would not change. That means the other 57% will look at alternatives. This is sensible, as the requirements for cloud ADCs are different than ones that support traditional applications. + +### IT pros want better automation capabilities + +This begs the question as to what features ADC buyers want for a cloud environment versus traditional ones. The survey asked specifically what features would be most appealing in future purchases, and the top response was automation, followed by central management, application analytics, on-demand scaling (which is a form of automation), and visibility. + +The desire to automate was a positive sign for the evolution of buyer mindset. Just a few years ago, the mere mention of automation would have sent IT pros into a panic. The reality is that IT can’t operate effectively without automation, and technology professionals are starting to understand that. + +The reason automation is needed is that manual changes are holding businesses back. The survey asked how the speed of ADC changes impacts the speed at which applications are rolled out, and a whopping 60% said it creates significant or minor delays. In an era of DevOps and continuous innovation, multiple minor delays create a drag on the business and can cause it to fall behind is more agile competitors. + +![][4] + +### ADC upgrades and service provisioning benefit most from automation + +The survey also drilled down on specific ADC tasks to see where automation would have the most impact. Respondents were asked how long certain tasks took, answering in minutes, days, weeks, or months. Shockingly, there wasn’t a single task where the majority said it could be done in minutes. The closest was adding DNS entries for new virtual IP addresses (VIPs) where 46% said they could do that in minutes. + +Upgrading, provisioning new load balancers, and provisioning new VIPs took the longest. Looking ahead, this foreshadows big problems. As the data center gets more disaggregated and distributed, IT will deploy more software-based ADCs in more places. Taking days or weeks or month to perform these functions will cause the organization to fall behind. + +The study clearly shows changes are in the air for the ADC market. For IT pros, I strongly recommend that as the environment shifts to the cloud, it’s prudent to evaluate new vendors. By all means, see what your incumbent vendor has, but look at least at two others that offer software-based solutions. Also, there should be a focus on automating as much as possible, so the primary evaluation criteria for ADCs should be how easy it is to implement automation. + +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/3400897/cloud-adoption-drives-the-evolution-of-application-delivery-controllers.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://images.idgesg.net/images/article/2019/05/cw_microsoft_sharepoint_vs_onedrive_clouds_and_hands_by_aramyan_gettyimages-909772962_2400x1600-100796932-large.jpg +[2]: https://kemptechnologies.com/research-papers/adc-market-research-study-zeus-kerravala/?utm_source=zkresearch&utm_medium=referral&utm_campaign=zkresearch&utm_term=zkresearch&utm_content=zkresearch +[3]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb +[4]: https://images.idgesg.net/images/article/2019/06/adc-survey-zk-research-100798593-large.jpg +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md b/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md new file mode 100644 index 0000000000..3da91bb311 --- /dev/null +++ b/sources/talk/20190606 For enterprise storage, persistent memory is here to stay.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (For enterprise storage, persistent memory is here to stay) +[#]: via: (https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html) +[#]: author: (John Edwards ) + +For enterprise storage, persistent memory is here to stay +====== +Persistent memory – also known as storage class memory – has tantalized data center operators for many years. A new technology promises the key to success. +![Thinkstock][1] + +It's hard to remember a time when semiconductor vendors haven't promised a fast, cost-effective and reliable persistent memory technology to anxious [data center][2] operators. Now, after many years of waiting and disappointment, technology may have finally caught up with the hype to make persistent memory a practical proposition. + +High-capacity persistent memory, also known as storage class memory ([SCM][3]), is fast and directly addressable like dynamic random-access memory (DRAM), yet is able to retain stored data even after its power has been switched off—intentionally or unintentionally. The technology can be used in data centers to replace cheaper, yet far slower traditional persistent storage components, such as [hard disk drives][4] (HDD) and [solid-state drives][5] (SSD). + +**Learn more about enterprise storage** + + * [Why NVMe over Fabric matters][6] + * [What is hyperconvergence?][7] + * [How NVMe is changing enterprise storage][8] + * [Making the right hyperconvergence choice: HCI hardware or software?][9] + + + +Persistent memory can also be used to replace DRAM itself in some situations without imposing a significant speed penalty. In this role, persistent memory can deliver crucial operational benefits, such as lightning-fast database-server restarts during maintenance, power emergencies and other expected and unanticipated reboot situations. + +Many different types of strategic operational applications and databases, particularly those that require low-latency, high durability and strong data consistency, can benefit from persistent memory. The technology also has the potential to accelerate virtual machine (VM) storage and deliver higher performance to multi-node, distributed-cloud applications. + +In a sense, persistent memory marks a rebirth of core memory. "Computers in the ‘50s to ‘70s used magnetic core memory, which was direct access, non-volatile memory," says Doug Wong, a senior member of [Toshiba Memory America's][10] technical staff. "Magnetic core memory was displaced by SRAM and DRAM, which are both volatile semiconductor memories." + +One of the first persistent memory devices to come to market is [Intel’s Optane DC][11]. Other vendors that have released persistent memory products or are planning to do so include [Samsung][12], Toshiba America Memory and [SK Hynix][13]. + +### Persistent memory: performance + reliability + +With persistent memory, data centers have a unique opportunity to gain faster performance and lower latency without enduring massive technology disruption. "It's faster than regular solid-state NAND flash-type storage, but you're also getting the benefit that it’s persistent," says Greg Schulz, a senior advisory analyst at vendor-independent storage advisory firm [StorageIO.][14] "It's the best of both worlds." + +Yet persistent memory offers adopters much more than speedy, reliable storage. In an ideal IT world, all of the data associated with an application would reside within DRAM to achieve maximum performance. "This is currently not practical due to limited DRAM and the fact that DRAM is volatile—data is lost when power fails," observes Scott Nelson, senior vice president and general manager of Toshiba Memory America's memory business unit. + +Persistent memory transports compatible applications to an "always on" status, providing continuous access to large datasets through increased system memory capacity, says Kristie Mann, [Intel's][15] director of marketing for data center memory and storage. She notes that Optane DC can supply data centers with up to three-times more system memory capacity (as much as 36TBs), system restarts in seconds versus minutes, 36% more virtual machines per node, and up to 8-times better performance on [Apache Spark][16], a widely used open-source distributed general-purpose cluster-computing framework. + +System memory currently represents 60% of total platform costs, Mann says. She observes that Optane DC persistent memory provides significant customer value by delivering 1.2x performance/dollar on key customer workloads. "This value will dramatically change memory/storage economics and accelerate the data-centric era," she predicts. + +### Where will persistent memory infiltrate enterprise storage? + +Persistent memory is likely to first enter the IT mainstream with minimal fanfare, serving as a high-performance caching layer for high performance SSDs. "This could be adopted relatively-quickly," Nelson observes. Yet this intermediary role promises to be merely a stepping-stone to increasingly crucial applications. + +Over the next few years, persistent technology will impact data centers serving enterprises across an array of sectors. "Anywhere time is money," Schulz says. "It could be financial services, but it could also be consumer-facing or sales-facing operations." + +Persistent memory supercharges anything data-related that requires extreme speed at extreme scale, observes Andrew Gooding, vice president of engineering at [Aerospike][17], which delivered the first commercially available open database optimized for use with Intel Optane DC. + +Machine learning is just one of many applications that stand to benefit from persistent memory. Gooding notes that ad tech firms, which rely on machine learning to understand consumers' reactions to online advertising campaigns, should find their work made much easier and more effective by persistent memory. "They’re collecting information as users within an ad campaign browse the web," he says. "If they can read and write all that data quickly, they can then apply machine-learning algorithms and tailor specific ads for users in real time." + +Meanwhile, as automakers become increasingly reliant on data insights, persistent memory promises to help them crunch numbers and refine sophisticated new technologies at breakneck speeds. "In the auto industry, manufacturers face massive data challenges in autonomous vehicles, where 20 exabytes of data needs to be processed in real time, and they're using self-training machine-learning algorithms to help with that," Gooding explains. "There are so many fields where huge amounts of data need to be processed quickly with machine-learning techniques—fraud detection, astronomy... the list goes on." + +Intel, like other persistent memory vendors, expects cloud service providers to be eager adopters, targeting various types of in-memory database services. Google, for example, is applying persistent memory to big data workloads on non-relational databases from vendors such as Aerospike and [Redis Labs][18], Mann says. + +High-performance computing (HPC) is yet another area where persistent memory promises to make a tremendous impact. [CERN][19], the European Organization for Nuclear Research, is using Intel's Optane DC to significantly reduce wait times for scientific computing. "The efficiency of their algorithms depends on ... persistent memory, and CERN considers it a major breakthrough that is necessary to the work they are doing," Mann observes. + +### How to prepare storage infrastructure for persistent memory + +Before jumping onto the persistent memory bandwagon, organizations need to carefully scrutinize their IT infrastructure to determine the precise locations of any existing data bottlenecks. This task will be primary application-dependent, Wong notes. "If there is significant performance degradation due to delays associated with access to data stored in non-volatile storage—SSD or HDD—then an SCM tier will improve performance," he explains. Yet some applications will probably not benefit from persistent memory, such as compute-bound applications where CPU performance is the bottleneck. + +Developers may need to reevaluate fundamental parts of their storage and application architectures, Gooding says. "They will need to know how to program with persistent memory," he notes. "How, for example, to make sure writes are flushed to the actual persistent memory device when necessary, as opposed to just sitting in the CPU cache." + +To leverage all of persistent memory's potential benefits, significant changes may also be required in how code is designed. When moving applications from DRAM and flash to persistent memory, developers will need to consider, for instance, what happens when a program crashes and restarts. "Right now, if they write code that leaks memory, that leaked memory is recovered on restart," Gooding explains. With persistent memory, that isn't necessarily the case. "Developers need to make sure the code is designed to reconstruct a consistent state when a program restarts," he notes. "You may not realize how much your designs rely on the traditional combination of fast volatile DRAM and block storage, so it can be tricky to change your code designs for something completely new like persistent memory." + +Older versions of operating systems may also need to be updated to accommodate the new technology, although newer OSes are gradually becoming persistent memory aware, Schulz says. "In other words, if they detect that persistent memory is available, then they know how to utilize that either as a cache, or some other memory." + +Hypervisors, such as [Hyper-V][20] and [VMware][21], now know how to leverage persistent memory to support productivity, performance and rapid restarts. By utilizing persistent memory along with the latest versions of VMware, a whole system can see an uplift in speed and also maximize the number of VMs to fit on a single host, says Ian McClarty, CEO and president of data center operator [PhoenixNAP Global IT Services][22]. "This is a great use case for companies who want to own less hardware or service providers who want to maximize hardware to virtual machine deployments." + +Many key enterprise applications, particularly databases, are also becoming persistent memory aware. SQL Server and [SAP’s][23] flagship [HANA][24] database management platform have both embraced persistent memory. "The SAP HANA platform is commonly used across multiple industries to process data and transactions, and then run advanced analytics ... to deliver real-time insights," Mann observes. + +In terms of timing, enterprises and IT organizations should begin persistent memory planning immediately, Schulz recommends. "You should be talking with your vendors and understanding their roadmap, their plans, for not only supporting this technology, but also in what mode: as storage, as memory." + +Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3398988/for-enterprise-storage-persistent-memory-is-here-to-stay.html + +作者:[John Edwards][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://images.idgesg.net/images/article/2017/08/file_folder_storage_sharing_thinkstock_477492571_3x2-100732889-large.jpg +[2]: https://www.networkworld.com/article/3353637/the-data-center-is-being-reimagined-not-disappearing.html +[3]: https://www.networkworld.com/article/3026720/the-next-generation-of-storage-disruption-storage-class-memory.html +[4]: https://www.networkworld.com/article/2159948/hard-disk-drives-vs--solid-state-drives--are-ssds-finally-worth-the-money-.html +[5]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[6]: https://www.networkworld.com/article/3273583/why-nvme-over-fabric-matters.html +[7]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence +[8]: https://www.networkworld.com/article/3280991/what-is-nvme-and-how-is-it-changing-enterprise-storage.html +[9]: https://www.networkworld.com/article/3318683/making-the-right-hyperconvergence-choice-hci-hardware-or-software +[10]: https://business.toshiba-memory.com/en-us/top.html +[11]: https://www.intel.com/content/www/us/en/architecture-and-technology/optane-dc-persistent-memory.html +[12]: https://www.samsung.com/semiconductor/ +[13]: https://www.skhynix.com/eng/index.jsp +[14]: https://storageio.com/ +[15]: https://www.intel.com/content/www/us/en/homepage.html +[16]: https://spark.apache.org/ +[17]: https://www.aerospike.com/ +[18]: https://redislabs.com/ +[19]: https://home.cern/ +[20]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/about/ +[21]: https://www.vmware.com/ +[22]: https://phoenixnap.com/ +[23]: https://www.sap.com/index.html +[24]: https://www.sap.com/products/hana.html +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md b/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md new file mode 100644 index 0000000000..b140969eb5 --- /dev/null +++ b/sources/talk/20190606 Juniper- Security could help drive interest in SDN.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Juniper: Security could help drive interest in SDN) +[#]: via: (https://www.networkworld.com/article/3400739/juniper-sdn-snapshot-finds-security-legacy-network-tech-impacts-core-network-changes.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Juniper: Security could help drive interest in SDN +====== +Juniper finds that enterprise interest in software-defined networking (SDN) is influenced by other factors, including artificial intelligence (AI) and machine learning (ML). +![monsitj / Getty Images][1] + +Security challenges and developing artificial intelligence/maching learning (AI/ML) technologies are among the key issues driving [software-defined networking][2] (SDN) implementations, according to a new Juniper survey of 500 IT decision makers. + +And SDN interest abounds – 98% of the 500 said they were already using or considering an SDN implementation. Juniper said it had [Wakefield Research][3] poll IT decision makers of companies with 500 or more employees about their SDN strategies between May 7 and May 14, 2019. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][4] + * [How to pick an off-site data-backup method][5] + * [SD-Branch: What it is and why you’ll need it][6] + * [What are the options for security SD-WAN?][7] + + + +SDN includes technologies that separate the network control plane from the forwarding plane to enable more automated provisioning and policy-based management of network resources. + +IDC estimates that the worldwide data-center SDN market will be worth more than $12 billion in 2022, recording a CAGR of 18.5% during the 2017-2022 period. The market-generated revenue of nearly $5.15 billion in 2017 was up more than 32.2% from 2016. + +There are many ideas driving the development of SDN. For example, it promises to reduce the complexity of statically defined networks; make automating network functions much easier; and allow for simpler provisioning and management of networked resources from the data center to the campus or wide area network. + +While the evolution of SDN is ongoing, Juniper’s study pointed out an issue that was perhaps not unexpected – many users are still managing operations via the command line interface (CLI). CLI is the primary text-based user interface used for configuring, monitoring and maintaining most networked devices. + +“If SDN is as attractive as it is then why manage the network with the same legacy technology of the past?” said Michael Bushong, vice president of enterprise and cloud marketing at Juniper Networks. “If you deploy SDN and don’t adjust the operational model then it is difficult to reap all the benefits SDN can bring. It’s the difference between managing devices individually which you may have done in the past to managing fleets of devices via SDN – it simplifies and reduces operational expenses.” + +Juniper pointed to a [Gartner prediction][8] that stated “by 2020, only 30% of network operations teams will use the command line interface (CLI) as their primary interface, down from 85% at years end 2016.” Garter stated that poll results from a recent Gartner conference found some 71% still using CLI as the primary way to make network changes. + +Gartner [wrote][9] in the past that CLI has remained the primary operational tool for mainstream network operations teams for easily the past 15-20 years but that “moving away from the CLI is a good thing for the networking industry, and while it won’t disappear completely (advanced/nuanced troubleshooting for example), it will be supplanted as the main interface into networking infrastructure.” + +Juniper’s study found that 87% of businesses are still doing most or some of their network management at the device level. + +What all of this shows is that customers are obviously interested in SDN but are still grappling with the best ways to get there, Bushong said. + +The Juniper study also found users interested in SDN because of the potential for a security boost. + +SDN can empowers a variety of security benefits. A customer can split up a network connection between an end user and the data center and have different security settings for the various types of network traffic. A network could have one public-facing, low-security network that does not touch any sensitive information. Another segment could have much more fine-grained remote-access control with software-based [firewall][10] and encryption policies on it, which allow sensitive data to traverse over it. SDN users can roll out security policies across the network from the data center to the edge much more rapidly than traditional network environments. + +“Many enterprises see security—not speed—as the biggest consequence of not making this transition in the next five years, with nearly 40 percent identifying the inability to quickly address new threats as one of their main concerns,” wrote Manoj Leelanivas, chief product officer at Juniper Networks, in a blog about the survey. + +“SDN is not often associated with greater security but this makes sense when we remember this is an operational transformation. In security, the challenge lies not in identifying threats or creating solutions, but in applying these solutions to a fragmented network. Streamlining complex security operations, touching many different departments and managing multiple security solutions, is where a software-defined approach can provide the answer,” Leelanivas stated. + +Some of the other key findings from Juniper included: + + * **The future of AI** : The deployment of artificial intelligence is about changing the operational model, Bushong said. “The ability to more easily manage workflows over groups of devices and derive usable insights to help customers be more proactive rather than reactive is the direction we are moving. Everything will ultimately be AI-driven, he said. + * **Automation** : While automation is often considered a threat, Juniper said its respondents see it positively within the context of SDN, with 38% reporting it will improve security and 25% that it will enhance their jobs by streamlining manual operations. + * **Flexibility** : Agility is the #1 benefit respondents considering SDN want to gain (48%), followed by improved reliability (43%) and greater simplicity (38%). + * **SD-WAN** : The majority, 54%, have rolled out or are in the process of rolling out SD-WAN, while an additional 34% have it under current consideration. + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400739/juniper-sdn-snapshot-finds-security-legacy-network-tech-impacts-core-network-changes.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://images.idgesg.net/images/article/2019/03/sdn_software-defined-network_architecture-100791938-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.wakefieldresearch.com/ +[4]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[5]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[6]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[7]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[8]: https://blogs.gartner.com/andrew-lerner/2018/01/04/checking-in-on-the-death-of-the-cli/ +[9]: https://blogs.gartner.com/andrew-lerner/2016/11/22/predicting-the-death-of-the-cli/ +[10]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 Self-learning sensor chips won-t need networks.md b/sources/talk/20190606 Self-learning sensor chips won-t need networks.md new file mode 100644 index 0000000000..c5abec5426 --- /dev/null +++ b/sources/talk/20190606 Self-learning sensor chips won-t need networks.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Self-learning sensor chips won’t need networks) +[#]: via: (https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Self-learning sensor chips won’t need networks +====== +Scientists working on new, machine-learning networks aim to embed everything needed for artificial intelligence (AI) onto a processor, eliminating the need to transfer data to the cloud or computers. +![Jiraroj Praditcharoenkul / Getty Images][1] + +Tiny, intelligent microelectronics should be used to perform as much sensor processing as possible on-chip rather than wasting resources by sending often un-needed, duplicated raw data to the cloud or computers. So say scientists behind new, machine-learning networks that aim to embed everything needed for artificial intelligence (AI) onto a processor. + +“This opens the door for many new applications, starting from real-time evaluation of sensor data,” says [Fraunhofer Institute for Microelectronic Circuits and Systems][2] on its website. No delays sending unnecessary data onwards, along with speedy processing, means theoretically there is zero latency. + +Plus, on-microprocessor, self-learning means the embedded, or sensor, devices can self-calibrate. They can even be “completely reconfigured to perform a totally different task afterwards,” the institute says. “An embedded system with different tasks is possible.” + +**[ Also read:[What is edge computing?][3] and [How edge networking and IoT will reshape data centers][4] ]** + +Much internet of things (IoT) data sent through networks is redundant and wastes resources: a temperature reading taken every 10 minutes, say, when the ambient temperature hasn’t changed, is one example. In fact, one only needs to know when the temperature has changed, and maybe then only when thresholds have been met. + +### Neural network-on-sensor chip + +The commercial German research organization says it’s developing a specific RISC-V microprocessor with a special hardware accelerator designed for a [brain-copying, artificial neural network (ANN) it has developed][5]. The architecture could ultimately be suitable for the condition-monitoring or predictive sensors of the kind we will likely see more of in the industrial internet of things (IIoT). + +Key to Fraunhofer IMS’s [Artificial Intelligence for Embedded Systems (AIfES)][6] is that the self-learning takes place at chip level rather than in the cloud or on a computer, and that it is independent of “connectivity towards a cloud or a powerful and resource-hungry processing entity.” But it still offers a “full AI mechanism, like independent learning,” + +It’s “decentralized AI,” says Fraunhofer IMS. "It’s not focused towards big-data processing.” + +Indeed, with these kinds of systems, no connection is actually required for the raw data, just for the post-analytical results, if indeed needed. Swarming can even replace that. Swarming lets sensors talk to one another, sharing relevant information without even getting a host network involved. + +“It is possible to build a network from small and adaptive systems that share tasks among themselves,” Fraunhofer IMS says. + +Other benefits in decentralized neural networks include that they can be more secure than the cloud. Because all processing takes place on the microprocessor, “no sensitive data needs to be transferred,” Fraunhofer IMS explains. + +### Other edge computing research + +The Fraunhofer researchers aren’t the only academics who believe entire networks become redundant with neuristor, brain-like AI chips. Binghamton University and Georgia Tech are working together on similar edge-oriented tech. + +“The idea is we want to have these chips that can do all the functioning in the chip, rather than messages back and forth with some sort of large server,” Binghamton said on its website when [I wrote about the university's work last year][7]. + +One of the advantages of no major communications linking: Not only don't you have to worry about internet resilience, but also that energy is saved creating the link. Energy efficiency is an ambition in the sensor world — replacing batteries is time consuming, expensive, and sometimes, in the case of remote locations, extremely difficult. + +Memory or storage for swaths of raw data awaiting transfer to be processed at a data center, or similar, doesn’t have to be provided either — it’s been processed at the source, so it can be discarded. + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][8] + * [How edge computing can help secure the IoT][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3400659/self-learning-sensor-chips-wont-need-networks.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_automation_by_jiraroj_praditcharoenkul_gettyimages-902668940_2400x1600-100788458-large.jpg +[2]: https://www.ims.fraunhofer.de/en.html +[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/News/AIfES-Artificial_Intelligence_for_Embedded_Systems.html +[6]: https://www.ims.fraunhofer.de/en/Business_Units_and_Core_Competencies/Electronic_Assistance_Systems/technologies/Artificial-Intelligence-for-Embedded-Systems-AIfES.html +[7]: https://www.networkworld.com/article/3326557/edge-chips-could-render-some-networks-useless.html +[8]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[9]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md b/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md new file mode 100644 index 0000000000..622537f2f9 --- /dev/null +++ b/sources/talk/20190606 What to do when yesterday-s technology won-t meet today-s support needs.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What to do when yesterday’s technology won’t meet today’s support needs) +[#]: via: (https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html) +[#]: author: (Anand Rajaram ) + +What to do when yesterday’s technology won’t meet today’s support needs +====== + +![iStock][1] + +You probably already know that end user technology is exploding and are feeling the effects of it in your support organization every day. Remember when IT sanctioned and standardized every hardware and software instance in the workplace? Those days are long gone. Today, it’s the driving force of productivity that dictates what will or won’t be used – and that can be hard on a support organization. + +Whatever users need to do their jobs better, faster, more efficiently is what you are seeing come into the workplace. So naturally, that’s what comes into your service desk too. Support organizations see all kinds of [devices, applications, systems, and equipment][2], and it’s adding a great deal of complexity and demand to keep up with. In fact, four of the top five factors causing support ticket volumes to rise are attributed to new and current technology. + +To keep up with the steady [rise of tickets][3] and stay out in front of this surge, support organizations need to take a good, hard look at the processes and technologies they use. Yesterday’s methods won’t cut it. The landscape is simply changing too fast. Supporting today’s users and getting them back to work fast requires an expanding set of skills and tools. + +So where do you start with a new technology project? Just because a technology is new or hyped doesn’t mean it’s right for your organization. It’s important to understand your project goals and the experience you really want to create and match your technology choices to those goals. But don’t go it alone. Talk to your teams. Get intimately familiar with how your support organization works today. Understand your customers’ needs at a deep level. And bring the right people to the table to cover: + + * Business problem analysis: What existing business issue are stakeholders unhappy with? + * The impact of that problem: How does that issue justify making a change? + * Process automation analysis: What area(s) can technology help automate? + * Other solutions: Have you considered any other options besides technology? + + + +With these questions answered, you’re ready to entertain your technology options. Put together your “must-haves” in a requirements document and reach out to potential suppliers. During the initial information-gathering stage, assess if the supplier understands your goals and how their technology helps you meet them. To narrow the field, compare solutions side by side against your goals. Select the top two or three for more in-depth product demos before moving into product evaluations. By the time you’re ready for implementation, you have empirical, practical knowledge of how the solution will perform against your business goals. + +The key takeaway is this: Technology for technology’s sake is just technology. But technology that drives business value is a solution. If you want a solution that drives results for your organization and your customers, it’s worth following a strategic selection process to match your goals with the best technology for the job. + +For more insight, check out the [LogMeIn Rescue][4] and HDI webinar “[Technology and the Service Desk: Expanding Mission, Expanding Skills”][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3399875/what-to-do-when-yesterday-s-technology-won-t-meet-today-s-support-needs.html + +作者:[Anand Rajaram][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://images.idgesg.net/images/article/2019/06/istock-1019006240-100798168-large.jpg +[2]: https://www.logmeinrescue.com/resources/datasheets/infographic-mobile-support-are-your-employees-getting-what-they-need?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[3]: https://www.logmeinrescue.com/resources/analyst-reports/the-importance-of-remote-support-in-a-shift-left-world?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[4]: https://www.logmeinrescue.com/?utm_source=idg%20media&utm_medium=display&utm_campaign=native&sfdc= +[5]: https://www.brighttalk.com/webcast/8855/312289?utm_source=LogMeIn7&utm_medium=brighttalk&utm_campaign=312289 diff --git a/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md b/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md new file mode 100644 index 0000000000..492262c617 --- /dev/null +++ b/sources/talk/20190611 6 ways to make enterprise IoT cost effective.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 ways to make enterprise IoT cost effective) +[#]: via: (https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +6 ways to make enterprise IoT cost effective +====== +Rob Mesirow, a principal at PwC’s Connected Solutions unit, offers tips for successfully implementing internet of things (IoT) projects without breaking the bank. +![DavidLeshem / Getty][1] + +There’s little question that the internet of things (IoT) holds enormous potential for the enterprise, in everything from asset tracking to compliance. + +But enterprise uses of IoT technology are still evolving, and it’s not yet entirely clear which use cases and practices currently make economic and business sense. So, I was thrilled to trade emails recently with [Rob Mesirow][2], a principal at [PwC’s Connected Solutions][3] unit, about how to make enterprise IoT implementations as cost effective as possible. + +“The IoT isn’t just about technology (hardware, sensors, software, networks, communications, the cloud, analytics, APIs),” Mesirow said, “though tech is obviously essential. It also includes ensuring cybersecurity, managing data governance, upskilling the workforce and creating a receptive workplace culture, building trust in the IoT, developing interoperability, and creating business partnerships and ecosystems—all part of a foundation that’s vital to a successful IoT implementation.” + +**[ Also read:[Enterprise IoT: Companies want solutions in these 4 areas][4] ]** + +Yes, that sounds complicated—and a lot of work for a still-hard-to-quantify return. Fortunately, though, Mesirow offered up some tips on how companies can make their IoT implementations as cost effective as possible. + +### 1\. Don’t wait for better technology + +Mesirow advised against waiting to implement IoT projects until you can deploy emerging technology such as [5G networks][5]. That makes sense, as long as your implementation doesn’t specifically require capabilities available only in the new technology. + +### 2\. Start with the basics, and scale up as needed + +“Companies need to start with the basics—building one app/task at a time—instead of jumping ahead with enterprise-wide implementations and ecosystems,” Mesirow said. + +“There’s no need to start an IoT initiative by tackling a huge, expensive ecosystem. Instead, begin with one manageable use case, and build up and out from there. The IoT can inexpensively automate many everyday tasks to increase effectiveness, employee productivity, and revenue.” + +After you pick the low-hanging fruit, it’s time to become more ambitious. + +“After getting a few successful pilots established, businesses can then scale up as needed, building on the established foundation of business processes, people experience, and technology," Mesirow said, + +### 3\. Make dumb things smart + +Of course, identifying the ripest low-hanging fruit isn’t always easy. + +“Companies need to focus on making dumb things smart, deploying infrastructure that’s not going to break the bank, and providing enterprise customers the opportunity to experience what data intelligence can do for their business,” Mesirow said. “Once they do that, things will take off.” + +### 4\. Leverage lower-cost networks + +“One key to building an IoT inexpensively is to use low-power, low-cost networks (Low-Power Wide-Area Networks (LPWAN)) to provide IoT services, which reduces costs significantly,” Mesirow said. + +Naturally, he mentioned that PwC has three separate platforms with some 80 products that hang off those platforms, which he said cost “a fraction of traditional IoT offerings, with security and privacy built in.” + +Despite the product pitch, though, Mesirow is right to call out the efficiencies involved in using low-cost, low-power networks instead of more expensive existing cellular. + +### 5\. Balance security vs. cost + +Companies need to plan their IoT network with costs vs. security in mind, Mesirow said. “Open-source networks will be less expensive, but there may be security concerns,” he said. + +That’s true, of course, but there may be security concerns in _any_ network, not just open-source solutions. Still, Mesirow’s overall point remains valid: Enterprises need to carefully consider all the trade-offs they’re making in their IoT efforts. + +### 6\. Account for _all_ the value IoT provides + +Finally, Mesirow pointed out that “much of the cost-effectiveness comes from the _value_ the IoT provides,” and its important to consider the return, not just the investment. + +“For example,” Mesirow said, the IoT “increases productivity by enabling the remote monitoring and control of business operations. It saves on energy costs by automatically turning off lights and HVAC when spaces are vacant, and predictive maintenance alerts lead to fewer machine repairs. And geolocation can lead to personalized marketing to customer smartphones, which can increase sales to nearby stores.” + +**[ Now read this:[5 reasons the IoT needs its own networks][6] ]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401082/6-ways-to-make-enterprise-iot-cost-effective.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/money_financial_salary_growth_currency_by-davidleshem-100787975-large.jpg +[2]: https://twitter.com/robmesirow +[3]: https://digital.pwc.com/content/pwc-digital/en/products/connected-solutions.html +[4]: https://www.networkworld.com/article/3396128/the-state-of-enterprise-iot-companies-want-solutions-for-these-4-areas.html +[5]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[6]: https://www.networkworld.com/article/3284506/5-reasons-the-iot-needs-its-own-networks.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190611 Cisco launches a developer-community cert program.md b/sources/talk/20190611 Cisco launches a developer-community cert program.md new file mode 100644 index 0000000000..92ce486e6d --- /dev/null +++ b/sources/talk/20190611 Cisco launches a developer-community cert program.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco launches a developer-community cert program) +[#]: via: (https://www.networkworld.com/article/3401524/cisco-launches-a-developer-community-cert-program.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco launches a developer-community cert program +====== +Cisco has revamped some of its most critical certification and career-development programs in an effort to address the emerging software-oriented-network environment. +![Getty Images][1] + +SAN DIEGO – Cisco revamped some of its most critical certification and career-development tools in an effort to address the emerging software-oriented network environment. + +Perhaps one of the biggest additions – rolled out here at the company’s Cisco Live customer event – is the new set of professional certifications for developers utilizing Cisco’s growing DevNet developer community. + +**[ Also see[4 job skills that can boost networking salaries][2] and [20 hot jobs ambitious IT pros should shoot for][3].]** + +The Cisco Certified DevNet Associate, Specialist and Professional certifications will cover software development for applications, automation, DevOps, cloud and IoT. They will also target software developers and network engineers who develop software proficiency to develop applications and automated workflows for operational networks and infrastructure. + +“This certification evolution is the next step to reflect the critical skills network engineers must have to be at the leading edge of networked-enabled business disruption and delivering customer excellence,” said Mike Adams, vice president and general manager of Learning@Cisco. “To perform effectively in this new world, every IT professional needs skills that are broader, deeper and more agile than ever before. And they have to be comfortable working as a multidisciplinary team including infrastructure network engineers, DevOps and automation specialists, and software professionals.” + +Other Cisco Certifications changes include: + + * Streamlined certifications to validate engineering professionals with Cisco Certified Network Associate (CCNA) and Cisco Specialist certifications as well as Cisco Certified Network Professional (CCNP) and Cisco Certified Internetwork Expert (CCIE) certifications in enterprise, data center, service provider, security and collaboration. + * For more senior professionals, the CCNP will give learners a choice of five tracks, covering enterprise technologies including infrastructure and wireless, service provider, data center, security and collaboration. Candidates will be able to further specialize in a particular focus area within those technologies. + * Cisco says it will eliminate pre-requisites for certifications, meaning engineers can change career options without having to take a defined path. + * Expansion of Cisco Networking Academy offerings to train entry level network professionals and software developers. Courses prepare students to earn CCNA and Certified DevNet Associate certifications, equipping them for high-demand jobs in IT. + + + +New network technologies such as intent-based networking, multi-domain networking, and programmability fundamentally change the capabilities of the network, giving network engineers the opportunity to architect solutions that utilize the programmable network in new and exciting ways, wrote Susie Wee senior vice president and chief technology officer of DevNet. + +“DevOps practices can be applied to the network, making the network more agile and enabling automation at scale. The new network provides more than just connectivity, it can now use policy and intent to securely connect applications, users, devices and data across multiple environments – from the data center and cloud, to the campus and branch, to the edge, and to the device,” Wee wrote. + +**[[Looking to upgrade your career in tech? This comprehensive online course teaches you how.][4] ]** + +She also announced the DevNet Automation Exchange, a community that will offer shared code, best practices and technology tools for users, developers or channel partners interested in developing automation apps. + +Wee said Cisco seeded the Automation Exchange with over 50 shared code repositories. + +“It is becoming increasingly clear that network ops can be handled much more efficiently with automation, and offering the tools to develop better applications is crucial going forward,” said Zeus Kerravala, founder and principal analyst with ZK Research. + +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/3401524/cisco-launches-a-developer-community-cert-program.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://images.idgesg.net/images/article/2019/01/run_digital-vanguard_business-executive-with-briefcase_career-growth-100786736-large.jpg +[2]: https://www.networkworld.com/article/3227832/lan-wan/4-job-skills-that-can-boost-networking-salaries.html +[3]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md b/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md new file mode 100644 index 0000000000..b440b8d65b --- /dev/null +++ b/sources/talk/20190611 The carbon footprints of IT shops that train AI models are huge.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The carbon footprints of IT shops that train AI models are huge) +[#]: via: (https://www.networkworld.com/article/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +The carbon footprints of IT shops that train AI models are huge +====== +Artificial intelligence (AI) model training can generate five times more carbon dioxide than a car does in a lifetime, researchers at the University of Massachusetts, Amherst find. +![ipopba / Getty Images][1] + +A new research paper from the University of Massachusetts, Amherst looked at the carbon dioxide (CO2) generated over the course of training several common large artificial intelligence (AI) models and found that the process can generate nearly five times the amount as an average American car over its lifetime plus the process of making the car itself. + +The [paper][2] specifically examined the model training process for natural-language processing (NLP), which is how AI handles natural language interactions. The study found that during the training process, more than 626,000 pounds of carbon dioxide is generated. + +This is significant, since AI training is one IT process that has remained firmly on-premises and not moved to the cloud. Very expensive equipment is needed, as is large volumes of data, so the cloud isn’t right work for most AI training, and the report notes this. Plus, IT shops want to keep that kind of IP in house. So, if you are experimenting with AI, that power bill is going to go up. + +**[ Read also:[How to plan a software-defined data-center network][3] ]** + +While the report used carbon dioxide as a measure, that’s still the product of electricity generation. Training involves the use of the most powerful processors, typically Nvidia GPUs, and they are not known for being low-power draws. And as the paper notes, “model training also incurs a substantial cost to the environment due to the energy required to power this hardware for weeks or months at a time.” + +Training is the most processor-intensive portion of AI. It can take days, weeks, or even months to “learn” what the model needs to know. That means power-hungry Nvidia GPUs running at full utilization for the entire time. In this case, how to handle and process natural language questions rather than broken sentences of keywords like your typical Google search. + +The report said training one model with a neural architecture generated 626,155 pounds of CO2. By contrast, one passenger flying round trip between New York and San Francisco would generate 1,984 pounds of CO2, an average American would generate 11,023 pounds in one year, and a car would generate 126,000 pounds over the course of its lifetime. + +### How the researchers calculated the CO2 amounts + +The researchers used four models in the NLP field that have been responsible for the biggest leaps in performance. They are Transformer, ELMo, BERT, and GPT-2. They trained all of the models on a single Nvidia Titan X GPU, with the exception of ELMo which was trained on three Nvidia GTX 1080 Ti GPUs. Each model was trained for a maximum of one day. + +**[[Learn Java from beginning concepts to advanced design patterns in this comprehensive 12-part course!][4] ]** + +They then used the number of training hours listed in the model’s original papers to calculate the total energy consumed over the complete training process. That number was converted into pounds of carbon dioxide equivalent based on the average energy mix in the U.S. + +The big takeaway is that computational costs start out relatively inexpensive, but they mushroom when additional tuning steps were used to increase the model’s final accuracy. A tuning process known as neural architecture search ([NAS][5]) is the worst offender because it does so much processing. NAS is an algorithm that searches for the best neural network architecture. It is seriously advanced AI and requires the most processing time and power. + +The researchers suggest it would be beneficial to directly compare different models to perform a cost-benefit (accuracy) analysis. + +“To address this, when proposing a model that is meant to be re-trained for downstream use, such as re-training on a new domain or fine-tuning on a new task, authors should report training time and computational resources required, as well as model sensitivity to hyperparameters. This will enable direct comparison across models, allowing subsequent consumers of these models to accurately assess whether the required computational resources,” the authors wrote. + +They also say researchers who are cost-constrained should pool resources and avoid the cloud, as cloud compute time is more expensive. In an example, it said a GPU server with eight Nvidia 1080 Ti GPUs and supporting hardware is available for approximately $20,000. To develop the sample models used in their study, that hardware would cost $145,000, plus electricity to run the models, about half the estimated cost to use on-demand cloud GPUs. + +“Unlike money spent on cloud compute, however, that invested in centralized resources would continue to pay off as resources are shared across many projects. A government-funded academic compute cloud would provide equitable access to all researchers,” they wrote. + +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/3401919/the-carbon-footprints-of-it-shops-that-train-ai-models-are-huge.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://images.idgesg.net/images/article/2019/05/ai-vendor-relationship-management_artificial-intelligence_hand-on-virtual-screen-100795246-large.jpg +[2]: https://arxiv.org/abs/1906.02243 +[3]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fjava +[5]: https://www.oreilly.com/ideas/what-is-neural-architecture-search +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md b/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md new file mode 100644 index 0000000000..a6cd0c73b4 --- /dev/null +++ b/sources/talk/20190612 Cisco offers cloud-based security for SD-WAN resources.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco offers cloud-based security for SD-WAN resources) +[#]: via: (https://www.networkworld.com/article/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco offers cloud-based security for SD-WAN resources +====== +Cisco adds support for its cloud-based security gateway Umbrella to SD-WAN software +![Thinkstock][1] + +SAN DIEGO— As many companies look to [SD-WAN][2] technology to reduce costs, improve connectivity and streamline branch office access, one of the key requirements will be solid security technologies to protect corporate resources. + +At its Cisco Live customer event here this week, the company took aim at that need by telling customers it added support for the its cloud-based security gateway – known as Umbrella – to its SD-WAN software offerings. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +At its most basic, SD-WAN lets companies aggregate a variety of network connections – including MPLS, 4G LTE and DSL – into a branch or network-edge location and provides a management software that can turn up new sites, prioritize traffic and set security policies. SD-WAN's driving principle is to simplify the way big companies turn up new links to branch offices, better manage the way those links are utilized – for data, voice or video – and potentially save money in the process. + +According to Cisco, Umbrella can provide the first line of defense against threats on the internet. By analyzing and learning from internet activity patterns, Umbrella automatically uncovers attacker infrastructure and proactively blocks requests to malicious destinations before a connection is even established — without adding latency for users. With Umbrella, customers can stop phishing and malware infections earlier, identify already infected devices faster and prevent data exfiltration, Cisco says. + +Branch offices and roaming users are more vulnerable to attacks, and attackers are looking to exploit them, said Gee Rittenhouse, senior vice president and general manager of Cisco's Security Business Group. He pointed to Enterprise Strategy Group research that says 68 percent of branch offices and roaming users were the source of compromise in recent attacks. And as organizations move to more direct internet access, this becomes an even greater risk, Rittenhouse said. + +“Scaling security at every location often means more appliances to ship and manage, more policies to separately maintain, which translates into more money and resources needed – but Umbrella offers an alternative to all that," he said. "Umbrella provides simple deployment and management, and in a single cloud platform, it unifies multiple layers of security, ncluding DNS, secure web gateway, firewall and cloud-access security,” Rittenhouse said. + +“It also acts as your secure onramp to the internet by offering secure internet access and controlled SaaS usage across all locations and roaming users.” + +Basically users can set up Umbrella support via the SD-WAN dashboard vManage, and the system automatically creates a secure tunnel to the cloud.** ** Once the SD-WAN traffic is pointed at the cloud, firewall and other security policies can be set. Customers can then see traffic and collect information about patterns or set policies and respond to anomalies, Rittenhouse said. + +Analysts said the Umbrella offering is another important security option offered by Cisco for SD-WAN customers. + +“Since it is cloud-based, using Umbrella is a great option for customers with lots of branch or SD-WAN locations who don’t want or need to have a security gateway on premises,” said Rohit Mehra, vice president of Network Infrastructure at IDC. “One of the largest requirements for large customers going forward will be the need for all manner of security technologies for the SD-WAN environment, and Cisco has a big menu of offerings that can address those requirements.” + +IDC says the SD-WAN infrastructure market will hit $4.5 billion by 2022, growing at a more than 40 percent yearly clip between now and then. + +The Umbrella announcement is on top of other recent SD-WAN security enhancements the company has made. In May [Cisco added support for Advanced Malware Protection (AMP) to its million-plus ISR/ASR edge routers][7] in an effort to reinforce branch- and core-network malware protection across the SD-WAN. + +“Together with Cisco Talos [Cisco’s security-intelligence arm], AMP imbues your SD-WAN branch, core and campuses locations with threat intelligence from millions of worldwide users, honeypots, sandboxes and extensive industry partnerships,” Cisco said. + +In total, AMP identifies more than 1.1 million unique malware samples a day and when AMP in Cisco SD-WAN platform spots malicious behavior it automatically blocks it, Cisco said. + +Last year Cisco added its [Viptela SD-WAN technology to the IOS XE][8] version 16.9.1 software that runs its core ISR/ASR routers such as the ISR models 1000, 4000 and ASR 1000, in use by organizations worldwide. Cisco bought Viptela in 2017. + +The release of Cisco IOS XE offered an instant upgrade path for creating cloud-controlled SD-WAN fabrics to connect distributed offices, people, devices and applications operating on the installed base, Cisco said. At the time Cisco said that Cisco SD-WAN on edge routers builds a secure virtual IP fabric by combining routing, segmentation, security, policy and orchestration. + +With the recent release of IOS-XE SD-WAN 16.11, Cisco has brought AMP and other enhancements to its SD-WAN. + +AMP support is added to a menu of security features already included in Cisco's SD-WAN software including support for URL filtering, Snort Intrusion Prevention, the ability to segment users across the WAN and embedded platform security, including the Cisco Trust Anchor module. + +The software also supports SD-WAN Cloud onRamp for CoLocation, which lets customers tie distributed multicloud applications back to a local branch office or local private data center. That way a cloud-to-branch link would be shorter, faster and possibly more secure that tying cloud-based applications directly to the data center. + +Also in May [Cisco and Teridion][9] said they would team to deliver faster enterprise software-defined WAN services. The integration links Cisco Meraki MX Security/SD-WAN appliances and its Auto VPN technology which lets users quickly bring up and configure secure sessions between branches and data centers with Teridion’s cloud-based WAN service. Teridion’s service promises customers better performance and control over traffic running from remote offices over the public internet to the data center. + +Teridion said the Meraki integration creates an IPSec connection from the Cisco Meraki MX to the Teridion edge. Customers create locations in the Teridion portal and apply the preconfigured Meraki template to them, or just upload a csv file if they have a lot of locations. Then, from each Meraki MX, they can create a third-party IPSec tunnel to the Teridion edge IP addresses that are generated as part of the Teridion configuration, the company stated. + +The combined Cisco Meraki and Teridion offering brings SD-WAN and security capabilities at the WAN edge that are tightly integrated with a WAN service delivered over cost-effective broadband or dedicated Internet access. Meraki’s MX family supports everything from SD-WAN and [Wi-Fi][10] features to next-generation [firewall][11] and intrusion prevention in a single package. + +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/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.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://images.techhive.com/images/article/2015/10/cloud-security-ts-100622309-large.jpg +[2]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://www.networkworld.com/article/3394597/cisco-adds-amp-to-sd-wan-for-israsr-routers.html +[8]: https://www.networkworld.com/article/3296007/cisco-upgrade-enables-sd-wan-in-1m-israsr-routers.html +[9]: https://www.networkworld.com/article/3396628/cisco-ties-its-securitysd-wan-gear-with-teridions-cloud-wan-service.html +[10]: https://www.networkworld.com/article/3318119/what-to-expect-from-wi-fi-6-in-2019.html +[11]: https://www.networkworld.com/article/3230457/what-is-a-firewall-perimeter-stateful-inspection-next-generation.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md b/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md new file mode 100644 index 0000000000..30e225de98 --- /dev/null +++ b/sources/talk/20190612 Dell and Cisco extend VxBlock integration with new features.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dell and Cisco extend VxBlock integration with new features) +[#]: via: (https://www.networkworld.com/article/3402036/dell-and-cisco-extend-vxblock-integration-with-new-features.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Dell and Cisco extend VxBlock integration with new features +====== +Dell EMC and Cisco took another step in their alliance, announcing plans to expand VxBlock 1000 integration across servers, networking, storage, and data protection. +![Dell EMC][1] + +Just two months ago [Dell EMC and Cisco renewed their converged infrastructure][2] vows, and now the two have taken another step in the alliance. At this year’s at [Cisco Live][3] event taking place in San Diego, the two announced plans to expand VxBlock 1000 integration across servers, networking, storage, and data protection. + +This is done through support of NVMe over Fabrics (NVMe-oF), which allows enterprise SSDs to talk to each other directly through a high-speed fabric. NVMe is an important advance because SATA and PCI Express SSDs could never talk directly to other drives before until NVMe came along. + +To leverage NVMe-oF to its fullest extent, Dell EMC has unveiled a new integrated Cisco compute (UCS) and storage (MDS) 32G options, extending PowerMax capabilities to deliver NVMe performance across the VxBlock stack. + +**More news from Cisco Live 2019:** + + * [Cisco offers cloud-based security for SD-WAN resources][4] + * [Cisco software to make networks smarter, safer, more manageable][5] + * [Cisco launches a developer-community cert program][6] + + + +Dell EMC said this will enhance the architecture, high-performance consistency, availability, and scalability of VxBlock and provide its customers with high-performance, end-to-end mission-critical workloads that can deliver microsecond responses. + +These new compute and storage options will be available to order sometime later this month. + +### Other VxBlock news from Dell EMC + +Dell EMC also announced it is extending its factory-integrated on-premise integrated protection solutions for VxBlock to hybrid and multi-cloud environments, such as Amazon Web Services (AWS). This update will offer to help protect VMware workloads and data via the company’s Data Domain Virtual Edition and Cloud Disaster Recovery software options. This will be available in July. + +The company also plans to release VxBlock Central 2.0 software next month. VxBlock Central is designed to help customers simplify CI administration through converged awareness, automation, and analytics. + +New to version 2.0 is modular licensing that matches workflow automation, advanced analytics, and life-cycle management/upgrade options to your needs. + +VxBlock Central 2.0 has a variety of license features, including the following: + +**Base** – Free with purchase of a VxBlock, the base license allows you to manage your system and improve compliance with inventory reporting and alerting. **Workflow Automation** – Provision infrastructure on-demand using engineered workflows through vRealize Orchestrator. New workflows available with this package include Cisco UCS server expansion with Unity and XtremIO storage arrays. **Advanced Analytics** – View capacity and KPIs to discover deeper actionable insights through vRealize Operations. **Lifecycle Management** (new, available later in 2019) – Apply “guided path” software upgrades to optimize system performance. + + * Lifecycle Management includes a new multi-tenant, cloud-based database based on Cloud IQ that will collect and store the CI component inventory structured by the customer, extending the value and ease of use of the cloud-based analytics monitoring. + * This feature extends the value and ease of use of the cloud-based analytics monitoring Cloud IQ already provides for individual Dell EMC storage arrays. + + + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402036/dell-and-cisco-extend-vxblock-integration-with-new-features.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://images.idgesg.net/images/article/2019/04/dell-emc-vxblock-1000-100794721-large.jpg +[2]: https://www.networkworld.com/article/3391071/dell-emc-and-cisco-renew-converged-infrastructure-alliance.html +[3]: https://www.ciscolive.com/global/ +[4]: https://www.networkworld.com/article/3402079/cisco-offers-cloud-based-security-for-sd-wan-resources.html +[5]: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html +[6]: https://www.networkworld.com/article/3401524/cisco-launches-a-developer-community-cert-program.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md b/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md new file mode 100644 index 0000000000..2f06f6afc1 --- /dev/null +++ b/sources/talk/20190612 IoT security vs. privacy- Which is a bigger issue.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT security vs. privacy: Which is a bigger issue?) +[#]: via: (https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +IoT security vs. privacy: Which is a bigger issue? +====== +When it comes to the internet of things (IoT), security has long been a key concern. But privacy issues could be an even bigger threat. +![Ring][1] + +If you follow the news surrounding the internet of things (IoT), you know that security issues have long been a key concern for IoT consumers, enterprises, and vendors. Those issues are very real, but I’m becoming increasingly convinced that related but fundamentally different _privacy_ vulnerabilities may well be an even bigger threat to the success of the IoT. + +In June alone, we’ve seen a flood of IoT privacy issues inundate the news cycle, and observers are increasingly sounding the alarm that IoT users should be paying attention to what happens to the data collected by IoT devices. + +**[ Also read:[It’s time for the IoT to 'optimize for trust'][2] and [A corporate guide to addressing IoT security][2] ]** + +Predictably, most of the teeth-gnashing has come on the consumer side, but that doesn’t mean enterprises users are immune to the issue. One the one hand, just like consumers, companies are vulnerable to their proprietary information being improperly shared and misused. More immediately, companies may face backlash from their own customers if they are seen as not properly guarding the data they collect via the IoT. Too often, in fact, enterprises shoot themselves in the foot on privacy issues, with practices that range from tone-deaf to exploitative to downright illegal—leading almost [two-thirds (63%) of consumers to describe IoT data collection as “creepy,”][3] while more than half (53%) “distrust connected devices to protect their privacy and handle information in a responsible manner.” + +### Ring becoming the poster child for IoT privacy issues + +As a case in point, let’s look at the case of [Ring, the IoT doorbell company now owned by Amazon][4]. Ring is [reportedly working with police departments to build a video surveillance network in residential neighborhoods][5]. Police in more than 50 cities and towns across the country are apparently offering free or discounted Ring doorbells, and sometimes requiring the recipients to share footage for use in investigations. (While [Ring touts the security benefits][6] of working with law enforcement, it has asked police departments to end the practice of _requiring_ users to hand over footage, as it appears to violate the devices’ terms of service.) + +Many privacy advocates are troubled by this degree of cooperation between police and Ring, but that’s only part of the problem. Last year, for example, [Ring workers in Ukraine reportedly watched customer feeds][7]. Amazingly, though, even that only scratches the surface of the privacy flaps surrounding Ring. + +### Guilty by video? + +According to [Motherboard][8], “Ring is using video captured by its doorbell cameras in Facebook advertisements that ask users to identify and call the cops on a woman whom local police say is a suspected thief.” While the police are apparently appreciative of the “additional eyes that may see this woman and recognize her,” the ad calls the woman a thief even though she has not been charged with a crime, much less convicted! + +Ring may be today’s poster child for IoT privacy issues, but IoT privacy complaints are widespread. In many cases, it comes down to what IoT users—or others nearby—are getting in return for giving up their privacy. According to the [Guardian][9], for example, Google’s Sidewalk Labs smart city project is little more than “surveillance capitalism.” And while car owners may get a discount on auto insurance in return for sharing their driving data, that relationship is hardly set in stone. It may not be long before drivers have to give up their data just to get insurance at all. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][10] ]** + +And as the recent [data breach at the U.S. Customs and Border Protection][11] once again demonstrates, private data is “[a genie without a bottle][12].” No matter what legal or technical protections are put in place, the data may always be revealed or used in unforeseen ways. Heck, when you put it all together, it’s enough to make you wonder [whether doorbells really need to be smart][13] at all? + +**Read more about IoT:** + + * [Google’s biggest, craziest ‘moonshot’ yet][14] + * [What is the IoT? How the internet of things works][15] + * [What is edge computing and how it’s changing the network][16] + * [Most powerful internet of things companies][17] + * [10 Hot IoT startups to watch][18] + * [The 6 ways to make money in IoT][19] + * [What is digital twin technology? [and why it matters]][20] + * [Blockchain, service-centric networking key to IoT success][21] + * [Getting grounded in IoT networking and security][22] + * [Building IoT-ready networks must become a priority][23] + * [What is the Industrial IoT? [And why the stakes are so high]][24] + + + +Join the Network World communities on [Facebook][25] and [LinkedIn][26] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401522/iot-security-vs-privacy-which-is-a-bigger-issue.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/ringvideodoorbellpro-100794084-large.jpg +[2]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[3]: https://www.cpomagazine.com/data-privacy/consumers-still-concerned-about-iot-security-and-privacy-issues/ +[4]: https://www.cnbc.com/2018/02/27/amazon-buys-ring-a-former-shark-tank-reject.html +[5]: https://www.cnet.com/features/amazons-helping-police-build-a-surveillance-network-with-ring-doorbells/ +[6]: https://blog.ring.com/2019/02/14/how-rings-neighbors-creates-safer-more-connected-communities/ +[7]: https://www.theinformation.com/go/b7668a689a +[8]: https://www.vice.com/en_us/article/pajm5z/amazon-home-surveillance-company-ring-law-enforcement-advertisements +[9]: https://www.theguardian.com/cities/2019/jun/06/toronto-smart-city-google-project-privacy-concerns +[10]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[11]: https://www.washingtonpost.com/technology/2019/06/10/us-customs-border-protection-says-photos-travelers-into-out-country-were-recently-taken-data-breach/?utm_term=.0f3a38aa40ca +[12]: https://smartbear.com/blog/test-and-monitor/data-scientists-are-sexy-and-7-more-surprises-from/ +[13]: https://slate.com/tag/should-this-thing-be-smart +[14]: https://www.networkworld.com/article/3058036/google-s-biggest-craziest-moonshot-yet.html +[15]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[16]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[17]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[18]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[19]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[20]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[21]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[22]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[23]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[24]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[25]: https://www.facebook.com/NetworkWorld/ +[26]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md b/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md new file mode 100644 index 0000000000..88a540e875 --- /dev/null +++ b/sources/talk/20190612 Software Defined Perimeter (SDP)- Creating a new network perimeter.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Software Defined Perimeter (SDP): Creating a new network perimeter) +[#]: via: (https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.html) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Software Defined Perimeter (SDP): Creating a new network perimeter +====== +Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. +![monsitj / Getty Images][1] + +Networks were initially designed to create internal segments that were separated from the external world by using a fixed perimeter. The internal network was deemed trustworthy, whereas the external was considered hostile. However, this is still the foundation for most networking professionals even though a lot has changed since the inception of the design. + +More often than not the fixed perimeter consists of a number of network and security appliances, thereby creating a service chained stack, resulting in appliance sprawl. Typically, the appliances that a user may need to pass to get to the internal LAN may vary. But generally, the stack would consist of global load balancers, external firewall, DDoS appliance, VPN concentrator, internal firewall and eventually LAN segments. + +The perimeter approach based its design on visibility and accessibility. If an entity external to the network can’t see an internal resource, then access cannot be gained. As a result, external entities were blocked from coming in, yet internal entities were permitted to passage out. However, it worked only to a certain degree. Realistically, the fixed network perimeter will always be breachable; it's just a matter of time. Someone with enough skill will eventually get through. + +**[ Related:[MPLS explained – What you need to know about multi-protocol label switching][2]** + +### Environmental changes – the cloud and mobile workforce + +Considering the way networks work today and the change in traffic patterns; both internal and to the cloud, this limits the effect of the fixed perimeter. Nowadays, we have a very fluid network perimeter with many points of entry. + +Imagine a castle with a portcullis that was used to gain access. To gain entry into the portcullis was easy as we just needed to pass one guard. There was only one way in and one way out. But today, in this digital world, we have so many small doors and ways to enter, all of which need to be individually protected. + +This boils down to the introduction of cloud-based application services and changing the location of the perimeter. Therefore, the existing networking equipment used for the perimeter is topologically ill-located. Nowadays, everything that is important is outside the perimeter, such as, remote access workers, SaaS, IaaS and PaaS-based applications. + +Users require access to the resources in various cloud services regardless of where the resources are located, resulting in complex-to-control multi-cloud environments. Objectively, the users do not and should not care where the applications are located. They just require access to the application. Also, the increased use of mobile workforce that demands anytime and anywhere access from a variety of devices has challenged the enterprises to support this dynamic workforce. + +There is also an increasing number of devices, such as, BYOD, on-site contractors, and partners that will continue to grow internal to the network. This ultimately leads to a world of over-connected networks. + +### Over-connected networks + +Over-connected networks result in complex configurations of network appliances. This results in large and complex policies without any context. + +They provide a level of coarse-grained access to a variety of services where the IP address does not correspond to the actual user. Traditional appliances that use static configurations to limit the incoming and outgoing traffic are commonly based on information in the IP packet and the port number. + +Essentially, there is no notion of policy and explanation of why a given source IP address is on the list. This approach fails to take into consideration any notion of trust and dynamically adjust access in relation to the device, users and application request events. + +### Problems with IP addresses + +Back in the early 1990s, RFC 1597 declared three IP ranges reserved for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. If an end host was configured with one of these addresses, it was considered more secure. However, this assumption of trust was shattered with the passage of time and it still haunts us today. + +Network Address Translation (NAT) also changed things to a great extent. NAT allowed internal trusted hosts to communicate directly with the external untrusted hosts. However, since Transmission Control Protocol (TCP) is bidirectional, it allows the data to be injected by the external hosts while connecting back to the internal hosts. + +Also, there is no contextual information regarding the IP addresses as the sole purpose revolved around connectivity. If you have the IP address of someone, you can connect to them. The authentication was handled higher up in the stack. + +Not only do user’s IP addresses change regularly, but there’s also not a one-to-one correspondence between the users and IP addresses. Anyone can communicate from any IP address they please and also insert themselves between you and the trusted resource. + +Have you ever heard of the 20-year old computer that responds to an internet control message protocol (ICMP) request, yet no one knows where it is? But this would not exist on a zero trust network as the network is dark until the administrator turns the lights on with a whitelist policy rule set. This is contrary to the legacy black policy rule set. You can find more information on zero trust in my course: [Zero Trust Networking: The Big Picture][3]. + +Therefore, we can’t just rely on the IP addresses and expect them to do much more other than connect. As a result, we have to move away from the IP addresses and network location as the proxy for access trust. The network location can longer be the driver of network access levels. It is not fully equipped to decide the trust of a device, user or application. + +### Visibility – a major gap + +When we analyze networking and its flaws, visibility is a major gap in today’s hybrid environments. By and large, enterprise networks are complex beasts. More than often networking pros do not have accurate data or insights into who or what is accessing the network resource. + +I.T does not have the visibility in place to detect, for example, insecure devices, unauthorized users and potentially harmful connections that could propagate malware or perform data exfiltration. + +Also, once you know how network elements connect, how do you ensure that they don’t reconnect through a broader definition of connectivity? For this, you need contextual visibility. You need full visibility into the network to see who, what, when, and how they are connecting with the device. + +### What’s the workaround? + +A new approach is needed that enables the application owners to protect the infrastructure located in a public or private cloud and on-premise data center. This new network architecture is known as [software-defined perimeter][4] (SDP). Back in 2013, Cloud Security Alliance (CSA) launched the SDP initiative, a project designed to develop the architecture for creating more robust networks. + +The principles behind SDPs are not entirely new. Organizations within the DoD and Intelligence Communities (IC) have implemented a similar network architecture that is based on authentication and authorization prior to network access. + +Typically, every internal resource is hidden behind an appliance. And a user must authenticate before visibility of the authorized services is made available and access is granted. + +### Applying the zero trust framework + +SDP is an extension to [zero trust][5] which removes the implicit trust from the network. The concept of SDP started with Google’s BeyondCorp, which is the general direction that the industry is heading to right now. + +Google’s BeyondCorp puts forward the idea that the corporate network does not have any meaning. The trust regarding accessing an application is set by a static network perimeter containing a central appliance. This appliance permits the inbound and outbound access based on a very coarse policy. + +However, access to the application should be based on other parameters such as who the user is, the judgment of the security stance of the device, followed by some continuous assessment of the session. Rationally, only then should access be permitted. + +Let’s face it, the assumption that internal traffic can be trusted is flawed and zero trust assumes that all hosts internal to the network are internet facing, thereby hostile. + +### What is software-defined perimeter (SDP)? + +The SDP aims to deploy perimeter functionality for dynamically provisioned perimeters meant for clouds, hybrid environments, and on-premise data center infrastructures. There is often a dynamic tunnel that automatically gets created during the session. That is a one-to-one mapping between the requesting entity and the trusted resource. The important point to note here is that perimeters are formed not solely to obey a fixed location already design by the network team. + +SDP relies on two major pillars and these are the authentication and authorization stages. SDPs require endpoints to authenticate and be authorized first before obtaining network access to the protected entities. Then, encrypted connections are created in real-time between the requesting systems and application infrastructure. + +Authenticating and authorizing the users and their devices before even allowing a single packet to reach the target service, enforces what's known as least privilege at the network layer. Essentially, the concept of least privilege is for an entity to be granted only the minimum privileges that it needs to get its work done. Within a zero trust network, privilege is more dynamic than it would be in traditional networks since it uses many different attributes of activity to determine the trust score. + +### The dark network + +Connectivity is based on a need-to-know model. Under this model, no DNS information, internal IP addresses or visible ports of internal network infrastructure are transmitted. This is the reason why SDP assets are considered as “dark”. As a result, SDP isolates any concerns about the network and application. The applications and users are considered abstract, be it on-premise or in the cloud, which becomes irrelevant to the assigned policy. + +Access is granted directly between the users and their devices to the application and resource, regardless of the underlying network infrastructure. There simply is no concept of inside and outside of the network. This ultimately removes the network location point as a position of advantage and also eliminates the excessive implicit trust that IP addresses offer. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][6]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402258/software-defined-perimeter-sdp-creating-a-new-network-perimeter.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://images.idgesg.net/images/article/2019/03/sdn_software-defined-network_architecture-100791938-large.jpg +[2]: https://www.networkworld.com/article/2297171/sd-wan/network-security-mpls-explained.html +[3]: http://pluralsight.com/courses/zero-trust-networking-big-picture +[4]: https://network-insight.net/2018/09/software-defined-perimeter-zero-trust/ +[5]: https://network-insight.net/2018/10/zero-trust-networking-ztn-want-ghosted/ +[6]: /contributor-network/signup.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md b/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md new file mode 100644 index 0000000000..a2271052c9 --- /dev/null +++ b/sources/talk/20190612 When to use 5G, when to use Wi-Fi 6.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When to use 5G, when to use Wi-Fi 6) +[#]: via: (https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html) +[#]: author: (Lee Doyle ) + +When to use 5G, when to use Wi-Fi 6 +====== +5G is a cellular service, and Wi-Fi 6 is a short-range wireless access technology, and each has attributes that make them useful in specific enterprise roles. +![Thinkstock][1] + +We have seen hype about whether [5G][2] cellular or [Wi-Fi 6][3] will win in the enterprise, but the reality is that the two are largely complementary with an overlap for some use cases, which will make for an interesting competitive environment through the early 2020s. + +### The potential for 5G in enterprises + +The promise of 5G for enterprise users is higher speed connectivity with lower latency. Cellular technology uses licensed spectrum which largely eliminates potential interference that may occur with unlicensed Wi-Fi spectrum. Like current 4G LTE technologies, 5G can be supplied by cellular wireless carriers or built as a private network . + +The architecture for 5G requires many more radio access points and can suffer from poor or no connectivity indoors. So, the typical organization needs to assess its [current 4G and potential 5G service][4] for its PCs, routers and other devices. Deploying indoor microcells, repeaters and distributed antennas can help solve indoor 5G service issues. As with 4G, the best enterprise 5G use case is for truly mobile connectivity such as public safety vehicles and in non-carpeted environments like mining, oil and gas extraction, transportation, farming and some manufacturing. + +In addition to broad mobility, 5G offers advantages in terms of authentication while roaming and speed of deployment as might be needed to provide WAN connectivity to a pop-up office or retail site. 5G will have the capacity to offload traffic in cases of data congestion such as live video. As 5G standards mature, the technology will improve its options for low-power IoT connectivity. + +5G will gradually roll out over the next four to five years starting in large cities and specific geographies; 4G technology will remain prevalent for a number of years. Enterprise users will need new devices, dongles and routers to connect to 5G services. For example, Apple iPhones are not expected to support 5G until 2020, and IoT devices will need specific cellular compatibility to connect to 5G. + +Doyle Research expects the 1Gbps and higher bandwidth promised by 5G will have a significant impact on the SD-WAN market. 4G LTE already enables cellular services to become a primary WAN link. 5G is likely to be cost competitive or cheaper than many wired WAN options such as MPLS or the internet. 5G gives enterprise WAN managers more options to provide increased bandwidth to their branch sites and remote users – potentially displacing MPLS over time. + +### The potential for Wi-Fi 6 in enterprises + +Wi-Fi is nearly ubiquitous for connecting mobile laptops, tablets and other devices to enterprise networks. Wi-Fi 6 (802.11ax) is the latest version of Wi-Fi and brings the promise of increased speed, low latency, improved aggregate bandwidth and advanced traffic management. While it has some similarities with 5G (both are based on orthogonal frequency division multiple access), Wi-Fi 6 is less prone to interference, requires less power (which prolongs device battery life) and has improved spectral efficiency. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][5] ]** + +As is typical for Wi-Fi, early [vendor-specific versions of Wi-Fi 6][6] are currently available from many manufacturers. The Wi-Fi alliance plans for certification of Wi-Fi 6-standard gear in 2020. Most enterprises will upgrade to Wi-Fi 6 along standard access-point life cycles of three years or so unless they have specific performance/latency requirements that prompt an upgrade sooner. + +Wi-Fi access points continue to be subject to interference, and it can be challenging to design and site APs to provide appropriate coverage. Enterprise LAN managers will continue to need vendor-supplied tools and partners to configure optimal Wi-Fi coverage for their organizations. Wi-Fi 6 solutions must be integrated with wired campus infrastructure. Wi-Fi suppliers need to do a better job at providing unified network management across wireless and wired solutions in the enterprise. + +### Need for wired backhaul + +For both technologies, wireless is combined with wired-network infrastructure to deliver high-speed communications end-to-end. In the enterprise, Wi-Fi is typically paired with wired Ethernet switches for campus and larger branches. Some devices are connected via cable to the switch, others via Wi-Fi – and laptops may use both methods. Wi-Fi access points are connected via Ethernet inside the enterprise and to the WAN or internet by fiber connections. + +The architecture for 5G makes extensive use of fiber optics to connect the distributed radio access network back to the core of the 5G network. Fiber is typically required to provide the high bandwidth needed to connect 5G endpoints to SaaS-based applications, and to provide live video and high-speed internet access. Private 5G networks will also have to meet high-speed wired-connectivity requirements. + +### Handoff issues + +Enterprise IT managers need to be concerned with handoff challenges as phones switch between 5G and Wi-Fi 6. These issues can affect performance and user satisfaction. Several groups are working towards standards to promote better interoperability between Wi-Fi 6 and 5G. As the architectures of Wi-Fi 6 align with 5G, the experience of moving between cellular and Wi-Fi networks should become more seamless. + +### 5G vs Wi-Fi 6 depends on locations, applications and devices + +Wi-Fi 6 and 5G are competitive with each other for specific situations in the enterprise environment that depend on location, application and device type. IT managers should carefully evaluate their current and emerging connectivity requirements. Wi-Fi will continue to dominate indoor environments and cellular wins for broad outdoor coverage. + +Some of the overlap cases occur in stadiums, hospitality and other large event spaces with many users competing for bandwidth. Government applications, including aspect of smart cities, can be applicable to both Wi-Fi and cellular. Health care facilities have many distributed medical devices and users that need connectivity. Large distributed manufacturing environments share similar characteristics. The emerging IoT deployments are perhaps the most interesting “competitive” environment with many overlapping use cases. + +### Recommendations for IT Leaders + +While the wireless technologies enabling them are converging, Wi-Fi 6 and 5G are fundamentally distinct networks – both of which have their role in enterprise connectivity. Enterprise IT leaders should focus on how Wi-Fi and cellular can complement each other, with Wi-Fi continuing as the in-building technology to connect PCs and laptops, offload phone and tablet data, and for some IoT connectivity. + +4G LTE moving to 5G will remain the truly mobile technology for phone and tablet connectivity, an option (via dongle) for PC connections, and increasingly popular for connecting some IoT devices. 5G WAN links will increasingly become standard as a backup for improved SD-WAN reliability and as primary links for remote offices. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html + +作者:[Lee Doyle][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://images.idgesg.net/images/article/2017/07/wi-fi_wireless_communication_network_abstract_thinkstock_610127984_1200x800-100730107-large.jpg +[2]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[3]: https://www.networkworld.com/article/3215907/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[4]: https://www.networkworld.com/article/3330603/5g-versus-4g-how-speed-latency-and-application-support-differ.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[6]: https://www.networkworld.com/article/3309439/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md b/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md new file mode 100644 index 0000000000..69b4356661 --- /dev/null +++ b/sources/talk/20190613 Data centers should sell spare UPS capacity to the grid.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data centers should sell spare UPS capacity to the grid) +[#]: via: (https://www.networkworld.com/article/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Data centers should sell spare UPS capacity to the grid +====== +Distributed Energy is gaining traction, providing an opportunity for data centers to sell excess power in data center UPS batteries to the grid. +![Getty Images][1] + +The energy storage capacity in uninterruptable power supply (UPS) batteries, languishing often dormant in data centers, could provide new revenue streams for those data centers, says Eaton, a major electrical power management company. + +Excess, grid-generated power, created during times of low demand, should be stored on the now-proliferating lithium-backup power systems strewn worldwide in data centers, Eaton says. Then, using an algorithm tied to grid-demand, electricity should be withdrawn as necessary for grid use. It would then be slid back onto the backup batteries when not needed. + +**[ Read also:[How server disaggregation can boost data center efficiency][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +The concept is called Distributed Energy and has been gaining traction in part because electrical generation is changing—emerging green power, such as wind and solar, being used now at the grid-level have considerations that differ from the now-retiring, fossil-fuel power generation. You can generate solar only in daylight, yet much demand takes place on dark evenings, for example. + +Coal, gas, and oil deliveries have always been, to a great extent, pre-planned, just-in-time, and used for electrical generation in real time. Nowadays, though, fluctuations between supply, storage, and demand are kicking in. Electricity storage on the grid is required. + +Eaton says that by piggy-backing on existing power banks, electricity distribution could be evened out better. The utilities would deliver power more efficiently, despite the peaks and troughs in demand—with the data center UPS, in effect, acting like a quasi-grid-power storage battery bank, or virtual power plant. + +The objective of this UPS use case, called EnergyAware, is to regulate frequency in the grid. That’s related to the tolerances needed to make the grid work—the cycles per second, or hertz, inherent in electrical current can’t deviate too much. Abnormalities happen if there’s a suddent spike in demand but no power on hand to supply the surge. + +### How the Distributed Energy concept works + +The distributed energy resource (DER), which can be added to any existing lithium-ion battery bank, in any building, allows for the consumption of energy, or the distribution of it, based on a Frequency Regulation grid-demand algorithm. It charges or discharges the backup battery, connected to the grid, thus balancing the grid frequency. + +Often, not much power will need to be removed, just “micro-bursts of energy,” explains Sean James, director of Energy Research at Microsoft, in an Eaton-published promotional video. Microsoft Innovation Center in Virginia has been working with Eaton on the project. Those bursts are enough to get the frequency tolerances back on track, but the UPS still functions as designed. + +Eaton says data centers should start participating in energy markets. That could mean bidding, as a producer of power, to those who need to buy it—the electricity market, also known as the grid. Data centers could conceivably even switch on generators to operate the data halls if the price for its battery-stored power was particularly lucrative at certain times. + +“A data center in the future wouldn’t just be a huge load on the grid,” James says. “In the future, you don’t have a data center or a power plant. It’s something in the middle. A data plant,” he says on the Eaton [website][4]. + +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/3402039/data-centers-should-sell-spare-ups-capacity-to-the-grid.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/business_continuity_server-100777720-large.jpg +[2]: https://www.networkworld.com/article/3266624/how-server-disaggregation-could-make-cloud-datacenters-more-efficient.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.eaton.com/us/en-us/products/backup-power-ups-surge-it-power-distribution/backup-power-ups/dual-purpose-ups-technology.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md b/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md new file mode 100644 index 0000000000..280cfd1a4a --- /dev/null +++ b/sources/talk/20190613 Oracle updates Exadata at long last with AI and machine learning abilities.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Oracle updates Exadata at long last with AI and machine learning abilities) +[#]: via: (https://www.networkworld.com/article/3402559/oracle-updates-exadata-at-long-last-with-ai-and-machine-learning-abilities.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Oracle updates Exadata at long last with AI and machine learning abilities +====== +Oracle to update the Oracle Exadata Database Machine X8 server line to include artificial intelligence (AI) and machine learning capabilities, plus support for hybrid cloud. +![Magdalena Petrova][1] + +After a rather [long period of silence][2], Oracle announced an update to its server line, the Oracle Exadata Database Machine X8, which features hardware and software enhancements that include artificial intelligence (AI) and machine learning capabilities, as well as support for hybrid cloud. + +Oracle acquired a hardware business nine years ago with the purchase of Sun Microsystems. It steadily whittled down the offerings, getting out of the commodity hardware business in favor of high-end mission-critical hardware. Whereas the Exalogic line is more of a general-purpose appliance running Oracle’s own version of Linux, Exadata is a purpose-built database server, and they really made some upgrades. + +The Exadata X8 comes with the latest Intel Xeon Scalable processors and PCIe NVME flash technology to drive performance improvements, which Oracle promises a 60% increase in I/O throughput for all-Flash storage and a 25% increase in IOPS per storage server compared to Exadata X7. The X8 offers a 60% performance improvement over the previous generation for analytics with up to 560GB per second throughput. It can scan a 1TB table in under two seconds. + +**[ Also read:[What is quantum computing (and why enterprises should care)][3] ]** + +The company also enhanced the storage server to offload Oracle Database processing, and the X8 features 60% more cores and 40% higher capacity disk drives over the X7. + +But the real enhancements come on the software side. With Exadata X8, Oracle introduces new machine-learning capabilities, such as Automatic Indexing, which continuously learns and tunes the database as usage patterns change. The Indexing technology originated with the Oracle Autonomous Database, the cloud-based software designed to automate management of Oracle databases. + +And no, MySQL is not included in the stack. This is for Oracle databases only. + +“We’re taking code from Autonomous Database and making it available on prem for our customers,” said Steve Zivanic, vice president for converged infrastructure at Oracle’s Cloud Business Group. “That enables companies rather than doing manual indexing for various Oracle databases to automate it with machine learning.” + +In one test, it took a 15-year-old Netsuite database with over 9,000 indexes built up over the lifespan of the database, and in 24 hours, its AI indexer rebuilt the indexes with just 6,000, reducing storage space and greatly increasing performance of the database, since the number of indexes to search were smaller. + +### Performance improvements with Exadata + +Zivanic cited several examples of server consolidation done with Exadata but would not identify companies by name. He told of a large healthcare company that achieved a 10-fold performance improvement over IBM Power servers and consolidated 600 Power servers with 50 Exadata systems. + +A financial services company replaced 4,000 Dell servers running Red Hat Linux and VMware with 100 Exadata systems running 6,000 production Oracle databases. Not only did it reduce its power footprint, but patching was down 99%. An unnamed retailer with 28 racks of hardware from five vendors went from installing 1,400 patches per year to 16 patches on four Exadata racks. + +Because Oracle owns the entire stack, from hardware to OS to middleware and database, Exadata can roll all of its patch components – 640 in all – into a single bundle. + +“The trend we’ve noticed is you see these [IT hardware] companies who try to maintain an erector set mentality,” said Zivanic. “And you have people saying why are we trying to build pods? Why don’t we buy finished goods and focus on our core competency rather than build erector sets?” + +### Oracle Zero Data Loss Recovery Appliance X8 now available + +Oracle also announced the availability of the Oracle Zero Data Loss Recovery Appliance X8, its database backup appliance, which offers up to 10 times faster data recovery of an Oracle Database than conventional data deduplication appliances while providing sub-second recoverability of all transactions. + +The new Oracle Recovery Appliance X8 now features 30% larger capacity, nearly a petabyte in a single rack, for the same price, Oracle says. + +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/3402559/oracle-updates-exadata-at-long-last-with-ai-and-machine-learning-abilities.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://images.techhive.com/images/article/2017/03/vid-still-79-of-82-100714308-large.jpg +[2]: https://www.networkworld.com/article/3317564/is-oracles-silence-on-its-on-premises-servers-cause-for-concern.html +[3]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md b/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md new file mode 100644 index 0000000000..d4a3a9a927 --- /dev/null +++ b/sources/talk/20190614 Report- Mirai tries to hook its tentacles into SD-WAN.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Report: Mirai tries to hook its tentacles into SD-WAN) +[#]: via: (https://www.networkworld.com/article/3403016/report-mirai-tries-to-hook-its-tentacles-into-sd-wan.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Report: Mirai tries to hook its tentacles into SD-WAN +====== + +Mirai – the software that has hijacked hundreds of thousands of internet-connected devices to launch massive DDoS attacks – now goes beyond recruiting just IoT products; it also includes code that seeks to exploit a vulnerability in corporate SD-WAN gear. + +That specific equipment – VMware’s SDX line of SD-WAN appliances – now has an updated software version that fixes the vulnerability, but by targeting it Mirai’s authors show that they now look beyond enlisting security cameras and set-top boxes and seek out any vulnerable connected devices, including enterprise networking gear. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][1] + * [How to pick an off-site data-backup method][2] + * [SD-Branch: What it is and why you’ll need it][3] + * [What are the options for security SD-WAN?][4] + + + +“I assume we’re going to see Mirai just collecting as many devices as it can,” said Jen Miller-Osborn, deputy director of threat research at Palo Alto Networks’ Unit 42, which recently issued [a report][5] about Mirai. + +### Exploiting SD-WAN gear is new + +While the exploit against the SD-WAN appliances was a departure for Mirai, it doesn’t represent a sea-change in the way its authors are approaching their work, according Miller-Osborn. + +The idea, she said, is simply to add any devices to the botnet, regardless of what they are. The fact that SD-WAN devices were targeted is more about those particular devices having a vulnerability than anything to do with their SD-WAN capabilities. + +### Responsible disclosure headed off execution of exploits + +[The vulnerability][6] itself was discovered last year by independent researchers who responsibly disclosed it to VMware, which then fixed it in a later software version. But the means to exploit the weakness nevertheless is included in a recently discovered new variant of Mirai, according to the Unit 42 report. + +The authors behind Mirai periodically update the software to add new targets to the list, according to Unit 42, and the botherders’ original tactic of simply targeting devices running default credentials has given way to a strategy that also exploits vulnerabilities in a wide range of different devices. The updated variant of the malicious software includes a total of eight new-to-Mirai exploits. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][7] ]** + +The remediated version of the VMware SD-WAN is SD-WAN Edge 3.1.2. The vulnerability still affects SD-WAN Edge 3.1.1 and earlier, [according to a VMware security advisory][8]. After the Unit 42 report came out VMware posted [a blog][9] that says it is conducting its own investigation into the matter. + +Detecting whether a given SD-WAN implementation has been compromised depends heavily on the degree of monitoring in place on the network. Any products that give IT staff the ability to notice unusual traffic to or from an affected appliance could flag that activity. Otherwise, it could be difficult to tell if anything’s wrong, Miller-Osborne said. “You honestly might not notice it unless you start seeing a hit in performance or an outside actor notifies you about it.” + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403016/report-mirai-tries-to-hook-its-tentacles-into-sd-wan.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[2]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[3]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[4]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[5]: https://unit42.paloaltonetworks.com/new-mirai-variant-adds-8-new-exploits-targets-additional-iot-devices/ +[6]: https://www.exploit-db.com/exploits/44959 +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[8]: https://www.vmware.com/security/advisories/VMSA-2018-0011.html +[9]: https://blogs.vmware.com/security/2019/06/vmsa-2018-0011-revisited.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md b/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md new file mode 100644 index 0000000000..9c31358d47 --- /dev/null +++ b/sources/talk/20190614 Western Digital launches open-source zettabyte storage initiative.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Western Digital launches open-source zettabyte storage initiative) +[#]: via: (https://www.networkworld.com/article/3402318/western-digital-launches-open-source-zettabyte-storage-initiative.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Western Digital launches open-source zettabyte storage initiative +====== +Western Digital's Zoned Storage initiative leverages new technology to create more efficient zettabyte-scale data storage for data centers by improving how data is organized when it is stored. +![monsitj / Getty Images][1] + +Western Digital has announced a project called the Zoned Storage initiative that leverages new technology to create more efficient zettabyte-scale data storage for data centers by improving how data is organized when it is stored. + +As part of this, the company also launched a [developer site][2] that will host open-source, standards-based tools and other resources. + +The Zoned Storage architecture is designed for Western Digital hardware and its shingled magnetic recording (SMR) HDDs, which hold up to 15TB of data, as well as the emerging zoned namespaces (ZNS) standard for NVMe SSDs, designed to deliver better endurance and predictability. + +**[ Now read:[What is quantum computing (and why enterprises should care)][3] ]** + +This initiative is not being retrofitted for non-SMR drives or non-NVMe SSDs. Western Digital estimates that by 2023, half of all its HDD shipments are expected to be SMR. And that will be needed because IDC predicts data will be generated at a rate of 103 zettabytes a year by 2023. + +With this project Western Digital is targeting cloud and hyperscale providers and anyone building a large data center who has to manage a large amount of data, according to Eddie Ramirez, senior director of product marketing for Western Digital. + +Western Digital is changing how data is written and stored from the traditional random 4K block writes to large blocks of sequential data, like Big Data workloads and video streams, which are rapidly growing in size and use in the digital age. + +“We are now looking at a one-size-fits-all architecture that leaves a lot of TCO [total cost of ownership] benefits on the table if you design for a single architecture,” Ramirez said. “We are looking at workloads that don’t rely on small block randomization of data but large block sequential write in nature.” + +Because drives use 4k write blocks, that leads to overprovisioning of storage, especially around SSDs. This is true of consumer and enterprise SSDs alike. My 1TB SSD drive has only 930GB available. And that loss scales. An 8TB SSD has only 6.4TB available, according to Ramirez. SSDs also have to be built with DRAM for caching of small block random writes. You need about 1GB of DRAM per 1TB of NAND to act as a buffer, according to Ramirez. + +### The benefits of Zoned Storage + +Zoned Storage allows for 15-20% more storage on a HDD the than traditional storage mechanism. It eliminates the overprovisioning of SSDs, so you get all the NAND flash the drive has and you need far fewer DRAM chips on an SSD. Additionally, Western Digital promises you will need up to one-eighth as much DRAM to act as a cache in future SSD drives, lowering the cost. + +Ramirez also said quality of service will improve, not necessarily that peak performance is better, but it will manage latency from outliers better. + +Western Digital has not disclosed what if any pricing is associated with the project. It plans to work with the open-source community, customers, and industry players to help accelerate application development around Zoned Storage through its website. + +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/3402318/western-digital-launches-open-source-zettabyte-storage-initiative.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://images.idgesg.net/images/article/2019/02/big_data_center_server_racks_storage_binary_analytics_by_monsitj_gettyimages-951389152_3x2-100787358-large.jpg +[2]: http://ZonedStorage.io +[3]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190617 5 transferable higher-education skills.md b/sources/talk/20190617 5 transferable higher-education skills.md new file mode 100644 index 0000000000..db0f584aaf --- /dev/null +++ b/sources/talk/20190617 5 transferable higher-education skills.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 transferable higher-education skills) +[#]: via: (https://opensource.com/article/19/6/5-transferable-higher-education-skills) +[#]: author: (Stephon Brown https://opensource.com/users/stephb) + +5 transferable higher-education skills +====== +If you're moving from the Ivory Tower to the Matrix, you already have +the foundation for success in the developer role. +![Two hands holding a resume with computer, clock, and desk chair ][1] + +My transition from a higher-education professional into the tech realm was comparable to moving from a pond into an ocean. There was so much to learn, and after learning, there was still so much more to learn! + +Rather than going down the rabbit hole and being overwhelmed by what I did not know, in the last two to three months, I have been able to take comfort in the realization that I was not entirely out of my element as a developer. The skills I acquired during my six years as a university professional gave me the foundation to be successful in the developer role. + +These skills are transferable in any direction you plan to go within or outside tech, and it's valuable to reflect on how they apply to your new position. + +### 1\. Composition and documentation + +Higher education is replete with opportunities to develop skills related to composition and communication. In most cases, clear writing and communication are mandatory requirements for university administrative and teaching positions. Although you may not yet be well-versed in deep technical concepts, learning documentation and writing your progress may be two of the strongest skills you bring as a former higher education administrator. All of those "In response to…" emails will finally come in handy when describing the inner workings of a class or leaving succinct comments for other developers to follow what you have implemented. + +### 2\. Problem-solving and critical thinking + +Whether you've been an adviser who sits with students and painstakingly develops class schedules for graduation or a finance buff who balances government funds, you will not leave critical thinking behind as you transition into a developer role. Although your critical thinking may have seemed specialized for your work, the skill of turning problems into opportunities is not lost when contributing to code. The experience gained while spending long days and nights revising recruitment strategies will be necessary when composing algorithms and creative ways of delivering data. Continue to foster a passion for solving problems, and you will not have any trouble becoming an efficient and skillful developer. + +### 3\. Communication + +Though it may seem to overlap with writing (above), communication spans verbal and written disciplines. When you're interacting with clients and leadership, you may have a leg up over your peers because of your higher-education experience. Being approachable and understanding how to manage interactions are skills that some software practitioners may not have fostered to an impactful level. Although you will experience days of staring at a screen and banging your head against the keyboard, you can rest well in knowing you can describe technical concepts and interact with a wide range of audiences, from clients to peers. + +### 4\. Leadership + +Sitting on that panel; planning that event; leading that workshop. All of those experiences provide you with the grounding to plan and lead smaller projects as a new developer. Leadership is not limited to heading up large and small teams; its essence lies in taking initiative. This can be volunteering to do research on a new feature or do more extensive unit tests for your code. However you use it, your foundation as an educator will allow you to go further in technology development and maintenance. + +### 5\. Research + +You can Google with the best of them. Being able to clearly truncate your query into the idea you are searching for is characteristic of a higher-education professional. Most administrator or educator jobs focus on solving problems in a defined process for qualitative, quantitative, or mixed results; therefore, cultivating your scientific mind is valuable when providing software solutions. Your research skills also open opportunities for branching into data science and machine learning. + +### Bonus: Collaboration + +Being able to reach across various offices and fields for event planning and program implementation fit well within team collaboration—both within your new team and across development teams. This may leak into the project management realm, but being able to plan and divide work between teams and establish accountability will allow you as a new developer to understand the software development lifecycle process a little more intimately because of your past related experience. + +### Summary + +As a developer jumping head-first into technology after years of walking students through the process of navigating higher education, [imposter syndrome][2] has been a constant fear since moving into technology. However, I have been able to take heart in knowing my experience as an educator and an administrator has not gone in vain. If you are like me, be encouraged in knowing that these transferable skills, some of which fall into the soft-skills and other categories, will continue to benefit you as a developer and a professional. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/5-transferable-higher-education-skills + +作者:[Stephon Brown][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/stephb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://en.wikipedia.org/wiki/Impostor_syndrome diff --git a/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md b/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md new file mode 100644 index 0000000000..31820a380b --- /dev/null +++ b/sources/talk/20190617 Use ImageGlass to quickly view JPG images as a slideshow.md @@ -0,0 +1,53 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use ImageGlass to quickly view JPG images as a slideshow) +[#]: via: (https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +Use ImageGlass to quickly view JPG images as a slideshow +====== +Want to view images from a folder one-by-one in a slideshow on Windows +10? Open source to the rescue. +![Looking back with binoculars][1] + +Welcome to today’s episode of "How Can I Make This Work?" In my case, I was trying to view a folder of JPG images as a slideshow on Windows 10. As often happens, I turned to open source to solve the issue. + +On a Mac, viewing a folder of JPG images as a slideshow is a simple matter of selecting all the images in a folder ( **Command-A** ), and then pressing **Option-Command-Y**. From there, you can advance the images with the arrow key. Of course, you can do a similar thing on Windows by selecting the first image, then clicking on the window frame's yellow **Manage** bar, then selecting **Slide Show**. There, you can control the speed, but only to a point: slow, medium, and fast. + +I wanted to advance the images in Windows the same way I do it on a Mac. Naturally, I fired up the Googler and searched for a solution. There, I found the [ImageGlass][2] open source app, [licensed GPL 3.0][3], and it did the trick perfectly. Here's what it looks like: + +![Viewing an image in ImageGlass.][4] + +### About ImageGlass + +ImageGlass was developed by Dương Diệu Pháp, a Vietnamese developer who works on the front end for Chainstack, according to his website. He collaborates with US-based [Kevin Routley][5], who "develops new features for ImageGlass." The source code is available on [GitHub][6]. + +ImageGlass supports most common image formats, including JPG, GIF, PNG, WEBP, SVG, and RAW. Users can customize this extension list easily. + +My specific problem was needing to find an image for a catalog cover. Unfortunately, it was in a folder containing dozens of photos. Navigating through the slideshow in ImageGlass, stopping on the image I wanted, and downloading it into my project folder turned out to be easy. Open source to the rescue yet again, and the app took only seconds to download and use. + +ImageGlass was featured as a Picasa alternative in Jason Baker’s article [9 open source alternatives to][7] [Picasa][7] from March 10, 2016. There are some other interesting image-related open source tools in there as well if you are in need. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/use-imageglass-view-jpg-images-slideshow-windows-10 + +作者:[Jeff Macharyas][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) +[2]: https://imageglass.org/ +[3]: https://github.com/d2phap/ImageGlass/blob/master/LICENSE +[4]: https://opensource.com/sites/default/files/uploads/imageglass-screenshot.png (Viewing an image in ImageGlass.) +[5]: https://github.com/fire-eggs +[6]: https://github.com/d2phap/ImageGlass +[7]: https://opensource.com/alternatives/picasa diff --git a/sources/talk/20190618 17 predictions about 5G networks and devices.md b/sources/talk/20190618 17 predictions about 5G networks and devices.md new file mode 100644 index 0000000000..d8833f9887 --- /dev/null +++ b/sources/talk/20190618 17 predictions about 5G networks and devices.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (17 predictions about 5G networks and devices) +[#]: via: (https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +17 predictions about 5G networks and devices +====== +Not surprisingly, the new Ericsson Mobility Report is bullish on the potential of 5G technology. Here’s a quick look at the most important numbers. +![Vertigo3D / Getty Images][1] + +_“As market after market switches on 5G, we are at a truly momentous point in time. No previous generation of mobile technology has had the potential to drive economic growth to the extent that 5G promises. It goes beyond connecting people to fully realizing the Internet of Things (IoT) and the Fourth Industrial Revolution.”_ —The opening paragraph of the [June 2019 Ericsson Mobility Report][2] + +Almost every significant technology advancement now goes through what [Gartner calls the “hype cycle.”][3] These days, Everyone expects new technologies to be met with gushing optimism and dreamy visions of how it’s going to change the world in the blink of an eye. After a while, we all come to expect the vendors and the press to go overboard with excitement, at least until reality and disappointment set in when things don’t pan out exactly as expected. + +**[ Also read:[The time of 5G is almost here][4] ]** + +Even with all that in mind, though, Ericsson’s whole-hearted embrace of 5G in its Internet Mobility Report is impressive. The optimism is backed up by lots of numbers, but they can be hard to tease out of the 36-document. So, let’s recap some of the most important top-line predictions (with my comments at the end). + +### Worldwide 5G growth projections + + 1. “More than 10 million 5G subscriptions are projected worldwide by the end of 2019.” + 2. “[We] now expect there to be 1.9 billion 5G subscriptions for enhanced mobile broadband by the end of 2024. This will account for over 20 percent of all mobile subscriptions at that time. The peak of LTE subscriptions is projected for 2022, at around 5.3 billion subscriptions, with the number declining slowly thereafter.” + 3. “In 2024, 5G networks will carry 35 percent of mobile data traffic globally.” + 4. “5G can cover up to 65 percent of the world’s population in 2024.” + 5. ”NB-IoT and Cat-M technologies will account for close to 45 percent of cellular IoT connections in 2024.” + 6. “By the end of 2024, nearly 35 percent of cellular IoT connections will be Broadband IoT, with 4G connecting the majority.” But 5G connections will support more advanced use cases. + 7. “Despite challenging 5G timelines, device suppliers are expected to be ready with different band and architecture support in a range of devices during 2019.” + 8. “Spectrum sharing … chipsets are currently in development and are anticipated to be in 5G commercial devices in late 2019." + 9. “[VoLTE][5] is the foundation for enabling voice and communication services on 5G devices. Subscriptions are expected to reach 2.1 billion by the end of 2019. … The number of VoLTE subscriptions is projected to reach 5.9 billion by the end of 2024, accounting for more than 85 percent of combined LTE and 5G subscriptions.” + + + +![][6] + +### Regional 5G projections + + 1. “In North America, … service providers have already launched commercial 5G services, both for fixed wireless access and mobile. … By the end of 2024, we anticipate close to 270 million 5G subscriptions in the region, accounting for more than 60 percent of mobile subscriptions.” + 2. “In Western Europe … The momentum for 5G in the region was highlighted by the first commercial launch in April. By the end of 2024, 5G is expected to account for around 40 percent of mobile subscriptions. + 3. In Central and Eastern Europe, … The first 5G subscriptions are expected in 2019, and will make up 15 percent of subscriptions in 2024.” + 4. “In North East Asia, … the region’s 5G subscription penetration is projected to reach 47 percent [by the end of 2024]. + 5. “[In India,] 5G subscriptions are expected to become available in 2022 and will represent 6 percent of mobile subscriptions at the end of 2024.” + 6. “In the Middle East and North Africa, we anticipate commercial 5G deployments with leading communications service providers during 2019, and significant volumes in 2021. … Around 60 million 5G subscriptions are forecast for the end of 2024, representing 3 percent of total mobile subscriptions.” + 7. “Initial 5G commercial devices are expected in the [South East Asia and Oceania] region during the first half of 2019. By the end of 2024, it is anticipated that almost 12 percent of subscriptions in the region will be for 5G.]” + 8. “In Latin America … the first 5G deployments will be possible in the 3.5GHz band during 2019. Argentina, Brazil, Chile, Colombia, and Mexico are anticipated to be the first countries in the region to deploy 5G, with increased subscription uptake forecast from 2020. By the end of 2024, 5G is set to make up 7 percent of mobile subscriptions.” + + + +### Is 5G really so inevitable? + +Considered individually, these predictions all seem perfectly reasonable. Heck, 10 million 5G subscriptions is only a drop in the global bucket. And rumors are already flying that Apple’s next round of iPhones will include 5G capability. Also, 2024 is still five years in the future, so why wouldn’t the faster connections drive impressive traffic stats? Similarly, North America and North East Asia will experience the fastest 5G penetration. + +But when you look at them all together, these numbers project a sense of 5G inevitability that could well be premature. It will take a _lot_ of spending, by a lot of different parties—carriers, chip makers, equipment vendors, phone manufacturers, and consumers—to make this kind of growth a reality. + +I’m not saying 5G won’t take over the world. I’m just saying that when so many things have to happen in a relatively short time, there are a lot of opportunities for the train to jump the tracks. Don’t be surprised if it takes longer than expected for 5G to turn into the worldwide default standard Ericsson—and everyone else—seems to think it will inevitably become. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403358/17-predictions-about-5g-networks-and-devices.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/5g_wireless_technology_network_connections_by_credit-vertigo3d_gettyimages-1043302218_3x2-100787550-large.jpg +[2]: https://www.ericsson.com/assets/local/mobility-report/documents/2019/ericsson-mobility-report-june-2019.pdf +[3]: https://www.gartner.com/en/research/methodologies/gartner-hype-cycle +[4]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[5]: https://www.gsma.com/futurenetworks/technology/volte/ +[6]: https://images.idgesg.net/images/article/2019/06/ericsson-mobility-report-june-2019-graph-100799481-large.jpg +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md b/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md new file mode 100644 index 0000000000..54a0cca26f --- /dev/null +++ b/sources/talk/20190618 Why your workplace arguments aren-t as effective as you-d like.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why your workplace arguments aren't as effective as you'd like) +[#]: via: (https://opensource.com/open-organization/19/6/barriers-productive-arguments) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland/users/ron-mcfarland) + +Why your workplace arguments aren't as effective as you'd like +====== +Open organizations rely on open conversations. These common barriers to +productive argument often get in the way. +![Arrows pointing different directions][1] + +Transparent, frank, and often contentious arguments are part of life in an open organization. But how can we be sure those conversations are _productive_ —not _destructive_? + +This is the second installment of a two-part series on how to argue and actually achieve something. In the [first article][2], I mentioned what arguments are (and are not), according to author Sinnott-Armstrong in his book _Think Again: How to Reason and Argue._ I also offered some suggestions for making arguments as productive as possible. + +In this article, I'll examine three barriers to productive arguments that Sinnott-Armstrong elaborates in his book: incivility, polarization, and language issues. Finally, I'll explain his suggestions for addressing those barriers. + +### Incivility + +"Incivility" has become a social concern in recent years. Consider this: As a tactic in arguments, incivility _can_ have an effect in certain situations—and that's why it's a common strategy. Sinnott-Armstrong notes that incivility: + + * **Attracts attention:** Incivility draws people's attention in one direction, sometimes to misdirect attention from or outright obscure other issues. It redirects people's attention to shocking statements. Incivility, exaggeration, and extremism can increase the size of an audience. + + * **Energizes:** Sinnott-Armstrong writes that seeing someone being uncivil on a topic of interest can generate energy from a state of powerlessness. + + * **Stimulates memory:** Forgetting shocking statements is difficult; they stick in our memory more easily than statements that are less surprising to us. + + * **Excites the powerless:** The groups most likely to believe and invest in someone being uncivil are those that feel they're powerless and being treated unfairly. + + + + +Unfortunately, incivility as a tactic in arguments has its costs. One such cost is polarization. + +### Polarization + +Sinnott-Armstrong writes about five forms of polarization: + + * **Distance:** If two people's or groups' views are far apart according to some relevant scale, have significant disagreements and little common ground, then they're polarized. + + * **Differences:** If two people or groups have fewer values and beliefs _in common_ than they _don't have in common_ , then they're polarized. + + * **Antagonism:** Groups are more polarized the more they feel hatred, disdain, fear, or other negative emotions toward other people or groups. + + * **Incivility:** Groups tend to be more polarized when they talk more negatively about people of the other groups. + + * **Rigidity:** Groups tend to be more polarized when they treat their values as indisputable and will not compromise. + + * **Gridlock:** Groups tend to be more polarized when they're unable to cooperate and work together toward common goals. + + + + +And I'll add one more form of polarization to Sinnott-Armstrong's list: + + * **Non-disclosure:** Groups tend to be more polarized when one or both of the groups refuses to share valid, verifiable information—or when they distract each other with useless or irrelevant information. One of the ways people polarize is by not talking to each other and withhold information. Similarly, they talk on subjects that distract us from the issue at hand. Some issues are difficult to talk about, but by doing so solutions can be explored. + + + +### Language issues + +Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. + +Language issues can be argument-stoppers Sinnott-Armstrong says. In particular, he outlines some of the following language-related barriers to productive argument. + + * **Guarding:** Using words like "all" can make a statement unbelievable; words like "sometimes" can make a statement too vague. + + * **Assuring:** Simply stating "trust me, I know what I'm talking about," without offering evidence that this is the case, can impede arguments. + + * **Evaluating:** Offering an evaluation of something—like saying "It is good"―without any supporting reasoning. + + * **Discounting:** This involves anticipating what the another person will say and attempting to weaken it as much as possible by framing an argument in a negative way. (Contrast these two sentences, for example: "Ramona is smart but boring" and "Ramona is boring but smart." The difference is subtle, but you'd probably want to spend less time with Ramona if you heard the first statement about her than if you heard the second.) + + + + +Identifying discussion-stoppers like these can help you avoid shutting down a discussion that would otherwise achieve beneficial outcomes. In addition, Sinnott-Armstrong specifically draws readers' attention to two other language problems that can kill productive debates: vagueness and ambiguity. + + * **Vagueness:** This occurs when a word or sentence is not precise enough and having many ways to interpret its true meaning and intent, which leads to confusion. Consider the sentence "It is big." "It" must be defined if it's not already obvious to everyone in the conversation. And a word like "big" must be clarified through comparison to something that everyone has agreed upon. + + * **Ambiguity:** This occurs when a sentence could have two distinct meanings. For example: "Police killed man with axe." Who was holding the axe, the man or the police? "My neighbor had a friend for dinner." Did your neighbor invite a friend to share a meal—or did she eat her friend? + + + + +### Overcoming barriers + +To help readers avoid these common roadblocks to productive arguments, Sinnott-Armstrong recommends a simple, four-step process for evaluating another person's argument. + + 1. **Observation:** First, observe a stated opinion and its related evidence to determine the precise nature of the claim. This might require you to ask some questions for clarification (you'll remember I employed this technique when arguing with my belligerent uncle, which I described [in the first article of this series][2]). + + 2. **Hypothesis:** Develop some hypothesis about the argument. In this case, the hypothesis should be an inference based on generally acceptable standards (for more on the structure of arguments themselves, also see [the first part of this series][2]). + + 3. **Comparison:** Compare that hypothesis with others and evaluate which is more accurate. More important issues will require you to conduct more comparisons. In other cases, premises are so obvious that no further explanation is required. + + 4. **Conclusion:** From the comparison analysis, reach a conclusion about whether your hypothesis about a competing argument is correct. + + + + +In many cases, the question is not whether a particular claim is _correct_ or _incorrect_ , but whether it is _believable._ So Sinnott-Armstrong also offers a four-step "believability test" for evaluating claims of this type. + + 1. **Expertise:** Does the person presenting the argument have authority in an appropriate field? Being a specialist is one field doesn't necessarily make that person an expert in another. + + 2. **Motive:** Would self-interest or other personal motives compel a person to withhold information or make false statements? To confirm one's statements, it might be wise to seek a totally separate, independent authority for confirmation. + + 3. **Sources:** Are the sources the person offers as evidence of a claim recognized experts? Do those sources have the expertise on the specific issue addressed? + + 4. **Agreement:** Is there agreement among many experts within the same specialty? + + + + +### Let's argue + +If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. + +When I was a university student, I would usually sit toward the front of the classroom. When I didn't understand something, I would start asking questions for clarification. Everyone else in the class would just sit silently, saying nothing. After class, however, other students would come up to me and thank me for asking those questions—because everyone else in the room was confused, too. + +Clarification is a powerful act—not just in the classroom, but during arguments anywhere. Building an organizational culture in which people feel empowered to ask for clarification is critical for productive arguments (I've [given presentations on this topic][3] before). If members have the courage to clarify premises, and they can do so in an environment where others don't think they're being belligerent, then this might be the key to a successful and productive argument. + +If you really want to strengthen your ability to argue, find someone that totally disagrees with you but wants to learn and understand your beliefs. Then, practice some of Sinnott-Armstrong's suggestions. Arguing productively will enhance [transparency, inclusivity, and collaboration][4] in your organization—leading to a more open culture. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/6/barriers-productive-arguments + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/directions-arrows.png?itok=EE3lFewZ (Arrows pointing different directions) +[2]: https://opensource.com/open-organization/19/5/productive-arguments +[3]: https://www.slideshare.net/RonMcFarland1/argue-successfully-achieve-something +[4]: https://opensource.com/open-organization/resources/open-org-definition diff --git a/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md b/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md new file mode 100644 index 0000000000..b3344c5eb2 --- /dev/null +++ b/sources/talk/20190619 Cisco connects with IBM in to simplify hybrid cloud deployment.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco connects with IBM in to simplify hybrid cloud deployment) +[#]: via: (https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco connects with IBM in to simplify hybrid cloud deployment +====== +Cisco and IBM are working todevelop a hybrid-cloud architecture that meld Cisco’s data-center, networking and analytics platforms with IBM’s cloud offerings. +![Ilze Lucero \(CC0\)][1] + +Cisco and IBM said the companies would meld their [data-center][2] and cloud technologies to help customers more easily and securely build and support on-premises and [hybrid-cloud][3] applications. + +Cisco, IBM Cloud and IBM Global Technology Services (the professional services business of IBM) said they will work to develop a hybrid-cloud architecture that melds Cisco’s data-center, networking and analytics platforms with IBM’s cloud offerings. IBM's contribution includea a heavy emphasis on Kubernetes-based offerings such as Cloud Foundry and Cloud Private as well as a catalog of [IBM enterprise software][4] such as Websphere and open source software such as Open Whisk, KNative, Istio and Prometheus. + +**[ Read also:[How to plan a software-defined data-center network][5] ]** + +Cisco said customers deploying its Virtual Application Centric Infrastructure (ACI) technologies can now extend that network fabric from on-premises to the IBM Cloud. ACI is Cisco’s [software-defined networking (SDN)][6] data-center package, but it also delivers the company’s Intent-Based Networking technology, which brings customers the ability to automatically implement network and policy changes on the fly and ensure data delivery. + +[IBM said Cisco ACI Virtual Pod][7] (vPOD) software can now run on IBM Cloud bare-metal servers. “vPOD consists of virtual spines and leafs and supports up to eight instances of ACI Virtual Edge. These elements are often deployed on VMware services on the IBM Cloud to support hybrid deployments from on-premises environments to the IBM Cloud," the company stated. + +“Through a new relationship with IBM’s Global Technology Services team, customers can implement Virtual ACI on their IBM Cloud,” Cisco’s Kaustubh Das, vice president of strategy and product development wrote in a [blog][8] about the agreement. “Virtual ACI is a software-only solution that you can deploy wherever you have at least two servers on which you can run the VMware ESXi hypervisor. In the future, the ability to deploy IBM Cloud Pak for Applications in a Cisco ACI environment will also be supported,” he stated. + +IBM’s prepackaged Cloud Paks include a secured Kubernetes container and containerized IBM middleware designed to let customers quickly spin-up enterprise-ready containers, Big Blue said. + +Additionally IBM said it would add support for its IBM Cloud Private, which manages Kubernetes and other containers, on Cisco HyperFlex and HyperFlex Edge hyperconverged infrastructure (HCI) systems. HyperFlex is Cisco's HCI that offers computing, networking and storage resources in a single system. The package can be managed via Cisco’s Intersight software-as-a-service cloud management platform that offers a central dashboard of HyperFlex operations. + +IBM said it was adding Hyperflex support to its IBM Cloud Pak for Applications as well. + +The paks include IBM Multicloud Manager which is a Kubernetes-based platform that runs on the company’s [IBM Cloud Private][9] platform and lets customers manage and integrate workloads on clouds from other providers such as Amazon, Red Hat and Microsoft. + +At the heart of the Multi-cloud Manager is a dashboard interface for managing thousands of Kubernetes applications and huge volumes of data regardless of where in the organization they are located. + +The idea is that Multi-cloud Manager lets operations and development teams get visibility of Kubernetes applications and components across the different clouds and clusters via a single control pane. + +“With IBM Multicloud Manager, enterprises can have a single place to manage multiple clusters running across multiple on-premises, public and private cloud environments, providing consistent visibility, governance and automation from on-premises to the edge, wrote IBM’s Evaristus Mainsah, general manager of IBM Cloud Private Ecosystem in a [blog][7] about the relationship. + +Distributed workloads can be pushed out and managed directly at the device at a much larger scale across multiple public clouds and on-premises locations. Visibility, compliance and governance are provided with extended MCM capabilities that will be available at the lightweight device layer, with a connection back to the central server/gateway, Mainsah stated. + +In addition, Cisco’s AppDynamics\can be tied in to monitor infrastructure and business performance, Cisco stated. Cisco recently added [AppDynamics for Kubernetes][10], which Cisco said will reduce the time it takes to identify and troubleshoot performance issues across Kubernetes clusters. + +The companies said the hybrid-cloud architecture they envision will help reduce the complexity of setting up and managing hybrid-cloud environments. + +Cisco and IBM are both aggressively pursuing cloud customers. Cisco[ ramped up][11] its own cloud presence in 2018 with all manner of support stemming from an [agreement with Amazon Web Services][12] (AWS) that will offer enterprise customers an integrated platform to help them more simply build, secure and connect [Kubernetes][13] clusters across private [data centers][14] and the AWS cloud. + +Cisco and Google in [April expanded their joint cloud-development][15] activities to help customers more easily build secure multicloud and hybrid applications everywhere from on-premises data centers to public clouds. + +IBM is waiting to close [its $34 billion Red Hat deal][16] that it expects will give it a huge presence in the hotly contested hybrid-cloud arena and increase its inroads to competitors – Google, Amazon and Microsoft among others. Gartner says that market will be worth $240 billion by next year. + +Join the Network World communities on [Facebook][17] and [LinkedIn][18] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.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://images.idgesg.net/images/article/2018/03/cubes_blocks_squares_containers_ilze_lucero_cc0_via_unsplash_1200x800-100752172-large.jpg +[2]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[3]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html +[4]: https://www.networkworld.com/article/3340043/ibm-marries-on-premises-private-and-public-cloud-data.html +[5]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[6]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html +[7]: https://www.ibm.com/blogs/cloud-computing/2019/06/18/ibm-cisco-collaborating-hybrid-cloud-modern-enterprise/ +[8]: https://blogs.cisco.com/datacenter/cisco-and-ibm-cloud-announce-hybrid-cloud-partnership +[9]: https://www.ibm.com/cloud/private +[10]: https://blog.appdynamics.com/product/kubernetes-monitoring-with-appdynamics/ +[11]: https://www.networkworld.com/article/3322937/lan-wan/what-will-be-hot-for-cisco-in-2019.html?nsdr=true +[12]: https://www.networkworld.com/article/3319782/cloud-computing/cisco-aws-marriage-simplifies-hybrid-cloud-app-development.html?nsdr=true +[13]: https://www.networkworld.com/article/3269848/cloud-computing/cisco-embraces-kubernetes-pushing-container-software-into-mainstream.html +[14]: https://www.networkworld.com/article/3223692/data-center/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[15]: https://www.networkworld.com/article/3388218/cisco-google-reenergize-multicloudhybrid-cloud-joint-development.html +[16]: https://www.networkworld.com/article/3316960/ibm-says-buying-red-hat-makes-it-the-biggest-in-hybrid-cloud.html +[17]: https://www.facebook.com/NetworkWorld/ +[18]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md b/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md new file mode 100644 index 0000000000..187e883706 --- /dev/null +++ b/sources/talk/20190619 Cisco issues critical security warnings on SD-WAN, DNA Center.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco issues critical security warnings on SD-WAN, DNA Center) +[#]: via: (https://www.networkworld.com/article/3403349/cisco-issues-critical-security-warnings-on-sd-wan-dna-center.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco issues critical security warnings on SD-WAN, DNA Center +====== +Vulnerabilities to Cisco's SD-WAN and DNA Center software top a list of nearly 30 security advisories issued by the company. +![zajcsik \(CC0\)][1] + +Cisco has released two critical warnings about security issues with its SD-WAN and DNA Center software packages. + +The worse, with a Common Vulnerability Scoring System rating of 9.3 out of 10, is a vulnerability in its [Digital Network Architecture][2] (DNA) Center software that could let an unauthenticated attacker connect an unauthorized network device to the subnet designated for cluster services. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][3] + * [How to pick an off-site data-backup method][4] + * [SD-Branch: What it is and why you’ll need it][5] + * [What are the options for security SD-WAN?][6] + + + +A successful exploit could let an attacker reach internal services that are not hardened for external access, Cisco [stated][7]. The vulnerability is due to insufficient access restriction on ports necessary for system operation, and the company discovered the issue during internal security testing, Cisco stated. + +Cisco DNA Center gives IT teams the ability to control access through policies using Software-Defined Access, automatically provision through Cisco DNA Automation, virtualize devices through Cisco Network Functions Virtualization (NFV), and lower security risks through segmentation and Encrypted Traffic Analysis. + +This vulnerability affects Cisco DNA Center Software releases prior to 1.3, and it is fixed in version 1.3 and releases after that. + +Cisco wrote that system updates are available from the Cisco cloud but not from the [Software Center][8] on Cisco.com. To upgrade to a fixed release of Cisco DNA Center Software, administrators can use the “System Updates” feature of the software. + +A second critical warning – with a CVVS score of 7.8 – is a weakness in the command-line interface of the Cisco SD-WAN Solution that could let an authenticated local attacker elevate lower-level privileges to the root user on an affected device. + +Cisco [wrote][9] that the vulnerability is due to insufficient authorization enforcement. An attacker could exploit this vulnerability by authenticating to the targeted device and executing commands that could lead to elevated privileges. A successful exploit could let the attacker make configuration changes to the system as the root user, the company stated. + +This vulnerability affects a range of Cisco products running a release of the Cisco SD-WAN Solution prior to Releases 18.3.6, 18.4.1, and 19.1.0 including: + + * vBond Orchestrator Software + * vEdge 100 Series Routers + * vEdge 1000 Series Routers + * vEdge 2000 Series Routers + * vEdge 5000 Series Routers + * vEdge Cloud Router Platform + * vManage Network Management Software + * vSmart Controller Software + + + +Cisco said it has released free [software updates][10] that address the vulnerability described in this advisory. Cisco wrote that it fixed this vulnerability in Release 18.4.1 of the Cisco SD-WAN Solution. + +The two critical warnings were included in a dump of [nearly 30 security advisories][11]. + +There were two other “High” impact rated warnings involving the SD-WAN software. + +One, a vulnerability in the vManage web-based UI (Web UI) of the Cisco SD-WAN Solution could let an authenticated, remote attacker gain elevated privileges on an affected vManage device, Cisco [wrote][12]. + +The vulnerability is due to a failure to properly authorize certain user actions in the device configuration. An attacker could exploit this vulnerability by logging in to the vManage Web UI and sending crafted HTTP requests to vManage. A successful exploit could let attackers gain elevated privileges and make changes to the configuration that they would not normally be authorized to make, Cisco stated. + +Another vulnerability in the vManage web-based UI could let an authenticated, remote attacker inject arbitrary commands that are executed with root privileges. + +This exposure is due to insufficient input validation, Cisco [wrote][13]. An attacker could exploit this vulnerability by authenticating to the device and submitting crafted input to the vManage Web UI. + +Both vulnerabilities affect Cisco vManage Network Management Software that is running a release of the Cisco SD-WAN Solution prior to Release 18.4.0 and Cisco has released free [software updates][10] to correct them. + +Other high-rated vulnerabilities Cisco disclosed included: + + * A [vulnerability][14] in the Cisco Discovery Protocol (CDP) implementation for the Cisco TelePresence Codec (TC) and Collaboration Endpoint (CE) Software could allow an unauthenticated, adjacent attacker to inject arbitrary shell commands that are executed by the device. + * A [weakness][15] in the internal packet-processing functionality of the Cisco StarOS operating system running on virtual platforms could allow an unauthenticated, remote attacker to cause an affected device to stop processing traffic, resulting in a denial of service (DoS) condition. + * A [vulnerability][16] in the web-based management interface of the Cisco RV110W Wireless-N VPN Firewall, Cisco RV130W Wireless-N Multifunction VPN Router, and Cisco RV215W Wireless-N VPN Router could allow an unauthenticated, remote attacker to cause a reload of an affected device, resulting in a denial of service (DoS) condition. + + + +Cisco has [released software][10] fixes for those advisories as well. + +Join the Network World communities on [Facebook][17] and [LinkedIn][18] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403349/cisco-issues-critical-security-warnings-on-sd-wan-dna-center.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://images.idgesg.net/images/article/2018/04/lightning_storm_night_gyorgy_karoly_toth_aka_zajcsik_cc0_via_pixabay_1200x800-100754504-large.jpg +[2]: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html +[3]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[4]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[5]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[6]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[7]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-dnac-bypass +[8]: https://software.cisco.com/download/home +[9]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-privesca +[10]: https://tools.cisco.com/security/center/resources/security_vulnerability_policy.html#fixes +[11]: https://tools.cisco.com/security/center/publicationListing.x?product=Cisco&sort=-day_sir&limit=50#~Vulnerabilities +[12]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-privilescal +[13]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-sdwan-cmdinj +[14]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-tele-shell-inj +[15]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-staros-asr-dos +[16]: https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20190619-rvrouters-dos +[17]: https://www.facebook.com/NetworkWorld/ +[18]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md b/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md new file mode 100644 index 0000000000..d0d1d24cb6 --- /dev/null +++ b/sources/talk/20190619 With Tableau, SaaS king Salesforce becomes a hybrid cloud company.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (With Tableau, SaaS king Salesforce becomes a hybrid cloud company) +[#]: via: (https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +With Tableau, SaaS king Salesforce becomes a hybrid cloud company +====== +Once dismissive of software, Salesforce acknowledges the inevitability of the hybrid cloud. +![Martyn Williams/IDGNS][1] + +I remember a time when people at Salesforce events would hand out pins that read “Software” inside a red circle with a slash through it. The High Priest of SaaS (a.k.a. CEO Marc Benioff) was so adamant against installed, on-premises software that his keynotes were always comical. + +Now, Salesforce is prepared to [spend $15.7 billion to acquire Tableau Software][2], the leader in on-premises data analytics. + +On the hell-freezes-over scale, this is up there with Microsoft embracing Linux or Apple PR people returning a phone call. Well, we know at least one of those has happened. + +**[ Also read:[Hybrid Cloud: The time for adoption is upon us][3] | Stay in the know: [Subscribe and get daily newsletter updates][4] ]** + +So, why would a company that is so steeped in the cloud, so anti-on-premises software, make such a massive purchase? + +Partly it is because Benioff and company are finally coming to the same conclusion as most everyone else: The hybrid cloud, a mix of on-premises systems and public cloud, is the wave of the future, and pure cloud plays are in the minority. + +The reality is that data is hybrid and does not sit in a single location, and Salesforce is finally acknowledging this, said Tim Crawford, president of Avoa, a strategic CIO advisory firm. + +“I see the acquisition of Tableau by Salesforce as less about getting into the on-prem game as it is a reality of the world we live in. Salesforce needed a solid analytics tool that went well beyond their existing capability. Tableau was that tool,” he said. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][5] ]** + +Salesforce also understands that they need a better understanding of customers and those data insights that drive customer decisions. That data is both on-prem and in the cloud, Crawford noted. It is in Salesforce, other solutions, and the myriad of Excel spreadsheets spread across employee systems. Tableau crosses the hybrid boundaries and brings a straightforward way to visualize data. + +Salesforce had analytics features as part of its SaaS platform, but it was geared around their own platform, whereas everyone uses Tableau and Tableau supports all manner of analytics. + +“There’s a huge overlap between Tableau customers and Salesforce customers,” Crawford said. “The data is everywhere in the enterprise, not just in Salesforce. Salesforce does a great job with its own data, but Tableau does great with data in a lot of places because it’s not tied to one platform. So, it opens up where the data comes from and the insights you get from the data.” + +Crawford said that once the deal is done and Tableau is under some deeper pockets, the organization may be able to innovate faster or do things they were unable to do prior. That hardly indicates Tableau was struggling, though. It pulled in [$1.16 billion in revenue][6] in 2018. + +Crawford also expects Salesforce to push Tableau to open up new possibilities for customer insights by unlocking customer data inside and outside of Salesforce. One challenge for the two companies is to maintain that neutrality so that they don’t lose the ability to use Tableau for non-customer centric activities. + +“It’s a beautiful way to visualize large sets of data that have nothing to do with customer centricity,” he said. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403442/with-tableau-saas-king-salesforce-becomes-a-hybrid-cloud-company.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://images.techhive.com/images/article/2015/09/150914-salesforce-dreamforce-2-100614575-large.jpg +[2]: https://www.cio.com/article/3402026/how-salesforces-tableau-acquisition-will-impact-it.html +[3]: http://www.networkworld.com/article/2172875/cloud-computing/hybrid-cloud--the-year-of-adoption-is-upon-us.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[6]: https://www.geekwire.com/2019/tableau-hits-841m-annual-recurring-revenue-41-transition-subscription-model-continues/ +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md b/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md new file mode 100644 index 0000000000..072b172fda --- /dev/null +++ b/sources/talk/20190620 Carrier services help expand healthcare, with 5G in the offing.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Carrier services help expand healthcare, with 5G in the offing) +[#]: via: (https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Carrier services help expand healthcare, with 5G in the offing +====== +Many telehealth initiatives tap into wireless networking supplied by service providers that may start offering services such as Citizen's Band and 5G to support remote medical care. +![Thinkstock][1] + +There are connectivity options aplenty for most types of [IoT][2] deployment, but the idea of simply handing the networking part of the equation off to a national licensed wireless carrier could be the best one for certain kinds of deployments in the medical field. + +Telehealth systems, for example, are still a relatively new facet of modern medicine, but they’re already among the most important applications that use carrier networks to deliver care. One such system is operated by the University of Mississippi Medical Center, for the treatment and education of diabetes patients. + +**[More on wireless:[The time of 5G is almost here][3]]** + +**[ Now read[20 hot jobs ambitious IT pros should shoot for][4]. ]** + +Greg Hall is the director of IT at UMMC’s center for telehealth. He said that the remote patient monitoring system is relatively simple by design – diabetes patients receive a tablet computer that they can use to input and track their blood sugar levels, alert clinicians to symptoms like nerve pain or foot sores, and even videoconference with their doctors directly. The tablet connects via Verizon, AT&T or CSpire – depending on who’s got the best coverage in a given area – back to UMMC’s servers. + +According to Hall, there are multiple advantages to using carrier connectivity instead of unlicensed (i.e. purpose-built [Wi-Fi][5] or other technology) to connect patients – some of whom live in remote parts of the state – to their caregivers. + +“We weren’t expecting everyone who uses the service to have Wi-Fi,” he said, “and they can take their tablet with them if they’re traveling.” + +The system serves about 250 patients in Mississippi, up from roughly 175 in the 2015 pilot program that got the effort off the ground. Nor is it strictly limited to diabetes care – Hall said that it’s already been extended to patients suffering from chronic obstructive pulmonary disease, asthma and even used for prenatal care, with further expansion in the offing. + +“The goal of our program isn’t just the monitoring piece, but also the education piece, teaching a person to live with their [condition] and thrive,” he said. + +It hasn’t all been smooth sailing. One issue was caused by the natural foliage of the area, as dense areas of pine trees can cause transmission problems, thanks to their needles being a particularly troublesome length and interfering with 2.5GHz wireless signals. But Hall said that the team has been able to install signal boosters or repeaters to overcome that obstacle. + +Neurologist Dr. Allen Gee’s practice in Wyoming attempts to address a similar issue – far-flung patients with medical needs that might not be addressed by the sparse local-care options. From his main office in Cody, he said, he can cover half the state via telepresence, using a purpose-built system that is based on cellular-data connectivity from TCT, Spectrum and AT&T, as well as remote audiovisual equipment and a link to electronic health records stored in distant locations. That allows him to receive patient data, audio/visual information and even imaging diagnostics remotely. Some specialists in the state are able to fly to those remote locations, others are not. + +While Gee’s preference is to meet with patients in person, that’s just not always possible, he said. + +“Medical specialists don’t get paid for windshield time,” he noted. “Being able to transfer information from an EHR facilitates the process of learning about the patient.” + +### 5G is coming** + +** + +According to Alan Stewart-Brown, vice president at infrastructure management vendor Opengear, there’s a lot to like about current carrier networks for medical use – particularly wide coverage and a lack of interference – but there are bigger things to come. + +“We have customers that have equipment in ambulances for instance, where they’re livestreaming patients’ vital signs to consoles that doctors can monitor,” he said. “They’re using carrier 4G for that right now and it works well enough, but there are limitations, namely latency, which you don’t get on [5G][6].” + +Beyond the simple fact of increased throughput and lower latency, widespread 5G deployments could open a wide array of new possibilities for medical technology, mostly involving real-time, very-high-definition video streaming. These include medical VR, remote surgery and the like. + +“The process you use to do things like real-time video – right now on a 4G network, that may or may not have a delay,” said Stewart-Brown. “Once you can get rid of the delay, the possibilities are endless as to what you can use the technology for.” + +### Citizens band + +Ron Malenfant, chief architect for service provider IoT at Cisco, agreed that the future of 5G for medical IoT is bright, but said that the actual applications of the technology have to be carefully thought out. + +“The use cases need to be worked on,” he said. “The innovative [companies] are starting to say ‘OK, what does 5G mean to me’ and starting to plan use cases.” + +One area that the carriers themselves have been eyeing recently is the CBRS band of radio frequencies, which sits around 3.5GHz. It’s what’s referred to as “lightly licensed” spectrum, in that parts of it are used for things like CB radio and other parts are the domain of the U.S. armed forces, and it could be used to build private networks for institutional users like hospitals, instead of deploying small but expensive 4G cells. The idea is that the institutions would be able to lease those frequencies for their specific area from the carrier directly for private LTE/CBRS networks, and, eventually 5G, Malenfant said. + +There’s also the issue, of course, that there are still a huge amount of unknowns around 5G, which isn’t expected to supplant LTE in the U.S. for at least another year or so. The medical field’s stiff regulatory requirements could also prove a stumbling block for the adoption of newer wireless technology. + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403366/carrier-services-help-expand-healthcare-with-5g-in-the-offing.html + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/stethoscope_mobile_healthcare_ipad_tablet_doctor_patient-100765655-large.jpg +[2]: https://www.networkworld.com/article/3207535/what-is-iot-how-the-internet-of-things-works.html +[3]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[4]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[5]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[6]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md b/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md new file mode 100644 index 0000000000..5ff550d3fc --- /dev/null +++ b/sources/talk/20190620 Cracks appear in Intel-s grip on supercomputing.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cracks appear in Intel’s grip on supercomputing) +[#]: via: (https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Cracks appear in Intel’s grip on supercomputing +====== +New competitors threaten to take Intel’s dominance in the high-performance computing (HPC) world, and we’re not even talking about AMD (yet). +![Randy Wong/LLNL][1] + +It’s June, so it’s that time again for the twice-yearly Top 500 supercomputer list, where bragging rights are established or, in most cases, reaffirmed. The list constantly shifts as new trends appear, and one of them might be a break in Intel’s dominance. + +[Supercomputers in the top 10 list][2] include a lot of IBM Power-based systems, and almost all run Nvidia GPUs. But there’s more going on than that. + +For starters, an ARM supercomputer has shown up, at #156. [Astra][3] at Sandia National Laboratories is an HPE system running Cavium (now Marvell) ThunderX2 processors. It debuted on the list at #204 last November, but thanks to upgrades, it has moved up the list. It won’t be the last ARM server to show up, either. + +**[ Also see:[10 of the world's fastest supercomputers][2] | Get daily insights: [Sign up for Network World newsletters][4] ]** + +Second is the appearance of four Nvidia DGX servers, with the [DGX SuperPOD][5] ranking the highest at #22. [DGX systems][6] are basically compact GPU boxes with a Xeon just to boot the thing. The GPUs do all the heavy lifting. + +AMD hasn’t shown up yet with the Epyc processors, but it will, given Cray is building them for the government. + +This signals a breaking up of the hold Intel has had on the high-performance computing (HPC) market for a long time, said Ashish Nadkarni, group vice president in IDC's worldwide infrastructure practice. “The Intel hold has already been broken up by all the accelerators in the supercomputing space. The more accelerators they use, the less need they have for Xeons. They can go with other processors that do justice to those accelerators,” he told me. + +With so much work in HPC and artificial intelligence (AI) being done by GPUs, the x86 processor becomes just a boot processor in a way. I wasn’t kidding about the DGX box. It’s got one Xeon and eight Tesla GPUs. And the Xeon is an E5, a midrange part. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][7] ]** + +“They don’t need high-end Xeons in servers any more, although there’s a lot of supercomputers that just use CPUs. The fact is there are so many options now,” said Nadkarni. One example of an all-CPU system is [Frontera][8], a Dell-based system at the Texas Advanced Computing Center in Austin. + +The top two computers, Sierra and Summit, both run IBM Power9 RISC processors, as well as Nvidia GPUs. All told, Nvidia is in 125 of the 500 supercomputers, including five of the top 10, the fastest computer in the world, the fastest in Europe (Piz Daint) and the fastest in Japan (ABCI). + +Lenovo was the top hardware provider, beating out Dell, HPE, and IBM combined. That’s because of its large presence in its native China. Nadkari said Lenovo, which acquired the IBM x86 server business in 2014, has benefitted from the IBM installed base, which has continued wanting the same tech from Lenovo under new ownership. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3403443/cracks-appear-in-intels-grip-on-supercomputing.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://images.idgesg.net/images/article/2018/10/sierra875x500-100778404-large.jpg +[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[3]: https://www.top500.org/system/179565 +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.top500.org/system/179691 +[6]: https://www.networkworld.com/article/3196088/nvidias-new-volta-based-dgx-1-supercomputer-puts-400-servers-in-a-box.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[8]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html#slide7 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md b/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md new file mode 100644 index 0000000000..ade07dcb10 --- /dev/null +++ b/sources/talk/20190620 Several deals solidify the hybrid cloud-s status as the cloud of choice.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Several deals solidify the hybrid cloud’s status as the cloud of choice) +[#]: via: (https://www.networkworld.com/article/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Several deals solidify the hybrid cloud’s status as the cloud of choice +====== +On-premises and cloud connections are being built by all the top vendors to bridge legacy and modern systems, creating hybrid cloud environments. +![Getty Images][1] + +The hybrid cloud market is expected to grow from $38.27 billion in 2017 to $97.64 billion by 2023, at a Compound Annual Growth Rate (CAGR) of 17.0% during the forecast period, according to Markets and Markets. + +The research firm said the hybrid cloud is rapidly becoming a leading cloud solution, as it provides various benefits, such as cost, efficiency, agility, mobility, and elasticity. One of the many reasons is the need for interoperability standards between cloud services and existing systems. + +Unless you are a startup company and can be born in the cloud, you have legacy data systems that need to be bridged, which is where the hybrid cloud comes in. + +So, in very short order we’ve seen a bunch of new alliances involving the old and new guard, reiterating that the need for hybrid solutions remains strong. + +**[ Read also:[What hybrid cloud means in practice][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +### HPE/Google + +In April, the Hewlett Packard Enterprise (HPE) and Google announced a deal where HPE introduced a variety of server solutions for Google Cloud’s Anthos, along with a consumption-based model for the validated HPE on-premises infrastructure that is integrated with Anthos. + +Following up with that, the two just announced a strategic partnership to create a hybrid cloud for containers by combining HPE’s on-premises infrastructure, Cloud Data Services, and GreenLake consumption model with Anthos. This allows for: + + * Bi-directional data mobility for data mobility and consistent data services between on-premises and cloud + * Application workload mobility to move containerized app workloads across on-premises and multi-cloud environments + * Multi-cloud flexibility, offering the choice of HPE Cloud Volumes and Anthos for what works best for the workload + * Unified hybrid management through Anthos, so customers can get a unified and consistent view of their applications and workloads regardless of where they reside + * Charged as a service via HPE GreenLake + + + +### IBM/Cisco + +This is a furthering of an already existing partnership between IBM and Cisco designed to deliver a common and secure developer experience across on-premises and public cloud environments for building modern applications. + +[Cisco said it will support IBM Cloud Private][4], an on-premises container application development platform, on Cisco HyperFlex and HyperFlex Edge hyperconverged infrastructure. This includes support for IBM Cloud Pak for Applications. IBM Cloud Paks deliver enterprise-ready containerized software solutions and developer tools for building apps and then easily moving to any cloud—public or private. + +This architecture delivers a common and secure Kubernetes experience across on-premises (including edge) and public cloud environments. IBM’s Multicloud Manager covers monitoring and management of clusters and container-based applications running from on-premises to the edge, while Cisco’s Virtual Application Centric Infrastructure (ACI) will allow customers to extend their network fabric from on-premises to the IBM Cloud. + +### IBM/Equinix + +Equinix expanded its collaboration with IBM Cloud to bring private and scalable connectivity to global enterprises via Equinix Cloud Exchange Fabric (ECX Fabric). This provides private connectivity to IBM Cloud, including Direct Link Exchange, Direct Link Dedicated and Direct Link Dedicated Hosting, that is secure and scalable. + +ECX Fabric is an on-demand, SDN-enabled interconnection service that allows any business to connect between its own distributed infrastructure and any other company’s distributed infrastructure, including cloud providers. Direct Link provides IBM customers with a connection between their network and IBM Cloud. So ECX Fabric provides IBM customers with a secured and scalable network connection to the IBM Cloud service. + +At the same time, ECX Fabric provides secure connections to other cloud providers, and most customers prefer a multi-vendor approach to avoid vendor lock-in. + +“Each of the partnerships focus on two things: 1) supporting a hybrid-cloud platform for their existing customers by reducing the friction to leveraging each solution and 2) leveraging the unique strength that each company brings. Each of the solutions are unique and would be unlikely to compete directly with other partnerships,” said Tim Crawford, president of Avoa, an IT consultancy. + +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/3403354/several-deals-solidify-the-hybrid-clouds-status-as-the-cloud-of-choice.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://images.idgesg.net/images/article/2019/02/cloud_hand_plus_sign_private-100787051-large.jpg +[2]: https://www.networkworld.com/article/3249495/what-hybrid-cloud-mean-practice +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3403363/cisco-connects-with-ibm-in-to-simplify-hybrid-cloud-deployment.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190625 You Can-t Afford Not to Use a Business-Driven SD-WAN.md b/sources/talk/20190625 You Can-t Afford Not to Use a Business-Driven SD-WAN.md new file mode 100644 index 0000000000..eb2dc6f18e --- /dev/null +++ b/sources/talk/20190625 You Can-t Afford Not to Use a Business-Driven SD-WAN.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You Can’t Afford Not to Use a Business-Driven SD-WAN) +[#]: via: (https://www.networkworld.com/article/3404618/you-can-t-afford-not-to-use-a-business-driven-sd-wan.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +You Can’t Afford Not to Use a Business-Driven SD-WAN +====== + +![maxkabakov/istock][1] + +Digital transformation and cloud initiatives are changing the way IT organizations are thinking about and architecting the wide area network. It is estimated that over 70 percent of applications have already moved to the cloud. Yet, the transformational promise of the cloud is falling short as conventional networks can’t keep pace with demands of the cloud. Why? Because today’s router-centric and basic [SD-WAN][2] architectures have either hit the wall or can’t keep up with traffic pattern shifts, distributed applications and the open security perimeters inherent to the cloud. This blog will explore the limitations of today’s WAN approaches, offering a better way forward with a business-first networking model. + +### **Traditional Router-centric WAN** + +The traditional router-centric model is network-driven, where businesses are forced to conform to the constraints of the network. Enterprises struggle trying to stretch the old router-centric WAN – it’s too cumbersome and complicated and is simply unable to meet the business needs of a cloud-first enterprise. Cloud-first enterprise business requirements include: + + * Using the internet to connect users directly to cloud applications + * Delivering new applications to 1000s of sites, across multiple clouds, in 10 percent of the time + * Delivering 10x more bandwidth at the edge, for the same budget + * Protecting the business when the cloud is open, accessible and everything is connected + * Continuously delivering a WOW application performance for every business-critical application + + + +![][3] + +### **Basic SD-WAN Solutions** + +To address the requirements of cloud-first businesses, a plethora of SD-WAN solutions have emerged in the past few years. Basic SD-WAN solutions are a step in the right direction but fall well short of the goal of a fully automated business-driven network. A basic SD-WAN provides some level of automation and intelligence, but it is unable to continuously and automatically adapt to changing network conditions. A basic SD-WAN solution can’t deliver a consistent WOW experience for real-time voice and video applications, especially over broadband. Furthermore, with a basic SD-WAN, IT is unable to deliver a simplified end-to-end secure segmentation across the LAN-WAN-LAN/Data Center to minimize the attack surface.  A basic SD-WAN also won’t deliver on the promised savings in operational costs. The graphic below illustrates the short falls of a basic SD-WAN offering.  + +![][4] + +### **The Time is Now to Shift to a Business-driven SD-WAN** + +With a [business-driven SD-WAN][5], the network becomes a business enabler, not a constraint. It acts as a business accelerant with a top-down approach that starts with business intent. Business intent defines how applications should be delivered to end users. Business intent can include performance, priority, security, resiliency, routing, etc. that should be applied to different classes of applications. With a business-driven SD-WAN, network resources are matched – automatically – based on the business priority and security requirements for every application. The network continuously monitors the performance of applications and transport resources and automatically adapts to any changes to remain in compliance with application QoS and security policies. A business-driven SD-WAN delivers the highest quality of experience for users with consistent, reliable application performance – including the highest quality voice and video over broadband.  + +The highest quality of experience doesn’t stop with users. With [centralized orchestration][6], a business-driven SD-WAN minimizes human error, makes changes easier and enables faster response to business needs. A business-driven SD-WAN goes beyond the automation and templates of basic SD-WAN solutions to power a self-driving wide area network™ that learns and adapts to the changing requirements of the business to ensure the highest levels of end user and application performance. It eliminates the impact of brownouts and blackouts as monitoring and analytics detect changing conditions and trigger immediate adjustments. Built-in monitoring, alarms/alerts and reporting enables faster troubleshooting when issues occur. With a highly available, resilient, business-driven SD-WAN, IT can reclaim their weekends and sleep through the night!  A unified platform is designed as one unifying and orchestrating network functions such as SD-WAN, firewall, segmentation, routing, WAN optimization, application visibility and control based on business requirements. With service chaining, to ecosystem partners (security, cloud and service providers), existing investments can be fully leveraged with rapid deployment, interoperating with full and open APIs.     + +![][7] + +In this table, a comparison of router-centric, basic SD-WAN and business-driven SD-WAN shows that enterprises get the most value and benefits from shifting to a business-first networking model.  + +![Full Harvey Ball: Most; Empty Harvey Ball: Least][8] + +Click on the [infographic][9] for a full summary of the WAN edge architecture approaches. + +![][10] + +With an interactive ROI calculator, you can calculate savings between a business-driven SD-WAN from Silver Peak and a traditional router-centric SD-WAN. Click [here][11] to calculate your savings right now. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3404618/you-can-t-afford-not-to-use-a-business-driven-sd-wan.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/06/istock-1073941846-100800084-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://images.idgesg.net/images/article/2019/06/illo_1-100800095-large.jpg +[4]: https://images.idgesg.net/images/article/2019/06/illo_2-100800097-large.jpg +[5]: https://www.silver-peak.com/products/unity-edge-connect +[6]: https://www.silver-peak.com/products/unity-orchestrator +[7]: https://images.idgesg.net/images/article/2019/06/illo_3-100800099-large.jpg +[8]: https://images.idgesg.net/images/article/2019/06/sd-wan-comparison-chart4-100800100-large.jpg +[9]: https://www.silver-peak.com/sites/default/files/infoctr/sd-wan-comparison-diagram-0119.pdf +[10]: https://images.idgesg.net/images/article/2019/06/acomparisonoftodayswanedgeapproaches-100800113-large.jpg +[11]: https://www.silver-peak.com/sd-wan-interactive-roi-calculator diff --git a/sources/talk/20190626 Juniper-s Mist adds WiFi 6, AI-based cloud services to enterprise edge.md b/sources/talk/20190626 Juniper-s Mist adds WiFi 6, AI-based cloud services to enterprise edge.md new file mode 100644 index 0000000000..0548e968fe --- /dev/null +++ b/sources/talk/20190626 Juniper-s Mist adds WiFi 6, AI-based cloud services to enterprise edge.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Juniper’s Mist adds WiFi 6, AI-based cloud services to enterprise edge) +[#]: via: (https://www.networkworld.com/article/3405123/juniper-s-mist-adds-wifi-6-ai-based-cloud-services-to-enterprise-edge.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Juniper’s Mist adds WiFi 6, AI-based cloud services to enterprise edge +====== +Mist, a Juniper Networks company, has rolled out an artificial-intelligence, cloud-based appliance and a WIFI 6 access point aimed at helping users roll out smart, high-density wireless networks. +![Getty Images][1] + +Mist, now a Juniper Networks company, has rolled out an artificial-intelligence, cloud-based appliance and a WiFi 6 access point that together aim at helping users deploy smart, high-density wireless networks. + +Leading the rollout is the Mist Edge appliance that extends Mist’s cloud services to the branch and lets enterprises manage the distributed Wi-Fi infrastructure from a central location.  + +**More about 802.11ax (Wi-Fi 6)** + + * [Why 802.11ax is the next big thing in wireless][2] + * [FAQ: 802.11ax Wi-Fi][3] + * [Wi-Fi 6 (802.11ax) is coming to a router near you][4] + * [Wi-Fi 6 with OFDMA opens a world of new wireless possibilities][5] + * [802.11ax preview: Access points and routers that support Wi-Fi 6 are on tap][6] + + + +The Mist Edge device features the company’s artificial-intelligence engine that helps automate tasks such as adjusting Wi-Fi signal strength and troubleshooting.  According to Mist, some other potential use cases for Mist Edge include: + + * Seamless roaming for large campus networks through on-premises tunnel termination of traffic to/from access points. + * Extending virtual LANs (VLANs) to distributed branches and telecommuters to replace remote virtual private network (VPN) technology. + * Dynamic traffic segmentation for IoT devices. + * The ability to split tunneling to keep guest access and corporate traffic separate. + + + +The company says a software-only version of Mist Edge will be available in the future.  + +[Mist’s][7] strength is its AI-based wireless platform which makes Wi-Fi more predictable, reliable and measurable. Mist is also unique in how it has delivered applications via cloud microservices and containers which could be attractive to enterprise users looking to reduce wireless operational costs, experts say.  + +Mist’s cloud-based system brings patented dynamic packet capture and machine learning technology to automatically identify, adapt and fix network issues, Gartner wrote in a recent Magic Quadrant report. The Mist system is delivered and managed via cloud services. + +“Mist's AI-driven Wi-Fi provides guest access, network management, policy applications and a virtual network assistant as well as analytics, IoT segmentation, and behavioral analysis at scale,” Gartner stated.  “Mist offers a new and unique approach to high-accuracy location services through a cloud-based machine-learning engine that uses Wi-Fi and Bluetooth Low Energy (BLE)-based signals from its multielement directional-antenna access points. The same platform can be used for Real Time Location System (RTLS) usage scenarios, static or zonal applications, and engagement use cases like wayfinding and proximity notifications.” + +Juniper bought Mist in March for $405 million for this AI-based WIFI technology.  For Juniper the Mist buy was significant as it had depended on agreements with partners such as Aerohive and Aruba to deliver wireless, according to Gartner.  + +Mist, too, has partners and recently announced joint product development with VMware that integrates Mist WLAN technology and VMware’s VeloCloud-based NSX SD-WAN. + +“Mist has focused on large enterprises and has won some very well known brands,” said Chris Depuy, technology analyst with the 650 Group.  “The [Mist/Juniper] combination is a good fit because both product lines are focusing on larger enterprises and over time, we expect Mist AI will be used to benefit the entire Juniper campus portfolio.” + +The other part of the company’s rollout is a WiFi 6 (802.11ax) access point, the Mist AP43, a cloud-managed WiFi 6 access point with integrated support for Mist’s AI automation and manageability. + +“The new access point gets Juniper to 802.11ax on the same time frame as other major competitors like Cisco,” said Depuy. “Juniper could not address customers who were upgrading wireless and wired at the same time without Mist. With 802.11ax, we expect new switches to be necessary because 1 GB isn’t fast enough to support these new APs. Thus, Juniper can now upgrade customers to 802.11ax and MultiGig switches instead of bringing in another vendor. “ + +WiFi 6 is designed for high-density public or private environments. But it also will be beneficial in internet of things (IoT) deployments, and in offices that use bandwidth-hogging applications like videoconferencing. Products promising WIFI 6 support have been rolling out across the industry with [HPE][8], [Cisco][9], [Arista][10] and others recently tossing their hats into the ring. + +The enterprise WLAN is now dominated by the 802.11ac standard, which makes up 86.4% of dependent access point (AP) shipments and 93.1% of enterprise WLAN dependent AP revenues. The next iteration of the standard, 802.11ax or WiFi 6, will increase in the market throughout the rest of 2019 and into 2020. In the consumer WLAN market, the 802.11ac standard accounted for 58.0% of shipments and 79.2% of revenue in 1Q19, according to IDC’s most recent [Worldwide Quarterly WLAN Tracker][11] report. + +"The WLAN market continues to see steady, moderate growth as enterprises invest in wireless connectivity to support the continued demand for access technology," said [Brandon Butler][12], senior research analyst, Network Infrastructure at IDC in the report. "Meanwhile, the coming Wi-Fi 6 standard will be a major driver of growth in the WLAN market in the coming years, especially in the advanced enterprise segments of the market." + +The AP43 lists at $1,585. + +Mist also announced a strategic relationship with ForeScout to automate management and security control of Wi-Fi client and Internet of Things (IoT) devices.  The Juniper and Forescout mashup lets customers monitor and profile devices and mobile clients including smartphones, tablets, laptops, robots and IoT devices (HVAC systems, security devices, displays, sensors, lights) based on their network traffic patterns. Then if anomalous or threatening behavior is observed, customers can launch trouble tickets, remediate software on devices as needed or quarantine devices. + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3405123/juniper-s-mist-adds-wifi-6-ai-based-cloud-services-to-enterprise-edge.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://images.idgesg.net/images/article/2019/02/wifi_cloud_wireless-100787113-large.jpg +[2]: https://www.networkworld.com/article/3215907/mobile-wireless/why-80211ax-is-the-next-big-thing-in-wi-fi.html +[3]: https://%20https//www.networkworld.com/article/3048196/mobile-wireless/faq-802-11ax-wi-fi.html +[4]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[5]: https://www.networkworld.com/article/3332018/wi-fi/wi-fi-6-with-ofdma-opens-a-world-of-new-wireless-possibilities.html +[6]: https://www.networkworld.com/article/3309439/mobile-wireless/80211ax-preview-access-points-and-routers-that-support-the-wi-fi-6-protocol-on-tap.html +[7]: https://www.networkworld.com/article/3089038/why-one-cisco-shop-is-willing-to-give-wifi-startup-mist-a-shot.html +[8]: https://www.arubanetworks.com/products/networking/802-11ax/ +[9]: https://www.networkworld.com/article/3391919/cisco-goes-all-in-on-wifi-6.html +[10]: https://www.networkworld.com/article/3400905/new-switches-wi-fi-gear-to-advance-aristas-campus-architecture.html +[11]: http://www.idc.com/tracker/showproductinfo.jsp?prod_id=262 +[12]: https://www.idc.com/getdoc.jsp?containerId=PRF005027 +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md new file mode 100644 index 0000000000..22a303d2f6 --- /dev/null +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Where are all the IoT experts going to come from?) +[#]: via: (https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts-going-to-come-from.html) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Where are all the IoT experts going to come from? +====== +The fast growth of the internet of things (IoT) is creating a need to train cross-functional experts who can combine traditional networking and infrastructure expertise with database and reporting skills. +![Kevin \(CC0\)][1] + +If the internet of things (IoT) is going to fulfill its enormous promise, it’s going to need legions of smart, skilled, _trained_ workers to make everything happen. And right now, it’s not entirely clear where those people are going to come from. + +That’s why I was interested in trading emails with Keith Flynn, senior director of product management, R&D at asset-optimization software company [AspenTech][2], who says that when dealing with the slew of new technologies that fall under the IoT umbrella, you need people who can understand how to configure the technology and interpret the data. Flynn sees a growing need for existing educational institutions to house IoT-specific programs, as well as an opportunity for new IoT-focused private colleges, offering a well -ounded curriculum + +“In the future,” Flynn told me, “IoT projects will differ tremendously from the general data management and automation projects of today. … The future requires a more holistic set of skills and cross-trading capabilities so that we’re all speaking the same language.” + +**[ Also read:  [20 hot jobs ambitious IT pros should shoot for][3] ]** + +With the IoT growing 30% a year, Flynn added, rather than a few specific skills, “everything from traditional deployment skills, like networking and infrastructure, to database and reporting skills and, frankly, even basic data science, need to be understood together and used together.” + +### Calling all IoT consultants + +“The first big opportunity for IoT-educated people is in the consulting field,” Flynn predicted. “As consulting companies adapt or die to the industry trends … having IoT-trained people on staff will help position them for IoT projects and make a claim in the new line of business: IoT consulting.” + +The problem is especially acute for startups and smaller companies. “The bigger the organization, the more likely they have a means to hire different people across different lines of skillsets,” Flynn said. “But for smaller organizations and smaller IoT projects, you need someone who can do both.” + +Both? Or _everything?_ The IoT “requires a combination of all knowledge and skillsets,” Flynn said, noting that “many of the skills aren’t new, they’ve just never been grouped together or taught together before.” + +**[ [Looking to upgrade your career in tech? This comprehensive online course teaches you how.][4] ]** + +### The IoT expert of the future + +True IoT expertise starts with foundational instrumentation and electrical skills, Flynn said, which can help workers implement new wireless transmitters and boost technology for better battery life and power consumption. + +“IT skills, like networking, IP addressing, subnet masks, cellular and satellite are also pivotal IoT needs,” Flynn said. He also sees a need for database management skills and cloud management and security expertise, “especially as things like [advanced process control] APC and sending sensor data directly to databases and data lakes become the norm.” + +### Where will IoT experts come from? + +Flynn said standardized formal education courses would be the best way to make sure that graduates or certificate holders have the right set of skills. He even laid out a sample curriculum: “Start in chronological order with the basics like [Electrical & Instrumentation] E&I and measurement. Then teach networking, and then database administration and cloud courses should follow that. This degree could even be looped into an existing engineering course, and it would probably take two years … to complete the IoT component.” + +While corporate training could also play role, “that’s easier said than done,” Flynn warned. “Those trainings will need to be organization-specific efforts and pushes.” + +Of course, there are already [plenty of online IoT training courses and certificate programs][5]. But, ultimately, the responsibility lies with the workers themselves. + +“Upskilling is incredibly important in this world as tech continues to transform industries,” Flynn said. “If that upskilling push doesn’t come from your employer, then online courses and certifications would be an excellent way to do that for yourself. We just need those courses to be created. ... I could even see organizations partnering with higher-education institutions that offer these courses to give their employees better access to it. Of course, the challenge with an IoT program is that it will need to constantly evolve to keep up with new advancements in tech.” + +**[ For more on IoT, see [tips for securing IoT on your network][6], our list of [the most powerful internet of things companies][7] and learn about the [industrial internet of things][8]. | Get regularly scheduled insights by [signing up for Network World newsletters][9]. ]** + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts-going-to-come-from.html + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/07/programmer_certification-skills_code_devops_glasses_student_by-kevin-unsplash-100764315-large.jpg +[2]: https://www.aspentech.com/ +[3]: https://www.networkworld.com/article/3276025/careers/20-hot-jobs-ambitious-it-pros-should-shoot-for.html +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fupgrading-your-technology-career +[5]: https://www.google.com/search?client=firefox-b-1-d&q=iot+training +[6]: https://www.networkworld.com/article/3254185/internet-of-things/tips-for-securing-iot-on-your-network.html#nww-fsb +[7]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[8]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html#nww-fsb +[9]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190630 Data Still Dominates.md b/sources/talk/20190630 Data Still Dominates.md new file mode 100644 index 0000000000..e9a86acf68 --- /dev/null +++ b/sources/talk/20190630 Data Still Dominates.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data Still Dominates) +[#]: via: (https://theartofmachinery.com/2019/06/30/data_still_dominates.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Data Still Dominates +====== + +Here’s [a quote from Linus Torvalds in 2006][1]: + +> I’m a huge proponent of designing your code around the data, rather than the other way around, and I think it’s one of the reasons git has been fairly successful… I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships. + +Which sounds a lot like [Eric Raymond’s “Rule of Representation” from 2003][2]: + +> Fold knowledge into data, so program logic can be stupid and robust. + +Which was just his summary of ideas like [this one from Rob Pike in 1989][3]: + +> Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. + +Which cites [Fred Brooks from 1975][4]: + +> ### Representation is the Essence of Programming +> +> Beyond craftmanship lies invention, and it is here that lean, spare, fast programs are born. Almost always these are the result of strategic breakthrough rather than tactical cleverness. Sometimes the strategic breakthrough will be a new algorithm, such as the Cooley-Tukey Fast Fourier Transform or the substitution of an n log n sort for an n2 set of comparisons. +> +> Much more often, strategic breakthrough will come from redoing the representation of the data or tables. This is where the heart of your program lies. Show me your flowcharts and conceal your tables, and I shall be continued to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious. + +So, smart people have been saying this again and again for nearly half a century: focus on the data first. But sometimes it feels like the most famous piece of smart programming advice that everyone forgets. + +Let me give some real examples. + +### The Highly Scalable System that Couldn’t + +This system was designed from the start to handle CPU-intensive loads with incredible scalability. Nothing was synchronous. Everything was done with callbacks, task queues and worker pools. + +But there were two problems: The first was that the “CPU-intensive load” turned out not to be that CPU-intensive after all — a single task took a few milliseconds at worst. So most of the architecture was doing more harm than good. The second problem was that although it sounded like a highly scalable distributed system, it wasn’t one — it only ran on one machine. Why? Because all communication between asynchronous components was done using files on the local filesystem, which was now the bottleneck for any scaling. The original design didn’t say much about data at all, except to advocate local files in the name of “simplicity”. Most of the document was about all the extra architecture that was “obviously” needed to handle the “CPU-intensiveness” of the load. + +### The Service-Oriented Architecture that was Still Data-Oriented + +This system followed a microservices design, made up of single-purpose apps with REST-style APIs. One component was a database that stored documents (basically responses to standard forms, and other electronic paperwork). Naturally it exposed an API for basic storage and retrieval, but pretty quickly there was a need for more complex search functionality. The designers felt that adding this search functionality to the existing document API would have gone against the principles of microservices design. They could talk about “search” as being a different kind of service from “get/put”, so their architecture shouldn’t couple them together. Besides, the tool they were planning to use for search indexing was separate from the database itself, so creating a new service made sense for implementation, too. + +In the end, a search API was created containing a search index that was essentially a duplicate of the data in the main database. This data was being updated dynamically, so any component that mutated document data through the main database API had to also update the search API. It’s impossible to do this with REST APIs without race conditions, so the two sets of data kept going out of sync every now and then, anyway. + +Despite what the architecture diagram promised, the two APIs were tightly coupled through their data dependencies. Later on it was recognised that the search index should be an implementation detail of a unified document service, and this made the system much more maintainable. “Do one thing” works at the data level, not the verb level. + +### The Fantastically Modular and Configurable Ball of Mud + +This system was a kind of automated deployment pipeline. The original designers wanted to make a tool that was flexible enough to solve deployment problems across the company. It was written as a set of pluggable components, with a configuration file system that not only configured the components, but acted as a [DSL][5] for programming how the components fitted into the pipeline. + +Fast forward a few years and it’s turned into “that program”. There was a long list of known bugs that no one was ever fixing. No one wanted to touch the code out of fear of breaking things. No one used any of the flexibility of the DSL. Everyone who used the program copy-pasted the same known-working configuration that everyone else used. + +What had gone wrong? Although the original design document used words like “modular”, “decoupled”, “extensible” and “configurable” a lot, it never said anything about data. So, data dependencies between components ended up being handled in an ad-hoc way using a globally shared blob of JSON. Over time, components made more and more undocumented assumptions about what was in or not in the JSON blob. Sure, the DSL allowed rearranging components into any order, but most configurations didn’t work. + +### Lessons + +I chose these three examples because they’re easy to explain, not to pick on others. I once tried to build a website, and failed trying to instead build some cringe-worthy XML database that didn’t even solve the data problems I had. Then there’s the project that turned into a broken mockery of half the functionality of `make`, again because I didn’t think about what I really needed. I wrote a post before based on a time I wrote [a castle-in-the-sky OOP class hierarchy that should have been encoded in data instead][6]. + +Update: + +Apparently many people still thought I wrote this to make fun of others. People who’ve actually worked with me will know I’m much more interested in the things I’m fixing than in blaming the people who did most of the work building them, but, okay, here’s what I think of the engineers involved. + +Honestly, the first example obviously happened because the designer was more interested in bringing a science project to work than in solving the problem at hand. Most of us have done that (mea culpa), but it’s really annoying to our colleagues who’ll probably have to help maintain them when we’re bored of them. If this sounds like you, please don’t get offended; please just stop. (I’d still rather work on the single-node distributed system than anything built around my “XML database”.) + +There’s nothing personal in the second example. Sometimes it feels like everyone is talking about how wonderful it is to split up services, but no one is talking about exactly when not to. People are learning the hard way all the time. + +The third example was actually from some of the smartest people I’ve ever had the chance to work with. + +(End update.) + +“Does this talk about the problems created by data?” turns out to be a pretty useful litmus test for good systems design. It’s also pretty handy for detecting false expert advice. The hard, messy systems design problems are data problems, so false experts love to ignore them. They’ll show you a wonderfully beautiful architecture, but without talking about what kind of data it’s appropriate for, and (crucially) what kind of data it isn’t. + +For example, a false expert might tell you that you should use a pub/sub system because pub/sub systems are loosely coupled, and loosely coupled components are more maintainable. That sounds nice and results in pretty diagrams, but it’s backwards thinking. Pub/sub doesn’t _make_ your components loosely coupled; pub/sub _is_ loosely coupled, which may or may not match your data needs. + +On the flip side, a well-designed data-oriented architecture goes a long way. Functional programming, service meshes, RPCs, design patterns, event loops, whatever, all have their merits, but personally I’ve seen tools like [boring old databases][7] be responsible for a lot more successfully shipped software. + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2019/06/30/data_still_dominates.html + +作者:[Simon Arneaud][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://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://lwn.net/Articles/193245/ +[2]: http://www.catb.org/~esr/writings/taoup/html/ch01s06.html +[3]: http://doc.cat-v.org/bell_labs/pikestyle +[4]: https://archive.org/stream/mythicalmanmonth00fred/mythicalmanmonth00fred_djvu.txt +[5]: https://martinfowler.com/books/dsl.html +[6]: https://theartofmachinery.com/2016/06/21/code_vs_data.html +[7]: https://theartofmachinery.com/2017/10/28/rdbs_considered_useful.html diff --git a/sources/talk/20190701 Tempered Networks simplifies secure network connectivity and microsegmentation.md b/sources/talk/20190701 Tempered Networks simplifies secure network connectivity and microsegmentation.md new file mode 100644 index 0000000000..5cf40e865d --- /dev/null +++ b/sources/talk/20190701 Tempered Networks simplifies secure network connectivity and microsegmentation.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tempered Networks simplifies secure network connectivity and microsegmentation) +[#]: via: (https://www.networkworld.com/article/3405853/tempered-networks-simplifies-secure-network-connectivity-and-microsegmentation.html) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Tempered Networks simplifies secure network connectivity and microsegmentation +====== +Tempered Networks’ Identity Defined Network platform uses the Host Identity Protocol to partition and isolate the network into trusted microsegments, providing an easy and cost-effective way to secure the network. +![Thinkstock][1] + +The TCP/IP protocol is the foundation of the internet and pretty much every single network out there. The protocol was designed 45 years ago and was originally only created for connectivity. There’s nothing in the protocol for security, mobility, or trusted authentication. + +The fundamental problem with TCP/IP is that the IP address within the protocol represents both the device location and the device identity on a network. This dual functionality of the address lacks the basic mechanisms for security and mobility of devices on a network. + +This is one of the reasons networks are so complicated today. To connect to things on a network or over the internet, you need VPNs, firewalls, routers, cell modems, etc. and you have all the configurations that come with ACLs, VLANs, certificates, and so on. The nightmare grows exponentially when you factor in internet of things (IoT) device connectivity and security. It’s all unsustainable at scale. + +Clearly, we need a more efficient and effective way to take on network connectivity, mobility, and security. + +**[ Also read: [What is microsegmentation? How getting granular improves network security][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +The Internet Engineering Task Force (IETF) tackled this problem with the Host Identity Protocol (HIP). It provides a method of separating the endpoint identifier and the locator roles of IP addresses. It introduces a new Host Identity (HI) name space, based on public keys, from which endpoint identifiers are taken. HIP uses existing IP addressing and forwarding for locators and packet delivery.The protocol is compatible with IPv4 and IPv6 applications and utilizes a customized IPsec tunnel mode for confidentiality, authentication, and integrity of network applications. + +Ratified by IETF in 2015, HIP represents a new security networking layer within the OSI stack. Think of it as Layer 3.5. It’s a flip of the trust model where TCP/IP is inherently promiscuous and will answer to anything that wants to talk to a device on that network. In contrast, HIP is a trust protocol that will not answer to anything on the network unless that connection has been authenticated and authorized based on its cryptographic identity. It is, in effect, a form of a [software-defined perimeter][4] around specific network resources. This is also known as [microsegmentation][5]. + +![][6] + +### Tempered Networks’ IDN platform creates segmented, encrypted network + +[Tempered Networks][7] has created a platform utilizing the HIP and a variety of technologies that partitions and isolates the network into trusted microsegments. Tempered Networks’ Identity Defined Networking (IDN) platform is deployed as an overlay technology that layers on top of any IP network. The HIP was designed to be both forward and backward compatible with any IP network without having to make any changes to the underlay network. The overlay network creates a direct tunnel between the two things you want to connect. + +**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][8] ]** + +The IDN platform uses three components to create a segmented and encrypted network: an orchestration engine called the Conductor, the HIPrelay identity-based router, and HIP Services enforcement points. + +The Conductor is a centralized orchestration and intelligence engine that connects, protects, and disconnects any resource globally through a single pane of glass. The Conductor is used to define and enforce policies for HIP Services. Policy configuration is done in a simple point-and-click manner. The Conductor is available as a physical or virtual appliance or in the Amazon Web Services (AWS) cloud. + +HIP Services provide software-based policy enforcement, enabling secure connectivity among IDN-protected devices, as well as cloaking, segmentation, identity-based routing, and IP mobility. They can be deployed on or in-line to any device or system and come in the form of HIPswitch hardware, HIPserver, HIPclient, Cloud HIPswitch, or Virtual HIPswitch. HIP Services also can be embedded in customer hardware or applications. + +Placing HIPswitches in front of any connected device renders the device HIP-enabled and immediately microsegments the traffic, isolating inbound and outbound traffic from the underlying network. HIPswitches deployed on the network automatically register with the Conductor using their cryptographic identity. + +HIPrelay works with the HIP Service-enabled endpoints to deliver peer-to-peer connectivity for any device or system across all networks and transport options. Rather than using Layer 3 or 4 rule sets or traditional routing protocols, HIPrelay routes and connects encrypted communications based on provable cryptographic identities traversing existing infrastructure. + +It sounds complicated, but it really isn’t. A use case example should demonstrate the ease and power of this solution. + +### Use case: Smart Ships + +An international cruise line recently installed Tempered Networks’ IDN solution to provide tighter security around its critical maritime systems. Prior to deployment, the systems for fuel, propulsion, navigation, ballast, weather, and incinerators were on a flat Layer 2 network, which basically allowed authorized users of the network to see everything. + +Given that vendors of the different maritime systems had access to their own system, the lack of microsegmentation allowed them to see the other systems as well. The cruise line needed a simple way to segment access to these different systems — isolating them from each other — and they wanted to do it without having to put the ships in dry dock for the network reconfiguration. + +The original configuration looked like this: + +![][9] + +The company implemented microsegmentation of the network based on the functionality of the systems. This isolated and segmented vendor access to only their own systems — everything else was hidden to them. The implementation involved installing HIPrelay identity routing in the cloud, several HIPswitch wireless devices onboard the ships, and HIPclient software on the vendors’ and crew members’ devices. The Conductor appliance that managed the entire deployment was installed in AWS. + +All of that was done without impacting the underlying network, and no dry dock time was required for the deployment. In addition, the cruise line was able to eliminate internal firewalls and VPNs that had previously been used for segmentation and remote access. The resulting configuration looks like this: + +![][10] + +The color coding of the illustration above indicates what systems are now able to directly see and communicate with their corresponding controllers and sensors. Everything else on the network is hidden from view of those systems. + +The acquisition cost of the Tempered Networks’ solution was one-tenth that of a traditional microsegmentation solution. The deployment time was 2 FTE days per ship compared to the 40 FTE days a traditional solution would have needed. No additional staffing was required to support the solution, and no changes were made to the underlying network. + +### A time-tested microsegmentation solution + +This technology came out of Boeing and was deployed for over 12 years within their manufacturing facilities until 2014, when Boeing allowed the technology to become commercialized. Tempered Networks took the HIP and developed the full platform with easy, centralized management. It was purpose-built to provide secure connectivity to networks. The solution has been successfully deployed in industrial domains such as the utilities sector, oil and gas, electricity generation, and aircraft manufacturing, as well as in enterprise domains and healthcare. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3405853/tempered-networks-simplifies-secure-network-connectivity-and-microsegmentation.html + +作者:[Linda Musthaler][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/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/01/network_security_hacker_virus_crime-100745979-large.jpg +[2]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.networkworld.com/article/3359363/software-defined-perimeter-brings-trusted-access-to-multi-cloud-applications-network-resources.html +[5]: https://www.networkworld.com/article/3247672/what-is-microsegmentation-how-getting-granular-improves-network-security.html +[6]: https://images.idgesg.net/images/article/2019/07/hip-slide-100800735-large.jpg +[7]: https://www.temperednetworks.com/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[9]: https://images.idgesg.net/images/article/2019/07/cruise-ship-before-100800736-large.jpg +[10]: https://images.idgesg.net/images/article/2019/07/cruise-ship-after-100800738-large.jpg +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md b/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md new file mode 100644 index 0000000000..3bddd4cdc3 --- /dev/null +++ b/sources/talk/20190702 SD-WAN Buyers Should Think Application Performance as well as Resiliency.md @@ -0,0 +1,49 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SD-WAN Buyers Should Think Application Performance as well as Resiliency) +[#]: via: (https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.html) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +SD-WAN Buyers Should Think Application Performance as well as Resiliency +====== + +![istock][1] + +As an industry analyst, not since the days of WAN Optimization have I seen a technology gain as much interest as I am seeing with [SD-WANs][2] today. Although full deployments are still limited, nearly every network manager, and often many IT leaders I talk to, are interested in it. The reason for this is two-fold – the WAN has grown in importance for cloud-first enterprises and is badly in need of an overhaul. This hasn’t gone unnoticed by the vendor community as there has been an explosion of companies bringing a broad range of SD-WAN offerings to market. The great news for buyers is that there is no shortage of choices. The bad news is there are too many choices and making the right decision difficult. + +One area of differentiation for SD-WAN vendors is how they handle application performance.  I think of the SD-WAN market as being split into two categories – basic and advanced SD-WANs.  A good analogy is to think of the virtualization market.  There are many vendors that offer hypervisors – in fact there are a number of free ones.  So why do companies pay a premium for VMware? It’s because VMware offers many advanced features and capabilities that make its solution do more than just virtualize servers. + +Similarly, basic SD-WAN solutions do a great job of helping to lower costs and to increase application resiliency through path selection capabilities but do nothing to improve application performance. One myth that needs busting is that all SD-WANs make your applications perform better. That’s simply not true as application availability and performance are two different things. It’s possible to have great performance and poor availability or high availability with lackluster performance.  + +Consider the case where a business runs a hybrid WAN and voice and video traffic is sent over the MPLS connection and broadband is used for other traffic. If the MPLS link becomes congested, but doesn’t go down, most SD-WAN solutions will continue to send video and voice over it, which obviously degrades the performance. If multiple broadband connections are used, the chances of congestion related issues are even more likely.  + +This is an important point for IT professionals to understand. The business justification for SD-WAN was initially built around saving money but if application performance suffers, the entire return on investment (ROI) for the project might as well be tossed out the window.  For many companies, the network is the business, so a poor performing network means equally poor performing applications which results lost productivity, lower revenues and possibly brand damage from customer experience issues.  + +I’ve talked to many organizations that had digital initiatives fail because the network wasn’t transformed. For example, a luxury retailer implemented a tablet program for in store personnel to be able to show merchandise to customers. High end retail is almost wholly impulse purchases so the more inventory that can be shown to a customer, the larger the resulting sales. The WAN that was in place was causing the mobile application to perform poorly causing the digital initiative to have a negative effect. Instead of driving sales, the mobile initiative was chasing customers from the store.  The idea was right but the poor performing WAN caused the project to fail. + +SD-WAN decision makers need to look to suppliers that have specific technologies integrated into it that can act when congestion occurs.  A great example of this is the Silver Peak [Unity EdgeConnect™][3] SD-WAN edge platform with [path conditioning][4], [traffic shaping][5] and sub-second link failover. This ensures the best possible quality for all critical applications, even when an underlying link experiences congestion or an outage, even for [voice and video over broadband][6]. This is a foundational component of advanced SD-WAN providers as they offer the same resiliency and cost benefits as a basic SD-WAN but also ensure application performance remains high.  + +The SD-WAN era is here, and organizations should be aggressive with deployments as it will transform the WAN and make it a digital transformation enabler. Decision makers should choose their provider carefully and ensure the vendor also improves application performance.  Without it, the digital initiatives will likely fail and negate any ROI the company was hoping to realize. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3406456/sd-wan-buyers-should-think-application-performance-as-well-as-resiliency.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://images.idgesg.net/images/article/2019/07/istock-157647179-100800860-large.jpg +[2]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[3]: https://www.silver-peak.com/products/unity-edge-connect +[4]: https://www.silver-peak.com/products/unity-edge-connect/path-conditioning +[5]: https://www.silver-peak.com/products-solutions/unity/traffic-shaping +[6]: https://www.silver-peak.com/sd-wan/voice-video-over-broadband diff --git a/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md b/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md new file mode 100644 index 0000000000..8d1e827aa8 --- /dev/null +++ b/sources/talk/20190703 An eco-friendly internet of disposable things is coming.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An eco-friendly internet of disposable things is coming) +[#]: via: (https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +An eco-friendly internet of disposable things is coming +====== +Researchers are creating a non-hazardous, bacteria-powered miniature battery that can be implanted into shipping labels and packaging to monitor temperature and track packages in real time. +![Thinkstock][1] + +Get ready for a future of disposable of internet of things (IoT) devices, one that will mean everything is connected to networks. It will be particularly useful in logistics, being used in single-use plastics in retail packaging and throw-away shippers’ carboard boxes. + +How it will happen? The answer is when non-hazardous, disposable bio-batteries make it possible. And that moment might be approaching. Researchers say they’re closer to commercializing a bacteria-powered miniature battery that they say will propel the IoDT. + +**[ Learn more: [Download a PDF bundle of five essential articles about IoT in the enterprise][2] ]** + +The “internet of disposable things is a new paradigm for the rapid evolution of wireless sensor networks,” says Seokheun Choi, an associate professor at Binghamton University, [in an article on the school’s website][3]. + +“Current IoDTs are mostly powered by expensive and environmentally hazardous batteries,” he says. Those costs can be significant in any kind of large-scale deployment, he says. And furthermore, with exponential growth, the environmental concerns would escalate rapidly. + +The miniaturized battery that Choi’s team has come up with is uniquely charged through power created by bacteria. It doesn’t have metals and acids in it. And it’s designed specifically to provide energy to sensors and radios in single-use IoT devices. Those could be the kinds of sensors ideal for supply-chain logistics where the container is ultimately going to end up in a landfill, creating a hazard. + +Another use case is real-time analysis of packaged food, with sensors monitoring temperature and location, preventing spoilage and providing safer food handling. For example, a farm product could be tracked for on-time delivery, as well as have its temperature measured, all within the packaging, as it moves from packaging facility to consumer. In the event of a food-borne illness outbreak, say, one can quickly find out where the product originated—which apparently is hard to do now. + +Other use cases could be battery-impregnated shipping labels that send real-time data to the internet. Importantly, in both use cases, packaging can be discarded without added environmental concerns. + +### How the bacteria-powered batteries work + +A slow release of nutrients provide the energy to the bacteria-powered batteries, which the researchers say can last up to eight days. “Slow and continuous reactions” convert the microbial nutrients into “long standing power,” they say in [their paper's abstract][4]. + +“Our biobattery is low-cost, disposable, and environmentally-friendly,” Choi says. + +Origami, the Japanese paper-folding skill used to create objects, was an inspiration for a similar microbial-based battery project the group wrote about last year in a paper. This one is liquid-based and not as long lasting. A bacteria-containing liquid was absorbed along the porous creases in folded paper, creating the paper-delivered power source, perhaps to be used in a shipping label. + +“Low-cost microbial fuel cells (MFCs) can be done efficiently by using a paper substrate and origami techniques,” [the group wrote then][5]. + +Scientists, too, envisage electronics now printed on circuit boards (PCBs) and can be toxic on disposal being printed entirely on eco-friendly paper. Product cycles, such as those found now in mobile devices and likely in future IoT devices, are continually getting tighter—thus PCBs are increasingly being disposed. Solutions are needed, experts say. + +Put the battery in the paper, too, is the argument here. And while you’re at it, get the biodegradation of the used-up biobattery to help break-down the organic-matter paper. + +Ultimately, Choi believes that the power-creating bacteria could even be introduced naturally by the environment—right now it’s added on by the scientists. + +**More on IoT:** + + * [What is the IoT? How the internet of things works][6] + * [What is edge computing and how it’s changing the network][7] + * [Most powerful Internet of Things companies][8] + * [10 Hot IoT startups to watch][9] + * [The 6 ways to make money in IoT][10] + * [What is digital twin technology? [and why it matters]][11] + * [Blockchain, service-centric networking key to IoT success][12] + * [Getting grounded in IoT networking and security][2] + * [Building IoT-ready networks must become a priority][13] + * [What is the Industrial IoT? [And why the stakes are so high]][14] + + + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3406462/an-eco-friendly-internet-of-disposable-things-is-coming.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/04/green-data-center-intro-100719502-large.jpg +[2]: https://www.networkworld.com/article/3269736/internet-of-things/getting-grounded-in-iot-networking-and-security.html +[3]: https://www.binghamton.edu/news/story/1867/everything-will-connect-to-the-internet-someday-and-this-biobattery-could-h +[4]: https://www.sciencedirect.com/science/article/abs/pii/S0378775319305580 +[5]: https://www.sciencedirect.com/science/article/pii/S0960148117311606 +[6]: https://www.networkworld.com/article/3207535/internet-of-things/what-is-the-iot-how-the-internet-of-things-works.html +[7]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[8]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html +[9]: https://www.networkworld.com/article/3270961/internet-of-things/10-hot-iot-startups-to-watch.html +[10]: https://www.networkworld.com/article/3279346/internet-of-things/the-6-ways-to-make-money-in-iot.html +[11]: https://www.networkworld.com/article/3280225/internet-of-things/what-is-digital-twin-technology-and-why-it-matters.html +[12]: https://www.networkworld.com/article/3276313/internet-of-things/blockchain-service-centric-networking-key-to-iot-success.html +[13]: https://www.networkworld.com/article/3276304/internet-of-things/building-iot-ready-networks-must-become-a-priority.html +[14]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md b/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md new file mode 100644 index 0000000000..fef21470c9 --- /dev/null +++ b/sources/talk/20190705 Lessons in Vendor Lock-in- Google and Huawei.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Lessons in Vendor Lock-in: Google and Huawei) +[#]: via: (https://www.linuxjournal.com/content/lessons-vendor-lock-google-and-huawei) +[#]: author: (Kyle Rankin https://www.linuxjournal.com/users/kyle-rankin) + +Lessons in Vendor Lock-in: Google and Huawei +====== +![](https://www.linuxjournal.com/sites/default/files/styles/850x500/public/nodeimage/story/bigstock-Us--China-Trade-War-Boxing-F-252887971_1.jpg?itok=oZBwXDrP) + +What happens when you're locked in to a vendor that's too big to fail, but is on the opposite end of a trade war? + +The story of Google no longer giving Huawei access to Android updates is still developing, so by the time you read this, the situation may have changed. At the moment, Google has granted Huawei a 90-day window whereby it will have access to Android OS updates, the Google Play store and other Google-owned Android assets. After that point, due to trade negotiations between the US and China, Huawei no longer will have that access. + +Whether or not this new policy between Google and Huawei is still in place when this article is published, this article isn't about trade policy or politics. Instead, I'm going to examine this as a new lesson in vendor lock-in that I don't think many have considered before: what happens when the vendor you rely on is forced by its government to stop you from being a customer? + +### Too Big to Fail + +Vendor lock-in isn't new, but until the last decade or so, it generally was thought of by engineers as a bad thing. Companies would take advantage the fact that you used one of their products that was legitimately good to use the rest of their products that may or may not be as good as those from their competitors. People felt the pain of being stuck with inferior products and rebelled. + +These days, a lot of engineers have entered the industry in a world where the new giants of lock-in are still growing and have only flexed their lock-in powers a bit. Many engineers shrug off worries about choosing a solution that requires you to use only products from one vendor, in particular if that vendor is a large enough company. There is an assumption that those companies are too big ever to fail, so why would it matter that you rely on them (as many companies in the cloud do) for every aspect of their technology stack? + +Many people who justify lock-in with companies who are too big to fail point to all of the even more important companies who use that vendor who would have even bigger problems should that vendor have a major bug, outage or go out of business. It would take so much effort to use cross-platform technologies, the thinking goes, when the risk of going all-in with a single vendor seems so small. + +Huawei also probably figured (rightly) that Google and Android were too big to fail. Why worry about the risks of being beholden to a single vendor for your OS when that vendor was used by other large companies and would have even bigger problems if the vendor went away? + +### The Power of Updates + +Google held a particularly interesting and subtle bit of lock-in power over Huawei (and any phone manufacturer who uses Android)—the power of software updates. This form of lock-in isn't new. Microsoft famously used the fact that software updates in Microsoft Office cost money (naturally, as it was selling that software) along with the fact that new versions of Office had this tendency to break backward compatibility with older document formats to encourage everyone to upgrade. The common scenario was that the upper-level folks in the office would get brand-new, cutting-edge computers with the latest version of Office on them. They would start saving new documents and sharing them, and everyone else wouldn't be able to open them. It ended up being easier to upgrade everyone's version of Office than to have the bosses remember to save new documents in old formats every time. + +The main difference with Android is that updates are critical not because of compatibility, but for security. Without OS updates, your phone ultimately will become vulnerable to exploits that attackers continue to find in your software. The Android OS that ships on phones is proprietary and therefore requires permission from Google to get those updates. + +Many people still don't think of the Android OS as proprietary software. Although people talk about the FOSS underpinnings in Android, only people who go to the extra effort of getting a pure-FOSS version of Android, like LineageOS, on their phones actually experience it. The version of Android most people tend to use has a bit of FOSS in the center, surrounded by proprietary Google Apps code. + +It's this Google Apps code that gives Google the kind of powerful leverage over a company like Huawei. With traditional Android releases, Google controls access to OS updates including security updates. All of this software is signed with Google's signing keys. This system is built with security in mind—attackers can't easily build their own OS update to install on your phone—but it also has a convenient side effect of giving Google control over the updates. + +What's more, the Google Apps suite isn't just a convenient way to load Gmail or Google Docs, it also includes the tight integration with your Google account and the Google Play store. Without those hooks, you don't have access to the giant library of applications that everyone expects to use on their phones. As anyone with a LineageOS phone that uses F-Droid can attest, while a large number of applications are available in the F-Droid market, you can't expect to see those same apps as on Google Play. Although you can side-load some Google Play apps, many applications, such as Google Maps, behave differently without a Google account. Note that this control isn't unique to Google. Apple uses similar code-signing features with similar restrictions on its own phones and app updates. + +### Conclusion + +Without access to these OS updates, Huawei now will have to decide whether to create its own LineageOS-style Android fork or a whole new phone OS of its own. In either case, it will have to abandon the Google Play Store ecosystem and use F-Droid-style app repositories, or if it goes 100% alone, it will need to create a completely new app ecosystem. If its engineers planned for this situation, then they likely are working on this plan right now; otherwise, they are all presumably scrambling to address an event that "should never happen". Here's hoping that if you find yourself in a similar case of vendor lock-in with an overseas company that's too big to fail, you never get caught in the middle of a trade war. + + +-------------------------------------------------------------------------------- + +via: https://www.linuxjournal.com/content/lessons-vendor-lock-google-and-huawei + +作者:[Kyle Rankin][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.linuxjournal.com/users/kyle-rankin +[b]: https://github.com/lujun9972 diff --git a/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md b/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md new file mode 100644 index 0000000000..add6ef0093 --- /dev/null +++ b/sources/talk/20190708 Colocation facilities buck the cloud-data-center trend.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Colocation facilities buck the cloud-data-center trend) +[#]: via: (https://www.networkworld.com/article/3407756/colocation-facilities-buck-the-cloud-data-center-trend.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Colocation facilities buck the cloud-data-center trend +====== +Lower prices and latency plus easy access to multiple cloud providers make colocation facilities an attractive option compared to building on-site data centers. +![gorodenkoff / Getty Images][1] + +[Data center][2] workloads are moving but not only to the cloud. Increasingly, they are shifting to colocation facilities as an alternative to privately owned data centers. + +### What is colocation? + +A colocation facility or colo is a data center in which a business can rent space for servers and other computing hardware that they purchase but that the colo provider manages. + +[Read about IPv6 and cloud-access security brokers][3] + +The colo company provides the building, cooling, power, bandwidth and physical security. Space is leased by the rack, cabinet, cage or room. Many colos started out as managed services and continue  to offer those specialized services. + +Some prominent providers include Equinix, Digital Reality Trust, CenturyLink, and NTT Communications, and there are several Chinese providers that only serve the China market. Unlike the data centers of cloud vendors like Amazon and Microsoft, these colo facilities are generally in large metropolitan areas. + +“Colos have been around a long time, but their initial use case was Web servers,” said Rick Villars, vice president of data centers and cloud research at IDC. “What’s changed now is the ratio of what’s customer-facing is much greater than in 2000, [with the]  expansion of companies needing to have more assets that are network-facing.” + +### Advantages of colos: Cost, cloud interconnect + +Homegrown data centers are often sized correctly, with either too much capacity or too little, said Jim Poole, vice president of business development at Equinix. “Customers come to us all the time and say, ‘Would you buy my data center? Because I only use 25 percent of it,’” he said. + +Poole said the average capital expenditure for a stand-alone enterprise data center that is not a part of the corporate campus is $9 million. Companies are increasingly realizing that it makes sense to buy the racks of hardware but place it in someone else’s secure facility that handles the power and cooling. “It’s the same argument for doing cloud computing but at the physical-infrastructure level,” he said. + +Mike Satter, vice president for OceanTech, a data-center-decommissioning service provider, says enterprises should absolutely outsource data-center construction or go the colo route. Just as there are contractors who specialize in building houses, there are experts who specialize in data-center design, he said. + +He added that with many data-center closures there is subsequent consolidation. “For every decommissioning we do, that same company is adding to another environment somewhere else. With the new hardware out there now, the servers can do the same work in 20 racks as they did in 80 racks five years ago. That means a reduced footprint and energy cost,” he said. + +Often these closures mean moving to a colo. OceanTech recently decommissioned a private data center for a major media outlet he declined to identify that involved shutting down a data center in New Jersey that held 70 racks of gear. The firm was going to move its apps to the cloud but ended up expanding to a colo facility in New York City. + +### Cloud isn't cheaper than private data centers + +Satter said he’s had conversations with companies that planned to go to the cloud but changed their minds when they saw what it would cost if they later decided to move workloads out. Cloud providers can “kill you with guidelines and costs” because your data is in their infrastructure, and they can set fees that make it expensive to move it to another provider, he said. “The cloud not a money saver.” + +That can drive decisions to keep data in-house or in a colo in order to keep tighter possession of their data. “Early on, when people weren’t hip to the game for how much it cost to move to the cloud, you had decision makers with influence say the cloud sounded good. Now they are realizing it costs a lot more dollars to do that vs. doing something on-prem, on your own,” said Satter. + +Guy Churchward, CEO of Datera, developer of software designed storage platforms for enterprises, has noticed a new trend among CIOs making a cloud vs. private decision for apps based on the lifespan of the app. + +“Organizations don’t know how much resource they need to throw at a task. The cloud makes more sense for [short-term apps],” he said. For applications that will be used for five years or more, it makes more sense to place them in company-controlled facilities, he said. That's because with three-to-five-year hardware-refresh cycles, the hardware lasts the entire lifespan of the app, and the hardware and app can be retired at the same time. + +Another force driving the decision of private data center vs. the cloud is machine learning. Churchward said that’s because machine learning is often done using large amounts of highly sensitive data, so customers wanted data kept securely in house. They also wanted a low-latency loop between their ML apps and the data lake from which they draw. + +### Colos connect to mulitple cloud providers + +Another allure of colocation providers is that they can act as a pipeline between enterprises and multiple cloud providers. So rather than directly connecting to AWS, Azure, etc., businesses can connect to a colo, and that colo acts like a giant switch, connecting them to cloud providers through dedicated, high-speed networks. + +Villars notes the typical corporate data center is either inside corporate HQ or someplace remote, like South Dakota where land was cheap. But the trade-off is that network connectivity to remote locations is often slower and more expensive. + +That’s where a data-center colo providers with a large footprints come in, since they have points of presence in major cities. No one would fault a New York City-based firm for putting its data center in upstate New York or even further away. But when Equinix, DTR, and others all have data centers right in New York City, customers might get faster and sometimes cheaper connections plus lower latency. + +Steve Cretney, vice president and CIO for food distributor Colony Brands, is in the midst of migrating the company to the cloud and moving everything he can from his data center to AWS. Rather than connect directly to AWS, Colony’s Wisconsin headquarters is connected to an Equinix data center in Chicago. + +Going with Equinix provides more and cheaper bandwidth to the cloud than buying direct connectivity on his own. “I effectively moved my data center into Chicago. Now I can compete with a better price on data communication and networks,” he said. + +Cretney estimates that by moving Colony’s networking from a smaller, local provider to Chicago, the company is seeing an annual cost savings of 50 percent for network connectivity that includes telecommunications. + +Also, Colony wants to adopt a mult-cloud-provider strategy to avoid vendor lock-in, and he gets that by using Equinix as his network connection. As the company eventually uses Microsoft Azure and Google Cloud and other providers, Equinex can provide flexible and economic interconnections, he said. + +### **Colos reduce the need for enterprise data-center real estate** + +In 2014, 80 percent of data-centers were owned by enterprises, while colos and the early cloud accounted for 20 percent, said Villars. Today that’s a 50-50 split, and by 2022-2023, IDC projects service providers will own 70 percent of the large-data-center space. + +For the past five years, the amount of new data-center construction by enterprises has been falling steadily at  5 to 10 percent per year, said Villars. “They are not building new ones because they are coming to the realization that being an expert at data-center construction is not something a company has.” + +Enterprises across many sectors are looking at their data-center environment and leveraging things like virtual machines and SSD, thereby compressing the size of their data centers and getting more work done within smaller physical footprints. “So at some point they ask if they are spending appropriately for this space. That’s when they look at colo,” said Villars. + +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/3407756/colocation-facilities-buck-the-cloud-data-center-trend.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://images.idgesg.net/images/article/2019/05/cso_cloud_computing_backups_it_engineer_data_center_server_racks_connections_by_gorodenkoff_gettyimages-943065400_3x2_2400x1600-100796535-large.jpg +[2]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html +[3]: https://www.networkworld.com/article/3391380/does-your-cloud-access-security-broker-support-ipv6-it-should.html +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190709 Cisco goes deeper into photonic, optical technology with -2.6B Acacia buy.md b/sources/talk/20190709 Cisco goes deeper into photonic, optical technology with -2.6B Acacia buy.md new file mode 100644 index 0000000000..96f4b055cd --- /dev/null +++ b/sources/talk/20190709 Cisco goes deeper into photonic, optical technology with -2.6B Acacia buy.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco goes deeper into photonic, optical technology with $2.6B Acacia buy) +[#]: via: (https://www.networkworld.com/article/3407706/cisco-goes-deeper-into-photonic-optical-technology-with-2-6b-acacia-buy.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco goes deeper into photonic, optical technology with $2.6B Acacia buy +====== +Cisco: Optical-interconnect technologies are becoming increasingly strategic for data centers, service providers +![KTSimage / Getty Images][1] + +Looking to bulk-up its optical systems portfolio, Cisco says it intends to buy Acacia Communications for approximately $2.6 billion.  The deal is Cisco’s largest since it [laid out $3.7B for AppDynamics][2] in 2017. + +Acacia develops, manufactures and sells high-speed [coherent optical][3] interconnect products that are designed to transform networks linking data centers, cloud and service providers. Cisco is familiar with Acacia as it has been a “significant” customer of the optical firm for about five years, Cisco said. + +**[ Also see [How to plan a software-defined data-center network][4] and [Efficient container use requires data-center software networking][5].]** + +Acacia’s other customers include Nokia Oyj, Huawei and ZTE. Cisco accounts for about 18% of its revenue, [according to Bloomberg’s supply-chain analysis][6]. + +"With the explosion of bandwidth in the multi-cloud era, optical interconnect technologies are becoming increasingly strategic,” said David Goeckeler, executive vice president and general manager of Cisco's networking and security business in a statement. “The acquisition of Acacia will allow us to build on the strength of our switching, routing and optical networking portfolio to address our customers' most demanding requirements." + +For Cisco, one of the key drivers for making this deal was Acacia’s coherent technology – “a fancy term that means the ability to send optical signals over long distances,” said Bill Gartner, senior vice president of Cisco’s Optical Systems and Optics business.  “That technology today is typically delivered via a line card on a big chassis in a separate optical layer but with Acadia’s digital signal processing, ASIC and other technology we are looking to move that from a line card to a pluggable module that increases network capacity, but also reduces complexity and costs.” + +In addition, Acacia uses silicon photonics as the platform for integration of multiple photonic functions for coherent optics, Gartner wrote in a [blog][7] about the acquisition. “Leveraging the advances in silicon photonics, each new generation of coherent optics products has enabled higher data transmission rates, lower power and higher performance than the one before.” + +Recent research from [IHS Markit][8] shows that data center interconnections are the fastest growing segment for coherent transceivers. + +“Acacia’s digital signal processing and small form-factor long-distance communications technology is strong and will be very valuable to Cisco in the long and short term,” said Jimmy Yu, vice president of the Dell'Oro Group. + +The question many analysts have is the impact the sale will have on other Acacia customers Yu said.   “If wasn’t for Acacia selling to others, [such as Huawei, ZTE and Infinera] I don’t thise think vendors would have done as well as they have, and when Cisco owns Acacia it could be a different story,” Yu said. + +The Acacia buy will significantly boost Cisco’s optical portfolio for application outside the data center.  In February [Cisco closed a deal to buy optical-semiconductor firm Luxtera][9] for $660 million, bringing it the advanced optical technology customers will need for speed and throughput for future data center and webscale networks. + +The combination of Cisco’s and Luxtera’s capabilities in 100GbE/400GbE optics, silicon and process technology will help customers build future-proof networks optimized for performance, reliability and cost, Cisco stated. + +The reason Cisco snatched-up Luxtera was its silicon photonics technology that moves data among computer chips optically, which is far quicker than today's electrical transfer, Cisco said. Photonics will be the underpinning of future switches and other networking devices. + +"It seems that Cisco is going all in on being a supplier of optical components and optical pluggable: Luxtera (client side optical components and pluggable) and Acacia (line side optical components and pluggable)," Yu said. + +"Unless Cisco captures more of the optical systems market share and coherent shipment volume, I think Cisco will need to continue selling Acacia products to the broader market and other system vendors due to the high cost of product development," Yu said. + +The acquisition is expected to close during the second half of Cisco's FY2020, and upon close, Acacia employees will join Cisco's Optical Systems and Optics business within its networking and security business under Goeckeler. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3407706/cisco-goes-deeper-into-photonic-optical-technology-with-2-6b-acacia-buy.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://images.idgesg.net/images/article/2019/02/money_currency_printing_press_us_100-dollar_bills_by_ktsimage_gettyimages-1015664778_2400x1600-100788423-large.jpg +[2]: https://www.networkworld.com/article/3184027/cisco-closes-appdynamics-deal-increases-software-weight.html +[3]: https://www.ciena.com/insights/what-is/What-Is-Coherent-Optics.html +[4]: https://www.networkworld.com/article/3284352/data-center/how-to-plan-a-software-defined-data-center-network.html +[5]: https://www.networkworld.com/article/3297379/data-center/efficient-container-use-requires-data-center-software-networking.html +[6]: https://www.bloomberg.com/news/articles/2019-07-09/cisco-to-acquire-acacia-communications-for-2-6-billion-jxvs6rva?utm_source=twitter&utm_medium=social&cmpid=socialflow-twitter-business&utm_content=business&utm_campaign=socialflow-organic +[7]: https://blogs.cisco.com/news/cisco-news-announcement-07191234 +[8]: https://technology.ihs.com/ +[9]: https://www.networkworld.com/article/3339360/cisco-pushes-silicon-photonics-for-enterprise-webscale-networking.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md b/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md new file mode 100644 index 0000000000..5ce4f7edfe --- /dev/null +++ b/sources/talk/20190709 Improving IT Operations - Key to Business Success in Digital Transformation.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Improving IT Operations – Key to Business Success in Digital Transformation) +[#]: via: (https://www.networkworld.com/article/3407698/improving-it-operations-key-to-business-success-in-digital-transformation.html) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Improving IT Operations – Key to Business Success in Digital Transformation +====== + +![Artem Peretiatko][1] + +Forty seven percent of CEOs say they are being “challenged” by their board of directors to show progress in shifting toward a digital business model according to the [Gartner 2018 CIO][2] Agenda Industry Insights Report. By improving IT operations, organizations can progress and even accelerate their digital transformation initiatives efficiently and successfully. The biggest barrier to success is that IT currently spends around 78 percent of their budget and 80 percent of their time just maintaining IT operations, leaving little time and resource left for innovation according to ZK Research[*][3]. + +### **Do you cut the operations budget or invest more in transforming operations? ** + +The Cisco IT Operations Readiness Index 2018 predicted a dramatic change in IT operations as CIOs embrace analytics and automation. The study reported that 88 percent of respondents identify investing in IT operations as key to driving preemptive practices and enhancing customer experience. + +### What does this have to do with the wide area network? + +According to the IT Operations Readiness Index, 73 percent of respondents will collect WAN operational or performance data and 70 percent will analyze WAN data and leverage the results to further automate network operations. However, security is the most data-driven infrastructure today compared to other IT infrastructure functions (i.e. IoT, IP telephony, network infrastructure, data center infrastructure, WAN connectivity, etc.). The big questions are: + + * How do you collect operations data and what data should you collect? + * How do you analyze it? + * How do you then automate IT operations based on the results? + + + +By no means, is this a simple task. IT departments use a combination of data collected internally and by outside vendors to aggregate information used to transform operations and make better business decisions. + +In a recent [survey][4] by Frost & Sullivan, 94 percent of respondents indicated they will deploy a Software-defined Wide Area Network ([SD-WAN][5]) in the next 24 months. SD-WAN addresses the gap that router-centric WAN architectures were not designed to fill. A business-driven SD-WAN, designed from the ground up to support a cloud-first business model, provides significantly more network and application performance visibility, significantly assisting enterprises to realize the transformational promise of a digital business model. In fact, Gartner indicates that 90 percent of WAN edge decisions will be based on SD-WAN by 2023. + +### How an SD-WAN can improve IT operations leading to successful digital transformation + +All SD-WAN solutions are not created alike. One of the key components that organizations need to consider and evaluate is having complete observability across the network and applications through a single pane of glass. Without visibility, IT risks running inefficient operations that will stifle digital transformation initiatives. This real-time visibility must provide: + + * Operational metrics enabling IT/CIO’s to shift from a reactive toward a predictive practice + * A centralized dashboard that allows IT to monitor, in real-time, all aspects of network operations – a dashboard that has flexible knobs to adjust and collect metrics from all WAN edge appliances to accelerate problem resolution + + + +The Silver Peak Unity [EdgeConnect™][6] SD-WAN edge platform provides granular visibility into network and application performance. The EdgeConnect platform ensures the highest quality of experience for both end users and IT. End users enjoy always-consistent, always-available application performance including the highest quality of voice and video, even over broadband. Utilizing the [Unity Orchestrator™][7] comprehensive management dashboard as shown below, IT gains complete observability into the performance attributes of the network and applications in real-time. Customizable widgets provide a wealth of operational data including a health heatmap for every SD-WAN appliance deployed, flow counts, active tunnels, logical topologies, top talkers, alarms, bandwidth consumed by each application and location, application latency and jitter and much more. Furthermore, the platform maintains a week’s worth of data with context allowing IT to playback and see what has transpired at a specific time and location, analogous to a DVR. + +By providing complete observability of the entire WAN, IT spends less time troubleshooting network and application bottlenecks and fielding support/help desk calls day and night, and more time focused on strategic business initiatives. + +![][8] + +This solution brief, “[Simplify SD-WAN Operations with Greater Visibility][9]”, provides additional detail on the capabilities offered in the business-driven EdgeConnect SD-WAN edge platform that enables businesses to accelerate their shift toward a digital business model. + +![][10] + +* ZK Research quote from [Cisco IT Operations Readiness Index 2018][11] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3407698/improving-it-operations-key-to-business-success-in-digital-transformation.html + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/07/istock-1096811078_1200x800-100801264-large.jpg +[2]: https://www.gartner.com/smarterwithgartner/is-digital-a-priority-for-your-industry/ +[3]: https://blog.silver-peak.com/improving-it-operations-key-to-business-success-in-digital-transformation#footnote +[4]: https://www.silver-peak.com/sd-wan-edge-survey +[5]: https://www.silver-peak.com/sd-wan +[6]: https://www.silver-peak.com/products/unity-edge-connect +[7]: https://www.silver-peak.com/products/unity-orchestrator +[8]: https://images.idgesg.net/images/article/2019/07/silver-peak-unity-edgeconnect-sdwan-100801265-large.jpg +[9]: https://www.silver-peak.com/resource-center/simplify-sd-wan-operations-greater-visibility +[10]: https://images.idgesg.net/images/article/2019/07/simplify-sd-wan-operations-with-greater-visibility-100801266-large.jpg +[11]: https://s3-us-west-1.amazonaws.com/connectedfutures-prod/wp-content/uploads/2018/11/CF_transforming_IT_operations_report_3-2.pdf diff --git a/sources/talk/20190709 Linux a key player in the edge computing revolution.md b/sources/talk/20190709 Linux a key player in the edge computing revolution.md new file mode 100644 index 0000000000..df1dba9344 --- /dev/null +++ b/sources/talk/20190709 Linux a key player in the edge computing revolution.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux a key player in the edge computing revolution) +[#]: via: (https://www.networkworld.com/article/3407702/linux-a-key-player-in-the-edge-computing-revolution.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Linux a key player in the edge computing revolution +====== +Edge computing is augmenting the role that Linux plays in our day-to-day lives. A conversation with Jaromir Coufal from Red Hat helps to define what the edge has become. +![Dominic Smith \(CC BY 2.0\)][1] + +In the past few years, [edge computing][2] has been revolutionizing how some very familiar services are provided to individuals like you and me, as well as how services are managed within major industries. Try to get your arms around what edge computing is today, and you might just discover that your arms aren’t nearly as long or as flexible as you’d imagined. And Linux is playing a major role in this ever-expanding edge. + +One reason why edge computing defies easy definition is that it takes many different forms. As Jaromir Coufal, principal product manager at Red Hat, recently pointed out to me, there is no single edge. Instead, there are lots of edges – depending on what compute features are needed. He suggests that we can think of the edge as something of a continuum of capabilities with the problem being resolved determining where along that particular continuum any edge solution will rest. + +**[ Also read: [What is edge computing?][3] and [How edge networking and IoT will reshape data centers][4] ]** + +Some forms of edge computing include consumer electronics that are used and installed in millions of homes, others that serve tens of thousands of small businesses with operating their facilities, and still others that tie large companies to their remote sites. Key to this elusive definition is the idea that edge computing always involves distributing the workload in such a way that the bulk of the computing work is done remotely from the central core of the business and close to the business problem being addressed. + +Done properly, edge computing can provide services that are both faster and more reliable. Applications running on the edge can be more resilient and run considerably faster because their required data resources are local. In addition, data can be processed or analyzed locally, often requiring only periodic transfer of results to central sites. + +While physical security might be lower at the edge, edge devices often implement security features that allow them to detect 1) manipulation of the device, 2) malicious software, and 3) a physical breach and wipe data. + +### Benefits of edge computing + +Some of the benefits of edge computing include: + + * A quick response to intrusion detection, including the ability for a remote device to detach or self-destruct + * The ability to instantly stop communication when needed + * Constrained functionality and fewer generic entry points + * Rugged and reliable problem resistance + * Making the overall computing system harder to attack because computing is distributed + * Less data-in-transit exposure + + + +Some examples of edge computing devices include those that provide: + + * Video surveillance – watching for activity, reporting only if seen + * Controlling autonomous vehicles + * Production monitoring and control + + + +### Edge computing success story: Chick-fil-A + +One impressive example of highly successful edge computing caught me by surprise. It turns out Chick-fil-A uses edge computing devices to help manage its food preparation services. At Chick-fil-A, edge devices: + + 1. Analyze a fryer’s cleaning and cooking + 2. Aggregate data as a failsafe in case internet connectivity is lost + 3. Help with decision-making about cooking – how much and how long to cook + 4. Enhance business operations + 5. Help automate the complex food cooking and holding decisions so that even newbies get things right + 6. Function even when the connection with the central site is down + + + +As Coufal pointed out, Chick-fil-A runs [Kubernetes][5] at the edge in every one of its restaurants. Their key motivators are low-latency, scale of operations, and continuous business. And it seems to be working extremely well. + +[Chick-fil-A’s hypothesis][6] captures it all: By making smarter kitchen equipment, we can collect more data. By applying data to our restaurant, we can build more intelligent systems. By building more intelligent systems, we can better scale our business. + +### Are you edge-ready? + +There’s no quick answer as to whether your organization is “edge ready.” Many factors determine what kind of services can be deployed on the edge and whether and when those services need to communicate with more central devices. Some of these include: + + * Whether your workload can be functionally distributed + * If it’s OK for devices to have infrequent contact with the central services + * If devices can work properly when cut off from their connection back to central services + * Whether the devices can be secured (e.g., trusted not to provide an entry point) + + + +Implementing an edge computing network will likely take a long time from initial planning to implementation. Still, this kind of technology is taking hold and offers some strong advantages. While edge computing initially took hold 15 or more years ago, the last few years have seen renewed interest thanks to tech advances that have enabled new uses. + +Coufal noted that it's been 15 or more years since edge computing concepts and technologies were first introduced, but renewed interest has come about due to tech advances enabling new uses that require this technology. + +**More about edge computing:** + + * [How edge networking and IoT will reshape data centers][4] + * [Edge computing best practices][7] + * [How edge computing can help secure the IoT][8] + + + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3407702/linux-a-key-player-in-the-edge-computing-revolution.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://images.idgesg.net/images/article/2019/07/telecom-100801330-large.jpg +[2]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[4]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[5]: https://www.infoworld.com/article/3268073/what-is-kubernetes-container-orchestration-explained.html +[6]: https://medium.com/@cfatechblog/edge-computing-at-chick-fil-a-7d67242675e2 +[7]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[8]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190710 The Titan supercomputer is being decommissioned- a costly, time-consuming project.md b/sources/talk/20190710 The Titan supercomputer is being decommissioned- a costly, time-consuming project.md new file mode 100644 index 0000000000..1cee0a981d --- /dev/null +++ b/sources/talk/20190710 The Titan supercomputer is being decommissioned- a costly, time-consuming project.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Titan supercomputer is being decommissioned: a costly, time-consuming project) +[#]: via: (https://www.networkworld.com/article/3408176/the-titan-supercomputer-is-being-decommissioned-a-costly-time-consuming-project.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +The Titan supercomputer is being decommissioned: a costly, time-consuming project +====== +The old gives way to new at Oak Ridge National Labs. The Titan supercomputer is being replaced by Frontier, and it's a super-sized task. +![Oak Ridge National Laboratory][1] + +A supercomputer deployed in 2012 is going into retirement after seven years of hard work, but the task of decommissioning it is not trivial. + +The Cray XK7 “Titan” supercomputer at the Department of Energy’s (DOE) Oak Ridge National Laboratory (ORNL) is scheduled to be decommissioned on August 1 and disassembled for recycling. + +At 27 petaflops, or 27 quadrillion calculations per second, Titan was at one point the fastest supercomputer in the world at its debut in 2012 and remained in the top 10 worldwide until June 2019. + +**[ Also read: [10 of the world's fastest supercomputers][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +But time marches on. This beast is positively ancient by computing standards. It uses 16-core AMD Opteron CPUs and Nvidia Kepler generation processors. You can buy a gaming PC with better than that today. + +“Titan has run its course,” Operations Manager Stephen McNally at ORNL said in an [article][4] published by ONRL. “The reality is, in electronic years, Titan is ancient. Think of what a cell phone was like seven years ago compared to the cell phones available today. Technology advances rapidly, including supercomputers.” + +In its seven years, Titan generated than 26 billion core hours of computing time for hundreds of research teams around the world, not just the DOE. It was one of the first to use GPUs, a groundbreaking move at the time but now commonplace. + +The Oak Ridge Leadership Computing Facility (OLCF) actually houses Titan in a 60,000-sq.-ft. facility, 20,000 of which is occupied by Titan, the Eos cluster that supports Titan and Atlas file system that holds 32 petabytes of data. + +**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +June 30 was the last day users could submit jobs to Titan or Eos, another supercomputer, which is also 7 years old.  + +### Decommissioning a supercomputer is a super-sized task + +Decommissioning a computer the size of Titan is more than turning off a switch. ONRL didn’t have a dollar estimate of the cost involved, but it did discuss the scale, which should give some idea of how costly this will be. + +The decommissioning of Titan will include about 41 people, including staff from ORNL, Cray, and external subcontractors. OLCF staff are supporting users who need to complete runs, save data, or transition their projects to other resources. + +Electricians will safely shut down the 9 megawatt-capacity system, and Cray staff will disassemble and recycle Titan’s electronics and its metal components and cabinets. A separate crew will handle the cooling system. All told, 350 tons of equipment and 10,800 pounds of refrigerant are being removed from the site. + +What becomes of the old gear is unclear. Even ONRL has no idea what Cray will do with it. McNally said there is no value in Titan’s parts: “It’s simply not worth the cost to a data center or university of powering and cooling even fragments of Titan. Titan’s value lies in the system as a whole.” + +The 20,000-sq.-ft. data center that is currently home to Titan will be gutted and expanded in preparation for [Frontier][6], the an exascale system scheduled for delivery in 2021 running AMD Epyc processors and Nvidia GPUs. + +A power, cooling, and data center upgrade is already underway ahead of the Titan decommissioning to prepare for Frontier. The whole removal process will take about a month but has been in the works for several months to ensure a smooth transition for people still using the old machine. + +**[ Now read this: [10 of the world's fastest supercomputers][2] ]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3408176/the-titan-supercomputer-is-being-decommissioned-a-costly-time-consuming-project.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://images.idgesg.net/images/article/2018/06/titan_supercomputer_at_ornl_oak_ridge_national_laboratory_1200x800-100762120-large.jpg +[2]: https://www.networkworld.com/article/3236875/embargo-10-of-the-worlds-fastest-supercomputers.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.olcf.ornl.gov/2019/06/28/farewell-titan/ +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.olcf.ornl.gov/frontier/ +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190710 Will IBM-s acquisition be the end of Red Hat.md b/sources/talk/20190710 Will IBM-s acquisition be the end of Red Hat.md new file mode 100644 index 0000000000..a1a2e4cad5 --- /dev/null +++ b/sources/talk/20190710 Will IBM-s acquisition be the end of Red Hat.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Will IBM’s acquisition be the end of Red Hat?) +[#]: via: (https://www.networkworld.com/article/3407746/will-ibms-acquisition-be-the-end-of-red-hat.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Will IBM’s acquisition be the end of Red Hat? +====== +IBM's acquisition of Red Hat is a big deal -- a 34 billion dollar big deal -- and many Linux professionals are wondering how it's going to change Red Hat's role in the Linux world. Here are some thoughts. +![Stephen Lawson/IDG][1] + +[IBM's acquisition of Red Hat for $34 billion][2] is now a done deal, and statements from the leadership of both companies sound extremely promising. But some in the Linux users have expressed concern. + +Questions being asked by some Linux professionals and devotees include: + + * Will Red Hat lose customer confidence now that it’s part of IBM and not an independent company? + * Will IBM continue putting funds into open source after paying such a huge price for Red Hat? Will they curtail what Red Hat is able to invest? + * Both companies’ leaders are saying all the right things now, but can they predict how their business partners and customers will react as they move forward? Will their good intentions be derailed? + + + +Part of the worry simply comes from the size of this deal. Thirty-four billion dollars is a _lot_ of money. This is probably the largest cloud computing acquisition to date. What kind of strain will that price tag put on how the new IBM functions going forward? Other worries come from the character of the acquisition – whether Red Hat will be able to continue operating independently and what will change if they cannot. In addition, a few Linux devotees hark back to Oracle’s acquisition of Sun Microsystems in 2010 and Sun’s slow death in its aftermath. + +**[ Also read: [The IBM-Red Hat deal: What it means for enterprises][3] | Get daily insights: [Sign up for Network World newsletters][4] ]** + +The good news is that this merger of IBM and Red Hat appears to offer each of the companies some significant benefits. IBM makes a strong move into cloud computing, and Red Hat gains a broader international footing. + +The other good news relates to the pace at which this acquisition occurred. Initially announced on October 28, 2018, it is now more than eight months later. It’s clear that the leadership of each company has not rushed headlong into this new relationship. Both parties to the acquisition appear to be moving ahead with trust and optimism. IBM promises to ensure Red Hat's independence and will allow it to continue to be "Red Hat" both in name and business activity. + +### The end of Red Hat highly unlikely + +Will this acquisition be the end of Red Hat? That outcome is not impossible, but it seems extremely unlikely. For one thing, both companies stand to gain significantly from the other’s strong points. IBM is likely to be revitalized in ways that allow it to be more successful, and Red Hat is starting from a very strong position. While it’s a huge gamble by some measurements, I think most of us Linux enthusiasts are cautiously optimistic at worst. + +IBM seems intent on allowing Red Hat to work independently and seems to be taking the time required to work out the kinks in their plans. + +As for the eventual demise of Sun Microsystems, the circumstances were very different. As this [coverage in Network World in 2017][5] suggests, Sun was in an altogether different position when it was acquired. The future for IBM and Red Hat appears to be considerably brighter – even to a former (decades earlier) member of the Sun User Group Board of Directors. + +The answer to the question posed by the title of this post is “probably not.” Only time will tell, but leadership seems committed to doing things the right way – preserving Red Hat's role in the Linux world and making the arrangement pay off for both organizations. And I, for one, expect good things to come from the merger – for IBM, for Red Hat and likely even for Linux enthusiasts like myself. + +**[ Now read this: [The IBM-Red Hat deal: What it means for enterprises][3] ]** + +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/3407746/will-ibms-acquisition-be-the-end-of-red-hat.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://images.techhive.com/images/article/2015/10/20151027-red-hat-logo-100625237-large.jpg +[2]: https://www.networkworld.com/article/3316960/ibm-closes-34b-red-hat-deal-vaults-into-multi-cloud.html +[3]: https://www.networkworld.com/article/3317517/the-ibm-red-hat-deal-what-it-means-for-enterprises.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.networkworld.com/article/3222707/the-sun-sets-on-solaris-and-sparc.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md b/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md new file mode 100644 index 0000000000..86150bc580 --- /dev/null +++ b/sources/talk/20190711 Smarter IoT concepts reveal creaking networks.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Smarter IoT concepts reveal creaking networks) +[#]: via: (https://www.networkworld.com/article/3407852/smarter-iot-concepts-reveal-creaking-networks.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Smarter IoT concepts reveal creaking networks +====== +Today’s networks don’t meet the needs of emergent internet of things systems. IoT systems need their own modern infrastructure, researchers at the University of Magdeburg say. +![Thinkstock][1] + +The internet of things (IoT) needs its own infrastructure ecosystem — one that doesn't use external clouds at all, researchers at the University of Magdeburg say. + +The computer scientists recently obtained funding from the German government to study how to build a future-generation of revolutionary, emergent IoT systems. They say networks must be fault tolerant, secure, and traverse disparate protocols, which they aren't now. + +**[ Read also: [What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3] ]** + +The researchers say a smarter, unique, and organic infrastructure needs to be developed for the IoT and that simply adapting the IoT to traditional networks won't work. They say services must self-organize and function autonomously and that people must accept the fact that we are using the internet in ways never originally intended.  + +"The internet, as we know it, is based on network architectures of the 70s and 80s, when it was designed for completely different applications,” the researchers say in their [media release][4]. The internet has centralized security, which causes choke points, and and an inherent lack of dynamic controls, which translates to inflexibility in access rights — all of which make it difficult to adapt the IoT to it. + +Device, data, and process management must be integrated into IoT systems, say the group behind the project, called [DoRIoT][5] (Dynamische Laufzeitumgebung für Organisch (dis-)Aggregierende IoT-Prozesse), translated as Dynamic Runtime Environment for Organic dis-Aggregating IoT Processes. + +“In order to close this gap, concepts [will be] developed in the project that transparently realize the access to the data,” says Professor Sebastian Zug of the University of Freiberg, a partner in DoRIoT. “For the application, it should make no difference whether the specific information requirement is answered by a server or an IoT node.” + +### Extreme edge computing + +In other words, servers and nodes, conceptually, should merge. One could argue it’s a form of extreme [edge computing][6], which is when processing and data storage is taken out of traditional, centralized data center environments and placed close to where the resources are required. It reduces latency, among other advantages. + +DoRIoT may take edge computing one step further. Detecting failures ahead of time and seamless migration of devices are wants, too — services can’t fail just because a new kind of device is introduced. + +“The systems [will] benefit from each other, for example, they can share computing power, data and so on,” says Mesut Güneş of Magdeburg’s [Faculty of Computer Science Institute for Intelligent Cooperating Systems][7]. + +“The result is an enormous data pool,” the researchers explain. “Which, in turn, makes it possible to make much more precise statements, for example when predicting climate models, observing traffic flows, or managing large factories in Industry 4.0.” + +[Industry 4.0][8] refers to smart factories that have connected machines autonomously self-managing their own supply chain, production output, and logistics without human intervention. + +Managing risks better than the current internet is one of DoRIoT's goals. The idea is to “guarantee full sovereignty over proprietary data.” To get there, though, one has to eliminate dependency on the cloud and access to data via third parties, they say. + +“This allows companies to be independent of the server infrastructures of external service providers such as Google, Microsoft or Amazon, which are subject to constant changes and even may not be accessible,” they say. + +**More about edge networking** + + * [How edge networking and IoT will reshape data centers][3] + * [Edge computing best practices][9] + * [How edge computing can help secure the IoT][10] + + + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3407852/smarter-iot-concepts-reveal-creaking-networks.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/02/industry_4-0_industrial_iot_internet_of_things_network_thinkstock_613880008-100749946-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: http://www.ovgu.de/en/University/In+Profile/Key+Profile+Areas/Research/Secure+data+protection+in+the+new+internet+of+things.html +[5]: http://www.doriot.net/ +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: http://iks.cs.ovgu.de/iks/en/ICS.html +[8]: https://www.networkworld.com/article/3199671/what-is-industry-4-0.html +[9]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[10]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/talk/20191110 What is DevSecOps.md b/sources/talk/20191110 What is DevSecOps.md deleted file mode 100644 index 007f8f0c76..0000000000 --- a/sources/talk/20191110 What is DevSecOps.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (What is DevSecOps?) -[#]: via: (https://opensource.com/article/19/1/what-devsecops) -[#]: author: (Brett Hunoldt https://opensource.com/users/bretthunoldtcom) - -What is DevSecOps? -====== -The journey to DevSecOps begins with empowerment, enablement, and education. Here's how to get started. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devop.png?itok=Yicb2nnZ) - -> “DevSecOps enables organizations to deliver inherently secure software at DevOps speed.” -Stefan Streichsbier - -DevSecOps as a practice or an art form is an evolution on the concept of DevOps. To better understand DevSecOps, you should first have an understanding of what DevOps means. - -DevOps was born from merging the practices of development and operations, removing the silos, aligning the focus, and improving efficiency and performance of both the teams and the product. A new synergy was formed, with DevOps focused on building products and services that are easy to maintain and that automate typical operations functions. - -Security is a common silo in many organizations. Security’s core focus is protecting the organization, and sometimes this means creating barriers or policies that slow down the execution of new services or products to ensure that everything is well understood and done safely and that nothing introduces unnecessary risk to the organization. - -**[[Download the Getting started with DevSecOps guide]][1]** - -Because of the distinct nature of the security silo and the friction it can introduce, development and operations sometimes bypass or work around security to meet their objectives. At some firms, the silo creates an expectation that security is entirely the responsibility of the security team and it is up to them to figure out what security defects or issues may be introduced as a result of a product. - -DevSecOps looks at merging the security discipline within DevOps. By enhancing or building security into the developer and/or operational role, or including a security role within the product engineering team, security naturally finds itself in the product by design. - -This allows companies to release new products and updates more quickly and with full confidence that security is embedded into the product. - -### Where does rugged software fit into DevSecOps? - -Building rugged software is more an aspect of the DevOps culture than a distinct practice, and it complements and enhances a DevSecOps practice. Think of a rugged product as something that has been battle-hardened through experimentation or experience. - -It’s important to note that rugged software is not necessarily 100% secure (although it may have been at some point in time). However, it has been designed to handle most of what is thrown at it. - -The key tenets of a rugged software practice are fostering competition, experimentation, controlled failure, and cooperation. - -### How do you get started in DevSecOps? - -Gettings started with DevSecOps involves shifting security requirements and execution to the earliest possible stage in the development process. It ultimately creates a shift in culture where security becomes everyone’s responsibility, not only the security team’s. - -You may have heard teams talking about a "shift left." If you flatten the development pipeline into a horizontal line to include the key stages of the product evolution—from initiation to design, building, testing, and finally to operating—the goal of a security is to be involved as early as possible. This allows the risks to be better evaluated, socialized, and mitigated by design. The "shift-left" mentality is about moving this engagement far left in this pipeline. - -This journey begins with three key elements: - - * empowerment - * enablement - * education - - - -Empowerment, in my view, is about releasing control and allowing teams to make independent decisions without fear of failure or repercussion (within reason). The only caveat in this process is that information is critical to making informed decisions (more on that below). - -To achieve empowerment, business and executive support (which can be created through internal sales, presentations, and establishing metrics to show the return on this investment) is critical to break down the historic barriers and siloed teams. Integrating security into the development and operations teams and increasing both communication and transparency can help you begin the journey to DevSecOps. - -This integration and mobilization allows teams to focus on a single outcome: Building a product for which they share responsibility and collaborate on development and security in a reliable way. This will take you most of the way towards empowerment. It places the shared responsibility for the product with the teams building it and ensures that any part of the product can be taken apart and maintain its security. - -Enablement involves placing the right tools and resources in the hands of the teams. It’s about creating a culture of knowledge-sharing through forums, wikis, and informal gatherings. - -Creating a culture that focuses on automation and the concept that repetitive tasks should be coded will likely reduce operational overhead and strengthen security. This scenario is about more than providing knowledge; it is about making this knowledge highly accessible through multiple channels and mediums (which are enabled through tools) so that it can be consumed and shared in whatever way teams or individuals prefer. One medium might work best when team members are coding and another when they are on the road. Make the tools accessible and simple and let the team play with them. - -Different DevSecOp teams will have different preferences, so allow them to be independent whenever possible. This is a delicate balancing exercise because you do want economies of scale and the ability to share among products. Collaboration and involvement in the selection and renewal of these tools will help lower the barriers of adoption. - -Finally, and perhaps most importantly, DevSecOps is about training and awareness building. Meetups, social gatherings, or formal presentations within the organization are great ways for peers to teach and share their learnings. Sometimes these highlight shared challenges, concerns, or risks others may not have considered. Sharing and teaching are also effective ways to learn and to mentor teams. - -In my experience, each organization's culture is unique, so you can’t take a “one-size-fits-all” approach. Reach out to your teams and find out what tools they want to use. Test different forums and gatherings and see what works best for your culture. Seek feedback and ask the teams what is working, what they like, and why. Adapt and learn, be positive, and never stop trying, and you’ll almost always succeed. - -[Download the Getting started with DevSecOps guide][1] - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/1/what-devsecops - -作者:[Brett Hunoldt][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/bretthunoldtcom -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/downloads/devsecops diff --git a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md index 5e5f4df763..0fb3c6469d 100644 --- a/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md +++ b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ninifly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20160301 How To Set Password Policies In Linux.md b/sources/tech/20160301 How To Set Password Policies In Linux.md deleted file mode 100644 index bad7c279bc..0000000000 --- a/sources/tech/20160301 How To Set Password Policies In Linux.md +++ /dev/null @@ -1,356 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Set Password Policies In Linux) -[#]: via: (https://www.ostechnix.com/how-to-set-password-policies-in-linux/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) - -How To Set Password Policies In Linux -====== -![](https://www.ostechnix.com/wp-content/uploads/2016/03/How-To-Set-Password-Policies-In-Linux-720x340.jpg) - -Even though Linux is secure by design, there are many chances for the security breach. One of them is weak passwords. As a System administrator, you must provide a strong password for the users. Because, mostly system breaches are happening due to weak passwords. This tutorial describes how to set password policies such as **password length** , **password complexity** , **password** **expiration period** etc., in DEB based systems like Debian, Ubuntu, Linux Mint, and RPM based systems like RHEL, CentOS, Scientific Linux. - -### Set password length in DEB based systems - -By default, all Linux operating systems requires **password length of minimum 6 characters** for the users. I strongly advice you not to go below this limit. Also, don’t use your real name, parents/spouse/kids name, or your date of birth as a password. Even a novice hacker can easily break such kind of passwords in minutes. The good password must always contains more than 6 characters including a number, a capital letter, and a special character. - -Usually, the password and authentication-related configuration files will be stored in **/etc/pam.d/** location in DEB based operating systems. - -To set minimum password length, edit**/etc/pam.d/common-password** file; - -``` -$ sudo nano /etc/pam.d/common-password -``` - -Find the following line: - -``` -password [success=2 default=ignore] pam_unix.so obscure sha512 -``` - -![][2] - -And add an extra word: **minlen=8** at the end. Here I set the minimum password length as **8**. - -``` -password [success=2 default=ignore] pam_unix.so obscure sha512 minlen=8 -``` - -![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-3-1.jpg) - -Save and close the file. So, now the users can’t use less than 8 characters for their password. - -### Set password length in RPM based systems - -**In RHEL, CentOS, Scientific Linux 7.x** systems, run the following command as root user to set password length. - -``` -# authconfig --passminlen=8 --update -``` - -To view the minimum password length, run: - -``` -# grep "^minlen" /etc/security/pwquality.conf -``` - -**Sample output:** - -``` -minlen = 8 -``` - -**In RHEL, CentOS, Scientific Linux 6.x** systems, edit **/etc/pam.d/system-auth** file: - -``` -# nano /etc/pam.d/system-auth -``` - -Find the following line and add the following at the end of the line: - -``` -password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 -``` - -![](https://www.ostechnix.com/wp-content/uploads/2016/03/root@server_003-3.jpg) - -As per the above setting, the minimum password length is **8** characters. - -### Set password complexity in DEB based systems - -This setting enforces how many classes, i.e upper-case, lower-case, and other characters, should be in a password. - -First install password quality checking library using command: - -``` -$ sudo apt-get install libpam-pwquality -``` - -Then, edit **/etc/pam.d/common-password** file: - -``` -$ sudo nano /etc/pam.d/common-password -``` - -To set at least one **upper-case** letters in the password, add a word **‘ucredit=-1’** at the end of the following line. - -``` -password requisite pam_pwquality.so retry=3 ucredit=-1 -``` - -![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_001-7.jpg) - -Set at least one **lower-case** letters in the password as shown below. - -``` -password requisite pam_pwquality.so retry=3 dcredit=-1 -``` - -Set at least **other** letters in the password as shown below. - -``` -password requisite pam_pwquality.so retry=3 ocredit=-1 -``` - -As you see in the above examples, we have set at least (minimum) one upper-case, lower-case, and a special character in the password. You can set any number of maximum allowed upper-case, lower-case, and other letters in your password. - -You can also set the minimum/maximum number of allowed classes in the password. - -The following example shows the minimum number of required classes of characters for the new password: - -``` -password requisite pam_pwquality.so retry=3 minclass=2 -``` - -### Set password complexity in RPM based systems - -**In RHEL 7.x / CentOS 7.x / Scientific Linux 7.x:** - -To set at least one lower-case letter in the password, run: - -``` -# authconfig --enablereqlower --update -``` - -To view the settings, run: - -``` -# grep "^lcredit" /etc/security/pwquality.conf -``` - -**Sample output:** - -``` -lcredit = -1 -``` - -Similarly, set at least one upper-case letter in the password using command: - -``` -# authconfig --enablerequpper --update -``` - -To view the settings: - -``` -# grep "^ucredit" /etc/security/pwquality.conf -``` - -**Sample output:** - -``` -ucredit = -1 -``` - -To set at least one digit in the password, run: - -``` -# authconfig --enablereqdigit --update -``` - -To view the setting, run: - -``` -# grep "^dcredit" /etc/security/pwquality.conf -``` - -**Sample output:** - -``` -dcredit = -1 -``` - -To set at least one other character in the password, run: - -``` -# authconfig --enablereqother --update -``` - -To view the setting, run: - -``` -# grep "^ocredit" /etc/security/pwquality.conf -``` - -**Sample output:** - -``` -ocredit = -1 -``` - -In **RHEL 6.x / CentOS 6.x / Scientific Linux 6.x systems** , edit **/etc/pam.d/system-auth** file as root user: - -``` -# nano /etc/pam.d/system-auth -``` - -Find the following line and add the following at the end of the line: - -``` -password requisite pam_cracklib.so try_first_pass retry=3 type= minlen=8 dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 -``` - -As per the above setting, the password must have at least 8 characters. In addtion, the password should also have at least one upper-case letter, one lower-case letter, one digit, and one other characters. - -### Set password expiration period in DEB based systems - -Now, We are going to set the following policies. - - 1. Maximum number of days a password may be used. - 2. Minimum number of days allowed between password changes. - 3. Number of days warning given before a password expires. - - - -To set this policy, edit: - -``` -$ sudo nano /etc/login.defs -``` - -Set the values as per your requirement. - -``` -PASS_MAX_DAYS 100 -PASS_MIN_DAYS 0 -PASS_WARN_AGE 7 -``` - -![](https://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_002-8.jpg) - -As you see in the above example, the user should change the password once in every **100** days and the warning message will appear **7** days before password expiration. - -Be mindful that these settings will impact the newly created users. - -To set maximum number of days between password change to existing users, you must run the following command: - -``` -$ sudo chage -M -``` - -To set minimum number of days between password change, run: - -``` -$ sudo chage -m -``` - -To set warning before password expires, run: - -``` -$ sudo chage -W -``` - -To display the password for the existing users, run: - -``` -$ sudo chage -l sk -``` - -Here, **sk** is my username. - -**Sample output:** - -``` -Last password change : Feb 24, 2017 -Password expires : never -Password inactive : never -Account expires : never -Minimum number of days between password change : 0 -Maximum number of days between password change : 99999 -Number of days of warning before password expires : 7 -``` - -As you see in the above output, the password never expires. - -To change the password expiration period of an existing user, - -``` -$ sudo chage -E 24/06/2018 -m 5 -M 90 -I 10 -W 10 sk -``` - -The above command will set password of the user **‘sk’** to expire on **24/06/2018**. Also the the minimum number days between password change is set 5 days and the maximum number of days between password changes is set to **90** days. The user account will be locked automatically after **10 days** and It will display a warning message for **10 days** before password expiration. - -### Set password expiration period in RPM based systems - -This is same as DEB based systems. - -### Forbid previously used passwords in DEB based systems - -You can limit the users to set a password which is already used in the past. To put this in layman terms, the users can’t use the same password again. - -To do so, edit**/etc/pam.d/common-password** file: - -``` -$ sudo nano /etc/pam.d/common-password -``` - -Find the following line and add the word **‘remember=5’** at the end: - -``` -password        [success=2 default=ignore]      pam_unix.so obscure use_authtok try_first_pass sha512 remember=5 -``` - -The above policy will prevent the users to use the last 5 used passwords. - -### Forbid previously used passwords in RPM based systems - -This is same for both RHEL 6.x and RHEL 7.x and it’s clone systems like CentOS, Scientific Linux. - -Edit **/etc/pam.d/system-auth** file as root user, - -``` -# vi /etc/pam.d/system-auth -``` - -Find the following line, and add **remember=5** at the end. - -``` -password     sufficient     pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5 -``` - -You know now what is password policies in Linux, and how to set different password policies in DEB and RPM based systems. - -That’s all for now. I will be here soon with another interesting and useful article. Until then stay tuned with OSTechNix. If you find this tutorial helpful, share it on your social, professional networks and support us. - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-set-password-policies-in-linux/ - -作者:[SK][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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[2]: http://www.ostechnix.com/wp-content/uploads/2016/03/sk@sk-_003-2-1.jpg diff --git a/sources/tech/20161106 Myths about -dev-urandom.md b/sources/tech/20161106 Myths about -dev-urandom.md deleted file mode 100644 index b00b5863d8..0000000000 --- a/sources/tech/20161106 Myths about -dev-urandom.md +++ /dev/null @@ -1,289 +0,0 @@ -Myths about /dev/urandom -====== - -There are a few things about /dev/urandom and /dev/random that are repeated again and again. Still they are false. - -I'm mostly talking about reasonably recent Linux systems, not other UNIX-like systems. - -### /dev/urandom is insecure. Always use /dev/random for cryptographic purposes. - -Fact: /dev/urandom is the preferred source of cryptographic randomness on UNIX-like systems. - -### /dev/urandom is a pseudo random number generator, a PRNG, while /dev/random is a “true” random number generator. - -Fact: Both /dev/urandom and /dev/random are using the exact same CSPRNG (a cryptographically secure pseudorandom number generator). They only differ in very few ways that have nothing to do with “true” randomness. - -### /dev/random is unambiguously the better choice for cryptography. Even if /dev/urandom were comparably secure, there's no reason to choose the latter. - -Fact: /dev/random has a very nasty problem: it blocks. - -### But that's good! /dev/random gives out exactly as much randomness as it has entropy in its pool. /dev/urandom will give you insecure random numbers, even though it has long run out of entropy. - -Fact: No. Even disregarding issues like availability and subsequent manipulation by users, the issue of entropy “running low” is a straw man. About 256 bits of entropy are enough to get computationally secure numbers for a long, long time. - -And the fun only starts here: how does /dev/random know how much entropy there is available to give out? Stay tuned! - -### But cryptographers always talk about constant re-seeding. Doesn't that contradict your last point? - -Fact: You got me! Kind of. It is true, the random number generator is constantly re-seeded using whatever entropy the system can lay its hands on. But that has (partly) other reasons. - -Look, I don't claim that injecting entropy is bad. It's good. I just claim that it's bad to block when the entropy estimate is low. - -### That's all good and nice, but even the man page for /dev/(u)random contradicts you! Does anyone who knows about this stuff actually agree with you? - -Fact: No, it really doesn't. It seems to imply that /dev/urandom is insecure for cryptographic use, unless you really understand all that cryptographic jargon. - -The man page does recommend the use of /dev/random in some cases (it doesn't hurt, in my opinion, but is not strictly necessary), but it also recommends /dev/urandom as the device to use for “normal” cryptographic use. - -And while appeal to authority is usually nothing to be proud of, in cryptographic issues you're generally right to be careful and try to get the opinion of a domain expert. - -And yes, quite a few experts share my view that /dev/urandom is the go-to solution for your random number needs in a cryptography context on UNIX-like systems. Obviously, their opinions influenced mine, not the other way around. - -Hard to believe, right? I must certainly be wrong! Well, read on and let me try to convince you. - -I tried to keep it out, but I fear there are two preliminaries to be taken care of, before we can really tackle all those points. - -Namely, what is randomness, or better: what kind of randomness am I talking about here? - -And, even more important, I'm really not being condescending. I have written this document to have a thing to point to, when this discussion comes up again. More than 140 characters. Without repeating myself again and again. Being able to hone the writing and the arguments itself, benefitting many discussions in many venues. - -And I'm certainly willing to hear differing opinions. I'm just saying that it won't be enough to state that /dev/urandom is bad. You need to identify the points you're disagreeing with and engage them. - -### You're saying I'm stupid! - -Emphatically no! - -Actually, I used to believe that /dev/urandom was insecure myself, a few years ago. And it's something you and me almost had to believe, because all those highly respected people on Usenet, in web forums and today on Twitter told us. Even the man page seems to say so. Who were we to dismiss their convincing argument about “entropy running low”? - -This misconception isn't so rampant because people are stupid, it is because with a little knowledge about cryptography (namely some vague idea what entropy is) it's very easy to be convinced of it. Intuition almost forces us there. Unfortunately intuition is often wrong in cryptography. So it is here. - -### True randomness - -What does it mean for random numbers to be “truly random”? - -I don't want to dive into that issue too deep, because it quickly gets philosophical. Discussions have been known to unravel fast, because everyone can wax about their favorite model of randomness, without paying attention to anyone else. Or even making himself understood. - -I believe that the “gold standard” for “true randomness” are quantum effects. Observe a photon pass through a semi-transparent mirror. Or not. Observe some radioactive material emit alpha particles. It's the best idea we have when it comes to randomness in the world. Other people might reasonably believe that those effects aren't truly random. Or even that there is no randomness in the world at all. Let a million flowers bloom. - -Cryptographers often circumvent this philosophical debate by disregarding what it means for randomness to be “true”. They care about unpredictability. As long as nobody can get any information about the next random number, we're fine. And when you're talking about random numbers as a prerequisite in using cryptography, that's what you should aim for, in my opinion. - -Anyway, I don't care much about those “philosophically secure” random numbers, as I like to think of your “true” random numbers. - -### Two kinds of security, one that matters - -But let's assume you've obtained those “true” random numbers. What are you going to do with them? - -You print them out, frame them and hang them on your living-room wall, to revel in the beauty of a quantum universe? That's great, and I certainly understand. - -Wait, what? You're using them? For cryptographic purposes? Well, that spoils everything, because now things get a bit ugly. - -You see, your truly-random, quantum effect blessed random numbers are put into some less respectable, real-world tarnished algorithms. - -Because almost all of the cryptographic algorithms we use do not hold up to ### information-theoretic security**. They can “only” offer **computational security. The two exceptions that come to my mind are Shamir's Secret Sharing and the One-time pad. And while the first one may be a valid counterpoint (if you actually intend to use it), the latter is utterly impractical. - -But all those algorithms you know about, AES, RSA, Diffie-Hellman, Elliptic curves, and all those crypto packages you're using, OpenSSL, GnuTLS, Keyczar, your operating system's crypto API, these are only computationally secure. - -What's the difference? While information-theoretically secure algorithms are secure, period, those other algorithms cannot guarantee security against an adversary with unlimited computational power who's trying all possibilities for keys. We still use them because it would take all the computers in the world taken together longer than the universe has existed, so far. That's the level of “insecurity” we're talking about here. - -Unless some clever guy breaks the algorithm itself, using much less computational power. Even computational power achievable today. That's the big prize every cryptanalyst dreams about: breaking AES itself, breaking RSA itself and so on. - -So now we're at the point where you don't trust the inner building blocks of the random number generator, insisting on “true randomness” instead of “pseudo randomness”. But then you're using those “true” random numbers in algorithms that you so despise that you didn't want them near your random number generator in the first place! - -Truth is, when state-of-the-art hash algorithms are broken, or when state-of-the-art block ciphers are broken, it doesn't matter that you get “philosophically insecure” random numbers because of them. You've got nothing left to securely use them for anyway. - -So just use those computationally-secure random numbers for your computationally-secure algorithms. In other words: use /dev/urandom. - -### Structure of Linux's random number generator - -#### An incorrect view - -Chances are, your idea of the kernel's random number generator is something similar to this: - -![image: mythical structure of the kernel's random number generator][1] - -“True randomness”, albeit possibly skewed and biased, enters the system and its entropy is precisely counted and immediately added to an internal entropy counter. After de-biasing and whitening it's entering the kernel's entropy pool, where both /dev/random and /dev/urandom get their random numbers from. - -The “true” random number generator, /dev/random, takes those random numbers straight out of the pool, if the entropy count is sufficient for the number of requested numbers, decreasing the entropy counter, of course. If not, it blocks until new entropy has entered the system. - -The important thing in this narrative is that /dev/random basically yields the numbers that have been input by those randomness sources outside, after only the necessary whitening. Nothing more, just pure randomness. - -/dev/urandom, so the story goes, is doing the same thing. Except when there isn't sufficient entropy in the system. In contrast to /dev/random, it does not block, but gets “low quality random” numbers from a pseudorandom number generator (conceded, a cryptographically secure one) that is running alongside the rest of the random number machinery. This CSPRNG is just seeded once (or maybe every now and then, it doesn't matter) with “true randomness” from the randomness pool, but you can't really trust it. - -In this view, that seems to be in a lot of people's minds when they're talking about random numbers on Linux, avoiding /dev/urandom is plausible. - -Because either there is enough entropy left, then you get the same you'd have gotten from /dev/random. Or there isn't, then you get those low-quality random numbers from a CSPRNG that almost never saw high-entropy input. - -Devilish, right? Unfortunately, also utterly wrong. In reality, the internal structure of the random number generator looks like this. - -#### A better simplification - -##### Before Linux 4.8 - -![image: actual structure of the kernel's random number generator before Linux 4.8][2] This is a pretty rough simplification. In fact, there isn't just one, but three pools filled with entropy. One primary pool, and one for /dev/random and /dev/urandom each, feeding off the primary pool. Those three pools all have their own entropy counts, but the counts of the secondary pools (for /dev/random and /dev/urandom) are mostly close to zero, and “fresh” entropy flows from the primary pool when needed, decreasing its entropy count. Also there is a lot of mixing and re-injecting outputs back into the system going on. All of this is far more detail than is necessary for this document. - -See the big difference? The CSPRNG is not running alongside the random number generator, filling in for those times when /dev/urandom wants to output something, but has nothing good to output. The CSPRNG is an integral part of the random number generation process. There is no /dev/random handing out “good and pure” random numbers straight from the whitener. Every randomness source's input is thoroughly mixed and hashed inside the CSPRNG, before it emerges as random numbers, either via /dev/urandom or /dev/random. - -Another important difference is that there is no entropy counting going on here, but estimation. The amount of entropy some source is giving you isn't something obvious that you just get, along with the data. It has to be estimated. Please note that when your estimate is too optimistic, the dearly held property of /dev/random, that it's only giving out as many random numbers as available entropy allows, is gone. Unfortunately, it's hard to estimate the amount of entropy. - -The Linux kernel uses only the arrival times of events to estimate their entropy. It does that by interpolating polynomials of those arrival times, to calculate “how surprising” the actual arrival time was, according to the model. Whether this polynomial interpolation model is the best way to estimate entropy is an interesting question. There is also the problem that internal hardware restrictions might influence those arrival times. The sampling rates of all kinds of hardware components may also play a role, because it directly influences the values and the granularity of those event arrival times. - -In the end, to the best of our knowledge, the kernel's entropy estimate is pretty good. Which means it's conservative. People argue about how good it really is, but that issue is far above my head. Still, if you insist on never handing out random numbers that are not “backed” by sufficient entropy, you might be nervous here. I'm sleeping sound because I don't care about the entropy estimate. - -So to make one thing crystal clear: both /dev/random and /dev/urandom are fed by the same CSPRNG. Only the behavior when their respective pool runs out of entropy, according to some estimate, differs: /dev/random blocks, while /dev/urandom does not. - -##### From Linux 4.8 onward - -In Linux 4.8 the equivalency between /dev/urandom and /dev/random was given up. Now /dev/urandom output does not come from an entropy pool, but directly from a CSPRNG. - -![image: actual structure of the kernel's random number generator from Linux 4.8 onward][3] - -We will see shortly why that is not a security problem. - -### What's wrong with blocking? - -Have you ever waited for /dev/random to give you more random numbers? Generating a PGP key inside a virtual machine maybe? Connecting to a web server that's waiting for more random numbers to create an ephemeral session key? - -That's the problem. It inherently runs counter to availability. So your system is not working. It's not doing what you built it to do. Obviously, that's bad. You wouldn't have built it if you didn't need it. - -I'm working on safety-related systems in factory automation. Can you guess what the main reason for failures of safety systems is? Manipulation. Simple as that. Something about the safety measure bugged the worker. It took too much time, was too inconvenient, whatever. People are very resourceful when it comes to finding “inofficial solutions”. - -But the problem runs even deeper: people don't like to be stopped in their ways. They will devise workarounds, concoct bizarre machinations to just get it running. People who don't know anything about cryptography. Normal people. - -Why not patching out the call to `random()`? Why not having some guy in a web forum tell you how to use some strange ioctl to increase the entropy counter? Why not switch off SSL altogether? - -In the end you just educate your users to do foolish things that compromise your system's security without you ever knowing about it. - -It's easy to disregard availability, usability or other nice properties. Security trumps everything, right? So better be inconvenient, unavailable or unusable than feign security. - -But that's a false dichotomy. Blocking is not necessary for security. As we saw, /dev/urandom gives you the same kind of random numbers as /dev/random, straight out of a CSPRNG. Use it! - -### The CSPRNGs are alright - -But now everything sounds really bleak. If even the high-quality random numbers from /dev/random are coming out of a CSPRNG, how can we use them for high-security purposes? - -It turns out, that “looking random” is the basic requirement for a lot of our cryptographic building blocks. If you take the output of a cryptographic hash, it has to be indistinguishable from a random string so that cryptographers will accept it. If you take a block cipher, its output (without knowing the key) must also be indistinguishable from random data. - -If anyone could gain an advantage over brute force breaking of cryptographic building blocks, using some perceived weakness of those CSPRNGs over “true” randomness, then it's the same old story: you don't have anything left. Block ciphers, hashes, everything is based on the same mathematical fundament as CSPRNGs. So don't be afraid. - -### What about entropy running low? - -It doesn't matter. - -The underlying cryptographic building blocks are designed such that an attacker cannot predict the outcome, as long as there was enough randomness (a.k.a. entropy) in the beginning. A usual lower limit for “enough” may be 256 bits. No more. - -Considering that we were pretty hand-wavey about the term “entropy” in the first place, it feels right. As we saw, the kernel's random number generator cannot even precisely know the amount of entropy entering the system. Only an estimate. And whether the model that's the basis for the estimate is good enough is pretty unclear, too. - -### Re-seeding - -But if entropy is so unimportant, why is fresh entropy constantly being injected into the random number generator? - -djb [remarked][4] that more entropy actually can hurt. - -First, it cannot hurt. If you've got more randomness just lying around, by all means use it! - -There is another reason why re-seeding the random number generator every now and then is important: - -Imagine an attacker knows everything about your random number generator's internal state. That's the most severe security compromise you can imagine, the attacker has full access to the system. - -You've totally lost now, because the attacker can compute all future outputs from this point on. - -But over time, with more and more fresh entropy being mixed into it, the internal state gets more and more random again. So that such a random number generator's design is kind of self-healing. - -But this is injecting entropy into the generator's internal state, it has nothing to do with blocking its output. - -### The random and urandom man page - -The man page for /dev/random and /dev/urandom is pretty effective when it comes to instilling fear into the gullible programmer's mind: - -> A read from the /dev/urandom device will not block waiting for more entropy. As a result, if there is not sufficient entropy in the entropy pool, the returned values are theoretically vulnerable to a cryptographic attack on the algorithms used by the driver. Knowledge of how to do this is not available in the current unclassified literature, but it is theoretically possible that such an attack may exist. If this is a concern in your application, use /dev/random instead. - -Such an attack is not known in “unclassified literature”, but the NSA certainly has one in store, right? And if you're really concerned about this (you should!), please use /dev/random, and all your problems are solved. - -The truth is, while there may be such an attack available to secret services, evil hackers or the Bogeyman, it's just not rational to just take it as a given. - -And even if you need that peace of mind, let me tell you a secret: no practical attacks on AES, SHA-3 or other solid ciphers and hashes are known in the “unclassified” literature, either. Are you going to stop using those, as well? Of course not! - -Now the fun part: “use /dev/random instead”. While /dev/urandom does not block, its random number output comes from the very same CSPRNG as /dev/random's. - -If you really need information-theoretically secure random numbers (you don't!), and that's about the only reason why the entropy of the CSPRNGs input matters, you can't use /dev/random, either! - -The man page is silly, that's all. At least it tries to redeem itself with this: - -> If you are unsure about whether you should use /dev/random or /dev/urandom, then probably you want to use the latter. As a general rule, /dev/urandom should be used for everything except long-lived GPG/SSL/SSH keys. - -Fine. I think it's unnecessary, but if you want to use /dev/random for your “long-lived keys”, by all means, do so! You'll be waiting a few seconds typing stuff on your keyboard, that's no problem. - -But please don't make connections to a mail server hang forever, just because you “wanted to be safe”. - -### Orthodoxy - -The view espoused here is certainly a tiny minority's opinions on the Internet. But ask a real cryptographer, you'll be hard pressed to find someone who sympathizes much with that blocking /dev/random. - -Let's take [Daniel Bernstein][5], better known as djb: - -> Cryptographers are certainly not responsible for this superstitious nonsense. Think about this for a moment: whoever wrote the /dev/random manual page seems to simultaneously believe that -> -> * (1) we can't figure out how to deterministically expand one 256-bit /dev/random output into an endless stream of unpredictable keys (this is what we need from urandom), but -> -> * (2) we _can_ figure out how to use a single key to safely encrypt many messages (this is what we need from SSL, PGP, etc.). -> -> - -> -> For a cryptographer this doesn't even pass the laugh test. - -Or [Thomas Pornin][6], who is probably one of the most helpful persons I've ever encountered on the Stackexchange sites: - -> The short answer is yes. The long answer is also yes. /dev/urandom yields data which is indistinguishable from true randomness, given existing technology. Getting "better" randomness than what /dev/urandom provides is meaningless, unless you are using one of the few "information theoretic" cryptographic algorithm, which is not your case (you would know it). -> -> The man page for urandom is somewhat misleading, arguably downright wrong, when it suggests that /dev/urandom may "run out of entropy" and /dev/random should be preferred; - -Or maybe [Thomas Ptacek][7], who is not a real cryptographer in the sense of designing cryptographic algorithms or building cryptographic systems, but still the founder of a well-reputed security consultancy that's doing a lot of penetration testing and breaking bad cryptography: - -> Use urandom. Use urandom. Use urandom. Use urandom. Use urandom. Use urandom. - -### Not everything is perfect - -/dev/urandom isn't perfect. The problems are twofold: - -On Linux, unlike FreeBSD, /dev/urandom never blocks. Remember that the whole security rested on some starting randomness, a seed? - -Linux's /dev/urandom happily gives you not-so-random numbers before the kernel even had the chance to gather entropy. When is that? At system start, booting the computer. - -FreeBSD does the right thing: they don't have the distinction between /dev/random and /dev/urandom, both are the same device. At startup /dev/random blocks once until enough starting entropy has been gathered. Then it won't block ever again. - -In the meantime, Linux has implemented a new syscall, originally introduced by OpenBSD as getentropy(2): getrandom(2). This syscall does the right thing: blocking until it has gathered enough initial entropy, and never blocking after that point. Of course, it is a syscall, not a character device, so it isn't as easily accessible from shell or script languages. It is available from Linux 3.17 onward. - -On Linux it isn't too bad, because Linux distributions save some random numbers when booting up the system (but after they have gathered some entropy, since the startup script doesn't run immediately after switching on the machine) into a seed file that is read next time the machine is booting. So you carry over the randomness from the last running of the machine. - -Obviously that isn't as good as if you let the shutdown scripts write out the seed, because in that case there would have been much more time to gather entropy. The advantage is obviously that this does not depend on a proper shutdown with execution of the shutdown scripts (in case the computer crashes, for example). - -And it doesn't help you the very first time a machine is running, but the Linux distributions usually do the same saving into a seed file when running the installer. So that's mostly okay. - -Virtual machines are the other problem. Because people like to clone them, or rewind them to a previously saved check point, this seed file doesn't help you. - -But the solution still isn't using /dev/random everywhere, but properly seeding each and every virtual machine after cloning, restoring a checkpoint, whatever. - -### tldr; - - Just use /dev/urandom! - - --------------------------------------------------------------------------------- - -via: https://www.2uo.de/myths-about-urandom/ - -作者:[Thomas Hühn][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2uo.de/ -[1]:https://www.2uo.de/myths-about-urandom/structure-no.png -[2]:https://www.2uo.de/myths-about-urandom/structure-yes.png -[3]:https://www.2uo.de/myths-about-urandom/structure-new.png -[4]:http://blog.cr.yp.to/20140205-entropy.html -[5]:http://www.mail-archive.com/cryptography@randombit.net/msg04763.html -[6]:http://security.stackexchange.com/questions/3936/is-a-rand-from-dev-urandom-secure-for-a-login-key/3939#3939 -[7]:http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ diff --git a/sources/tech/20170410 Writing a Time Series Database from Scratch.md b/sources/tech/20170410 Writing a Time Series Database from Scratch.md deleted file mode 100644 index a7f8289b63..0000000000 --- a/sources/tech/20170410 Writing a Time Series Database from Scratch.md +++ /dev/null @@ -1,438 +0,0 @@ -Writing a Time Series Database from Scratch -============================================================ - - -I work on monitoring. In particular on [Prometheus][2], a monitoring system that includes a custom time series database, and its integration with [Kubernetes][3]. - -In many ways Kubernetes represents all the things Prometheus was designed for. It makes continuous deployments, auto scaling, and other features of highly dynamic environments easily accessible. The query language and operational model, among many other conceptual decisions make Prometheus particularly well-suited for such environments. Yet, if monitored workloads become significantly more dynamic, this also puts new strains on monitoring system itself. With this in mind, rather than doubling back on problems Prometheus already solves well, we specifically aim to increase its performance in environments with highly dynamic, or transient services. - -Prometheus's storage layer has historically shown outstanding performance, where a single server is able to ingest up to one million samples per second as several million time series, all while occupying a surprisingly small amount of disk space. While the current storage has served us well, I propose a newly designed storage subsystem that corrects for shortcomings of the existing solution and is equipped to handle the next order of scale. - -> Note: I've no background in databases. What I say might be wrong and mislead. You can channel your criticism towards me (fabxc) in #prometheus on Freenode. - -### Problems, Problems, Problem Space - -First, a quick outline of what we are trying to accomplish and what key problems it raises. For each, we take a look at Prometheus' current approach, what it does well, and which problems we aim to address with the new design. - -### Time series data - -We have a system that collects data points over time. - -``` -identifier -> (t0, v0), (t1, v1), (t2, v2), (t3, v3), .... -``` - -Each data point is a tuple of a timestamp and a value. For the purpose of monitoring, the timestamp is an integer and the value any number. A 64 bit float turns out to be a good representation for counter as well as gauge values, so we go with that. A sequence of data points with strictly monotonically increasing timestamps is a series, which is addressed by an identifier. Our identifier is a metric name with a dictionary of  _label dimensions_ . Label dimensions partition the measurement space of a single metric. Each metric name plus a unique set of labels is its own  _time series_  that has a value stream associated with it. - -This is a typical set of series identifiers that are part of metric counting requests: - -``` -requests_total{path="/status", method="GET", instance=”10.0.0.1:80”} -requests_total{path="/status", method="POST", instance=”10.0.0.3:80”} -requests_total{path="/", method="GET", instance=”10.0.0.2:80”} -``` - -Let's simplify this representation right away: A metric name can be treated as just another label dimension — `__name__` in our case. At the query level, it might be be treated specially but that doesn't concern our way of storing it, as we will see later. - -``` -{__name__="requests_total", path="/status", method="GET", instance=”10.0.0.1:80”} -{__name__="requests_total", path="/status", method="POST", instance=”10.0.0.3:80”} -{__name__="requests_total", path="/", method="GET", instance=”10.0.0.2:80”} -``` - -When querying time series data, we want to do so by selecting series by their labels. In the simplest case `{__name__="requests_total"}` selects all series belonging to the `requests_total` metric. For all selected series, we retrieve data points within a specified time window. -In more complex queries, we may wish to select series satisfying several label selectors at once and also represent more complex conditions than equality. For example, negative (`method!="GET"`) or regular expression matching (`method=~"PUT|POST"`). - -This largely defines the stored data and how it is recalled. - -### Vertical and Horizontal - -In a simplified view, all data points can be laid out on a two-dimensional plane. The  _horizontal_  dimension represents the time and the series identifier space spreads across the  _vertical_  dimension. - -``` -series - ^ - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="GET"} - │ . . . . . . . . . . . . . . . . . . . . . . {__name__="request_total", method="POST"} - │ . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . . . {__name__="errors_total", method="POST"} - │ . . . . . . . . . . . . . . . . . {__name__="errors_total", method="GET"} - │ . . . . . . . . . . . . . . - │ . . . . . . . . . . . . . . . . . . . ... - │ . . . . . . . . . . . . . . . . . . . . - v - <-------------------- time ---------------------> -``` - -Prometheus retrieves data points by periodically scraping the current values for a set of time series. The entity from which we retrieve such a batch is called a  _target_ . Thereby, the write pattern is completely vertical and highly concurrent as samples from each target are ingested independently. -To provide some measurement of scale: A single Prometheus instance collects data points from tens of thousands of  _targets_ , which expose hundreds to thousands of different time series each. - -At the scale of collecting millions of data points per second, batching writes is a non-negotiable performance requirement. Writing single data points scattered across our disk would be painfully slow. Thus, we want to write larger chunks of data in sequence. -This is an unsurprising fact for spinning disks, as their head would have to physically move to different sections all the time. While SSDs are known for fast random writes, they actually can't modify individual bytes but only write in  _pages_  of 4KiB or more. This means writing a 16 byte sample is equivalent to writing a full 4KiB page. This behavior is part of what is known as [ _write amplification_ ][4], which as a bonus causes your SSD to wear out – so it wouldn't just be slow, but literally destroy your hardware within a few days or weeks. -For more in-depth information on the problem, the blog series ["Coding for SSDs" series][5] is a an excellent resource. Let's just consider the main take away: sequential and batched writes are the ideal write pattern for spinning disks and SSDs alike. A simple rule to stick to. - -The querying pattern is significantly more differentiated than the write the pattern. We can query a single datapoint for a single series, a single datapoint for 10000 series, weeks of data points for a single series, weeks of data points for 10000 series, etc. So on our two-dimensional plane, queries are neither fully vertical or horizontal, but a rectangular combination of the two. -[Recording rules][6] mitigate the problem for known queries but are not a general solution for ad-hoc queries, which still have to perform reasonably well. - -We know that we want to write in batches, but the only batches we get are vertical sets of data points across series. When querying data points for a series over a time window, not only would it be hard to figure out where the individual points can be found, we'd also have to read from a lot of random places on disk. With possibly millions of touched samples per query, this is slow even on the fastest SSDs. Reads will also retrieve more data from our disk than the requested 16 byte sample. SSDs will load a full page, HDDs will at least read an entire sector. Either way, we are wasting precious read throughput. -So ideally, samples for the same series would be stored sequentially so we can just scan through them with as few reads as possible. On top, we only need to know where this sequence starts to access all data points. - -There's obviously a strong tension between the ideal pattern for writing collected data to disk and the layout that would be significantly more efficient for serving queries. It is  _the_  fundamental problem our TSDB has to solve. - -#### Current solution - -Time to take a look at how Prometheus's current storage, let's call it "V2", addresses this problem. -We create one file per time series that contains all of its samples in sequential order. As appending single samples to all those files every few seconds is expensive, we batch up 1KiB chunks of samples for a series in memory and append those chunks to the individual files, once they are full. This approach solves a large part of the problem. Writes are now batched, samples are stored sequentially. It also enables incredibly efficient compression formats, based on the property that a given sample changes only very little with respect to the previous sample in the same series. Facebook's paper on their Gorilla TSDB describes a similar chunk-based approach and [introduces a compression format][7] that reduces 16 byte samples to an average of 1.37 bytes. The V2 storage uses various compression formats including a variation of Gorilla’s. - -``` - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series A - └──────────┴─────────┴─────────┴─────────┴─────────┘ - ┌──────────┬─────────┬─────────┬─────────┬─────────┐ series B - └──────────┴─────────┴─────────┴─────────┴─────────┘ - . . . - ┌──────────┬─────────┬─────────┬─────────┬─────────┬─────────┐ series XYZ - └──────────┴─────────┴─────────┴─────────┴─────────┴─────────┘ - chunk 1 chunk 2 chunk 3 ... -``` - -While the chunk-based approach is great, keeping a separate file for each series is troubling the V2 storage for various reasons: - -* We actually need a lot more files than the number of time series we are currently collecting data for. More on that in the section on "Series Churn". With several million files, sooner or later way may run out of [inodes][1] on our filesystem. This is a condition we can only recover from by reformatting our disks, which is as invasive and disruptive as it could be. We generally want to avoid formatting disks specifically to fit a single application. -* Even when chunked, several thousands of chunks per second are completed and ready to be persisted. This still requires thousands of individual disk writes every second. While it is alleviated by also batching up several completed chunks for a series, this in return increases the total memory footprint of data which is waiting to be persisted. -* It's infeasible to keep all files open for reads and writes. In particular because ~99% of data is never queried again after 24 hours. If it is queried though though, we have to open up to thousands of files, find and read relevant data points into memory, and close them again. As this would result in high query latencies, data chunks are cached rather aggressively leading to problems outlined further in the section on "Resource Consumption". -* Eventually, old data has to be deleted and data needs to be removed from the front of millions of files. This means that deletions are actually write intensive operations. Additionally, cycling through millions of files and analyzing them makes this a process that often takes hours. By the time it completes, it might have to start over again. Oh yea, and deleting the old files will cause further write amplification for your SSD! -* Chunks that are currently accumulating are only held in memory. If the application crashes, data will be lost. To avoid this, the memory state is periodically checkpointed to disk, which may take significantly longer than the window of data loss we are willing to accept. Restoring the checkpoint may also take several minutes, causing painfully long restart cycles. - -The key take away from the existing design is the concept of chunks, which we most certainly want to keep. The most recent chunks always being held in memory is also generally good. After all, the most recent data is queried the most by a large margin. -Having one file per time series is a concept we would like to find an alternative to. - -### Series Churn - -In the Prometheus context, we use the term  _series churn_  to describe that a set of time series becomes inactive, i.e. receives no more data points, and a new set of active series appears instead. -For example, all series exposed by a given microservice instance have a respective “instance” label attached that identifies its origin. If we perform a rolling update of our microservice and swap out every instance with a newer version, series churn occurs. In more dynamic environments those events may happen on an hourly basis. Cluster orchestration systems like Kubernetes allow continuous auto-scaling and frequent rolling updates of applications, potentially creating tens of thousands of new application instances, and with them completely new sets of time series, every day. - -``` -series - ^ - │ . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . . - │ . . . . . . - │ . . . . . . - │ . . . . . - │ . . . . . - │ . . . . . - v - <-------------------- time ---------------------> -``` - -So even if the entire infrastructure roughly remains constant in size, over time there's a linear growth of time series in our database. While a Prometheus server will happily collect data for 10 million time series, query performance is significantly impacted if data has to be found among a billion series. - -#### Current solution - -The current V2 storage of Prometheus has an index based on LevelDB for all series that are currently stored. It allows querying series containing a given label pair, but lacks a scalable way to combine results from different label selections. -For example, selecting all series with label `__name__="requests_total"` works efficiently, but selecting all series with `instance="A" AND __name__="requests_total"` has scalability problems. We will later revisit what causes this and which tweaks are necessary to improve lookup latencies. - -This problem is in fact what spawned the initial hunt for a better storage system. Prometheus needed an improved indexing approach for quickly searching hundreds of millions of time series. - -### Resource consumption - -Resource consumption is one of the consistent topics when trying to scale Prometheus (or anything, really). But it's not actually the absolute resource hunger that is troubling users. In fact, Prometheus manages an incredible throughput given its requirements. The problem is rather its relative unpredictability and instability in face of changes. By its architecture the V2 storage slowly builds up chunks of sample data, which causes the memory consumption to ramp up over time. As chunks get completed, they are written to disk and can be evicted from memory. Eventually, Prometheus's memory usage reaches a steady state. That is until the monitored environment changes —  _series churn_  increases the usage of memory, CPU, and disk IO every time we scale an application or do a rolling update. -If the change is ongoing, it will yet again reach a steady state eventually but it will be significantly higher than in a more static environment. Transition periods are often multiple hours long and it is hard to determine what the maximum resource usage will be. - -The approach of having a single file per time series also makes it way too easy for a single query to knock out the Prometheus process. When querying data that is not cached in memory, the files for queried series are opened and the chunks containing relevant data points are read into memory. If the amount of data exceeds the memory available, Prometheus quits rather ungracefully by getting OOM-killed. -After the query is completed the loaded data can be released again but it is generally cached much longer to serve subsequent queries on the same data faster. The latter is a good thing obviously. - -Lastly, we looked at write amplification in the context of SSDs and how Prometheus addresses it by batching up writes to mitigate it. Nonetheless, in several places it still causes write amplification by having too small batches and not aligning data precisely on page boundaries. For larger Prometheus servers, a reduced hardware lifetime was observed in the real world. Chances are that this is still rather normal for database applications with high write throughput, but we should keep an eye on whether we can mitigate it. - -### Starting Over - -By now we have a good idea of our problem domain, how the V2 storage solves it, and where its design has issues. We also saw some great concepts that we want to adapt more or less seamlessly. A fair amount of V2's problems can be addressed with improvements and partial redesigns, but to keep things fun (and after carefully evaluating my options, of course), I decided to take a stab at writing an entire time series database — from scratch, i.e. writing bytes to the file system. - -The critical concerns of performance and resource usage are a direct consequence of the chosen storage format. We have to find the right set of algorithms and disk layout for our data to implement a well-performing storage layer. - -This is where I take the shortcut and drive straight to the solution — skip the headache, failed ideas, endless sketching, tears, and despair. - -### V3 — Macro Design - -What's the macro layout of our storage? In short, everything that is revealed when running `tree` on our data directory. Just looking at that gives us a surprisingly good picture of what is going on. - -``` -$ tree ./data -./data -├── b-000001 -│ ├── chunks -│ │ ├── 000001 -│ │ ├── 000002 -│ │ └── 000003 -│ ├── index -│ └── meta.json -├── b-000004 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -├── b-000005 -│ ├── chunks -│ │ └── 000001 -│ ├── index -│ └── meta.json -└── b-000006 - ├── meta.json - └── wal - ├── 000001 - ├── 000002 - └── 000003 -``` - -At the top level, we have a sequence of numbered blocks, prefixed with `b-`. Each block obviously holds a file containing an index and a "chunk" directory holding more numbered files. The “chunks” directory contains nothing but raw chunks of data points for various series. Just as for V2, this makes reading series data over a time windows very cheap and allows us to apply the same efficient compression algorithms. The concept has proven to work well and we stick with it. Obviously, there is no longer a single file per series but instead a handful of files holds chunks for many of them. -The existence of an “index” file should not be surprising. Let's just assume it contains a lot of black magic allowing us to find labels, their possible values, entire time series and the chunks holding their data points. - -But why are there several directories containing the layout of index and chunk files? And why does the last one contain a "wal" directory instead? Understanding those two questions, solves about 90% of our problems. - -#### Many Little Databases - -We partition our  _horizontal_  dimension, i.e. the time space, into non-overlapping blocks. Each block acts as a fully independent database containing all time series data for its time window. Hence, it has its own index and set of chunk files. - -``` - -t0 t1 t2 t3 now - ┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ │ │ │ │ │ │ │ ┌────────────┐ - │ │ │ │ │ │ │ mutable │ <─── write ──── ┤ Prometheus │ - │ │ │ │ │ │ │ │ └────────────┘ - └───────────┘ └───────────┘ └───────────┘ └───────────┘ ^ - └──────────────┴───────┬──────┴──────────────┘ │ - │ query - │ │ - merge ─────────────────────────────────────────────────┘ -``` - -Every block of data is immutable. Of course, we must be able to add new series and samples to the most recent block as we collect new data. For this block, all new data is written to an in-memory database that provides the same lookup properties as our persistent blocks. The in-memory data structures can be updated efficiently. To prevent data loss, all incoming data is also written to a temporary  _write ahead log_ , which is the set of files in our “wal” directory, from which we can re-populate the in-memory database on restart. -All these files come with their own serialization format, which comes with all the things one would expect: lots of flags, offsets, varints, and CRC32 checksums. Good fun to come up with, rather boring to read about. - -This layout allows us to fan out queries to all blocks relevant to the queried time range. The partial results from each block are merged back together to form the overall result. - -This horizontal partitioning adds a few great capabilities: - -* When querying a time range, we can easily ignore all data blocks outside of this range. It trivially addresses the problem of  _series churn_  by reducing the set of inspected data to begin with. -* When completing a block, we can persist the data from our in-memory database by sequentially writing just a handful of larger files. We avoid any write-amplification and serve SSDs and HDDs equally well. -* We keep the good property of V2 that recent chunks, which are queried most, are always hot in memory. -* Nicely enough, we are also no longer bound to the fixed 1KiB chunk size to better align data on disk. We can pick any size that makes the most sense for the individual data points and chosen compression format. -* Deleting old data becomes extremely cheap and instantaneous. We merely have to delete a single directory. Remember, in the old storage we had to analyze and re-write up to hundreds of millions of files, which could take hours to converge. - -Each block also contains a `meta.json` file. It simply holds human-readable information about the block to easily understand the state of our storage and the data it contains. - -##### mmap - -Moving from millions of small files to a handful of larger allows us to keep all files open with little overhead. This unblocks the usage of [`mmap(2)`][8], a system call that allows us to transparently back a virtual memory region by file contents. For simplicity, you might want to think of it like swap space, just that all our data is on disk already and no writes occur when swapping data out of memory. - -This means we can treat all contents of our database as if they were in memory without occupying any physical RAM. Only if we access certain byte ranges in our database files, the operating system lazily loads pages from disk. This puts the operating system in charge of all memory management related to our persisted data. Generally, it is more qualified to make such decisions, as it has the full view on the entire machine and all its processes. Queried data can be rather aggressively cached in memory, yet under memory pressure the pages will be evicted. If the machine has unused memory, Prometheus will now happily cache the entire database, yet will immediately return it once another application needs it. -Therefore, queries can longer easily OOM our process by querying more persisted data than fits into RAM. The memory cache size becomes fully adaptive and data is only loaded once the query actually needs it. - -From my understanding, this is how a lot of databases work today and an ideal way to do it if the disk format allows — unless one is confident to outsmart the OS from within the process. We certainly get a lot of capabilities with little work from our side. - -#### Compaction - -The storage has to periodically "cut" a new block and write the previous one, which is now completed, onto disk. Only after the block was successfully persisted, the write ahead log files, which are used to restore in-memory blocks, are deleted. -We are interested in keeping each block reasonably short (about two hours for a typical setup) to avoid accumulating too much data in memory. When querying multiple blocks, we have to merge their results into an overall result. This merge procedure obviously comes with a cost and a week-long query should not have to merge 80+ partial results. - -To achieve both, we introduce  _compaction_ . Compaction describes the process of taking one or more blocks of data and writing them into a, potentially larger, block. It can also modify existing data along the way, e.g. dropping deleted data, or restructuring our sample chunks for improved query performance. - -``` - -t0 t1 t2 t3 t4 now - ┌────────────┐ ┌──────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 mutable │ before - └────────────┘ └──────────┘ └───────────┘ └───────────┘ └───────────┘ - ┌─────────────────────────────────────────┐ ┌───────────┐ ┌───────────┐ - │ 1 compacted │ │ 4 │ │ 5 mutable │ after (option A) - └─────────────────────────────────────────┘ └───────────┘ └───────────┘ - ┌──────────────────────────┐ ┌──────────────────────────┐ ┌───────────┐ - │ 1 compacted │ │ 3 compacted │ │ 5 mutable │ after (option B) - └──────────────────────────┘ └──────────────────────────┘ └───────────┘ -``` - -In this example we have the sequential blocks `[1, 2, 3, 4]`. Blocks 1, 2, and 3 can be compacted together and the new layout is `[1, 4]`. Alternatively, compact them in pairs of two into `[1, 3]`. All time series data still exist but now in fewer blocks overall. This significantly reduces the merging cost at query time as fewer partial query results have to be merged. - -#### Retention - -We saw that deleting old data was a slow process in the V2 storage and put a toll on CPU, memory, and disk alike. How can we drop old data in our block based design? Quite simply, by just deleting the directory of a block that has no data within our configured retention window. In the example below, block 1 can safely be deleted, whereas 2 has to stick around until it falls fully behind the boundary. - -``` - | - ┌────────────┐ ┌────┼─────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐ - │ 1 │ │ 2 | │ │ 3 │ │ 4 │ │ 5 │ . . . - └────────────┘ └────┼─────┘ └───────────┘ └───────────┘ └───────────┘ - | - | - retention boundary -``` - -The older data gets, the larger the blocks may become as we keep compacting previously compacted blocks. An upper limit has to be applied so blocks don’t grow to span the entire database and thus diminish the original benefits of our design. -Conveniently, this also limits the total disk overhead of blocks that are partially inside and partially outside of the retention window, i.e. block 2 in the example above. When setting the maximum block size at 10% of the total retention window, our total overhead of keeping block 2 around is also bound by 10%. - -Summed up, retention deletion goes from very expensive, to practically free. - -> _If you've come this far and have some background in databases, you might be asking one thing by now: Is any of this new? — Not really; and probably for the better._ -> -> _The pattern of batching data up in memory, tracked in a write ahead log, and periodically flushed to disk is ubiquitous today._ -> _The benefits we have seen apply almost universally regardless of the data's domain specifics. Prominent open source examples following this approach are LevelDB, Cassandra, InfluxDB, or HBase. The key takeaway is to avoid reinventing an inferior wheel, researching proven methods, and applying them with the right twist._ -> _Running out of places to add your own magic dust later is an unlikely scenario._ - -### The Index - -The initial motivation to investigate storage improvements were the problems brought by  _series churn_ . The block-based layout reduces the total number of series that have to be considered for serving a query. So assuming our index lookup was of complexity  _O(n^2)_ , we managed to reduce the  _n_  a fair amount and now have an improved complexity of  _O(n^2)_  — uhm, wait... damnit. -A quick flashback to "Algorithms 101" reminds us that this, in theory, did not buy us anything. If things were bad before, they are just as bad now. Theory can be depressing. - -In practice, most of our queries will already be answered significantly faster. Yet, queries spanning the full time range remain slow even if they just need to find a handful of series. My original idea, dating back way before all this work was started, was a solution to exactly this problem: we need a more capable [ _inverted index_ ][9]. -An inverted index provides a fast lookup of data items based on a subset of their contents. Simply put, I can look up all series that have a label `app=”nginx"` without having to walk through every single series and check whether it contains that label. - -For that, each series is assigned a unique ID by which it can be retrieved in constant time, i.e. O(1). In this case the ID is our  _forward index_ . - -> Example: If the series with IDs 10, 29, and 9 contain the label `app="nginx"`, the inverted index for the label "nginx" is the simple list `[10, 29, 9]`, which can be used to quickly retrieve all series containing the label. Even if there were 20 billion further series, it would not affect the speed of this lookup. - -In short, if  _n_  is our total number of series, and  _m_  is the result size for a given query, the complexity of our query using the index is now  _O(m)_ . Queries scaling along the amount of data they retrieve ( _m_ ) instead of the data body being searched ( _n_ ) is a great property as  _m_  is generally significantly smaller. -For brevity, let’s assume we can retrieve the inverted index list itself in constant time. - -Actually, this is almost exactly the kind of inverted index V2 has and a minimum requirement to serve performant queries across millions of series. The keen observer will have noticed, that in the worst case, a label exists in all series and thus  _m_  is, again, in  _O(n)_ . This is expected and perfectly fine. If you query all data, it naturally takes longer. Things become problematic once we get involved with more complex queries. - -#### Combining Labels - -Labels associated with millions of series are common. Suppose a horizontally scaling “foo” microservice with hundreds of instances with thousands of series each. Every single series will have the label `app="foo"`. Of course, one generally won't query all series but restrict the query by further labels, e.g. I want to know how many requests my service instances received and query `__name__="requests_total" AND app="foo"`. - -To find all series satisfying both label selectors, we take the inverted index list for each and intersect them. The resulting set will typically be orders of magnitude smaller than each input list individually. As each input list has the worst case size O(n), the brute force solution of nested iteration over both lists, has a runtime of O(n^2). The same cost applies for other set operations, such as the union (`app="foo" OR app="bar"`). When adding further label selectors to the query, the exponent increases for each to O(n^3), O(n^4), O(n^5), ... O(n^k). A lot of tricks can be played to minimize the effective runtime by changing the execution order. The more sophisticated, the more knowledge about the shape of the data and the relationships between labels is needed. This introduces a lot of complexity, yet does not decrease our algorithmic worst case runtime. - -This is essentially the approach in the V2 storage and luckily a seemingly slight modification is enough gain significant improvements. What happens if we assume that the IDs in our inverted indices are sorted? - -Suppose this example of lists for our initial query: - -``` -__name__="requests_total" -> [ 9999, 1000, 1001, 2000000, 2000001, 2000002, 2000003 ] - app="foo" -> [ 1, 3, 10, 11, 12, 100, 311, 320, 1000, 1001, 10002 ] - - intersection => [ 1000, 1001 ] -``` - -The intersection is fairly small. We can find it by setting a cursor at the beginning of each list and always advancing the one at the smaller number. When both numbers are equal, we add the number to our result and advance both cursors. Overall, we scan both lists in this zig-zag pattern and thus have a total cost of  _O(2n) = O(n)_  as we only ever move forward in either list. - -The procedure for more than two lists of different set operations works similarly. So the number of  _k_  set operations merely modifies the factor ( _O(k*n)_ ) instead of the exponent ( _O(n^k)_ ) of our worst-case lookup runtime. A great improvement. -What I described here is a simplified version of the canonical search index used by practically any [full text search engine][10] out there. Every series descriptor is treated as a short "document", and every label (name + fixed value) as a "word" inside of it. We can ignore a lot of additional data typically encountered in search engine indices, such as word position and frequency data. -Seemingly endless research exists on approaches improving the practical runtime, often making some assumptions about the input data. Unsurprisingly, there are also plenty of techniques to compress inverted indices that come with their own benefits and drawbacks. As our "documents" are tiny and the “words” are hugely repetitive across all series, compression becomes almost irrelevant. For example, a real-world dataset of ~4.4 million series with about 12 labels each has less than 5,000 unique labels. For our initial storage version, we stick to the basic approach without compression, and just a few simple tweaks added to skip over large ranges of non-intersecting IDs. - -While keeping the IDs sorted may sound simple, it is not always a trivial invariant to keep up. For instance, the V2 storage assigns hashes as IDs to new series and we cannot efficiently build up sorted inverted indices. -Another daunting task is modifying the indices on disk as data gets deleted or updated. Typically, the easiest approach is to simply recompute and rewrite them but doing so while keeping the database queryable and consistent. The V3 storage does exactly this by having a separate immutable index per block that is only modified via rewrite on compaction. Only the indices for the mutable blocks, which are held entirely in memory, need to be updated. - -### Benchmarking - -I started initial development of the storage with a benchmark based on ~4.4 million series descriptors extracted from a real world data set and generated synthetic data points to feed into those series. This iteration just tested the stand-alone storage and was crucial to quickly identify performance bottlenecks and trigger deadlocks only experienced under highly concurrent load. - -After the conceptual implementation was done, the benchmark could sustain a write throughput of 20 million data points per second on my Macbook Pro — all while a dozen Chrome tabs and Slack were running. So while this sounded all great it also indicated that there's no further point in pushing this benchmark (or running it in a less random environment for that matter). After all, it is synthetic and thus not worth much beyond a good first impression. Starting out about 20x above the initial design target, it was time to embed this into an actual Prometheus server, adding all the practical overhead and flakes only experienced in more realistic environments. - -We actually had no reproducible benchmarking setup for Prometheus, in particular none that allowed A/B testing of different versions. Concerning in hindsight, but [now we have one][11]! - -Our tool allows us to declaratively define a benchmarking scenario, which is then deployed to a Kubernetes cluster on AWS. While this is not the best environment for all-out benchmarking, it certainly reflects our user base better than dedicated bare metal servers with 64 cores and 128GB of memory. -We deploy two Prometheus 1.5.2 servers (V2 storage) and two Prometheus servers from the 2.0 development branch (V3 storage). Each Prometheus server runs on a dedicated machine with an SSD. A horizontally scaled application exposing typical microservice metrics is deployed to worker nodes. Additionally, the Kubernetes cluster itself and the nodes are being monitored. The whole setup is supervised by yet another Meta-Prometheus, monitoring each Prometheus server for health and performance. -To simulate series churn, the microservice is periodically scaled up and down to remove old pods and spawn new pods, exposing new series. Query load is simulated by a selection of "typical" queries, run against one server of each Prometheus version. - -Overall the scaling and querying load as well as the sampling frequency significantly exceed today's production deployments of Prometheus. For instance, we swap out 60% of our microservice instances every 15 minutes to produce series churn. This would likely only happen 1-5 times a day in a modern infrastructure. This ensures that our V3 design is capable of handling the workloads of the years ahead. As a result, the performance differences between Prometheus 1.5.2 and 2.0 are larger than in a more moderate environment. -In total, we are collecting about 110,000 samples per second from 850 targets exposing half a million series at a time. - -After leaving this setup running for a while, we can take a look at the numbers. We evaluate several metrics over the first 12 hours within both versiones reached a steady state. - -> Be aware of the slightly truncated Y axis in screen shots from the Prometheus graph UI. - - ![Heap usage GB](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/heap_usage.png) -> _Heap memory usage in GB_ - -Memory usage is the most troubling resource for users today as it is relatively unpredictable and it may cause the process to crash. -Obviously, the queried servers are consuming more memory, which can largely be attributed to overhead of the query engine, which will be subject to future optimizations. Overall, Prometheus 2.0's memory consumption is reduced by 3-4x. After about six hours, there is a clear spike in Prometheus 1.5, which aligns with the our retention boundary at six hours. As deletions are quite costly, resource consumption ramps up. This will become visible throughout various other graphs below. - - ![CPU usage cores](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/cpu_usage.png) -> _CPU usage in cores/second_ - -A similar pattern shows for CPU usage, but the delta between queried and non-queried servers is more significant. Averaging at about 0.5 cores/sec while ingesting about 110,000 samples/second, our new storage becomes almost negligible compared to the cycles spent on query evaluation. In total the new storage needs 3-10 times fewer CPU resources. - - ![Disk writes](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_writes.png) ->_Disk writes in MB/second_ - -The by far most dramatic and unexpected improvement shows in write utilization of our disk. It clearly shows why Prometheus 1.5 is prone to wear out SSDs. We see an initial ramp-up as soon as the first chunks are persisted into the series files and a second ramp-up once deletion starts rewriting them. Surprisingly, the queried and non-queried server show a very different utilization. -Prometheus 2.0 on the other hand, merely writes about a single Megabyte per second to its write ahead log. Writes periodically spike when blocks are compacted to disk. Overall savings: staggering 97-99%. - - ![Disk usage](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/disk_usage.png) -> _Disk size in GB_ - -Closely related to disk writes is the total amount of occupied disk space. As we are using almost the same compression algorithm for samples, which is the bulk of our data, they should be about the same. In a more stable setup that would largely be true, but as we are dealing with high  _series churn_ , there's also the per-series overhead to consider. -As we can see, Prometheus 1.5 ramps up storage space a lot faster before both versions reach a steady state as the retention kicks in. Prometheus 2.0 seems to have a significantly lower overhead per individual series. We can nicely see how space is linearly filled up by the write ahead log and instantaneously drops as its gets compacted. The fact that the lines for both Prometheus 2.0 servers do not exactly match is a fact that needs further investigation. - -This all looks quite promising. The important piece left is query latency. The new index should have improved our lookup complexity. What has not substantially changed is processing of this data, e.g. in `rate()` functions or aggregations. Those aspects are part of the query engine. - - ![Query latency](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/query_latency.png) ->_99th percentile query latency in seconds_ - -Expectations are completely met by the data. In Prometheus 1.5 the query latency increases over time as more series are stored. It only levels off once retention starts and old series are deleted. In contrast, Prometheus 2.0 stays in place right from the beginning. -Some caution must be taken on how this data was collected. The queries fired against the servers were chosen by estimating a good mix of range and instant queries, doing heavier and more lightweight computations, and touching few or many series. It does not necessarily represent a real-world distribution of queries. It is also not representative for queries hitting cold data and we can assume that all sample data is practically always hot in memory in either storage. -Nonetheless, we can say with good confidence, that the overall query performance became very resilient to series churn and improved by up to 4x in our straining benchmarking scenario. In a more static environment, we can assume query time to be mostly spent in the query engine itself and the improvement to be notably lower. - - ![Ingestion rate](https://fabxc.org/blog/2017-04-10-writing-a-tsdb/assets/ingestion_rate.png) ->_Ingested samples/second_ - -Lastly, a quick look into our ingestion rates of the different Prometheus servers. We can see that both servers with the V3 storage have the same ingestion rate. After a few hours it becomes unstable, which is caused by various nodes of the benchmarking cluster becoming unresponsive due to high load rather than the Prometheus instances. (The fact that both 2.0 lines exactly match is hopefully convincing enough.) -Both Prometheus 1.5.2 servers start suffering from significant drops in ingestion rate even though more CPU and memory resources are available. The high stress of series churn causes a larger amount of data to not be collected. - -But what's the  _absolute maximum_  number of samples per second you could ingest now? - -I don't know — and deliberately don't care. - -There are a lot of factors that shape the data flowing into Prometheus and there is no single number capable of capturing quality. Maximum ingestion rate has historically been a metric leading to skewed benchmarks and neglect of more important aspects such as query performance and resilience to series churn. The rough assumption that resource usage increases linearly was confirmed by some basic testing. It is easy to extrapolate what could be possible. - -Our benchmarking setup simulates a highly dynamic environment stressing Prometheus more than most real-world setups today. The results show we went way above our initial design goal, while running on non-optimal cloud servers. Ultimately, success will be determined by user feedback rather than benchmarking numbers. - -> Note:  _At time of writing this, Prometheus 1.6 is in development, which will allow configuring the maximum memory usage more reliably and may notably reduce overall consumption in favor of slightly increased CPU utilization. I did not repeat the tests against this as the overall results still hold, especially when facing high series churn._ - -### Conclusion - -Prometheus sets out to handle high cardinality of series and throughput of individual samples. It remains a challenging task, but the new storage seems to position us well for the hyper-scale, hyper-convergent, GIFEE infrastructure of the futu... well, it seems to work pretty well. - -A [first alpha release of Prometheus 2.0][12] with the new V3 storage is available for testing. Expect crashes, deadlocks, and other bugs at this early stage. - -The code for the storage itself can be found [in a separate project][13]. It's surprisingly agnostic to Prometheus itself and could be widely useful for a wider range of applications looking for an efficient local storage time series database. - -> _There's a long list of people to thank for their contributions to this work. Here they go in no particular order:_ -> -> _The groundlaying work by Bjoern Rabenstein and Julius Volz on the V2 storage engine and their feedback on V3 was fundamental to everything seen in this new generation._ -> -> _Wilhelm Bierbaum's ongoing advice and insight contributed significantly to the new design. Brian Brazil's continous feedback ensured that we ended up with a semantically sound approach. Insightful discussions with Peter Bourgon validated the design and shaped this write-up._ -> -> _Not to forget my entire team at CoreOS and the company itself for supporting and sponsoring this work. Thanks to everyone who listened to my ramblings about SSDs, floats, and serialization formats again and again._ - - --------------------------------------------------------------------------------- - -via: https://fabxc.org/blog/2017-04-10-writing-a-tsdb/ - -作者:[Fabian Reinartz ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://twitter.com/fabxc -[1]:https://en.wikipedia.org/wiki/Inode -[2]:https://prometheus.io/ -[3]:https://kubernetes.io/ -[4]:https://en.wikipedia.org/wiki/Write_amplification -[5]:http://codecapsule.com/2014/02/12/coding-for-ssds-part-1-introduction-and-table-of-contents/ -[6]:https://prometheus.io/docs/practices/rules/ -[7]:http://www.vldb.org/pvldb/vol8/p1816-teller.pdf -[8]:https://en.wikipedia.org/wiki/Mmap -[9]:https://en.wikipedia.org/wiki/Inverted_index -[10]:https://en.wikipedia.org/wiki/Search_engine_indexing#Inverted_indices -[11]:https://github.com/prometheus/prombench -[12]:https://prometheus.io/blog/2017/04/10/promehteus-20-sneak-peak/ -[13]:https://github.com/prometheus/tsdb diff --git a/sources/tech/20170414 5 projects for Raspberry Pi at home.md b/sources/tech/20170414 5 projects for Raspberry Pi at home.md deleted file mode 100644 index 37c9fde3db..0000000000 --- a/sources/tech/20170414 5 projects for Raspberry Pi at home.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 projects for Raspberry Pi at home) -[#]: via: (https://opensource.com/article/17/4/5-projects-raspberry-pi-home) -[#]: author: (Ben Nuttall (Community Moderator) ) - -5 projects for Raspberry Pi at home -====== - -![5 projects for Raspberry Pi at home][1] - -The [Raspberry Pi][2] computer can be used in all kinds of settings and for a variety of purposes. It obviously has a place in education for helping students with learning programming and maker skills in the classroom and the hackspace, and it has plenty of industrial applications in the workplace and in factories. I'm going to introduce five projects you might want to build in your own home. - -### Media center - -One of the most common uses for Raspberry Pi in people's homes is behind the TV running media center software serving multimedia files. It's easy to set this up, and the Raspberry Pi provides plenty of GPU (Graphics Processing Unit) power to render HD TV shows and movies to your big screen TV. [Kodi][3] (formerly XBMC) on a Raspberry Pi is a great way to playback any media you have on a hard drive or network-attached storage. You can also install a plugin to play YouTube videos. - -There are a few different options available, most prominently [OSMC][4] (Open Source Media Center) and [LibreELEC][5], both based on Kodi. They both perform well at playing media content, but OSMC has a more visually appearing user interface, while LibreElec is much more lightweight. All you have to do is choose a distribution, download the image and install on an SD card (or just use [NOOBS][6]), boot it up, and you're ready to go. - -![LibreElec ][7] - -LibreElec; Raspberry Pi Foundation, CC BY-SA - -![OSMC][8] - -OSMC.tv, Copyright, Used with permission - -Before proceeding you'll need to decide [w][9][hich Raspberry Pi model to use][9]. These distributions will work on any Pi (1, 2, 3, or Zero), and video playback will essentially be matched on each of these. Apart from the Pi 3 (and Zero W) having built-in Wi-Fi, the only noticeable difference is the reaction speed of the user interface, which will be much faster on a Pi 3. A Pi 2 will not be much slower, so that's fine if you don't need Wi-Fi, but the Pi 3 will noticeably outperform the Pi 1 and Zero when it comes to flicking through the menus. - -### SSH gateway - -If you want to be able to access computers and devices on your home network from outside over the internet, you have to open up ports on those devices to allow outside traffic. Opening ports to the internet is a security risk, meaning you're always at risk of attack, misuse, or any kind of unauthorized access. However, if you install a Raspberry Pi on your network and set up port forwarding to allow only SSH access to that Pi, you can use that as a secure gateway to hop onto other Pis and PCs on the network. - -Most routers allow you to configure port-forwarding rules. You'll need to give your Pi a fixed internal IP address and set up port 22 on your router to map to port 22 on your Raspberry Pi. If your ISP provides you with a static IP address, you'll be able to SSH into it with this as the host address (for example, **ssh pi@123.45.56.78** ). If you have a domain name, you can configure a subdomain to point to this IP address, so you don't have to remember it (for example, **ssh[pi@home.mydomain.com][10]** ). - -![][11] - -However, if you're going to expose a Raspberry Pi to the internet, you should be very careful not to put your network at risk. There are a few simple procedures you can follow to make it sufficiently secure: - -1\. Most people suggest you change your login password (which makes sense, seeing as the default password “raspberry” is well known), but this does not protect against brute-force attacks. You could change your password and add a two-factor authentication (so you need your password _and_ a time-dependent passcode generated by your phone), which is more secure. However, I believe the best way to secure your Raspberry Pi from intruders is to [disable][12] [“password authentication”][12] in your SSH configuration, so you allow only SSH key access. This means that anyone trying to SSH in by guessing your password will never succeed. Only with your private SSH key can anyone gain access. Similarly, most people suggest changing the SSH port from the default 22 to something unexpected, but a simple [Nmap][13] of your IP address will reveal your true SSH port. - -2\. Ideally, you would not run much in the way of other software on this Pi, so you don't end up accidentally exposing anything else. If you want to run other software, you might be better running it on another Pi on the network that is not exposed to the internet. Ensure that you keep your packages up to date by upgrading regularly, particularly the **openssh-server** package, so that any security vulnerabilities are patched. - -3\. Install [sshblack][14] or [fail2ban][15] to blacklist any users who seem to be acting maliciously, such as attempting to brute force your SSH password. - -Once you've secured your Raspberry Pi and put it online, you'll be able to log in to your network from anywhere in the world. Once you're on your Raspberry Pi, you can SSH into other devices on the network using their local IP address (for example, 192.168.1.31). If you have passwords on these devices, just use the password. If they're also SSH-key-only, you'll need to ensure your key is forwarded over SSH by using the **-A** flag: **ssh -A pi@123.45.67.89**. - -### CCTV / pet camera - -Another great home project is to set up a camera module to take photos or stream video, capture and save files, or streamed internally or to the internet. There are many reasons you might want to do this, but two common use cases are for a homemade security camera or to monitor a pet. - -The [Raspberry Pi camera module][16] is a brilliant accessory. It provides full HD photo and video, lots of advanced configuration, and is [easy to][17] [program][17]. The [infrared camera][18] is ideal for this kind of use, and with an infrared LED (which the Pi can control) you can see in the dark! - -If you want to take still images on a regular basis to keep an eye on things, you can just write a short [Python][19] script or use the command line tool [raspistill][20], and schedule it to recur in [Cron][21]. You might want to have it save them to [Dropbox][22] or another web service, upload them to a web server, or you can even create a [web app][23] to display them. - -If you want to stream video, internally or externally, that's really easy, too. A simple MJPEG (Motion JPEG) example is provided in the [picamera documentation][24] (under “web streaming”). Just download or copy that code into a file, run it and visit the Pi's IP address at port 8000, and you'll see your camera's output live. - -A more advanced streaming project, [pistreaming][25], is available, which uses [JSMpeg][26] (a JavaScript video player) with the web server and a websocket for the camera stream running separately. This method is more performant and is just as easy to get running as the previous example, but there is more code involved and if set up to stream on the internet, requires you to open two ports. - -Once you have web streaming set up, you can position the camera where you want it. I have one set up to keep an eye on my pet tortoise: - -![Tortoise ][27] - -Ben Nuttall, CC BY-SA - -If you want to be able to control where the camera actually points, you can do so using servos. A neat solution is to use Pimoroni's [Pan-Tilt HAT][28], which allows you to move the camera easily in two dimensions. To integrate this with pistreaming, see the project's [pantilthat branch][29]. - -![Pan-tilt][30] - -Pimoroni.com, Copyright, Used with permission - -If you want to position your Pi outside, you'll need a waterproof enclosure and some way of getting power to the Pi. PoE (Power-over-Ethernet) cables can be a good way of achieving this. - -### Home automation and IoT - -It's 2017 and there are internet-connected devices everywhere, especially in the home. Our lightbulbs have Wi-Fi, our toasters are smarter than they used to be, and our tea kettles are at risk of attack from Russia. As long as you keep your devices secure, or don't connect them to the internet if they don't need to be, then you can make great use of IoT devices to automate tasks around the home. - -There are plenty of services you can buy or subscribe to, like Nest Thermostat or Philips Hue lightbulbs, which allow you to control your heating or your lighting from your phone, respectively—whether you're inside or away from home. You can use a Raspberry Pi to boost the power of these kinds of devices by automating interactions with them according to a set of rules involving timing or even sensors. One thing you can't do with Philips Hue is have the lights come on when you enter the room, but with a Raspberry Pi and a motion sensor, you can use a Python API to turn on the lights. Similarly, you can configure your Nest to turn on the heating when you're at home, but what if you only want it to turn on if there's at least two people home? Write some Python code to check which phones are on the network and if there are at least two, tell the Nest to turn on the heat. - -You can do a great deal more without integrating with existing IoT devices and with only using simple components. A homemade burglar alarm, an automated chicken coop door opener, a night light, a music box, a timed heat lamp, an automated backup server, a print server, or whatever you can imagine. - -### Tor proxy and blocking ads - -Adafruit's [Onion Pi][31] is a [Tor][32] proxy that makes your web traffic anonymous, allowing you to use the internet free of snoopers and any kind of surveillance. Follow Adafruit's tutorial on setting up Onion Pi and you're on your way to a peaceful anonymous browsing experience. - -![Onion-Pi][33] - -Onion-pi from Adafruit, Copyright, Used with permission - -![Pi-hole][34]You can install a Raspberry Pi on your network that intercepts all web traffic and filters out any advertising. Simply download the [Pi-hole][35] software onto the Pi, and all devices on your network will be ad-free (it even blocks in-app ads on your mobile devices). - -There are plenty more uses for the Raspberry Pi at home. What do you use Raspberry Pi for at home? What do you want to use it for? - -Let us know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/4/5-projects-raspberry-pi-home - -作者:[Ben Nuttall (Community Moderator)][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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberry_pi_home_automation.png?itok=2TnmJpD8 (5 projects for Raspberry Pi at home) -[2]: https://www.raspberrypi.org/ -[3]: https://kodi.tv/ -[4]: https://osmc.tv/ -[5]: https://libreelec.tv/ -[6]: https://www.raspberrypi.org/downloads/noobs/ -[7]: https://opensource.com/sites/default/files/libreelec_0.png (LibreElec ) -[8]: https://opensource.com/sites/default/files/osmc.png (OSMC) -[9]: https://opensource.com/life/16/10/which-raspberry-pi-should-you-choose-your-project -[10]: mailto:pi@home.mydomain.com -[11]: https://opensource.com/sites/default/files/resize/screenshot_from_2017-04-07_15-13-01-700x380.png -[12]: http://stackoverflow.com/questions/20898384/ssh-disable-password-authentication -[13]: https://nmap.org/ -[14]: http://www.pettingers.org/code/sshblack.html -[15]: https://www.fail2ban.org/wiki/index.php/Main_Page -[16]: https://www.raspberrypi.org/products/camera-module-v2/ -[17]: https://opensource.com/life/15/6/raspberry-pi-camera-projects -[18]: https://www.raspberrypi.org/products/pi-noir-camera-v2/ -[19]: http://picamera.readthedocs.io/ -[20]: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md -[21]: https://www.raspberrypi.org/documentation/linux/usage/cron.md -[22]: https://github.com/RZRZR/plant-cam -[23]: https://github.com/bennuttall/bett-bot -[24]: http://picamera.readthedocs.io/en/release-1.13/recipes2.html#web-streaming -[25]: https://github.com/waveform80/pistreaming -[26]: http://jsmpeg.com/ -[27]: https://opensource.com/sites/default/files/tortoise.jpg (Tortoise) -[28]: https://shop.pimoroni.com/products/pan-tilt-hat -[29]: https://github.com/waveform80/pistreaming/tree/pantilthat -[30]: https://opensource.com/sites/default/files/pan-tilt.gif (Pan-tilt) -[31]: https://learn.adafruit.com/onion-pi/overview -[32]: https://www.torproject.org/ -[33]: https://opensource.com/sites/default/files/onion-pi.jpg (Onion-Pi) -[34]: https://opensource.com/sites/default/files/resize/pi-hole-250x250.png (Pi-hole) -[35]: https://pi-hole.net/ diff --git a/sources/tech/20171006 Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components.md b/sources/tech/20171006 Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components.md index 0ff40cdd6e..190bf5775e 100644 --- a/sources/tech/20171006 Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components.md +++ b/sources/tech/20171006 Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components.md @@ -1,3 +1,5 @@ +bestony is translating. + Create a Clean-Code App with Kotlin Coroutines and Android Architecture Components ============================================================ diff --git a/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md b/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md index 3c61f6dd8f..20c14074c6 100644 --- a/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md +++ b/sources/tech/20171010 In Device We Trust Measure Twice Compute Once with Xen Linux TPM 2.0 and TXT.md @@ -1,6 +1,3 @@ -ezio is translating - - In Device We Trust: Measure Twice, Compute Once with Xen, Linux, TPM 2.0 and TXT ============================================================ diff --git a/sources/tech/20171116 Unleash Your Creativity – Linux Programs for Drawing and Image Editing.md b/sources/tech/20171116 Unleash Your Creativity – Linux Programs for Drawing and Image Editing.md index c6c50d9b25..0b5576e3a6 100644 --- a/sources/tech/20171116 Unleash Your Creativity – Linux Programs for Drawing and Image Editing.md +++ b/sources/tech/20171116 Unleash Your Creativity – Linux Programs for Drawing and Image Editing.md @@ -1,3 +1,4 @@ +IEAST is translating ### Unleash Your Creativity – Linux Programs for Drawing and Image Editing By: [chabowski][1] @@ -74,11 +75,11 @@ And indeed, the sky’s the limit on how creative a user wants to be when using ( - _**2** votes, average: **5.00** out of 5_ + _**2** votes, average: **5.00** out of 5_ ) - _You need to be a registered member to rate this post._ + _You need to be a registered member to rate this post._ Tags: [drawing][19], [Getting Started with Linux][20], [GIMP][21], [image editing][22], [Images][23], [InkScape][24], [KDE][25], [Krita][26], [Leap 42.3][27], [LibreOffice][28], [Linux Magazine][29], [Okular][30], [openSUSE][31], [PDF][32] Categories: [Desktop][33], [Expert Views][34], [LibreOffice][35], [openSUSE][36] diff --git a/sources/tech/20171117 5 open source fonts ideal for programmers.md b/sources/tech/20171117 5 open source fonts ideal for programmers.md deleted file mode 100644 index 2212a0bc85..0000000000 --- a/sources/tech/20171117 5 open source fonts ideal for programmers.md +++ /dev/null @@ -1,133 +0,0 @@ -5 open source fonts ideal for programmers -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn) - -What is the best programming font? First, you need to consider that not all fonts are created equally. When choosing a font for casual reading, the reader expects the letters to smoothly flow into one another, giving an easy and enjoyable experience. A single character for a standard font is akin to puzzle piece designed to carefully mesh with every other part of the overall typeface. - -When writing code, however, your font requirements are typically more functional in nature. This is why most programmers prefer to use monospaced fonts with fixed-width letters, when given the option. Selecting a font that has distinguishable numbers and punctuation, is aesthetically pleasing, and has a copyright license that meets your needs is also important. - -There are certain features that make a font optimal for programming. First, a detailed definition of what makes a monospaced font is in order. Consider the letter "w" as it compares to the letter "i" for a moment. When you are dealing with a font, it is important to think about the whitespace around the letter, as well as the letter itself. In the world of physical books and newspapers, where efficient use of space is often critical, it makes sense to assign less width to the thin "i" than the wide "w." - -There are certain features that make a font optimal for programming. - -Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts. - -Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts. - -In this article we will explore five excellent open source font options that are ideal for programming and writing code. - -### 1. Firacode: The best overall programming font - -### [firacode.png][1] - -![FiraCode example][2] - - -FiraCode, Andrew Lekashman - -### [firacode2.png][3] - -![FiraCode compared to Fira Mono][4] - - -FiraCode compared to Fira Mono, [Nikita Prokopov][5] via GitHub - -### 2. Inconsolata: Elegant and created by a brilliant designer - -### [inconsolata.png][6] - -![Inconsolata example][7] - - -Inconsolata, Andrew Lekashman - -The first font on our list is [FiraCode][5] , a programming font that truly goes above and beyond the call of duty. FiraCode is an extension of Fira, the open source font family commissioned by Mozilla. What makes FiraCode different is that it modifies the common symbol combinations or ligatures used in code to be extraordinarily readable. This font family comes in several styles, notably including a Retina option. You can find examples for how it applies to many programming languages on its [GitHub][5] page. - -[Inconsolata][8] is one of the most beautiful monospaced fonts. It has been around since 2006 as an open source and freely available option. The creator, Raph Levien designed Inconsolata with one basic statement in mind: "monospaced fonts do not have to suck." Two things that stand out about Inconsolata are its extremely clear differences between 0 and O and its well-defined punctuation. - -### 3. DejaVu Sans Mono: Standard issue with many Linux distros and huge glyph coverage - -### [dejavu_sans_mono.png][9] - -![DejaVu Sans Mono example][10] - - -DejaVu Sans Mono, Andrew Lekashman - -Inspired by the copyrighted and closed Vera font family used in GNOME, [DejaVu Sans Mono][11] is an extremely popular programming font that comes bundled with nearly every modern Linux distribution. DejaVu comes packed with a whopping 3,310 glyphs under the Book Variant, compared to a standard font, which normally rests easy at around 100 glyphs. You'll have no shortage of characters to work with, it has enormous coverage over Unicode, and it is actively growing all of the time. - -### 4. Source Code Pro: Elegant and readable, created by a small, talented team at Adobe - -### [source_code_pro.png][12] - -![Source Code Pro example][13] - - -Source Code Pro, Andrew Lekashman - -Designed by Paul Hunt and Teo Tuominen, [Source Code Pro][14] was [produced by Adobe][15] to be one of its first open source fonts. Source Code Pro is notable in that it is extremely readable and has excellent differentiation between potentially confusing characters and punctuation. Source Code Pro is also a font family and comes in seven different styles: Extralight, Light, Regular, Medium, Semibold, Bold, and Black, with italic variants of each. - -### [source_code_pro2.png][16] - -![Differentiating potentially confusable characters][17] - - -Differentiating potentially confusable characters, [Paul D. Hunt][15] via Adobe Typekit Blog. - -### [source_code_pro3.png][18] - -![Metacharacters with special meaning in computer languages][19] - - -Metacharacters with special meaning in computer languages, [Paul D. Hunt][15] via Adobe Typekit Blog - -### 5. Noto Mono: Enormous language coverage, created by a large team at Google - -### [noto.png][20] - -![Noto Mono example][21] - - -Noto Mono, Andrew Lekashman - -The last font on our list is [Noto Mono][22], the monospaced version of the expansive Noto font family by Google. While not specifically designed for programming, Noto Mono is available in 209 languages (including emoji!) and is actively supported and updated. The project is enormous and is an extension of Google's stated mission to organize the world's information. If you want to learn more about it, check out this excellent [video about the font][23]. - -### Choosing the right font - -Whichever typeface you select, you will most likely spend hours each day immersed within it, so make sure it resonates with you on an aesthetic and philosophical level. Choosing the right open source font is an important part of making sure that you have the best possible environment for productivity. Any of these fonts is a fantastic choice, and each option has a powerful feature set that lets it stand out from the rest. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/11/how-select-open-source-programming-font - -作者:[Andrew Lekashman][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 -[1]:/https://opensource.comfile/377151 -[2]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example) -[3]:https://opensource.com/file/377156 -[4]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono) -[5]:https://github.com/tonsky/FiraCode -[6]:https://opensource.com/file/377161 -[7]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example) -[8]:http://www.levien.com/type/myfonts/inconsolata.html -[9]:https://opensource.com/file/377146 -[10]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example) -[11]:https://dejavu-fonts.github.io/ -[12]:https://opensource.com/file/377171 -[13]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example) -[14]:https://github.com/adobe-fonts/source-code-pro -[15]:https://blog.typekit.com/2012/09/24/source-code-pro/ -[16]:https://opensource.com/file/377176 -[17]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters) -[18]:https://opensource.com/file/377181 -[19]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages) -[20]:https://opensource.com/file/377166 -[21]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example) -[22]:https://www.google.com/get/noto/#mono-mono -[23]:https://www.youtube.com/watch?v=AAzvk9HSi84 diff --git a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md b/sources/tech/20171214 Build a game framework with Python using the module Pygame.md deleted file mode 100644 index 704c74e042..0000000000 --- a/sources/tech/20171214 Build a game framework with Python using the module Pygame.md +++ /dev/null @@ -1,283 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a game framework with Python using the module Pygame) -[#]: via: (https://opensource.com/article/17/12/game-framework-python) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Build a game framework with Python using the module Pygame -====== -The first part of this series explored Python by creating a simple dice game. Now it's time to make your own game from scratch. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python2-header.png?itok=tEvOVo4A) - -In my [first article in this series][1], I explained how to use Python to create a simple, text-based dice game. This time, I'll demonstrate how to use the Python module Pygame to create a graphical game. It will take several articles to get a game that actually does anything, but by the end of the series, you will have a better understanding of how to find and learn new Python modules and how to build an application from the ground up. - -Before you start, you must install [Pygame][2]. - -### Installing new Python modules - -There are several ways to install Python modules, but the two most common are: - - * From your distribution's software repository - * Using the Python package manager, pip - - - -Both methods work well, and each has its own set of advantages. If you're developing on Linux or BSD, leveraging your distribution's software repository ensures automated and timely updates. - -However, using Python's built-in package manager gives you control over when modules are updated. Also, it is not OS-specific, meaning you can use it even when you're not on your usual development machine. Another advantage of pip is that it allows local installs of modules, which is helpful if you don't have administrative rights to a computer you're using. - -### Using pip - -If you have both Python and Python3 installed on your system, the command you want to use is probably `pip3`, which differentiates it from Python 2.x's `pip` command. If you're unsure, try `pip3` first. - -The `pip` command works a lot like most Linux package managers. You can search for Python modules with `search`, then install them with `install`. If you don't have permission to install software on the computer you're using, you can use the `--user` option to just install the module into your home directory. - -``` -$ pip3 search pygame -[...] -Pygame (1.9.3)                 - Python Game Development -sge-pygame (1.5)               - A 2-D game engine for Python -pygame_camera (0.1.1)          - A Camera lib for PyGame -pygame_cffi (0.2.1)            - A cffi-based SDL wrapper that copies the pygame API. -[...] -$ pip3 install Pygame --user -``` - -Pygame is a Python module, which means that it's just a set of libraries that can be used in your Python programs. In other words, it's not a program that you launch, like [IDLE][3] or [Ninja-IDE][4] are. - -### Getting started with Pygame - -A video game needs a setting; a world in which it takes place. In Python, there are two different ways to create your setting: - - * Set a background color - * Set a background image - - - -Your background is only an image or a color. Your video game characters can't interact with things in the background, so don't put anything too important back there. It's just set dressing. - -### Setting up your Pygame script - -To start a new Pygame project, create a folder on your computer. All your game files go into this directory. It's vitally important that you keep all the files needed to run your game inside of your project folder. - -![](https://opensource.com/sites/default/files/u128651/project.jpg) - -A Python script starts with the file type, your name, and the license you want to use. Use an open source license so your friends can improve your game and share their changes with you: - -``` -#!/usr/bin/env python3 -# by Seth Kenlon - -## GPLv3 -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program.  If not, see . -``` - -Then you tell Python what modules you want to use. Some of the modules are common Python libraries, and of course, you want to include the one you just installed, Pygame. - -``` -import pygame  # load pygame keywords -import sys     # let  python use your file system -import os      # help python identify your OS -``` - -Since you'll be working a lot with this script file, it helps to make sections within the file so you know where to put stuff. You do this with block comments, which are comments that are visible only when looking at your source code. Create three blocks in your code. - -``` -''' -Objects -''' - -# put Python classes and functions here - -''' -Setup -''' - -# put run-once code here - -''' -Main Loop -''' - -# put game loop here -``` - -Next, set the window size for your game. Keep in mind that not everyone has a big computer screen, so it's best to use a screen size that fits on most people's computers. - -There is a way to toggle full-screen mode, the way many modern video games do, but since you're just starting out, keep it simple and just set one size. - -``` -''' -Setup -''' -worldx = 960 -worldy = 720 -``` - -The Pygame engine requires some basic setup before you can use it in a script. You must set the frame rate, start its internal clock, and start (`init`) Pygame. - -``` -fps   = 40  # frame rate -ani   = 4   # animation cycles -clock = pygame.time.Clock() -pygame.init() -``` - -Now you can set your background. - -### Setting the background - -Before you continue, open a graphics application and create a background for your game world. Save it as `stage.png` inside a folder called `images` in your project directory. - -There are several free graphics applications you can use. - - * [Krita][5] is a professional-level paint materials emulator that can be used to create beautiful images. If you're very interested in creating art for video games, you can even purchase a series of online [game art tutorials][6]. - * [Pinta][7] is a basic, easy to learn paint application. - * [Inkscape][8] is a vector graphics application. Use it to draw with shapes, lines, splines, and Bézier curves. - - - -Your graphic doesn't have to be complex, and you can always go back and change it later. Once you have it, add this code in the setup section of your file: - -``` -world    = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png').convert()) -backdropbox = world.get_rect() -``` - -If you're just going to fill the background of your game world with a color, all you need is: - -``` -world = pygame.display.set_mode([worldx,worldy]) -``` - -You also must define a color to use. In your setup section, create some color definitions using values for red, green, and blue (RGB). - -``` -''' -Setup -''' - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -``` - -At this point, you could theoretically start your game. The problem is, it would only last for a millisecond. - -To prove this, save your file as `your-name_game.py` (replace `your-name` with your actual name). Then launch your game. - -If you are using IDLE, run your game by selecting `Run Module` from the Run menu. - -If you are using Ninja, click the `Run file` button in the left button bar. - -![](https://opensource.com/sites/default/files/u128651/ninja_run_0.png) - -You can also run a Python script straight from a Unix terminal or a Windows command prompt. - -``` -$ python3 ./your-name_game.py -``` - -If you're using Windows, use this command: - -``` -py.exe your-name_game.py -``` - -However you launch it, don't expect much, because your game only lasts a few milliseconds right now. You can fix that in the next section. - -### Looping - -Unless told otherwise, a Python script runs once and only once. Computers are very fast these days, so your Python script runs in less than a second. - -To force your game to stay open and active long enough for someone to see it (let alone play it), use a `while` loop. To make your game remain open, you can set a variable to some value, then tell a `while` loop to keep looping for as long as the variable remains unchanged. - -This is often called a "main loop," and you can use the term `main` as your variable. Add this anywhere in your setup section: - -``` -main = True -``` - -During the main loop, use Pygame keywords to detect if keys on the keyboard have been pressed or released. Add this to your main loop section: - -``` -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Also in your main loop, refresh your world's background. - -If you are using an image for the background: - -``` -world.blit(backdrop, backdropbox) -``` - -If you are using a color for the background: - -``` -world.fill(BLUE) -``` - -Finally, tell Pygame to refresh everything on the screen and advance the game's internal clock. - -``` -    pygame.display.flip() -    clock.tick(fps) -``` - -Save your file, and run it again to see the most boring game ever created. - -To quit the game, press `q` on your keyboard. - -In the [next article][9] of this series, I'll show you how to add to your currently empty game world, so go ahead and start creating some graphics to use! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-framework-python - -作者:[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/article/17/10/python-101 -[2]: http://www.pygame.org/wiki/about -[3]: https://en.wikipedia.org/wiki/IDLE -[4]: http://ninja-ide.org/ -[5]: http://krita.org -[6]: https://gumroad.com/l/krita-game-art-tutorial-1 -[7]: https://pinta-project.com/pintaproject/pinta/releases -[8]: http://inkscape.org -[9]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player diff --git a/sources/tech/20171215 How to add a player to your Python game.md b/sources/tech/20171215 How to add a player to your Python game.md deleted file mode 100644 index caa1e4754e..0000000000 --- a/sources/tech/20171215 How to add a player to your Python game.md +++ /dev/null @@ -1,162 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to add a player to your Python game) -[#]: via: (https://opensource.com/article/17/12/game-python-add-a-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to add a player to your Python game -====== -Part three of a series on building a game from scratch with Python. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python3-game.png?itok=jG9UdwC3) - -In the [first article of this series][1], I explained how to use Python to create a simple, text-based dice game. In the second part, I showed you how to build a game from scratch, starting with [creating the game's environment][2]. But every game needs a player, and every player needs a playable character, so that's what we'll do next in the third part of the series. - -In Pygame, the icon or avatar that a player controls is called a sprite. If you don't have any graphics to use for a player sprite yet, create something for yourself using [Krita][3] or [Inkscape][4]. If you lack confidence in your artistic skills, you can also search [OpenClipArt.org][5] or [OpenGameArt.org][6] for something pre-generated. Then, if you didn't already do so in the previous article, create a directory called `images` alongside your Python project directory. Put the images you want to use in your game into the `images` folder. - -To make your game truly exciting, you ought to use an animated sprite for your hero. It means you have to draw more assets, but it makes a big difference. The most common animation is a walk cycle, a series of drawings that make it look like your sprite is walking. The quick and dirty version of a walk cycle requires four drawings. - -![](https://opensource.com/sites/default/files/u128651/walk-cycle-poses.jpg) - -Note: The code samples in this article allow for both a static player sprite and an animated one. - -Name your player sprite `hero.png`. If you're creating an animated sprite, append a digit after the name, starting with `hero1.png`. - -### Create a Python class - -In Python, when you create an object that you want to appear on screen, you create a class. - -Near the top of your Python script, add the code to create a player. In the code sample below, the first three lines are already in the Python script that you're working on: - -``` -import pygame -import sys -import os # new code below - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -    img = pygame.image.load(os.path.join('images','hero.png')).convert() -    self.images.append(img) -    self.image = self.images[0] -    self.rect  = self.image.get_rect() -``` - -If you have a walk cycle for your playable character, save each drawing as an individual file called `hero1.png` to `hero4.png` in the `images` folder. - -Use a loop to tell Python to cycle through each file. - -``` -''' -Objects -''' - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.images = [] -        for i in range(1,5): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() -``` - -### Bring the player into the game world - -Now that a Player class exists, you must use it to spawn a player sprite in your game world. If you never call on the Player class, it never runs, and there will be no player. You can test this out by running your game now. The game will run just as well as it did at the end of the previous article, with the exact same results: an empty game world. - -To bring a player sprite into your world, you must call the Player class to generate a sprite and then add it to a Pygame sprite group. In this code sample, the first three lines are existing code, so add the lines afterwards: - -``` -world       = pygame.display.set_mode([worldx,worldy]) -backdrop    = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = screen.get_rect() - -# new code below - -player = Player()   # spawn player -player.rect.x = 0   # go to x -player.rect.y = 0   # go to y -player_list = pygame.sprite.Group() -player_list.add(player) -``` - -Try launching your game to see what happens. Warning: it won't do what you expect. When you launch your project, the player sprite doesn't spawn. Actually, it spawns, but only for a millisecond. How do you fix something that only happens for a millisecond? You might recall from the previous article that you need to add something to the main loop. To make the player spawn for longer than a millisecond, tell Python to draw it once per loop. - -Change the bottom clause of your loop to look like this: - -``` -    world.blit(backdrop, backdropbox) -    player_list.draw(screen) # draw player -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game now. Your player spawns! - -### Setting the alpha channel - -Depending on how you created your player sprite, it may have a colored block around it. What you are seeing is the space that ought to be occupied by an alpha channel. It's meant to be the "color" of invisibility, but Python doesn't know to make it invisible yet. What you are seeing, then, is the space within the bounding box (or "hit box," in modern gaming terms) around the sprite. - -![](https://opensource.com/sites/default/files/u128651/greenscreen.jpg) - -You can tell Python what color to make invisible by setting an alpha channel and using RGB values. If you don't know the RGB values your drawing uses as alpha, open your drawing in Krita or Inkscape and fill the empty space around your drawing with a unique color, like #00ff00 (more or less a "greenscreen green"). Take note of the color's hex value (#00ff00, for greenscreen green) and use that in your Python script as the alpha channel. - -Using alpha requires the addition of two lines in your Sprite creation code. Some version of the first line is already in your code. Add the other two lines: - -``` -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha()     # optimise alpha -            img.set_colorkey(ALPHA) # set alpha -``` - -Python doesn't know what to use as alpha unless you tell it. In the setup area of your code, add some more color definitions. Add this variable definition anywhere in your setup section: - -``` -ALPHA = (0, 255, 0) -``` - -In this example code, **0,255,0** is used, which is the same value in RGB as #00ff00 is in hex. You can get all of these color values from a good graphics application like [GIMP][7], Krita, or Inkscape. Alternately, you can also detect color values with a good system-wide color chooser, like [KColorChooser][8]. - -![](https://opensource.com/sites/default/files/u128651/kcolor.png) - -If your graphics application is rendering your sprite's background as some other value, adjust the values of your alpha variable as needed. No matter what you set your alpha value, it will be made "invisible." RGB values are very strict, so if you need to use 000 for alpha, but you need 000 for the black lines of your drawing, just change the lines of your drawing to 111, which is close enough to black that nobody but a computer can tell the difference. - -Launch your game to see the results. - -![](https://opensource.com/sites/default/files/u128651/alpha.jpg) - -In the [fourth part of this series][9], I'll show you how to make your sprite move. How exciting! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-add-a-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: http://krita.org -[4]: http://inkscape.org -[5]: http://openclipart.org -[6]: https://opengameart.org/ -[7]: http://gimp.org -[8]: https://github.com/KDE/kcolorchooser -[9]: https://opensource.com/article/17/12/program-game-python-part-4-moving-your-sprite diff --git a/sources/tech/20171226 The shell scripting trap.md b/sources/tech/20171226 The shell scripting trap.md deleted file mode 100644 index f91620ce98..0000000000 --- a/sources/tech/20171226 The shell scripting trap.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The shell scripting trap) -[#]: via: (https://arp242.net/weblog/shell-scripting-trap.html) -[#]: author: (Martin Tournoij https://arp242.net/) - -The shell scripting trap -====== - - -Shell scripting is great. It is amazingly simple to create something very useful. Even a simple no-brainer command such as: - -``` -# Official way of naming Go-related things: -$ grep -i ^go /usr/share/dict/american-english /usr/share/dict/british /usr/share/dict/british-english /usr/share/dict/catala /usr/share/dict/catalan /usr/share/dict/cracklib-small /usr/share/dict/finnish /usr/share/dict/french /usr/share/dict/german /usr/share/dict/italian /usr/share/dict/ngerman /usr/share/dict/ogerman /usr/share/dict/spanish /usr/share/dict/usa /usr/share/dict/words | cut -d: -f2 | sort -R | head -n1 -goldfish -``` - -Takes several lines of code and a lot more brainpower in many programming languages. For example in Ruby: - -``` -puts(Dir['/usr/share/dict/*-english'].map do |f| - File.open(f) - .readlines - .select { |l| l[0..1].downcase == 'go' } -end.flatten.sample.chomp) -``` - -The Ruby version isn’t that long, or even especially complicated. But the shell script version was so simple that I didn’t even need to actually test it to make sure it is correct, whereas I did have to test the Ruby version to ensure I didn’t make a mistake. It’s also twice as long and looks a lot more dense. - -This is why people use shell scripts, it’s so easy to make something useful. Here’s is another example: - -``` -curl https://nl.wikipedia.org/wiki/Lijst_van_Nederlandse_gemeenten | - grep '^
  • (.+).*
  • |\1|' | - grep -Ev '(^Tabel van|^Lijst van|Nederland)' -``` - -This gets a list of all Dutch municipalities. I actually wrote this as a quick one-shot script to populate a database years ago, but it still works fine today, and it took me a minimum of effort to make it. Doing this in e.g. Ruby would take a lot more effort. - -But there’s a downside, as your script grows it will become increasingly harder to maintain, but you also don’t really want to rewrite it to something else, as you’ve already spent so much time on the shell script version. - -This is what I call ‘the shell script trap’, which is a special case of the [sunk cost fallacy][1]. - -And many scripts do grow beyond their original intended size, and often you will spend a lot more time than you should on “fixing that one bug”, or “adding just one small feature”. Rinse, repeat. - -If you had written it in Python or Ruby or another similar language from the start, you would have spent some more time writing the original version, but would have spent much less time maintaining it, while almost certainly having fewer bugs. - -Take my [packman.vim][2] script for example. It started out as a simple `for` loop over all directories and a `git pull` and has grown from there. At about 200 lines it’s hardly the most complex script, but had I written it in Go as I originally planned then it would have been much easier to add support for printing out the status or cloning new repos from a config file. It would also be almost trivial to add support for parallel clones, which is hard (though not impossible) to do correct in a shell script. In hindsight, I would have saved time, and gotten a better result to boot. - -I regret writing most shell scripts I’ve written for similar reasons, and my 2018 new year’s pledge will be to not write any more. - -#### Appendix: the problems - -And to be clear, shell scripting does come with some real limitation. Some examples: - - * Dealing with filenames that contain spaces or other ‘special’ characters requires careful attention to detail. The vast majority of scripts get this wrong, even when written by experienced authors who care about such things (e.g. me), because it’s so easy to do it wrong. [Adding quotes is not enough][3]. - - * There are many “right” and “wrong” ways to do things. Should you use `which` or `command`? Should you use `$@` or `$*`, and should that be quoted? Should you use `cmd $arg` or `cmd "$arg"`? etc. etc. - - * You cannot store any NULL bytes (0x00) in variables; it is very hard to make shell scripts deal with binary data. - - * While you can make something very useful very quickly, implementing more complex algorithms can be very painful – if not nigh-impossible – even when using the ksh/zsh/bash extensions. My ad-hoc HTML parsing in the example above was okay for a quick one-off script, but you really don’t want to do things like that in a production-script. - - * It can be hard to write shell scripts that work well on all platforms. `/bin/sh` could be `dash` or `bash`, and will behave different. External tools such as `grep`, `sed`, etc. may or may not support certain flags. Are you sure that your script works on all versions (past, present, and future) of Linux, macOS, and Windows equally well? - - * Debugging shell scripts can be hard, especially as the syntax can get fairly obscure quite fast, and not everyone is equally well versed in shell scripting. - - * Error handling can be tricky (check `$?` or `set -e`), and doing something more advanced beyond “an error occurred” is practically impossible. - - * Undefined variables are not an error unless you use `set -u`, leading to “fun stuff” like `rm -r ~/$undefined` deleting user’s home dir ([not a theoretical problem][4]). - - * Everything is a string. Some shells add arrays, which works but the syntax is obscure and ugly. Numeric computations with fractions remain tricky and rely on external tools such as `bc` or `dc` (`$(( .. ))` expansion only works for integers). - - - - -**Feedback** - -You can mail me at [martin@arp242.net][5] or [create a GitHub issue][6] for feedback, questions, etc. - --------------------------------------------------------------------------------- - -via: https://arp242.net/weblog/shell-scripting-trap.html - -作者:[Martin Tournoij][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://arp242.net/ -[b]: https://github.com/lujun9972 -[1]: https://youarenotsosmart.com/2011/03/25/the-sunk-cost-fallacy/ -[2]: https://github.com/Carpetsmoker/packman.vim -[3]: https://dwheeler.com/essays/filenames-in-shell.html -[4]: https://github.com/ValveSoftware/steam-for-linux/issues/3671 -[5]: mailto:martin@arp242.net -[6]: https://github.com/Carpetsmoker/arp242.net/issues/new diff --git a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md index 15043628e0..4ab7fea3f6 100644 --- a/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md +++ b/sources/tech/20180116 How To Create A Bootable Zorin OS USB Drive.md @@ -1,4 +1,3 @@ -RHSNOW is translating. How To Create A Bootable Zorin OS USB Drive ====== ![Zorin OS][17] diff --git a/sources/tech/20180118 Rediscovering make- the power behind rules.md b/sources/tech/20180118 Rediscovering make- the power behind rules.md deleted file mode 100644 index 143b852da0..0000000000 --- a/sources/tech/20180118 Rediscovering make- the power behind rules.md +++ /dev/null @@ -1,101 +0,0 @@ -tomjlw is translating -Rediscovering make: the power behind rules -====== - -![](https://user-images.githubusercontent.com/4419992/35015638-0529f1c0-faf4-11e7-9801-4995fc4b54f0.jpg) - -I used to think makefiles were just a convenient way to list groups of shell commands; over time I've learned how powerful, flexible, and full-featured they are. This post brings to light over some of those features related to rules. - -### Rules - -Rules are instructions that indicate `make` how and when a file called the target should be built. The target can depend on other files called prerequisites. - -You instruct `make` how to build the target in the recipe, which is no more than a set of shell commands to be executed, one at a time, in the order they appear. The syntax looks like this: -``` -target_name : prerequisites - recipe -``` - -Once you have defined a rule, you can build the target from the command line by executing: -``` -$ make target_name -``` - -Once the target is built, `make` is smart enough to not run the recipe ever again unless at least one of the prerequisites has changed. - -### More on prerequisites - -Prerequisites indicate two things: - - * When the target should be built: if a prerequisite is newer than the target, `make` assumes that the target should be built. - * An order of execution: since prerequisites can, in turn, be built by another rule on the makefile, they also implicitly set an order on which rules are executed. - - - -If you want to define an order, but you don't want to rebuild the target if the prerequisite changes, you can use a special kind of prerequisite called order only, which can be placed after the normal prerequisites, separated by a pipe (`|`) - -### Patterns - -For convenience, `make` accepts patterns for targets and prerequisites. A pattern is defined by including the `%` character, a wildcard that matches any number of literal characters or an empty string. Here are some examples: - - * `%`: match any file - * `%.md`: match all files with the `.md` extension - * `prefix%.go`: match all files that start with `prefix` that have the `.go` extension - - - -### Special targets - -There's a set of target names that have special meaning for `make` called special targets. - -You can find the full list of special targets in the [documentation][1]. As a rule of thumb, special targets start with a dot followed by uppercase letters. - -Here are a few useful ones: - -**.PHONY** : Indicates `make` that the prerequisites of this target are considered to be phony targets, which means that `make` will always run it's recipe regardless of whether a file with that name exists or what its last-modification time is. - -**.DEFAULT** : Used for any target for which no rules are found. - -**.IGNORE** : If you specify prerequisites for `.IGNORE`, `make` will ignore errors in execution of their recipes. - -### Substitutions - -Substitutions are useful when you need to modify the value of a variable with alterations that you specify. - -A substitution has the form `$(var:a=b)` and its meaning is to take the value of the variable `var`, replace every `a` at the end of a word with `b` in that value, and substitute the resulting string. For example: -``` -foo := a.o -bar : = $(foo:.o=.c) # sets bar to a.c -``` - -note: special thanks to [Luis Lavena][2] for letting me know about the existence of substitutions. - -### Archive Files - -Archive files are used to collect multiple data files together into a single file (same concept as a zip file), they are built with the `ar` Unix utility. `ar` can be used to create archives for any purpose, but has been largely replaced by `tar` for any other purposes than [static libraries][3]. - -In `make`, you can use an individual member of an archive file as a target or prerequisite as follows: -``` -archive(member) : prerequisite - recipe -``` - -### Final Thoughts - -There's a lot more to discover about make, but at least this counts as a start, I strongly encourage you to check the [documentation][4], create a dumb makefile, and just play with it. - --------------------------------------------------------------------------------- - -via: https://monades.roperzh.com/rediscovering-make-power-behind-rules/ - -作者:[Roberto Dip][a] -译者:[tomjlw](https://github.com/tomjlw) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://monades.roperzh.com -[1]:https://www.gnu.org/software/make/manual/make.html#Special-Targets -[2]:https://twitter.com/luislavena/ -[3]:http://tldp.org/HOWTO/Program-Library-HOWTO/static-libraries.html -[4]:https://www.gnu.org/software/make/manual/make.html diff --git a/sources/tech/20180119 Two great uses for the cp command Bash shortcuts.md b/sources/tech/20180119 Two great uses for the cp command Bash shortcuts.md index b3a5200278..6974ded497 100644 --- a/sources/tech/20180119 Two great uses for the cp command Bash shortcuts.md +++ b/sources/tech/20180119 Two great uses for the cp command Bash shortcuts.md @@ -1,3 +1,5 @@ +translating by zyk2290 + Two great uses for the cp command: Bash shortcuts ============================================================ diff --git a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md b/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md deleted file mode 100644 index 4553570166..0000000000 --- a/sources/tech/20180130 An introduction to the DomTerm terminal emulator for Linux.md +++ /dev/null @@ -1,126 +0,0 @@ -An introduction to the DomTerm terminal emulator for Linux -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) - -[DomTerm][1] is a modern terminal emulator that uses a browser engine as a "GUI toolkit." This enables some neat features, such as embeddable graphics and links, HTML rich text, and foldable (show/hide) commands. Otherwise it looks and feels like a feature-full, standalone terminal emulator, with excellent xterm compatibility (including mouse handling and 24-bit color), and appropriate "chrome" (menus). In addition, there is built-in support for session management and sub-windows (as in `tmux` and `GNU screen`), basic input editing (as in `readline`), and paging (as in `less`). - -![](https://opensource.com/sites/default/files/u128651/domterm1.png) -Image 1: The DomTerminal terminal emulator. View larger image. - -Below we'll look more at these features. We'll assume you have `domterm` installed (skip to the end of this article if you need to get and build DomTerm). First, though, here's a quick overview of the technology. - -### Frontend vs. backend - -Most of DomTerm is written in JavaScript and runs in a browser engine. This can be a desktop web browser, such as Chrome or Firefox (see image 3), or it can be an embedded browser. Using a general web browser works fine, but the user experience isn't as nice (as the menus are designed for general browsing, not for a terminal emulator), and the security model gets in the way, so using an embedded browser is nicer. - -The following are currently supported: - - * `qtdomterm`, which uses the Qt toolkit and `QtWebEngine` - * An `[Electron][2]` embedding (see image 1) - * `atom-domterm` runs DomTerm as a package in the [Atom text editor][3] (which is also based on Electron) and integrates with the Atom pane system (see image 2) - * A wrapper for JavaFX's `WebEngine`, which is useful for code written in Java (see image 4) - * Previously, the preferred frontend used [Firefox-XUL][4], but Mozilla has since dropped XUL - - - -![DomTerm terminal panes in Atom editor][6] - -Image 2: DomTerm terminal panes in Atom editor. [View larger image.][7] - -Currently, the Electron frontend is probably the nicest option, closely followed by the Qt frontend. If you use Atom, `atom-domterm` works pretty well. - -The backend server is written in C. It manages pseudo terminals (PTYs) and sessions. It is also an HTTP server that provides the JavaScript and other files to the frontend. The `domterm` command starts terminal jobs and performs other requests. If there is no server running, `domterm` daemonizes itself. Communication between the backend and the server is normally done using WebSockets (with [libwebsockets][8] on the server). However, the JavaFX embedding uses neither WebSockets nor the DomTerm server; instead Java applications communicate directly using the Java-JavaScript bridge. - -### A solid xterm-compatible terminal emulator - -DomTerm looks and feels like a modern terminal emulator. It handles mouse events, 24-bit color, Unicode, double-width (CJK) characters, and input methods. DomTerm does a very good job on the [vttest testsuite][9]. - -Unusual features include: - -**Show/hide buttons ("folding"):** The little triangles (seen in image 2 above) are buttons that hide/show the corresponding output. To create the buttons, just add certain [escape sequences][10] in the [prompt text][11]. - -**Mouse-click support for`readline` and similar input editors:** If you click in the (yellow) input area, DomTerm will send the right sequence of arrow-key keystrokes to the application. (This is enabled by escape sequences in the prompt; you can also force it using Alt+Click.) - -**Style the terminal using CSS:** This is usually done in `~/.domterm/settings.ini`, which is automatically reloaded when saved. For example, in image 2, terminal-specific background colors were set. - -### A better REPL console - -A classic terminal emulator works on rectangular grids of character cells. This works for a REPL (command shell), but it is not ideal. Here are some DomTerm features useful for REPLs that are not typically found in terminal emulators: - -**A command can "print" an image, a graph, a mathematical formula, or a set of clickable links:** An application can send an escape sequence containing almost any HTML. (The HTML is scrubbed to remove JavaScript and other dangerous features.) - -The image 3 shows a fragment from a [`gnuplot`][12] session. Gnuplot (2.1 or later) supports `domterm` as a terminal type. Graphical output is converted to an [SVG image][13], which is then printed to the terminal. My blog post [Gnuplot display on DomTerm][14] provides more information on this. - -![](https://opensource.com/sites/default/files/dt-gnuplot.png) -Image 3: Gnuplot screenshot. View larger image. - -The [Kawa][15] language has a library for creating and transforming [geometric picture values][16]. If you print such a picture value to a DomTerm terminal, the picture is converted to SVG and embedded in the output. - -![](https://opensource.com/sites/default/files/dt-kawa1.png) -Image 4: Computable geometry in Kawa. View larger image. - -**Rich text in output:** Help messages are more readable and look nicer with HTML styling. The lower pane of image 1 shows the ouput from `domterm help`. (The output is plaintext if not running under DomTerm.) Note the `PAUSED` message from the built-in pager. - -**Error messages can include clickable links:** DomTerm recognizes the syntax `filename:line:column:` and turns it into a link that opens the file and line in a configurable text editor. (This works for relative filenames if you use `PROMPT_COMMAND` or similar to track directories.) - -A compiler can detect that it is running under DomTerm and directly emit file links in an escape sequence. This is more robust than depending on DomTerm's pattern matching, as it handles spaces and other special characters, and it does not depend on directory tracking. In image 4, you can see error messages from the [Kawa compiler][15]. Hovering over the file position causes it to be underlined, and the `file:` URL shows in the `atom-domterm` message area (bottom of the window). (When not using `atom-domterm`, such messages are shown in an overlay box, as seen for the `PAUSED` message in image 1.) - -The action when clicking on a link is configurable. The default action for a `file:` link with a `#position` suffix is to open the file in a text editor. - -**Structured internal representation:** The following are all represented in the internal node structure: Commands, prompts, input lines, normal and error output, tabs, and preserving the structure if you "Save as HTML." The HTML file is compatible with XML, so you can use XML tools to search or transform the output. The command `domterm view-saved` opens a saved HTML file in a way that enables command folding (show/hide buttons are active) and reflow on window resize. - -**Built-in Lisp-style pretty-printing:** You can include pretty-printing directives (e.g., grouping) in the output such that line breaks are recalculated on window resize. See my article [Dynamic pretty-printing in DomTerm][17] for a deeper discussion. - -**Basic built-in line editing** with history (like `GNU readline`): This uses the browser's built-in editor, so it has great mouse and selection handling. You can switch between normal character-mode (most characters typed are sent directly to the process); or line-mode (regular characters are inserted while control characters cause editing actions, with Enter sending the edited line to the process). The default is automatic mode, where DomTerm switches between character-mode and line-mode depending on whether the PTY is in raw or canonical mode. - -**A built-in pager** (like a simplified `less`): Keyboard shortcuts will control scrolling. In "paging mode," the output pauses after each new screen (or single line, if you move forward line-by-line). The paging mode is unobtrusive and smart about user input, so you can (if you wish) run it without it interfering with interactive programs. - -### Multiplexing and sessions - -**Tabs and tiling:** Not only can you create multiple terminal tabs, you can also tile them. You can use either the mouse or a keyboard shortcut to move between panes and tabs as well as create new ones. They can be rearranged and resized with the mouse. This is implemented using the [GoldenLayout][18] JavaScript library. [Image 1][19] shows a window with two panes. The top one has two tabs, with one running [Midnight Commander][20]; the bottom pane shows `domterm help` output as HTML. However, on Atom we instead use its built-in draggable tiles and tabs; you can see this in image 2. - -**Detaching and reattaching to sessions:** DomTerm supports sessions arrangement, similar to `tmux` and GNU `screen`. You can even attach multiple windows or panes to the same session. This supports multi-user session sharing and remote connections. (For security, all sessions of the same server need to be able to read a Unix domain socket and a local file containing a random key. This restriction will be lifted when we have a good, safe remote-access story.) - -**The** **`domterm`** **command** is also like `tmux` or GNU `screen` in that has multiple options for controlling or starting a server that manages one or more sessions. The major difference is that, if it's not already running under DomTerm, the `domterm` command creates a new top-level window, rather than running in the existing terminal. - -The `domterm` command has a number of sub-commands, similar to `tmux` or `git`. Some sub-commands create windows or sessions. Others (such as "printing" an image) only work within an existing DomTerm session. - -The command `domterm browse` opens a window or pane for browsing a specified URL, such as when browsing documentation. - -### Getting and installing DomTerm - -DomTerm is available from its [GitHub repository][21]. Currently, there are no prebuilt packages, but there are [detailed instructions][22]. All prerequisites are available on Fedora 27, which makes it especially easy to build. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/introduction-domterm-terminal-emulator - -作者:[Per Bothner][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/perbothner -[1]:http://domterm.org/ -[2]:https://electronjs.org/ -[3]:https://atom.io/ -[4]:https://en.wikipedia.org/wiki/XUL -[5]:/file/385346 -[6]:https://opensource.com/sites/default/files/images/dt-atom1.png (DomTerm terminal panes in Atom editor) -[7]:https://opensource.com/sites/default/files/images/dt-atom1.png -[8]:https://libwebsockets.org/ -[9]:http://invisible-island.net/vttest/ -[10]:http://domterm.org/Wire-byte-protocol.html -[11]:http://domterm.org/Shell-prompts.html -[12]:http://www.gnuplot.info/ -[13]:https://developer.mozilla.org/en-US/docs/Web/SVG -[14]:http://per.bothner.com/blog/2016/gnuplot-in-domterm/ -[15]:https://www.gnu.org/software/kawa/ -[16]:https://www.gnu.org/software/kawa/Composable-pictures.html -[17]:http://per.bothner.com/blog/2017/dynamic-prettyprinting/ -[18]:https://golden-layout.com/ -[19]:https://opensource.com/sites/default/files/u128651/domterm1.png -[20]:https://midnight-commander.org/ -[21]:https://github.com/PerBothner/DomTerm -[22]:http://domterm.org/Downloading-and-building.html diff --git a/sources/tech/20180205 Rancher - Container Management Application.md b/sources/tech/20180205 Rancher - Container Management Application.md deleted file mode 100644 index 6ddd4aa4f3..0000000000 --- a/sources/tech/20180205 Rancher - Container Management Application.md +++ /dev/null @@ -1,223 +0,0 @@ -arrowfeng is translating - -Rancher - Container Management Application -====== -Docker is a cutting-edge software used for containerization, that is used in most of IT companies to reduce infrastructure cost. - -By default docker comes without any GUI, which is easy for Linux administrator to manage it and it’s very difficult for developers to manage. When it’s come to production then it’s very difficult for Linux admin too. So, what would be the best solution to manage the docker without any trouble. - -The only way is GUI. The Docker API has allowed third party applications to interfacing with Docker. There are many docker GUI applications available in the market. We already wrote an article about Portainer application. Today we are going to discuss about Rancher. - -Containers make software development easier, enabling you to write code faster and run it better. However, running containers in production can be hard. - -**Suggested Read :** [Portainer – A Simple Docker Management GUI][1] - -### What is Rancher - -[Rancher][2] is a complete container management platform that makes it easy to deploy and run containers in production on any infrastructure. It provides infrastructure services such as multi-host networking, global and local load balancing, and volume snapshots. It integrates native Docker management capabilities such as Docker Machine and Docker Swarm. It offers a rich user experience that enables devops admins to operate Docker in production at large scale. - -Navigate to following article for docker installation on Linux. - -**Suggested Read :** -**(#)** [How to install Docker in Linux][3] -**(#)** [How to play with Docker images on Linux][4] -**(#)** [How to play with Docker containers on Linux][5] -**(#)** [How to Install, Run Applications inside Docker Containers][6] - -### Rancher Features - - * Set up Kubernetes in two minutes - * Launch apps with single click (90 popular Docker applications) - * Deploy and manage Docker easily - * complete container management platform for production environment - * Quickly deploy containers in production - * Automate container deployment and operations with a robust technology - * Modular infrastructure services - * Rich set of orchestration tools - * Rancher supports multiple authentication mechanisms - - - -### How to install Rancher - -Rancher installation is very simple since it’s runs as a lightweight Docker containers. Rancher is deployed as a set of Docker containers. Running Rancher is as simple as launching two containers. One container as the management server and another container on a node as an agent. Simple run the following command to deploy rancher on Linux. - -Rancher server offers two different package tags like `stable` & `latest`. The below commands will pull appropriate build rancher image and install on your system. It will only take a couple of minutes for Rancher server to start up. - - * `stable` : This tag will be their latest development builds. These builds will have been validated through rancher CI automation framework which is not advisable for deployment in production. - * `latest` : It’s a latest stable release version which is recommend for production environment. - - - -Rancher installation comes with many varieties. In this tutorial we are going to discuss about two variants. - - * Install rancher server in a single container (Inbuilt Rancher Database) - * Install rancher server in a single container (External Database) - - - -### Method-1 - -Run the following commands to install rancher server in a single container (Inbuilt Rancher Database). -``` -$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable - -$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:latest - -``` - -### Method-2 - -Instead of using the internal database that comes with Rancher server, you can start Rancher server pointing to an external database. First create required database, database user for the same. -``` -> CREATE DATABASE IF NOT EXISTS cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8'; -> GRANT ALL ON cattle.* TO 'cattle'@'%' IDENTIFIED BY 'cattle'; -> GRANT ALL ON cattle.* TO 'cattle'@'localhost' IDENTIFIED BY 'cattle'; - -``` - -Run the following command to start Rancher connecting to an external database. -``` -$ sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server \ - --db-host myhost.example.com --db-port 3306 --db-user username --db-pass password --db-name cattle - -``` - -If you want to test Rancher 2.0 use the following command to start. -``` -$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/server:preview - -``` - -### Access & Setup Rancher Through GUI - -Navigate to the following URL `http://hostname:8080` or `http://server_ip:8080` to access rancher GUI. -[![][7]![][7]][8] - -### How To Register the Host - -Register your host URL which allow hosts to connect to the Rancher API. It’s one time setup. - -To do, Click “Add a Host” link under the main menu or Go to >> Infrastructure >> Add Hosts then hit `save` button. -[![][7]![][7]][9] - -By default access control authentication is disabled in rancher so first we have to enable the access control authentication through available method, otherwise anyone can access the GUI. - -Go to >> Admin >> Access Control and input the following values and finally hit `Enable Authentication` button to enable it. In my case i’m enabling via `local authentication` - - * **`Login UserName`** Input your descried login username - * **`Full Name`** Input your full name - * **`Password`** Input your descried password - * **`Confirm Password`**Confirm the password once again - - - -[![][7]![][7]][10] - -Logout and login back with your new login credential. -[![][7]![][7]][11] - -Now, i can see the local authentication is enabled. -[![][7]![][7]][12] - -### How To Add Hosts - -After register your host, it will take you to next page where you can choose Linux machines from varies cloud providers. We are going to add the host that is running Rancher server, so select the `custom` option and input the required information. - -Enter your server public IP address in the 4th step and run the command which is displaying in the 5th step into your terminal then finally hit `close` button. -``` -$ sudo docker run -e CATTLE_AGENT_IP="192.168.1.112" --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.2.9 http://192.168.1.112:8080/v1/scripts/3F8217A1DCF01A7B7F8A:1514678400000:D7WeLUcEUnqZOt8rWjrvoaUE - -INFO: Running Agent Registration Process, CATTLE_URL=http://192.168.1.112:8080/v1 -INFO: Attempting to connect to: http://66.70.189.137:8080/v1 -INFO: http://192.168.1.112:8080/v1 is accessible -INFO: Inspecting host capabilities -INFO: Boot2Docker: false -INFO: Host writable: true -INFO: Token: xxxxxxxx -INFO: Running registration -INFO: Printing Environment -INFO: ENV: CATTLE_ACCESS_KEY=A35151AB87C15633DFB4 -INFO: ENV: CATTLE_AGENT_IP=192.168.1.112 -INFO: ENV: CATTLE_HOME=/var/lib/cattle -INFO: ENV: CATTLE_REGISTRATION_ACCESS_KEY=registrationToken -INFO: ENV: CATTLE_REGISTRATION_SECRET_KEY=xxxxxxx -INFO: ENV: CATTLE_SECRET_KEY=xxxxxxx -INFO: ENV: CATTLE_URL=http://192.168.1.112:8080/v1 -INFO: ENV: DETECTED_CATTLE_AGENT_IP=172.17.0.1 -INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v1.2.9 -INFO: Deleting container rancher-agent -INFO: Launched Rancher Agent: 3415a1fd101f3c57d9cff6aef373c0ce66a3e20772122d2ca832039dcefd92fd - -``` - -[![][7]![][7]][13] - -Wait few seconds then the newly added host will be visible. To bring this Go to Infrastructure >> Hosts page. -[![][7]![][7]][14] - -### How To View Containers - -Just navigate the following location to view a list of running containers. Go to >> Infrastructure >> Containers. -[![][7]![][7]][15] - -### How To Create Container - -It’s very simple, just navigate the following location to create a container. - -Go to >> Infrastructure >> Containers >> “Add Container” and input the required information as per your requirement. To test this, i’m going to create Centos container with latest OS. -[![][7]![][7]][16] - -The same has been listed here. Infrastructure >> Containers -[![][7]![][7]][17] - -Hit on the `Container` name to view the container performances information like CPU, memory, network and storage. -[![][7]![][7]][18] - -To manage the container such as stop, start, clone, restart, etc. Choose the particular container then hit `Three dot's` button in the left side of the container or `Actions` button to perform. -[![][7]![][7]][19] - -If you want console access of the container, just hit `Execute Shell` option in the action button. -[![][7]![][7]][20] - -### How To Deploy Container From Application Catalog - -Rancher provides a catalog of application templates that make it easy to deploy in single click. It’s maintain popular applications (nearly 90) contributed by the Rancher community. -[![][7]![][7]][21] - -Go to >> Catalog >> All >> Choose the required application >> Finally hit “Launch” button to deploy. -[![][7]![][7]][22] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/rancher-a-complete-container-management-platform-for-production-environment/ - -作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/magesh/ -[1]:https://www.2daygeek.com/portainer-a-simple-docker-management-gui/ -[2]:http://rancher.com/ -[3]:https://www.2daygeek.com/install-docker-on-centos-rhel-fedora-ubuntu-debian-oracle-archi-scentific-linux-mint-opensuse/ -[4]:https://www.2daygeek.com/list-search-pull-download-remove-docker-images-on-linux/ -[5]:https://www.2daygeek.com/create-run-list-start-stop-attach-delete-interactive-daemonized-docker-containers-on-linux/ -[6]:https://www.2daygeek.com/install-run-applications-inside-docker-containers/ -[7]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[8]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-1.png -[9]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-2.png -[10]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-3.png -[11]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-3a.png -[12]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-4.png -[13]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-5.png -[14]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-6.png -[15]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-7.png -[16]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-8.png -[17]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-9.png -[18]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-10.png -[19]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-11.png -[20]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-12.png -[21]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-13.png -[22]:https://www.2daygeek.com/wp-content/uploads/2018/02/Install-rancher-container-management-application-in-linux-14.png diff --git a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md b/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md deleted file mode 100644 index 555a475651..0000000000 --- a/sources/tech/20180312 ddgr - A Command Line Tool To Search DuckDuckGo From The Terminal.md +++ /dev/null @@ -1,231 +0,0 @@ -ddgr – A Command Line Tool To Search DuckDuckGo From The Terminal -====== -Bash tricks are really awesome in Linux that makes everything is possible in Linux. - -It really works well for developers or system admins because they are spending most of the time with terminal. Did you know why they are preferring this tricks? - -These trick will improve their productivity and also make them to work fast. - -### What Is ddgr - -[ddgr][1] is a command-line utility to search DuckDuckGo from the terminal. ddgr works out of the box with several text-based browsers if the BROWSER environment variable is set. - -Make sure your system should have installed any text-based browsers. You may know about [googler][2] that allow users to perform Google searches from the Linux command line. - -It’s highly popular among cmdline users and they are expect the similar utility for privacy-aware DuckDuckGo, that’s why ddgr came to picture. - -Unlike the web interface, you can specify the number of search results you would like to see per page. - -**Suggested Read :** -**(#)** [Googler – Google Search From The Linux Command Line][2] -**(#)** [Buku – A Powerful Command-line Bookmark Manager for Linux][3] -**(#)** [SoCLI – Easy Way To Search And Browse Stack Overflow From The Terminal][4] -**(#)** [RTV (Reddit Terminal Viewer) – A Simple Terminal Viewer For Reddit][5] - -### What Is DuckDuckGo - -DDG stands for DuckDuckGo. DuckDuckGo (DDG) is an Internet search engine that really protecting users search and privacy. - -They didn’t filter users personalized search results and It’s showing the same search results to all users for a given search term. - -Most of the users prefer google search engine, if you really worrying about privacy then you can blindly go with DuckDuckGo. - -### ddgr Features - - * Fast and clean (no ads, stray URLs or clutter), custom color - * Designed to deliver maximum readability at minimum space - * Specify the number of search results to show per page - * Navigate result pages from omniprompt, open URLs in browser - * Search and option completion scripts for Bash, Zsh and Fish - * DuckDuckGo Bang support (along with completion) - * Open the first result directly in browser (as in I’m Feeling Ducky) - * Non-stop searches: fire new searches at omniprompt without exiting - * Keywords (e.g. filetype:mime, site:somesite.com) support - * Limit search by time, specify region, disable safe search - * HTTPS proxy support, Do Not Track set, optionally disable User Agent - * Support custom url handler script or cmdline utility - * Comprehensive documentation, man page with handy usage examples - * Minimal dependencies - - - -### Prerequisites - -ddgr requires Python 3.4 or later. So, make sure you system should have Python 3.4 or later version. -``` -$ python3 --version -Python 3.6.3 - -``` - -### How To Install ddgr In Linux - -We can easily install ddgr using the following command based on the distributions. - -For **`Fedora`** , use [DNF Command][6] to install ddgr. -``` -# dnf install ddgr - -``` - -Alternatively we can use [SNAP Command][7] to install ddgr. -``` -# snap install ddgr - -``` - -For **`LinuxMint/Ubuntu`** , use [APT-GET Command][8] or [APT Command][9] to install ddgr. -``` -$ sudo add-apt-repository ppa:twodopeshaggy/jarun -$ sudo apt-get update -$ sudo apt-get install ddgr - -``` - -For **`Arch Linux`** based systems, use [Yaourt Command][10] or [Packer Command][11] to install ddgr from AUR repository. -``` -$ yaourt -S ddgr -or -$ packer -S ddgr - -``` - -For **`Debian`** , use [DPKG Command][12] to install ddgr. -``` -# wget https://github.com/jarun/ddgr/releases/download/v1.2/ddgr_1.2-1_debian9.amd64.deb -# dpkg -i ddgr_1.2-1_debian9.amd64.deb - -``` - -For **`CentOS 7`** , use [YUM Command][13] to install ddgr. -``` -# yum install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.el7.3.centos.x86_64.rpm - -``` - -For **`opensuse`** , use [zypper Command][14] to install ddgr. -``` -# zypper install https://github.com/jarun/ddgr/releases/download/v1.2/ddgr-1.2-1.opensuse42.3.x86_64.rpm - -``` - -### How To Launch ddgr - -Enter the `ddgr` command without any option on terminal to bring DuckDuckGo search. You will get the same output similar to below. -``` -$ ddgr - -``` - -![][16] - -### How To Search Using ddgr - -We can initiate the search through two ways. Either from omniprompt or directly from terminal. You can search any phrases which you want. - -Directly from terminal. -``` -$ ddgr 2daygeek - -``` - -![][17] - -From `omniprompt`. -![][18] - -### Omniprompt Shortcut - -Enter `?` to obtain the `omniprompt`, which will show you list of keywords and shortcut to work further with ddgr. -![][19] - -### How To Move Next,Previous, and Fist Page - -It allows user to move next page or previous page or first page. - - * `n:` Move to next set of search results - * `p:` Move to previous set of search results - * `f:` Jump to the first page - - - -![][20] - -### How To Initiate A New Search - -“ **d** ” option allow users to initiate a new search from omniprompt. For example, i searched about `2daygeek website` and now i’m going to initiate a new search with phrase “ **Magesh Maruthamuthu** “. - -From `omniprompt`. -``` -ddgr (? for help) d magesh maruthmuthu - -``` - -![][21] - -### Show Complete URLs In Search Result - -By default it shows only an article heading, add the “ **x** ” option in search to show complete article urls in search result. -``` -$ ddgr -n 5 -x 2daygeek - -``` - -![][22] - -### Limit Search Results - -By default search results shows 10 results per page. If you want to limit the page results for your convenience, you can do by passing `--num or -n` argument with ddgr. -``` -$ ddgr -n 5 2daygeek - -``` - -![][23] - -### Website Specific Search - -To search specific pages from the particular website, use the below format. This will fetch the results for given keywords from the website. For example, We are going search about “ **Package Manager** ” from 2daygeek website. See the results. -``` -$ ddgr -n 5 --site 2daygeek "package manager" - -``` - -![][24] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/ddgr-duckduckgo-search-from-the-command-line-in-linux/ - -作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/magesh/ -[1]:https://github.com/jarun/ddgr -[2]:https://www.2daygeek.com/googler-google-search-from-the-command-line-on-linux/ -[3]:https://www.2daygeek.com/buku-command-line-bookmark-manager-linux/ -[4]:https://www.2daygeek.com/socli-search-and-browse-stack-overflow-from-linux-terminal/ -[5]:https://www.2daygeek.com/rtv-reddit-terminal-viewer-a-simple-terminal-viewer-for-reddit/ -[6]:https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[7]:https://www.2daygeek.com/snap-command-examples/ -[8]:https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[9]:https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[10]:https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ -[11]:https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ -[12]:https://www.2daygeek.com/dpkg-command-to-manage-packages-on-debian-ubuntu-linux-mint-systems/ -[13]:https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[14]:https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[15]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[16]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux1.png -[17]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-3.png -[18]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-2.png -[19]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-4.png -[20]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-5a.png -[21]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-6a.png -[22]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-7a.png -[23]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-8.png -[24]:https://www.2daygeek.com/wp-content/uploads/2018/03/ddgr-duckduckgo-command-line-search-for-linux-9a.png diff --git a/sources/tech/20180324 Memories of writing a parser for man pages.md b/sources/tech/20180324 Memories of writing a parser for man pages.md deleted file mode 100644 index fb53aed395..0000000000 --- a/sources/tech/20180324 Memories of writing a parser for man pages.md +++ /dev/null @@ -1,109 +0,0 @@ -Memories of writing a parser for man pages -====== - -I generally enjoy being bored, but sometimes enough is enough—that was the case a Sunday afternoon of 2015 when I decided to start an open source project to overcome my boredom. - -In my quest for ideas, I stumbled upon a request to build a [“Man page viewer built with web standards”][1] by [Mathias Bynens][2] and without thinking too much, I started coding a man page parser in JavaScript, which after a lot of back and forths, ended up being [Jroff][3]. - -Back then, I was familiar with manual pages as a concept and used them a fair amount of times, but that was all I knew, I had no idea how they were generated or if there was a standard in place. Two years later, here are some thoughts on the matter. - -### How man pages are written - -The first thing that surprised me at the time, was the notion that manpages at their core are just plain text files stored somewhere in the system (you can check this directory using the `manpath` command). - -This files not only contain the documentation, but also formatting information using a typesetting system from the 1970s called `troff`. - -> troff, and its GNU implementation groff, are programs that process a textual description of a document to produce typeset versions suitable for printing. **It’s more ‘What you describe is what you get’ rather than WYSIWYG.** -> -> — extracted from [troff.org][4] - -If you are totally unfamiliar with typesetting formats, you can think of them as Markdown on steroids, but in exchange for the flexibility you have a more complex syntax: - -![groff-compressor][5] - -The `groff` file can be written manually, or generated from other formats such as Markdown, Latex, HTML, and so on with many different tools. - -Why `groff` and man pages are tied together has to do with history, the format has [mutated along time][6], and his lineage is composed of a chain of similarly-named programs: RUNOFF > roff > nroff > troff > groff. - -But this doesn’t necessarily mean that `groff` is strictly related to man pages, it’s a general-purpose format that has been used to [write books][7] and even for [phototypesetting][8]. - -Moreover, It’s worth noting that `groff` can also call a postprocessor to convert its intermediate output to a final format, which is not necessarily ascii for terminal display! some of the supported formats are: TeX DVI, HTML, Canon, HP LaserJet4 compatible, PostScript, utf8 and many more. - -### Macros - -Other of the cool features of the format is its extensibility, you can write macros that enhance the basic functionalities. - -With the vast history of *nix systems, there are several macro packages that group useful macros together for specific functionalities according to the output that you want to generate, examples of macro packages are `man`, `mdoc`, `mom`, `ms`, `mm`, and the list goes on. - -Manual pages are conventionally written using `man` and `mdoc`. - -You can easily distinguish native `groff` commands from macros by the way standard `groff` packages capitalize their macro names. For `man`, each macro’s name is uppercased, like .PP, .TH, .SH, etc. For `mdoc`, only the first letter is uppercased: .Pp, .Dt, .Sh. - -![groff-example][9] - -### Challenges - -Whether you are considering to write your own `groff` parser, or just curious, these are some of the problems that I have found more challenging. - -#### Context-sensitive grammar - -Formally, `groff` has a context-free grammar, unfortunately, since macros describe opaque bodies of tokens, the set of macros in a package may not itself implement a context-free grammar. - -This kept me away (for good or bad) from the parser generators that were available at the time. - -#### Nested macros - -Most of the macros in `mdoc` are callable, this roughly means that macros can be used as arguments of other macros, for example, consider this: - - * The macro `Fl` (Flag) adds a dash to its argument, so `Fl s` produces `-s` - * The macro `Ar` (Argument) provides facilities to define arguments - * The `Op` (Optional) macro wraps its argument in brackets, as this is the standard idiom to define something as optional. - * The following combination `.Op Fl s Ar file` produces `[-s file]` because `Op` macros can be nested. - - - -#### Lack of beginner-friendly resources - -Something that really confused me was the lack of a canonical, well defined and clear source to look at, there’s a lot of information in the web which assumes a lot about the reader that it takes time to grasp. - -### Interesting macros - -To wrap up, I will offer to you a very short list of macros that I found interesting while developing jroff: - -**man** - - * TH: when writing manual pages with `man` macros, your first line that is not a comment must be this macro, it accepts five parameters: title section date source manual - * BI: bold alternating with italics (especially useful for function specifications) - * BR: bold alternating with Roman (especially useful for referring to other manual pages) - - - -**mdoc** - - * .Dd, .Dt, .Os: similar to how `man` macros require the `.TH` the `mdoc` macros require these three macros, in that particular order. Their initials stand for: Document date, Document title and Operating system. - * .Bl, .It, .El: these three macros are used to create list, their names are self-explanatory: Begin list, Item and End list. - - - - --------------------------------------------------------------------------------- - -via: https://monades.roperzh.com/memories-writing-parser-man-pages/ - -作者:[Roberto Dip][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://monades.roperzh.com -[1]:https://github.com/h5bp/lazyweb-requests/issues/114 -[2]:https://mathiasbynens.be/ -[3]:jroff -[4]:https://www.troff.org/ -[5]:https://user-images.githubusercontent.com/4419992/37868021-2e74027c-2f7f-11e8-894b-80829ce39435.gif -[6]:https://manpages.bsd.lv/history.html -[7]:https://rkrishnan.org/posts/2016-03-07-how-is-gopl-typeset.html -[8]:https://en.wikipedia.org/wiki/Phototypesetting -[9]:https://user-images.githubusercontent.com/4419992/37866838-e602ad78-2f6e-11e8-97a9-2a4494c766ae.jpg diff --git a/sources/tech/20180406 MX Linux- A Mid-Weight Distro Focused on Simplicity.md b/sources/tech/20180406 MX Linux- A Mid-Weight Distro Focused on Simplicity.md deleted file mode 100644 index 8cf35ea8bf..0000000000 --- a/sources/tech/20180406 MX Linux- A Mid-Weight Distro Focused on Simplicity.md +++ /dev/null @@ -1,147 +0,0 @@ -MX Linux: A Mid-Weight Distro Focused on Simplicity -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mxlinux.png?itok=OLjmCxT9) -There are so many distributions of Linux. Some of those distributions go a very long way to differentiate themselves. In other cases, the differences are so minimal, you wonder why anyone would have bothered reinventing that particular wheel. It’s that latter concern that had me wondering why [antiX][1] and [MEPIS][2] communities would come together to create yet another distribution—especially given that the results would be an Xfce edition of antiX, built by the MEPIS community. - -Does building antiX with an Xfce desktop warrant its own distribution? After all, antiX claims to be a “fast, lightweight and easy to install systemd-free linux live CD distribution based on Debian Stable.” The antiX desktop of choice is [LXDE][3], which does certainly fit the bill for a lightweight desktop. So why retool antiX into another lightweight distribution, only this time with Xfce? Well, as anyone within the Linux community knows, variance adds flavor and a good lightweight distribution is a worthwhile endeavor (especially in preventing old hardware from making its way to the landfill). Of course, LXDE and Xfce aren’t quite in the same category. LXDE should be considered a true lightweight desktop, whereas Xfce should be considered more a mid-weight desktop. And that, my friends, is key to why MX Linux is an important iteration of antiX. A mid-weight distribution, built on Debian, that includes all the tools you need to get your work done. - -But there’s something really keen within MX Linux—something directly borrowed from antiX—and that is the installation tool. When I first set up a VirtualBox VM to install MX Linux, I assumed the installation would be the typical, incredibly easy Linux installation I’d grown accustomed to. Much to my surprise, that antiX installer MX Linux uses could be a real game changer, especially for those on the fence about giving Linux a try. - -So even before I began kicking the tires of MX Linux, I was impressed. Let’s take a look at what makes the installation of this distribution so special, and then finally have a go with the desktop. - -You can download MX Linux 17.1 from [here][4]. The minimum system requirements are: - - * A CD/DVD drive (and BIOS capable of booting from that drive), or a live USB (and BIOS capable of booting from USB) - - * A modern i486 Intel or AMD processor - - * 512 MB of RAM memory - - * 5 GB free hard drive space - - * A SoundBlaster, AC97 or HDA-compatible sound card - - * For use as a LiveUSB, 4 GB free - - - - -### Installation - -Out of the gate, the MX Linux installer makes installing Linux a breeze. Although it may not be the most modern-looking installation tool, there’s little to second-guess. The heart of the installation begins with choosing the disks and selecting the installation type (Figure 1). - - -![install][6] - -Figure 1: One of the first installer screens for MX Linux. - -[Used with permission][7] - -The next important screen (Figure 2) requires you to set a computer name, domain, and (if necessary) a workgroup for MS Networking. - -That ability to configure a workgroup is the first bit to really stand out. This is the first distribution I can remember that offers this option during installation. It also should clue you in that MX Linux offers the ability to share directories out of the box. It does, and it does so with aplomb. It’s not perfect, but it works without having to install any extra package (more on this in a bit). - -The last important installation screen (that requires user-interaction) is the creation of the user account and root password (Figure 3). - - -![user][9] - -Figure 3: Setting up your user account details and the root user password. - -[Used with permission][7] - -Once you’ve taken care of this final screen, the installation will complete and ask you to reboot. Upon rebooting, you’ll be greeted with the login screen. Login and enjoy the MX Linux experience. - -### Usage - -The Xfce desktop is quite an easy interface to get up to speed with. The default places the panel on the left edge of the screen (Figure 4). - - -![desktop ][11] - -Figure 4: The default MX Linux desktop. - -[Used with permission][7] - -If you want to move the panel to a more traditional location, right click a blank spot on the panel and click Panel > Panel Preferences. In the resulting window (Figure 5), click the Mode drop-down to select from between Deskbar, Vertical, or Horizontal. - - -![panel][13] - -Figure 5: Configuring the MX Linux Panel. - -[Used with permission][7] - -The difference between the Deskbar and Vertical options is that, in the Deskbar mode, the panel is aligned vertically, just like in the vertical mode, but the plugins are laid out horizontally. This means you can create much wider panels (for widescreen layouts). If you opt for a horizontal layout, it will default to the top—you will have to then uncheck the Lock panel check box, click Close, and then (using the drag handle on the left edge of the panel) drag it to the bottom. You can then go back into the Panel Settings window and re-lock the panel. - -Beyond that, using the Xfce desktop should be a no-brainer for nearly any experience level … it’s that easy. You’ll find software to cover productivity (LibreOffice, Orage Calendar, PDF-Shuffler), graphics (GIMP), communication (Firefox, Thunderbird, HexChat), multimedia (Clementine, guvcview, SMTube, VLC media player), and a number of tools specific to MX Linux (called MX Tools, that range from a live-USB drive creator, a network assistant, package installer, repo manager, live ISO snapshot creator, and more). - -![sharing][15] - -Figure 6: Sharing out a directory to your network. - -[Used with permission][7] - -### Samba - -Let’s talk about sharing folders to your network. As I mentioned, you won’t have to install any extra packages to get this to function. You simply open up the file manager, right-click anywhere, and select Share a folder on your network. You will be prompted for the administrative password (set during installation). Upon successful authentication, the Samba Server Configuration Tool will open (Figure 6). - -![sharing][17] - -Figure 7: Configuring the share on MX Linux. - -[Used with permission][7] - -Click the + button and configure your share. You will be asked to locate the directory, give the share a name/description, and then decide if the share is writeable and visible (Figure 7). - -When you click the Access tab, you have the choice between giving everyone access to the share or just specific users. Here’s where the problem arises. At this point, no users will be available for sharing. Why? They haven’t been added. In order to add them, there are two possibilities: From the command line or using the tool we already have open. Let’s take the obvious route. From the main window of the Samba Server Configuration Tool, click Preferences > Samba Users. In the resulting window, click Add user. - -A new window will appear (Figure 8), where you need to select the user from the drop-down, enter a Windows username, and type/retype a password for the user. - -![Samba][19] - -Figure 8: Adding a user to Samba. - -[Used with permission][7] - -Once you’ve clicked OK, the user will be added and the share will be accessible, to that user, across your network. Creating Samba shares really can be that easy. - -### The conclusion - -MX Linux makes transitioning from just about any desktop operating system simple. Although some might find the desktop interface to be a bit less-than-modern, the distribution’s primary focus isn’t on beauty, but simplicity. To that end, MX Linux succeeds in stellar fashion. This flavor of Linux can make anyone feel right at home on Linux. Spin up this mid-weight distribution and see if it can’t serve as your daily driver. - -Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/4/mx-linux-mid-weight-distro-focused-simplicity - -作者:[JACK WALLEN][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/jlwallen -[1]:https://antixlinux.com/ -[2]:https://en.wikipedia.org/wiki/MEPIS -[3]:https://lxde.org/ -[4]:https://mxlinux.org/download-links -[5]:/files/images/mxlinux1jpg -[6]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mxlinux_1.jpg?itok=i9bNScjH (install) -[7]:/licenses/category/used-permission -[8]:/files/images/mxlinux3jpg -[9]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mxlinux_3.jpg?itok=ppf2l_bm (user) -[10]:/files/images/mxlinux4jpg -[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mxlinux_4.jpg?itok=mS1eBy9m (desktop) -[12]:/files/images/mxlinux5jpg -[13]:https://www.linux.com/sites/lcom/files/styles/floated_images/public/mxlinux_5.jpg?itok=wsN1hviN (panel) -[14]:/files/images/mxlinux6jpg -[15]:https://www.linux.com/sites/lcom/files/styles/floated_images/public/mxlinux_6.jpg?itok=vw8mIp9T (sharing) -[16]:/files/images/mxlinux7jpg -[17]:https://www.linux.com/sites/lcom/files/styles/floated_images/public/mxlinux_7.jpg?itok=tRIWdcEk (sharing) -[18]:/files/images/mxlinux8jpg -[19]:https://www.linux.com/sites/lcom/files/styles/floated_images/public/mxlinux_8.jpg?itok=ZS6lhZN2 (Samba) -[20]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md b/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md deleted file mode 100644 index ef91a88431..0000000000 --- a/sources/tech/20180407 12 Best GTK Themes for Ubuntu and other Linux Distributions.md +++ /dev/null @@ -1,174 +0,0 @@ -translating by robsean - -12 Best GTK Themes for Ubuntu and other Linux Distributions -====== -**Brief: Let’s have a look at some of the beautiful GTK themes that you can use not only in Ubuntu but other Linux distributions that use GNOME.** - -For those of us that use Ubuntu proper, the move from Unity to Gnome as the default desktop environment has made theming and customizing easier than ever. Gnome has a fairly large tweaking community, and there is no shortage of fantastic GTK themes for users to choose from. With that in mind, I went ahead and found some of my favorite themes that I have come across in recent months. These are what I believe offer some of the best experiences that you can find. - -### Best themes for Ubuntu and other Linux distributions - -This is not an exhaustive list and may exclude some of the themes you already use and love, but hopefully, you find at least one theme that you enjoy that you did not already know about. All themes present should work on any Gnome 3 setup, Ubuntu or not. I lost some screenshots so I have taken images from the official websites. - -The themes listed here are in no particular order. - -But before you see the best GNOME themes, you should learn [how to install themes in Ubuntu GNOME][1]. - -#### 1\. Arc-Ambiance - -![][2] - -Arc and Arc variant themes have been around for quite some time now, and are widely regarded as some of the best themes you can find. In this example, I have selected Arc-Ambiance because of its modern take on the default Ambiance theme in Ubuntu. - -I am a fan of both the Arc theme and the default Ambiance theme, so needless to say, I was pumped when I came across a theme that merged the best of both worlds. If you are a fan of the arc themes but not a fan of this one in particular, Gnome look has plenty of other options that will most certainly suit your taste. - -[Arc-Ambiance Theme][3] - -#### 2\. Adapta Colorpack - -![][4] - -The Adapta theme has been one of my favorite flat themes I have ever found. Like Arc, Adapata is widely adopted by many-a-linux user. I have selected this color pack because in one download you have several options to choose from. In fact, there are 19 to choose from. Yep. You read that correctly. 19! - -So, if you are a fan of the flat/material design language that we see a lot of today, then there is most likely a variant in this theme pack that will satisfy you. - -[Adapta Colorpack Theme][5] - -#### 3\. Numix Collection - -![][6] - -Ah, Numix! Oh, the years we have spent together! For those of us that have been theming our DE for the last couple of years, you must have come across the Numix themes or icon packs at some point in time. Numix was probably the first modern theme for Linux that I fell in love with, and I am still in love with it today. And after all these years, it still hasn’t lost its charm. - -The gray tone throughout the theme, especially with the default pinkish-red highlight color, makes for a genuinely clean and complete experience. You would be hard pressed to find a theme pack as polished as Numix. And in this offering, you have plenty of options to choose from, so go crazy! - -[Numix Collection Theme][7] - -#### 4\. Hooli - -![][8] - -Hooli is a theme that has been out for some time now, but only recently came across my radar. I am a fan of most flat themes but have usually strayed away from themes that come to close to the material design language. Hooli, like Adapta, takes notes from that design language, but does it in a way that I think sets it apart from the rest. The green highlight color is one of my favorite parts about the theme, and it does a good job at not overpowering the entire theme. - -[Hooli Theme][9] - -#### 5\. Arrongin/Telinkrin - -![][10] - -Bonus: Two themes in one! And they are relatively new contenders in the theming realm. They both take notes from Ubuntu’s soon to be finished “[communitheme][11]” and bring it to your desktop today. The only real difference I can find between the offerings are the colors. Arrongin is centered around an Ubuntu-esq orange color, while Telinkrin uses a slightly more KDE Breeze-esq blue. I personally prefer the blue, but both are great options! - -[Arrongin/Telinkrin Themes][12] - -#### 6\. Gnome-osx - -![][13] - -I have to admit, usually, when I see that a theme has “osx” or something similar in the title, I don’t expect much. Most Apple inspired themes seem to have so much in common that I can’t really find a reason to use them. There are two themes I can think of that break this mold: the Arc-osc them and the Gnome-osx theme that we have here. - -The reason I like the Gnome-osx theme is because it truly does look at home on the Gnome desktop. It does a great job at blending into the DE without being too flat. So for those of you that enjoy a slightly less flat theme, and you like the red, yellow, and green button scheme for the close, minimize, and maximize buttons, than this theme is perfect for you. - -[Gnome-osx Theme][14] - -#### 7\. Ultimate Maia - -![][15] - -There was a time when I used Manjaro Gnome. Since then I have reverted back to Ubuntu, but one thing I wish I could have brought with me was the Manjaro theme. If you feel the same about the Manjaro theme as I do, then you are in luck because you can bring it to ANY distro you want that is running Gnome! - -The rich green color, the Breeze-esq close, minimize, maximize buttons, and the over-all polish of the theme makes for one compelling option. It even offers some other color variants of you are not a fan of the green. But let’s be honest…who isn’t a fan of that Manjaro green color? - -[Ultimate Maia Theme][16] - -#### 8\. Vimix - -![][17] - -This was a theme I easily got excited about. It is modern, pulls from the macOS red, yellow, green buttons without directly copying them, and tones down the vibrancy of the theme, making for one unique alternative to most other themes. It comes with three dark variants and several colors to choose from so most of us will find something we like. - -[Vimix Theme][18] - -#### 9\. Ant - -![][19] - -Like Vimix, Ant pulls inspiration from macOS for the button colors without directly copying the style. Where Vimix tones down the color options, Ant adds a richness to the colors that looks fantastic on my System 76 Galago Pro screen. The variation between the three theme options is pretty dramatic, and though it may not be to everyone’s taste, it is most certainly to mine. - -[Ant Theme][20] - -#### 10\. Flat Remix - -![][21] - -If you haven’t noticed by this point, I am a sucker for someone who pays attention to the details in the close, minimize, maximize buttons. The color theme that Flat Remix uses is one I have not seen anywhere else, with a red, blue, and orange color way. Add that on top of a theme that looks almost like a mix between Arc and Adapta, and you have Flat Remix. - -I am personally a fan of the dark option, but the light alternative is very nice as well. So if you like subtle transparencies, a cohesive dark theme, and a touch of color here and there, Flat Remix is for you. - -[Flat Remix Theme][22] - -#### 11\. Paper - -![][23] - -[Paper][24] has been around for some time now. I remember using it for the first back in 2014. I would say, at this point, Paper is more known for its icon pack than for its GTK theme, but that doesn’t mean that the theme isn’t a wonderful option in and of its self. Even though I adored the Paper icons from the beginning, I can’t say that I was a huge fan of the Paper theme when I first tried it out. - -I felt like the bright colors and fun approach to a theme made for an “immature” experience. Now, years later, Paper has grown on me, to say the least, and the light hearted approach that the theme takes is one I greatly appreciate. - -[Paper Theme][25] - -#### 12\. Pop - -![][26] - -Pop is one of the newer offerings on this list. Created by the folks over at [System 76][27], the Pop GTK theme is a fork of the Adapta theme listed earlier and comes with a matching icon pack, which is a fork of the previously mentioned Paper icon pack. - -The theme was released soon after System 76 announced that they were releasing [their own distribution,][28] Pop!_OS. You can read my [Pop!_OS review][29] to know more about it. Needless to say, I think Pop is a fantastic theme with a superb amount of polish and offers a fresh feel to any Gnome desktop. - -[Pop Theme][30] - -#### Conclusion - -Obviously, there way more themes to choose from than we could feature in one article, but these are some of the most complete and polished themes I have used in recent months. If you think we missed any that you really like or you just really dislike one that I featured above, then feel free to let me know in the comment section below and share why you think your favorite themes are better! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-gtk-themes/ - -作者:[Phillip Prado][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://itsfoss.com/author/phillip/ -[1]:https://itsfoss.com/install-themes-ubuntu/ -[2]:https://itsfoss.com/wp-content/uploads/2018/03/arcambaince-300x225.png -[3]:https://www.gnome-look.org/p/1193861/ -[4]:https://itsfoss.com/wp-content/uploads/2018/03/adapta-300x169.jpg -[5]:https://www.gnome-look.org/p/1190851/ -[6]:https://itsfoss.com/wp-content/uploads/2018/03/numix-300x169.png -[7]:https://www.gnome-look.org/p/1170667/ -[8]:https://itsfoss.com/wp-content/uploads/2018/03/hooli2-800x500.jpg -[9]:https://www.gnome-look.org/p/1102901/ -[10]:https://itsfoss.com/wp-content/uploads/2018/03/AT-800x590.jpg -[11]:https://itsfoss.com/ubuntu-community-theme/ -[12]:https://www.gnome-look.org/p/1215199/ -[13]:https://itsfoss.com/wp-content/uploads/2018/03/gosx-800x473.jpg -[14]:https://www.opendesktop.org/s/Gnome/p/1171688/ -[15]:https://itsfoss.com/wp-content/uploads/2018/03/ultimatemaia-800x450.jpg -[16]:https://www.opendesktop.org/s/Gnome/p/1193879/ -[17]:https://itsfoss.com/wp-content/uploads/2018/03/vimix-800x450.jpg -[18]:https://www.gnome-look.org/p/1013698/ -[19]:https://itsfoss.com/wp-content/uploads/2018/03/ant-800x533.png -[20]:https://www.opendesktop.org/p/1099856/ -[21]:https://itsfoss.com/wp-content/uploads/2018/03/flatremix-800x450.png -[22]:https://www.opendesktop.org/p/1214931/ -[23]:https://itsfoss.com/wp-content/uploads/2018/04/paper-800x450.jpg -[24]:https://itsfoss.com/install-paper-theme-linux/ -[25]:https://snwh.org/paper/download -[26]:https://itsfoss.com/wp-content/uploads/2018/04/pop-800x449.jpg -[27]:https://system76.com/ -[28]:https://itsfoss.com/system76-popos-linux/ -[29]:https://itsfoss.com/pop-os-linux-review/ -[30]:https://github.com/pop-os/gtk-theme/blob/master/README.md diff --git a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md b/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md deleted file mode 100644 index f75baf6166..0000000000 --- a/sources/tech/20180416 How To Resize Active-Primary root Partition Using GParted Utility.md +++ /dev/null @@ -1,181 +0,0 @@ -How To Resize Active/Primary root Partition Using GParted Utility -====== -Today we are going to discuss about disk partition. It’s one of the best topics in Linux. This allow users to resize the active root partition in Linux. - -In this article we will teach you how to resize the active root partition on Linux using Gparted utility. - -Just imagine, our system has 30GB disk and we didn’t configure properly while installation the Ubuntu operating system. - -We need to install another OS in that so we want to make secondary partition on that. - -Its not advisable to resize active partition. However, we are going to perform this as there is no way to free up the system. - -Make sure you should take backup of important data before performing this action because if something goes wrong (For example, if power got failure or your system got rebooted), you can retain your data. - -### What Is Gparted - -[GParted][1] is a free partition manager that enables you to resize, copy, and move partitions without data loss. We can use all of the features of the GParted application is by using the GParted Live bootable image. GParted Live enables you to use GParted on GNU/Linux as well as other operating systems, such as Windows or Mac OS X. - -### 1) Check Disk Space Usage Using df Command - -I just want to show you about my partition using df command. The df command output clearly showing that i only have one partition. -``` -$ df -h -Filesystem Size Used Avail Use% Mounted on -/dev/sda1 30G 3.4G 26.2G 16% / -none 4.0K 0 4.0K 0% /sys/fs/cgroup -udev 487M 4.0K 487M 1% /dev -tmpfs 100M 844K 99M 1% /run -none 5.0M 0 5.0M 0% /run/lock -none 498M 152K 497M 1% /run/shm -none 100M 52K 100M 1% /run/user - -``` - -### 2) Check Disk Partition Using fdisk Command - -I’m going to verify this using fdisk command. -``` -$ sudo fdisk -l -[sudo] password for daygeek: - -Disk /dev/sda: 33.1 GB, 33129218048 bytes -255 heads, 63 sectors/track, 4027 cylinders, total 64705504 sectors -Units = sectors of 1 * 512 = 512 bytes -Sector size (logical/physical): 512 bytes / 512 bytes -I/O size (minimum/optimal): 512 bytes / 512 bytes -Disk identifier: 0x000473a3 - - Device Boot Start End Blocks Id System -/dev/sda1 * 2048 62609407 31303680 83 Linux -/dev/sda2 62611454 64704511 1046529 5 Extended -/dev/sda5 62611456 64704511 1046528 82 Linux swap / Solaris - -``` - -### 3) Download GParted live ISO Image - -Use the below command to download GParted live ISO to perform this action. -``` -$ wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso - -``` - -### 4) Boot Your System With GParted Live Installation Media - -Boot your system with GParted live installation media (like Burned CD/DVD or USB or ISO image). You will get the output similar to below screen. Here choose **GParted Live (Default settings)** and hit **Enter**. -![][3] - -### 5) Keyboard Selection - -By default it chooses the second option, just hit **Enter**. -![][4] - -### 6) Language Selection - -By default it chooses **33** for US English, just hit **Enter**. -![][5] - -### 7) Mode Selection (GUI or Command-Line) - -By default it chooses **0** for GUI mode, just hit **Enter**. -![][6] - -### 8) Loaded GParted Live Screen - -Now, GParted live screen is loaded. It is showing the list of partition which was created by me earlier. -![][7] - -### 9) How To Resize The root Partition - -Choose the root partition you want to resize, only one partition is available here so i’m going to edit that partition to install another OS. -![][8] - -To do so, press **Resize/Move** button to resize the partition. -![][9] - -Here, enter the size which you want take out from this partition in first box. I’m going to claim **10GB** so, i added **10240MB** and leave rest of boxes as default, then hit **Resize/Move** button -![][10] - -It will ask you once again to confirm to resize the partition because you are editing the live system partition, then hit **Ok**. -![][11] - -It has been successfully shrink the partition from 30GB to 20GB. Also shows Unallocated disk space of 10GB. -![][12] - -Finally click `Apply` button to perform remaining below operations. -![][13] - - * **`e2fsck`** e2fsck is a file system check utility that automatically repair the file system for bad sectors, I/O errors related to HDD. - * **`resize2fs`** The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. - * **`e2image`** The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file. - - - -**`e2fsck`** e2fsck is a file system check utility that automatically repair the file system for bad sectors, I/O errors related to HDD. -![][14] - -**`resize2fs`** The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. -![][15] - -**`e2image`** The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file. -![][16] - -All the operation got completed and close the dialog box. -![][17] - -Now, i could able to see **10GB** of Unallocated disk partition. -![][18] - -Reboot the system to check this. -![][19] - -### 10) Check Free Space - -Login to the system back and use fdisk command to see the available space in the partition. Yes i could see **10GB** of Unallocated disk space on this partition. -``` -$ sudo parted /dev/sda print free -[sudo] password for daygeek: -Model: ATA VBOX HARDDISK (scsi) -Disk /dev/sda: 32.2GB -Sector size (logical/physical): 512B/512B -Partition Table: msdos -Disk Flags: - -Number Start End Size Type File system Flags - 32.3kB 10.7GB 10.7GB Free Space - 1 10.7GB 32.2GB 21.5GB primary ext4 boot - -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility/ - -作者:[Magesh Maruthamuthu][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/magesh/ -[1]:https://gparted.org/ -[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[3]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-1.png -[4]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-2.png -[5]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-3.png -[6]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-4.png -[7]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-5.png -[8]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-6.png -[9]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-7.png -[10]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-8.png -[11]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-9.png -[12]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-10.png -[13]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-11.png -[14]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-12.png -[15]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-13.png -[16]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-14.png -[17]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-15.png -[18]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-16.png -[19]:https://www.2daygeek.com/wp-content/uploads/2014/08/how-to-resize-active-primary-root-partition-in-linux-using-gparted-utility-17.png diff --git a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md b/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md deleted file mode 100644 index 9bda5fa335..0000000000 --- a/sources/tech/20180429 The Easiest PDO Tutorial (Basics).md +++ /dev/null @@ -1,170 +0,0 @@ -The Easiest PDO Tutorial (Basics) -====== - -![](http://www.theitstuff.com/wp-content/uploads/2018/04/php-language.jpg) - -Approximately 80% of the web is powered by PHP. And similarly, high number goes for SQL as well. Up until PHP version 5.5, we had the **mysql_** commands for accessing mysql databases but they were eventually deprecated due to insufficient security. - -This happened with PHP 5.5 in 2013 and as I write this article, the year is 2018 and we are on PHP 7.2. The deprecation of mysql**_** brought 2 major ways of accessing the database, the **mysqli** and the **PDO** libraries. - -Now though the mysqli library was the official successor, PDO gained more fame due to a simple reason that mysqli could only support mysql databases whereas PDO could support 12 different types of database drivers. Also, PDO had several more features that made it the better choice for most developers. You can see some of the feature comparisons in the table below; - -| | PDO | MySQLi | -| Database support** | 12 drivers | Only MySQL | -| Paradigm | OOP | Procedural + OOP | -| Prepared Statements Client Side) | Yes | No | -| Named Parameters | Yes | No | - -Now I guess it is pretty clear why PDO is the choice for most developers, so let’s dig into it and hopefully we will try to cover most of the PDO you need in this article itself. - -### Connection - -The first step is connecting to the database and since PDO is completely Object Oriented, we will be using the instance of a PDO class. - -The first thing we do is we define the host, database name, user, password and the database charset. - -`$host = 'localhost';` - -`$db = 'theitstuff';` - -`$user = 'root';` - -`$pass = 'root';` - -`$charset = 'utf8mb4';` - -`$dsn = "mysql:host=$host;dbname=$db;charset=$charset";` - -`$conn = new PDO($dsn, $user, $pass);` - -After that, as you can see in the code above we have created the **DSN** variable, the DSN variable is simply a variable that holds the information about the database. For some people running mysql on external servers, you could also adjust your port number by simply supplying a **port=$port_number**. - -Finally, you can create an instance of the PDO class, I have used the **$conn** variable and I have supplied the **$dsn, $user, $pass** parameters. If you have followed this, you should now have an object named $conn that is an instance of the PDO connection class. Now it’s time to get into the database and run some queries. - -### A simple SQL Query - -Let us now run a simple SQL query. - -`$tis = $conn->query('SELECT name, age FROM students');` - -`while ($row = $tis->fetch())` - -`{` - -`echo $row['name']."\t";` - -`echo $row['age'];` - -`echo "
    ";` - -`}` - -This is the simplest form of running a query with PDO. We first created a variable called **tis( **short for TheITStuff** )** and then you can see the syntax as we used the query function from the $conn object that we had created. - -We then ran a while loop and created a **$row** variable to fetch the contents from the **$tis** object and finally echoed out each row by calling out the column name. - -Easy wasn’t it ?. Now let’s get to the prepared statement. - -### Prepared Statements - -Prepared statements were one of the major reasons people started using PDO as it had prepared statements that could prevent SQL injections. - -There are 2 basic methods available, you could either use positional or named parameters. - -#### Position parameters - -Let us see an example of a query using positional parameters. - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` - -`$tis->bindValue(1,'mike');` - -`$tis->bindValue(2,22);` - -`$tis->execute();` - -In the above example, we have placed 2 question marks and later used the **bindValue()** function to map the values into the query. The values are bound to the position of the question mark in the statement. - -I could also use variables instead of directly supplying values by using the **bindParam()** function and example for the same would be this. - -`$name='Rishabh'; $age=20;` - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(?, ?)");` - -`$tis->bindParam(1,$name);` - -`$tis->bindParam(2,$age);` - -`$tis->execute();` - -### Named Parameters - -Named parameters are also prepared statements that map values/variables to a named position in the query. Since there is no positional binding, it is very efficient in queries that use the same variable multiple time. - -`$name='Rishabh'; $age=20;` - -`$tis = $conn->prepare("INSERT INTO STUDENTS(name, age) values(:name, :age)");` - -`$tis->bindParam(':name', $name);` - -`$tis->bindParam(':age', $age);` - -`$tis->execute();` - -The only change you can notice is that I used **:name** and **:age** as placeholders and then mapped variables to them. The colon is used before the parameter and it is of extreme importance to let PDO know that the position is for a variable. - -You can similarly use **bindValue()** to directly map values using Named parameters as well. - -### Fetching the Data - -PDO is very rich when it comes to fetching data and it actually offers a number of formats in which you can get the data from your database. - -You can use the **PDO::FETCH_ASSOC** to fetch associative arrays, **PDO::FETCH_NUM** to fetch numeric arrays and **PDO::FETCH_OBJ** to fetch object arrays. - -`$tis = $conn->prepare("SELECT * FROM STUDENTS");` - -`$tis->execute();` - -`$result = $tis->fetchAll(PDO::FETCH_ASSOC);` - -You can see that I have used **fetchAll** since I wanted all matching records. If only one row is expected or desired, you can simply use **fetch.** - -Now that we have fetched the data it is time to loop through it and that is extremely easy. - -`foreach($result as $lnu){` - -`echo $lnu['name'];` - -`echo $lnu['age']."
    ";` - -`}` - -You can see that since I had requested associative arrays, I am accessing individual members by their names. - -Though there is absolutely no problem in defining how you want your data delivered, you could actually set one as default when defining the connection variable itself. - -All you need to do is create an options array where you put in all your default configs and simply pass the array in the connection variable. - -`$options = [` - -` PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,` - -`];` - -`$conn = new PDO($dsn, $user, $pass, $options);` - -This was a very brief and quick intro to PDO we will be making an advanced tutorial soon. If you had any difficulties understanding any part of the tutorial, do let me know in the comment section and I’ll be there for you. - - --------------------------------------------------------------------------------- - -via: http://www.theitstuff.com/easiest-pdo-tutorial-basics - -作者:[Rishabh Kandari][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.theitstuff.com/author/reevkandari diff --git a/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md b/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md deleted file mode 100644 index d04ee6d742..0000000000 --- a/sources/tech/20180529 Manage your workstation with Ansible- Configure desktop settings.md +++ /dev/null @@ -1,196 +0,0 @@ -Manage your workstation with Ansible: Configure desktop settings -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ) - -In the [first article][1] of this series on using Ansible to configure a workstation, we set up a repository and configured a few basic things. In the [second part][2], we automated Ansible to apply settings automatically when changes are made to our repository. In this third (and final) article, we'll use Ansible to configure GNOME desktop settings. - -This configuration will work only on newer distributions (such as Ubuntu 18.04, which I'll use in my examples). Older versions of Ubuntu will not work, as they ship with a version of `python-psutils` that is too old for Ansible's `dconf` module to work properly. If you're using a newer version of your Linux distribution, you should have no issues. - -Before you begin, make sure you've worked through parts one and two of this series, as part three builds upon that groundwork. If you haven't already, download the GitHub repository you've been using in those first two articles. We'll add a few more features to it. - -### Set a wallpaper and lock screen - -First, we'll create a taskbook to hold our GNOME settings. In the root of the repository, you should have a file named `local.yml`. Add the following line to it: -``` -- include: tasks/gnome.yml - -``` - -The entire file should now look like this: -``` -- hosts: localhost - -  become: true - -  pre_tasks: - -    - name: update repositories - -      apt: update_cache=yes - -      changed_when: False - - - -  tasks: - -    - include: tasks/users.yml - -    - include: tasks/cron.yml - -    - include: tasks/packages.yml - -    - include: tasks/gnome.yml - -``` - -Basically, this added a reference to a file named `gnome.yml` that will be stored in the `tasks` directory inside the repository. We haven't created this file yet, so let's do that now. Create `gnome.yml` file in the `tasks` directory, and place the following content inside: -``` -- name: Install python-psutil package - -  apt: name=python-psutil - - - -- name: Copy wallpaper file - -  copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - - - -- name: Set GNOME Wallpaper - -  become_user: jay - -  dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" - -``` - -Note that this code refers to my username (`jay`) several times, so make sure to replace every occurrence of `jay` with the username you use on your machine. Also, if you're not using Ubuntu 18.04 (as I am), you'll have to change the `apt` line to match the package manager for your chosen distribution and to confirm the name of the `python-psutil` package for your distribution, as it may be different. - -`wallpaper.jpg` inside the `files` directory. This file must exist or the Ansible configuration will fail. Inside the `tasks` directory, create a subdirectory named `files`. Find a wallpaper image you like, name it `wallpaper.jpg`, and place it inside the `files` directory. If the file is a PNG image instead of a JPG, change the file extension in both the code and in the repository. If you're not feeling creative, I have an example wallpaper file in the - -In the example tasks, I referred to a file namedinside thedirectory. This file must exist or the Ansible configuration will fail. Inside thedirectory, create a subdirectory named. Find a wallpaper image you like, name it, and place it inside thedirectory. If the file is a PNG image instead of a JPG, change the file extension in both the code and in the repository. If you're not feeling creative, I have an example wallpaper file in the [GitHub repository][3] for this article series that you can use. - -Once you've made all these changes, commit everything to your GitHub repository, and push those changes. To recap, you should've completed the following: - - * Modified the `local.yml` file to refer to the `tasks/gnome.yml` playbook - * Created the `tasks/gnome.yml` playbook with the content mentioned above - * Created a `files` directory inside the `tasks` directory, with an image file named `wallpaper.jpg` (or whatever you chose to call it). - - - -Once you've completed those steps and pushed your changes back to the repository, the configuration should be automatically applied during its next scheduled run. (You may recall that we automated this in the previous article.) If you're in a hurry, you can apply the configuration immediately with the following command: -``` -sudo ansible-pull -U https://github.com//ansible.git - -``` - -If everything ran correctly, you should see your new wallpaper. - -Let's take a moment to go through what the new GNOME taskbook does. First, we added a play to install the `python-psutil` package. If we don't add this, we can't use the `dconf` module, since it requires this package to be installed before we can modify GNOME settings. Next, we used the `copy` module to copy the wallpaper file to our `home` directory, and we named the resulting file starting with a period to hide it. If you'd prefer not to have this file in the root of your `home` directory, you can always instruct this section to copy it somewhere else—it will still work as long as you refer to it at the correct place. In the next play, we used the `dconf` module to change GNOME settings. In this case, we adjusted the `/org/gnome/desktop/background/picture-uri` key and set it equal to `file:///home/jay/.wallpaper.jpg`. Note the quotes in this section of the playbook—you must always use two single-quotes in `dconf` values, and you must also include double-quotes if the value is a string. - -Now, let's take our configuration a step further and apply a background to the lock screen. Here's the GNOME taskbook again, but with two additional plays added: -``` -- name: Install python-psutil package - -  apt: name=python-psutil - - - -- name: Copy wallpaper file - -  copy: src=files/wallpaper.jpg dest=/home/jay/.wallpaper.jpg owner=jay group=jay mode=600 - - - -- name: Set GNOME wallpaper - -  dconf: key="/org/gnome/desktop/background/picture-uri" value="'file:///home/jay/.wallpaper.jpg'" - - - -- name: Copy lockscreenfile - -  copy: src=files/lockscreen.jpg dest=/home/jay/.lockscreen.jpg owner=jay group=jay mode=600 - - - -- name: Set lock screen background - -  become_user: jay - -  dconf: key="/org/gnome/desktop/screensaver/picture-uri" value="'file:///home/jay/.lockscreen.jpg'" - -``` - -As you can see, we're pretty much doing the same thing as we did with the wallpaper. We added two additional tasks, one to copy the lock screen image and place it in our `home` directory, and another to apply the setting to GNOME so it will be used. Again, be sure to change your username from `jay` and also name your desired lock screen picture `lockscreen.jpg` and copy it to the `files` directory. Once you've committed these changes to your repository, the new lock screen should be applied during the next scheduled Ansible run. - -### Apply a new desktop theme - -Setting the wallpaper and lock screen background is cool and all, but let's go even further and apply a desktop theme. First, let's add an instruction to our taskbook to install the package for the `arc` theme. Add the following code to the beginning of the GNOME taskbook: -``` -- name: Install arc theme - -  apt: name=arc-theme - -``` - -Then, at the bottom, add the following play: -``` -- name: Set GTK theme - -  become_user: jay - -  dconf: key="/org/gnome/desktop/interface/gtk-theme" value="'Arc'" - -``` - -Did you see GNOME's GTK theme change right before your eyes? We added a play to install the `arc-theme` package via the `apt` module and another play to apply this theme to GNOME. - -### Make other customizations - -Now that you've changed some GNOME settings, feel free to add additional customizations on your own. Any setting you can tweak in GNOME can be automated this way; setting the wallpapers and the theme were just a few examples. You may be wondering how to find the settings that you want to change. Here's a trick that works for me. - -First, take a snapshot of ALL your current `dconf` settings by running the following command on the machine you're managing: -``` -dconf dump / > before.txt - -``` - -This command exports all your current changes to a file named `before.txt`. Next, manually change the setting you want to automate, and capture the `dconf` settings again: -``` -dconf dump / > after.txt - -``` - -Now, you can use the `diff` command to see what's different between the two files: -``` -diff before.txt after.txt - -``` - -This should give you a list of keys that changed. While it's true that changing settings manually defeats the purpose of automation, what you're essentially doing is capturing the keys that change when you update your preferred settings, which then allows you to create Ansible plays to modify those settings so you'll never need to touch those settings again. If you ever need to restore your machine, your Ansible repository will take care of each and every one of your customizations. If you have multiple machines, or even a fleet of workstations, you only have to manually make the change once, and all other workstations will have the new settings applied and be completely in sync. - -### Wrapping up - -If you've followed along with this series, you should know how to set up Ansible to automate your workstation. These examples offer a useful baseline, and you can use the syntax and examples to make additional customizations. As you go along, you can continue to add new modifications, which will make your Ansible configuration grow over time. - -I've used Ansible in this way to automate everything, including my user account and password; configuration files for Vim, tmux, etc.; desktop packages; SSH settings; SSH keys; and basically everything I could ever want to customize. Using this series as a starting point will pave the way for you to completely automate your workstations. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/5/manage-your-workstation-ansible-part-3 - -作者:[Jay LaCroix][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/jlacroix -[1]:https://opensource.com/article/18/3/manage-workstation-ansible -[2]:https://opensource.com/article/18/3/manage-your-workstation-configuration-ansible-part-2 -[3]:https://github.com/jlacroix82/ansible_article.git diff --git a/sources/tech/20180601 Get Started with Snap Packages in Linux.md b/sources/tech/20180601 Get Started with Snap Packages in Linux.md index 1693d3c44e..632151832a 100644 --- a/sources/tech/20180601 Get Started with Snap Packages in Linux.md +++ b/sources/tech/20180601 Get Started with Snap Packages in Linux.md @@ -1,12 +1,3 @@ -[#]: collector: (lujun9972) -[#]: translator: (pityonline) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Get Started with Snap Packages in Linux) -[#]: via: (https://www.linux.com/learn/intro-to-linux/2018/5/get-started-snap-packages-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) - Get Started with Snap Packages in Linux ====== @@ -148,7 +139,7 @@ via: https://www.linux.com/learn/intro-to-linux/2018/5/get-started-snap-packages 作者:[Jack Wallen][a] 选题:[lujun9972](https://github.com/lujun9972) -译者:[pityonline](https://github.com/pityonline) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md b/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md deleted file mode 100644 index f716a164a5..0000000000 --- a/sources/tech/20180604 BootISO - A Simple Bash Script To Securely Create A Bootable USB Device From ISO File.md +++ /dev/null @@ -1,172 +0,0 @@ -BootISO – A Simple Bash Script To Securely Create A Bootable USB Device From ISO File -====== -Most of us (including me) very often create a bootable USB device from ISO file for OS installation. - -There are many applications freely available in Linux for this purpose. Even we wrote few of the utility in the past. - -Every one uses different application and each application has their own features and functionality. - -In that few of applications are belongs to CLI and few of them associated with GUI. - -Today we are going to discuss about similar kind of utility called BootISO. It’s a simple bash script, which allow users to create a USB device from ISO file. - -Many of the Linux admin uses dd command to create bootable ISO, which is one of the native and famous method but the same time, it’s one of the very dangerous command. So, be careful, when you performing any action with dd command. - -**Suggested Read :** -**(#)** [Etcher – Easy way to Create a bootable USB drive & SD card from an ISO image][1] -**(#)** [Create a bootable USB drive from an ISO image using dd command on Linux][2] - -### What IS BootISO - -[BootIOS][3] is a simple bash script, which allow users to securely create a bootable USB device from one ISO file. It’s written in bash. - -It doesn’t offer any GUI but in the same time it has vast of options, which allow newbies to create a bootable USB device in Linux without any issues. Since it’s a intelligent tool that automatically choose if any USB device is connected on the system. - -It will print the list when the system has more than one USB device connected. When you choose manually another hard disk manually instead of USB, this will safely exit without writing anything on it. - -This script will also check for dependencies and prompt user for installation, it works with all package managers such as apt-get, yum, dnf, pacman and zypper. - -### BootISO Features - - * It checks whether the selected ISO has the correct mime-type or not. If no then it exit. - * BootISO will exit automatically, if you selected any other disks (local hard drive) except USB drives. - * BootISO allow users to select the desired USB drives when you have more than one. - * BootISO prompts the user for confirmation before erasing and paritioning USB device. - * BootISO will handle any failure from a command properly and exit. - * BootISO will call a cleanup routine on exit with trap. - - - -### How To Install BootISO In Linux - -There are few ways are available to install BootISO in Linux but i would advise users to install using the following method. -``` -$ curl -L https://git.io/bootiso -O -$ chmod +x bootiso -$ sudo mv bootiso /usr/local/bin/ - -``` - -Once BootISO installed, run the following command to list the available USB devices. -``` -$ bootiso -l - -Listing USB drives available in your system: -NAME HOTPLUG SIZE STATE TYPE -sdd 1 32G running disk - -``` - -If you have only one USB device, then simple run the following command to create a bootable USB device from ISO file. -``` -$ bootiso /path/to/iso file - -$ bootiso /opt/iso_images/archlinux-2018.05.01-x86_64.iso -Granting root privileges for bootiso. -Listing USB drives available in your system: -NAME HOTPLUG SIZE STATE TYPE -sdd 1 32G running disk -Autoselecting `sdd' (only USB device candidate) -The selected device `/dev/sdd' is connected through USB. -Created ISO mount point at `/tmp/iso.vXo' -`bootiso' is about to wipe out the content of device `/dev/sdd'. -Are you sure you want to proceed? (y/n)>y -Erasing contents of /dev/sdd... -Creating FAT32 partition on `/dev/sdd1'... -Created USB device mount point at `/tmp/usb.0j5' -Copying files from ISO to USB device with `rsync' -Synchronizing writes on device `/dev/sdd' -`bootiso' took 250 seconds to write ISO to USB device with `rsync' method. -ISO succesfully unmounted. -USB device succesfully unmounted. -USB device succesfully ejected. -You can safely remove it ! - -``` - -Mention your device name, when you have more than one USB device using `--device` option. -``` -$ bootiso -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - -``` - -By default bootios uses `rsync` command to perform all the action and if you want to use `dd` command instead of, use the following format. -``` -$ bootiso --dd -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - -``` - -If you want to skip `mime-type` check, include the following option with bootios utility. -``` -$ bootiso --no-mime-check -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - -``` - -Add the below option with bootios to skip user for confirmation before erasing and partitioning USB device. -``` -$ bootiso -y -d /dev/sde /opt/iso_images/archlinux-2018.05.01-x86_64.iso - -``` - -Enable autoselecting USB devices in conjunction with -y option. -``` -$ bootiso -y -a /opt/iso_images/archlinux-2018.05.01-x86_64.iso - -``` - -To know more all the available option for bootiso, run the following command. -``` -$ bootiso -h -Create a bootable USB from any ISO securely. -Usage: bootiso [...] - -Options - --h, --help, help Display this help message and exit. --v, --version Display version and exit. --d, --device Select block file as USB device. - If is not connected through USB, `bootiso' will fail and exit. - Device block files are usually situated in /dev/sXX or /dev/hXX. - You will be prompted to select a device if you don't use this option. --b, --bootloader Install a bootloader with syslinux (safe mode) for non-hybrid ISOs. Does not work with `--dd' option. --y, --assume-yes `bootiso' won't prompt the user for confirmation before erasing and partitioning USB device. - Use at your own risks. --a, --autoselect Enable autoselecting USB devices in conjunction with -y option. - Autoselect will automatically select a USB drive device if there is exactly one connected to the system. - Enabled by default when neither -d nor --no-usb-check options are given. --J, --no-eject Do not eject device after unmounting. --l, --list-usb-drives List available USB drives. --M, --no-mime-check `bootiso' won't assert that selected ISO file has the right mime-type. --s, --strict-mime-check Disallow loose application/octet-stream mime type in ISO file. --- POSIX end of options. ---dd Use `dd' utility instead of mounting + `rsync'. - Does not allow bootloader installation with syslinux. ---no-usb-check `bootiso' won't assert that selected device is a USB (connected through USB bus). - Use at your own risks. - -Readme - - Bootiso v2.5.2. - Author: Jules Samuel Randolph - Bugs and new features: https://github.com/jsamr/bootiso/issues - If you like bootiso, please help the community by making it visible: - * star the project at https://github.com/jsamr/bootiso - * upvote those SE post: https://goo.gl/BNRmvm https://goo.gl/YDBvFe - -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/bootiso-a-simple-bash-script-to-securely-create-a-bootable-usb-device-in-linux-from-iso-file/ - -作者:[Prakash Subramanian][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.2daygeek.com/author/prakash/ -[1]:https://www.2daygeek.com/etcher-easy-way-to-create-a-bootable-usb-drive-sd-card-from-an-iso-image-on-linux/ -[2]:https://www.2daygeek.com/create-a-bootable-usb-drive-from-an-iso-image-using-dd-command-on-linux/ -[3]:https://github.com/jsamr/bootiso diff --git a/sources/tech/20180605 How to use autofs to mount NFS shares.md b/sources/tech/20180605 How to use autofs to mount NFS shares.md deleted file mode 100644 index 815cb53708..0000000000 --- a/sources/tech/20180605 How to use autofs to mount NFS shares.md +++ /dev/null @@ -1,138 +0,0 @@ -How to use autofs to mount NFS shares -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) - -Most Linux file systems are mounted at boot and remain mounted while the system is running. This is also true of any remote file systems that have been configured in the `fstab` file. However, there may be times when you prefer to have a remote file system mount only on demand—for example, to boost performance by reducing network bandwidth usage, or to hide or obfuscate certain directories for security reasons. The package [autofs][1] provides this feature. In this article, I'll describe how to get a basic automount configuration up and running. - -`tree.mydatacenter.net` is up and running. Also assume a data directory named `ourfiles` and two user directories, for Carl and Sarah, are being shared by this server. - -First, a few assumptions: Assume the NFS server namedis up and running. Also assume a data directory namedand two user directories, for Carl and Sarah, are being shared by this server. - -A few best practices will make things work a bit better: It is a good idea to use the same user ID for your users on the server and any client workstations where they have an account. Also, your workstations and server should have the same domain name. Checking the relevant configuration files should confirm. -``` -alan@workstation1:~$ sudo getent passwd carl sarah - -[sudo] password for alan: - -carl:x:1020:1020:Carl,,,:/home/carl:/bin/bash - -sarah:x:1021:1021:Sarah,,,:/home/sarah:/bin/bash - - - -alan@workstation1:~$ sudo getent hosts - -127.0.0.1       localhost - -127.0.1.1       workstation1.mydatacenter.net workstation1 - -10.10.1.5       tree.mydatacenter.net tree - -``` - -As you can see, both the client workstation and the NFS server are configured in the `hosts` file. I’m assuming a basic home or even small office network that might lack proper internal domain name service (i.e., DNS). - -### Install the packages - -You need to install only two packages: `nfs-common` for NFS client functions, and `autofs` to provide the automount function. -``` -alan@workstation1:~$ sudo apt-get install nfs-common autofs - -``` - -You can verify that the autofs files have been placed in the `etc` directory: -``` -alan@workstation1:~$ cd /etc; ll auto* - --rw-r--r-- 1 root root 12596 Nov 19  2015 autofs.conf - --rw-r--r-- 1 root root   857 Mar 10  2017 auto.master - --rw-r--r-- 1 root root   708 Jul  6  2017 auto.misc - --rwxr-xr-x 1 root root  1039 Nov 19  2015 auto.net* - --rwxr-xr-x 1 root root  2191 Nov 19  2015 auto.smb* - -alan@workstation1:/etc$ - -``` - -### Configure autofs - -Now you need to edit several of these files and add the file `auto.home`. First, add the following two lines to the file `auto.master`: -``` -/mnt/tree  /etc/auto.misc - -/home/tree  /etc/auto.home - -``` - -Each line begins with the directory where the NFS shares will be mounted. Go ahead and create those directories: -``` -alan@workstation1:/etc$ sudo mkdir /mnt/tree /home/tree - -``` - -Second, add the following line to the file `auto.misc`: -``` -ourfiles        -fstype=nfs     tree:/share/ourfiles - -``` - -This line instructs autofs to mount the `ourfiles` share at the location matched in the `auto.master` file for `auto.misc`. As shown above, these files will be available in the directory `/mnt/tree/ourfiles`. - -Third, create the file `auto.home` with the following line: -``` -*               -fstype=nfs     tree:/home/& - -``` - -This line instructs autofs to mount the users share at the location matched in the `auto.master` file for `auto.home`. In this case, Carl and Sarah's files will be available in the directories `/home/tree/carl` or `/home/tree/sarah`, respectively. The asterisk (referred to as a wildcard) makes it possible for each user's share to be automatically mounted when they log in. The ampersand also works as a wildcard representing the user's directory on the server side. Their home directory should be mapped accordingly in the `passwd` file. This doesn’t have to be done if you prefer a local home directory; instead, the user could use this as simple remote storage for specific files. - -Finally, restart the `autofs` daemon so it will recognize and load these configuration file changes. -``` -alan@workstation1:/etc$ sudo service autofs restart - -``` - -### Testing autofs - -If you change to one of the directories listed in the file `auto.master` and run the `ls` command, you won’t see anything immediately. For example, change directory `(cd)` to `/mnt/tree`. At first, the output of `ls` won’t show anything, but after running `cd ourfiles`, the `ourfiles` share directory will be automatically mounted. The `cd` command will also be executed and you will be placed into the newly mounted directory. -``` -carl@workstation1:~$ cd /mnt/tree - -carl@workstation1:/mnt/tree$ ls - -carl@workstation1:/mnt/tree$ cd ourfiles - -carl@workstation1:/mnt/tree/ourfiles$ - -``` - -To further confirm that things are working, the `mount` command will display the details of the mounted share. -``` -carl@workstation1:~$ mount - -tree:/mnt/share/ourfiles on /mnt/tree/ourfiles type nfs4 (rw,relatime,vers=4.0,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.10.1.22,local_lock=none,addr=10.10.1.5) - -``` - -The `/home/tree` directory will work the same way for Carl and Sarah. - -I find it useful to bookmark these directories in my file manager for quicker access. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/6/using-autofs-mount-nfs-shares - -作者:[Alan Formy-Duval][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/alanfdoss -[1]:https://wiki.archlinux.org/index.php/autofs diff --git a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md b/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md deleted file mode 100644 index 664c054913..0000000000 --- a/sources/tech/20180611 3 open source alternatives to Adobe Lightroom.md +++ /dev/null @@ -1,84 +0,0 @@ -3 open source alternatives to Adobe Lightroom -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/camera-photography-film.jpg?itok=oe2ixyu6) - -You wouldn't be wrong to wonder whether the smartphone, that modern jack-of-all-trades, is taking over photography. While that might be valid in the point-and-shoot camera market, there are a sizeable number of photography professionals and hobbyists who recognize that a camera that fits in your pocket can never replace a high-end DSLR camera and the depth, clarity, and realism of its photos. - -All of that power comes with a small price in terms of convenience; like negatives from traditional film cameras, the [raw image][1] files produced by DSLRs must be processed before they can be edited or printed. For this, a digital image processing application is indispensable, and the go-to application has been Adobe Lightroom. But for many reasons—including its expensive, subscription-based pricing model and its proprietary license—there's a lot of interest in open source and other alternatives. - -Lightroom has two main functions: processing raw image files and digital asset management (DAM)—organizing images with tags, ratings, and other metadata to make it easier to keep track of them. - -In this article, we'll look at three open source image processing applications: Darktable, LightZone, and RawTherapee. All of them have DAM capabilities, but none has Lightroom's machine learning-based image categorization and tagging features. If you're looking for more information about open source DAM software, check out Terry Hancock's article "[Digital asset management for an open movie project][2]," where he shares his research on software to organize multimedia files for his [_Lunatics!_][3] open movie project. - -### Darktable - -![Darktable][4] - -Like the other applications on our list, [darktable][5] processes raw images into usable file formats—it exports into JPEG, PNG, TIFF, PPM, PFM, and EXR, and it also supports Google and Facebook web albums, Flickr uploads, email attachments, and web gallery creation. - -Its 61 image operation modules allow you to adjust contrast, tone, exposure, color, noise, etc.; add watermarks; crop and rotate; and much more. As with the other applications described in this article, those edits are "non-destructive"—that is, your original raw image is preserved no matter how many tweaks and modifications you make. - -Darktable imports raw images from more than 400 cameras plus JPEG, CR2, DNG, OpenEXR, and PFM; images are managed in a database so you can filter and search using metadata including tags, ratings, and color. It's also available in 21 languages and is supported on Linux, MacOS, BSD, Solaris 11/GNOME, and Windows. (The [Windows port][6] is new, and darktable warns it may have "rough edges or missing functionality" compared to other versions.) - -Darktable is licensed under [GPLv3][7]; you can learn more by perusing its [features][8], viewing the [user manual][9], or accessing its [source code][10] on GitHub. - -### LightZone - -![LightZone's tool stack][11] - -As a non-destructive raw image processing tool, [LightZone][12] is similar to the other two applications on this list: it's cross-platform, operating on Windows, MacOS, and Linux, and it supports JPG and TIFF images in addition to raw. But it's also unique in several ways. - -For one thing, it started out in 2005 as a proprietary image processing tool and later became an open source project under a BSD license. Also, before you can download the application, you must register for a free account; this is so the LightZone development community can track downloads and build the community. (Approval is quick and automated, so it's not a large barrier.) - -Another difference is that image modifications are done using stackable tools, rather than filters (like most image-editing applications); tool stacks can be rearranged or removed, as well as saved and copied to a batch of images. You can also edit certain parts of an image using a vector-based tool or by selecting pixels based on color or brightness. - -You can get more information on LightZone by searching its [forums][13] or accessing its [source code][14] on GitHub. - -### RawTherapee - -![RawTherapee][15] - -[RawTherapee][16] is another popular open source ([GPL][17]) raw image processor worth your attention. Like darktable and LightZone, it is cross-platform (Windows, MacOS, and Linux) and implements edits in a non-destructive fashion, so you maintain access to your original raw image file no matter what filters or changes you make. - -RawTherapee uses a panel-based interface, including a history panel to keep track of your changes and revert to a previous point; a snapshot panel that allows you to work with multiple versions of a photo; and scrollable tool panels to easily select a tool without worrying about accidentally using the wrong one. Its tools offer a wide variety of exposure, color, detail, transformation, and demosaicing features. - -The application imports raw files from most cameras and is localized to more than 25 languages, making it widely usable. Features like batch processing and [SSE][18] optimizations improve speed and CPU performance. - -RawTherapee offers many other [features][19]; check out its [documentation][20] and [source code][21] for details. - -Do you use another open source raw image processing tool in your photography? Do you have any related tips or suggestions for other photographers? If so, please share your recommendations in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/alternatives/adobe-lightroom - -作者:[Opensource.com][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com -[1]:https://en.wikipedia.org/wiki/Raw_image_format -[2]:https://opensource.com/article/18/3/movie-open-source-software -[3]:http://lunatics.tv/ -[4]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_darkroom1.jpg?itok=0fjk37tC (Darktable) -[5]:http://www.darktable.org/ -[6]:https://www.darktable.org/about/faq/#faq-windows -[7]:https://github.com/darktable-org/darktable/blob/master/LICENSE -[8]:https://www.darktable.org/about/features/ -[9]:https://www.darktable.org/resources/ -[10]:https://github.com/darktable-org/darktable -[11]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_lightzone1tookstack.jpg?itok=1e3s85CZ (LightZone's tool stack) -[12]:http://www.lightzoneproject.org/ -[13]:http://www.lightzoneproject.org/Forum -[14]:https://github.com/ktgw0316/LightZone -[15]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/uploads/raw-image-processors_rawtherapee.jpg?itok=meiuLxPw (RawTherapee) -[16]:http://rawtherapee.com/ -[17]:https://github.com/Beep6581/RawTherapee/blob/dev/LICENSE.txt -[18]:https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions -[19]:http://rawpedia.rawtherapee.com/Features -[20]:http://rawpedia.rawtherapee.com/Main_Page -[21]:https://github.com/Beep6581/RawTherapee diff --git a/sources/tech/20180629 100 Best Ubuntu Apps.md b/sources/tech/20180629 100 Best Ubuntu Apps.md deleted file mode 100644 index 487ebd6e7d..0000000000 --- a/sources/tech/20180629 100 Best Ubuntu Apps.md +++ /dev/null @@ -1,1185 +0,0 @@ -DaivdMax2006 is translating -100 Best Ubuntu Apps -====== - -Earlier this year we have published the list of [20 Best Ubuntu Applications for 2018][1] which can be very useful to many users. Now we are almost in the second half of 2018, so today we are going to have a look at 100 best applications for Ubuntu which you will find very useful. - -![100 Best Ubuntu Apps][2] - -Many users who have recently switched to Ubuntu from Microsoft Windows or any other operating system face the dilemma of finding best alternative to application software they have been using for years on their previous OS. Ubuntu has thousands of free to use and open-source application software’s that perform way better than many paid software’s on Windows and other OS. - -Following list features many application software in various categories, so that you can find best application which best matched to your requirements. - -### **1\. Google Chrome Browser** - -Almost all the Linux distributions feature Mozilla Firefox web browser by default and it is a tough competitor to Google Chrome. But Chrome has its own advantages over Firefox like Chrome gives you direct access to your Google account from where you can sync bookmarks, browser history, extensions, etc. from Chrome browser on other operating systems and mobile phones. - -![Chrome][3] - -Google Chrome features up-to-date Flash player for Linux which is not the case with other web browsers on Linux including Mozilla Firefox and Opera web browser. If you continuously use Chrome on Windows then it is best choice to use it on Linux too. - -### 2\. **Steam** - -Gaming on Linux is a real deal now, which was a distant dream few years ago. In 2013, Valve announced Steam gaming client for Linux and everything has changed since then. Earlier users were hesitant to switch to Linux from Windows just because they would not be able to play their favourite games on Ubuntu but that is not the case now. - -![Steam][4] - -Some users might find installing Steam on Linux tricky but it worth all your efforts as thousands of Steam games are available for Linux. Some popular high-end games like Counter Strike: Global Offensive, Hitman, Dota 2 are available for Linux, you just need to make sure you have minimum hardware required to play these games. - -``` -$ sudo add-apt-repository multiverse - -$ sudo apt-get update - -$ sudo apt-get install steam -``` - -### **3\. WordPress Desktop Client** - -Yes you read it correct, WordPress has its dedicated desktop client for Ubuntu from where you can manage your WordPress sites. You can also write and design separately on desktop client without need for switching browser tabs. - -![][5] - -If you have websites backed by WordPress then this desktop client is must have application for you as you can also keep track of all the WordPress notifications in one single window. You can also check stats for performance of posts on website. Desktop client is available in Ubuntu Software Centre from where you can download and install it. - -### **4\. VLC Media Player** - -VLC is a very popular cross-platform and open-source media player which is also available for Ubuntu. What makes VLC a best media player is that it can play videos in all the Audio and Video formats available on planet without any issue. - -![][6] - -VLC has a slick user interface which is very easy to use and apart from that it offers lot of features such as online video streaming, audio and video customization, etc. - -``` -$ sudo add-apt-repository ppa:videolan/master-daily -$ sudo apt update -$ sudo apt-get install vlc qtwayland5 -``` - -### **5\. Atom Text Editor** - -Having developed by Github, Atom is a free and open-source text editor which can also be used as Integrated Development Environment (IDE) for coding and editing in major programming languages. Atom developers claim it to be a completely hackable text editor for 21st Century. - -![][7] - -Atom Text Editor has one of the best user interfaces and it is a feature rich text editor with offerings like auto-completion, syntax highlighting and support of extensions and plug-ins. - -``` -$ sudo add-apt-repository ppa:webupd8team/atom -$ sudo apt-get update -$ sudo apt-get install atom -``` - -### **6\. GIMP Photo Editor** - -GIMP (GNU Image Manipulation Programme) is free and open-source photo editor for Ubuntu. It is arguably a best alternative to Adobe Photoshop on Windows. If you have been continuously using Adobe Photoshop and finding it difficult to get used to GIMP, then you can customize GIMP to look very similar to Photoshop. - -![][8] - -GIMP is a feature rich Photo editor and you can always use additional features by installing extensions and plug-ins anytime. - -``` -$ sudo apt-get install gimp -``` - -### **7\. Google Play Music Desktop Player** - -Google Play Music Desktop Player is an open-source music player which is replica of Google Play Music or you can say it’s better than that. Google always lacked a desktop music client but this third-party app fills the void perfectly. - -![][9] - -Like you can see in above screenshot, its interface is second to none in terms of look and feel. You just need to sign in into Google account and then it will import all your music and favorites into this desktop client. You can download installation files from its official [website][10] and install it using Software Center. - -### **8\. Franz** - -Franz is an instant messaging client that combines chat and messaging services into one application. It is one of the modern instant messaging platforms and it supports Facebook Messenger, WhatsApp, Telegram, HipChat, WeChat, Google Hangouts, Skype integration under one single application. - -![][11] - -Franz is complete messaging platform which you can use for business as well to manage mass customer service. To install Franz you need to download installation package from its [website][12] and open it using Software Center. - -### **9\. Synaptic Package Manager** - -Synaptic Package Manager is one of the must have tools on Ubuntu because it works for graphical interface for ‘apt-get’ command which we usually use to install apps on Ubuntu using Terminal. It gives tough competition to default app stores on various Linux distros. - -![][13] - -Synaptic comes with very simple user interface which is very fast and easy to use as compared to other app stores. On left-hand side you can browse various apps in different categories from where you can easily install and uninstall apps. - -``` -$ sudo apt-get install synaptic -``` - -### **10\. Skype** - -Skype is a very popular cross-platform video calling application which is now also available for Linux as a Snap app. Skype is an instant messaging application which offers features like voice and video calls, desktop screen sharing, etc. - -![][14] - -Skype has an excellent user interface which very similar to desktop client on Windows and it is very easy to use. It could be very useful app for many switchers from Windows. - -``` -$ sudo snap install skype -``` - -### **13\. VirtualBox** - -VirtualBox is a cross-platform virtualization software application developed by Oracle Corporation. If you love trying out new operating systems then VirtualBox is the must have Ubuntu application for you. You can tryout Linux, Mac inside Windows Operating System or Windows and Mac inside Linux. - -![][15] - -What VB actually does is it lets you run guest operating system on host operating system virtually. It creates virtual hard drive and installs guest OS on it. You can download and install VB directly from Ubuntu Software Center. - -### **12\. Unity Tweak Tool** - -Unity Tweak Tool (Gnome Tweak Tool) is must have tool for every Linux user because it gives user ability to customize desktop according to your need. You can try new GTK themes, set up desktop hot corners, customize icon set, tweak unity launcher, etc. - -![][16] - -Unity Tweak Tool can be very useful to user as it has everything covered right from the basic to advanced configurations. - -``` -$ sudo apt-get install unity-tweak-tool -``` - -### **13\. Ubuntu Cleaner** - -Ubuntu Cleaner is a system maintenance tool especially designed to remove packages that are no longer useful, remove unnecessary apps and clean-up browser caches. Ubuntu Cleaner has very simple user interface which is very easy to use. - -![][17] - -Ubuntu Cleaner is one of the best alternatives to BleachBit which is also a decent cleaning tool available for Linux distros. - -``` -$ sudo add-apt-repository ppa:gerardpuig/ppa -$ sudo apt-get update -$ sudo apt-get install ubuntu-cleaner -``` - -### 14\. Visual Studio Code - -Visual Studio Code is code editor which you will find very similar to Atom Text Editor and Sublime Text if you have already used them. Visual Studio Code proves to be very good educational tool as it explains everything from HTML tags to syntax in programming. - -![][18] - -Visual Studio comes with Git integration out of the box and it has excellent user interface which you will find very similar to likes of Atom Text Editor and Sublime Text. You can download and install it from Ubuntu Software Center. - -### **15\. Corebird** - -If you are looking for desktop client where you can use your Twitter then Corebird Twitter Client is the app you are looking for. It is arguably best Twitter client available for Linux distros and it offers features very similar to Twitter app on your mobile phone. - -![][19] - -Corebird Twitter Client also gives notifications whenever someone likes and retweets your tweet or messages you. You can also add multiple Twitter accounts on this client. - -``` -$ sudo snap install corebird -``` - -### **16\. Pixbuf** - -Pixbuf is a desktop client from Pixbuf photo community hub which lets you upload, share and sale your photos. It supports photo sharing to social media networks like Facebook, Pinterest, Instagram, Twitter, etc. and photography services including Flickr, 500px and Youpic. - -![][20] - -Pixbuf offers features like analytics which gives you stats about clicks, retweets, repins on your photo, scheduled posts, dedicated iOS extension. It also has mobile app, so that you can always be connected with your Pixbuf account from anywhere. Pixbuf is available for download in Ubuntu Software Center as a snap package. - -### **17\. Clementine Music Player** - -Clementine is a cross-platform music player and a good competitor to Rhythmbox which is default music player on Ubuntu. It is fast and easy to use music player thanks to its user friendly interface. It supports audio playback in all the major audio file formats. - -![][21] - -Apart from playing music from local library you can also listen to online radio from Spotify, SKY.fm, Soundcloud, etc. It also offers other features like smart and dynamic playlists, syncing music from cloud storages like Dropbox, Google Drive, etc. - -``` -$ sudo add-apt-repository ppa:me-davidsansome/clementine -$ sudo apt-get update -$ sudo apt-get install clementine -``` - -### **18\. Blender** - -Blender is free and open-source 3D creation application software which you can use to create 3D printed models, animated films, video games, etc. It comes with integrated game engine out of the box which you can use to develop and test video games. - -![blender][22] - -Blender has catchy user interface which is easy to use and it includes features like built-in render engine, digital sculpturing, simulation tool, animation tools and many more. It is one of the best applications you will ever find for Ubuntu considering it’s free and features it offers. - -### **19\. Audacity** - -Audacity is an open-source audio editing application which you can use to record, edit audio files. You can record audio from various inputs like microphone, electric guitar, etc. It also gives ability to edit and trim audio clips according to your need. - -![][23] - -Recently Audacity released with new features for Ubuntu which includes theme improvements, zoom toggle command, etc. Apart from these it offers features like various audio effects including noise reduction and many more. - -``` -$ sudo add-apt-repository ppa:ubuntuhandbook1/audacity -$ sudo apt-get update -$ sudo apt-get install audacity -``` - -### **20\. Vim** - -Vim is an Integrated Development Environment which you can use as standalone application or command line interface for programming in various major programming languages like Python. - -![][24] - -Most of the programmers prefer coding in Vim because it is fast and highly customizable IDE. Initially you might find it difficult to use but you will quickly get used to it. - -``` -$ sudo apt-get install vim -``` - -### **21\. Inkscape** - -Inkscape is an open-source and cross-platform vector graphics editor which you will find very much similar to Corel Draw and Adobe Illustrator. Using it you can create and edit vector graphics such as charts, logos, diagrams, illustrations, etc. - -![][25] - -Inkscape uses Scalable Vector Graphics (SVG) and an open XML-based W3C standard as a primary format. It supports various formats including JPEG, PNG, GIF, PDF, AI (Adobe Illustrator Format), VSD, etc. - -``` -$ sudo add-apt-repository ppa:inkscape.dev/stable -$ sudo apt-get update -$ sudo apt-get install inkscape -``` - -### **22\. Shotcut** - -Shotcut is a free, open-source and cross-platform video editing application developed by Meltytech, LLC on the MLT Multimedia Framework. It is one of the most powerful video editors you will ever find for Linux distros as it supports all the major audio, video and image formats. - -![][26] - -It gives ability to edit multiple tracks with various file formats using non-linear video editing. It also comes with support for 4K video resolutions and features like various audio and video filters, tone generator, audio mixing and many others. - -``` -snap install shotcut -- classic -``` - -### **23\. SimpleScreenRecorder** - -SimpleScreenRecorder is a free and lightweight screen video recorder for Ubuntu. This screen recorder can be very useful tool for you if you are a YouTube creator or application developer. - -![][27] - -It can capture a video/audio record of desktop screen or record video games directly. You can set video resolution, frame rate, etc. before starting the screen recording. It has simple user interface which you will find very easy to use. - -``` -$ sudo add-apt-repository ppa:marten-baert/simplescreenrecorder -$ sudo apt-get update -$ sudo apt-get install simplescreenrecorder -``` - -### **24\. Telegram** - -Telegram is a cloud-based instant messaging and VoIP platform which has got lot of popularity in recent years. It is an open-source and cross-platform messenger where user can send messages, share videos, photos, audio and other files. - -![][28] - -Some of the notable features in Telegram are secrete chats, voice messages, bots, telescope for video messages, live locations and social login. Privacy and security is at highest priority in Telegram, so all messages you send and receive are end-to-end encrypted. - -``` -``` -$ sudo snap install telegram-desktop - -### **25\. ClamTk** - -As we know viruses meant to harm Windows PC cannot do any harm to Ubuntu but it is always prone to get infected by some mails from Windows PC containing harmful files. So it is safe to have some antivirus applications on Linux too. - -![][29] - -ClamTk is a lightweight malware scanner which scans files and folders on your system and cleans if any harmful files are found. ClamTk is available as a Snap package and can be downloaded from Ubuntu Software Center. - -### **26\. MailSpring** - -MailSpring earlier known as Nylas Mail or Nylas N1 is an open-source email client. It saves all the mails locally on computer so that you can access them anytime you need. It features advanced search which uses AND and OR operations so that you can search for mails based on different parameters. - -![][30] - -MailSpring comes with excellent user interface which you will find only on handful of other mail clients. Privacy and security, scheduler, contact manager, calendar are some of the features MailSpring offers. - -### **27\. PyCharm** - -PyCharm is one of my favorite Python IDEs after Vim because it has slick user interface with lot of extensions and plug-in support. Basically it comes in two editions, one is community edition which is free and open-source and other is professional edition which is paid one. - -![][31] - -PyCharm is highly customizable IDE and sports features such as error highlighting, code analysis, integrated unit testing and Python debugger, etc. PyCharm is the preferred IDE by most of the Python programmers and developers. - -### **28\. Caffeine** - -Imagine you are watching something on YouTube or reading a news article and suddenly Ubuntu locks your screen, I know that is very annoying. It happens with many of us, so Caffeine is the tool that will help you block the Ubuntu lock screen or screensaver. - -![][32] - -Caffeine Inhibitor is lightweight tool, it adds icon on notification bar from where you can activate or deactivate it easily. No additional setting needs to be done in order to use this tool. - -``` -$ sudo add-apt-repository ppa:eugenesan/ppa -$ sudo apt-get update -$ sudo apt-get install caffeine -y -``` - -### **29\. Etcher USB Image Writer** - -Etcher is an open-source USB Image Writer developed by resin.io. It is a cross-platform application which helps you burn image files like ZIP, ISO, IMG to USB storage. If you always try out new OS then Etcher is the must have tool for you as it is easy to use and reliable. - -![][33] - -Etcher has clean user interface that guides you through process of burning image file to USB drive or SD card in three easy steps. Steps involve selecting Image file, selecting USB drive and finally flash (writes files to USB drive). You can download and install Etcher from its [website][34]. - -### **30\. Neofetch** - -Neofetch is a cool system information tool that gives you all the information about your system by running “neofetch” command in Terminal. It is cool tool to have because it gives you information about desktop environment, kernel version, bash version and GTK theme you are running. - -![][35] - -As compared to other system information tools Nefetch is highly customizable tool. You can perform various customizations using command line. - -``` -$ sudo add-apt-repository ppa:dawidd0811/neofetch -$ sudo apt-get update -$ sudo apt-get update install neofetch -``` - -### 31\. Liferea - -Liferea (Linux Feed Reader) is a free and open-source news aggregator for online news feeds. It is a fast and easy to use new aggregator that supports various formats such as RSS/RDF, Atom, etc. - -![][36] -Liferea comes with sync support with TinyTinyRSS out of the box and it gives you an ability to read feeds in offline mode. It is one of the best feed readers you will find for Linux in terms of reliability and flexibility. - -``` -$ sudo add-apt-repository ppa:ubuntuhandbook1/apps -$ sudo apt-get update -$ sudo apt-get install liferea -``` - -### 32\. Shutter - -It is easy to take screenshots in Ubuntu but when it comes to edit screenshots Shutter is the must have application for you. It helps you capture, edit and share screenshots easily. Using Shutter’s selector tool you can select particular part of your screen to take screenshot. - -![][37] - -Shutter is a feature-rich screenshot tool which offers features like adding effects to screenshot, draw lines, etc. It also gives you option to upload your screenshot to various image hosting sites. You can directly download and install Shutter from Software Center. - -### 33\. Weather - -Weather is a small application which gives you real-time weather information for your city or any other location in the world. It is simple and lightweight tool which gives you detailed forecast of up to 7 days and hourly details for current and next day. - -![][38] - -It integrates with GNOME shell to give you information about current weather conditions at recently searched locations. It has minimalist user interface which works smoothly on minimum hardware requirement. - -### 34\. Ramme - -Ramme is cool unofficial Instagram desktop client which gives you feel of Instagram mobile phone app. It is an Electron-based client so it replicates Instagram app and offers features like theme customization, etc. - -![][39] - -But due to Instagram’s API restrictions you can’t upload image using Ramme client but you can always go through Instagram feed, like and comment on posts, message friends. You can download Ramme installation files from[Github.][40] - -### **35\. Thunderbird** - -Thunderbird is an open-source email client which is also a default email client in most of the Linux distributions. Despite parting ways with Mozilla in 2017, Thunderbird is still very popular and best email client on Linux platform. It comes with features like spam filtering, IMAP and POP email syncing, calendar support, address book integration and many other features out of the box. - -![][41] - -It is a cross-platform email client with full community support across all supported platforms. You can always change its look and feel thanks to its highly customizable nature. - -### **36\. Pidgin** - -Pidgin is an instant messaging client where you can login into different instant messaging networks under single window. You can login to instant messaging networks like Google Talk, XMPP, AIM, Bonjour, etc. - -![][42] - -Pidgin has all the features you can expect in an instant messenger and you can always enhance its performance by installing additional plug-ins. - -``` -``` -$ sudo apt-get install pidgin - -### **37\. Krita** - -Krita is a free and open-source digital painting, editing and animation application developed by KDE. It has excellent user interface with everything placed perfectly so that you can easily find the tool you need. - -![][43] - -It uses OpenGL canvas which boosts Krita’s performance and it offers many features like different painting tools, animation tools, vector tools, layers and masks and many more. Krita is available in Ubuntu Software Center, you can easily download it from there. - -### **38\. Dropbox** - -Dropbox is stand-out player in cloud storage and its Linux clients works really well on Ubuntu once installed properly. While Google Drive comes out of the box on Ubuntu 16.04 LTS and later, Dropbox is still a preferred cloud storage tool on Linux in terms of features it offers. - -![][44] -It always works in background and back up new files from your system to cloud storage, syncs files continuously between your computer and its cloud storage. - -``` -$ sudo apt-get install nautilus-dropbox -``` - -### 39\. Kodi - -Kodi formerly known as Xbox Media Center (XBMC) is an open-source media player. You can play music, videos, podcasts and video games both in online and offline mode. This software was first developed for first generation of Xbox gaming console and then slowly ported to personal computers. - -![][45] - -Kodi has very impressive video interface which is fast and powerful. It is highly customizable media player and by installing additional plug-ins you can access online streaming services like Pandora, Spotify, Amazon Prime Video, Netflix and YouTube. - -### **40\. Spotify** - -Spotify is one of the best online media streaming sites. It provides music, podcast and video streaming services both on free and paid subscription basis. Earlier Spotify was not supported on Linux but now it has its own fully functional desktop client for Ubuntu. - -![][46] - -Alongside Google Play Music Desktop Player, Spotify is must have media player for you. You just need to login to your Spotify account to access your favorite online content from anywhere. - -### 41\. Brackets - -Brackets is an open-source text editor developed by Adobe. It can be used for web development and design in web technologies such as HTML, CSS and JavaScript. It sports live preview mode which is great feature to have as it can get real-time view of whatever the changes you make in script. - -![][47] - -It is one of the modern text editors on Ubuntu and has slick user interface which takes web development task to new level. It also offers features like inline editor and supports for popular extensions like Emmet, Beautify, Git, File Icons, etc. - -### 42\. Bitwarden - -Account safety is serious concern now as we can see rise in security breaches in which users passwords are stolen and important data being compromised. So Bitwarden is recommended tool for you which stores all your account logins and passwords safe and secure at one place. - -![][48] - -Bitwarden uses AES-256 bit encryption technique to store all the login details and only user has access to his data. It also helps you to create strong passwords which are less likely to be hacked. - -### 43\. Terminator - -Terminator is an open-source terminal emulator programmed and developed in Java. It is a cross-platform emulator which lets you have privilege of multiple terminals in one single window which is not the case in Linux default terminal emulator. - -![][49] - -Other stand-out feature in Terminator includes automatic logging, drag and drop, intelligent vertical and horizontal scrolling, etc. - -``` -$ sudo apt-get install terminator -``` - -### 44\. Yak Yak - -Yak Yak is an open-source unofficial desktop client for Google Hangouts messenger. It could be good alternative to Microsoft’s Skype as it comes with bunch of some amazing features out of the box. You can enable desktop notifications, language preferences, and works on minimal memory and power requirements. - -![][50] - -Yak Yak comes with all the features you would expect in any instant messaging app such as typing indicator, drag and drop media files, and audio/video calling. - -### 45\. **Thonny** - -Thonny is a simple and lightweight IDE especially designed for beginners in programming. If you are new to programming then this is the must have IDE for you because it lets you learn while programming in Python. - -![][51] - -Thonny is also great tool for debugging as it supports live variables during debugging, apart from this it offers features like separate windows for executing function call, simple user interface, etc. - -``` -$ sudo apt-get install thonny -``` - -### **46\. Font Manager** - -Font Manager is a lightweight tool for managing, adding or removing fonts on your Ubuntu system. It is specially built for Gnome desktop environment, users don’t having idea about managing fonts using command line will find this tool very useful. - -![][52] - -Gtk+ Font Manager is not meant to be for professional users, it has simple user interface which you will find very easy to navigate. You just need to download font files from internet and add them using Font Manager. - -$ sudo add-apt-repository ppa:font-manager/staging -$ sudo apt-get update -$ sudo apt-get install font-manager - -### **47\. Atril Document Viewer** - -Atril is a simple document viewer which supports file formats like Portable Document Format (PDF), PostScript (PS), Encapsulated PostScript (EPS), DJVU and DVI. Atril comes bundled with MATE desktop environment and it is identical to Evince which is default document on the most of the Linux distros. - -![][53] - -Atril has simple and lightweight user interface which is highly customizable and offers features like search, bookmarks and UI includes thumbnails on the left-hand side. - -``` -$ sudo apt-get install atril -``` - -### **48\. Notepadqq** - -If you have ever used Notepad++ on Windows and looking for similar program on Linux then don’t worry developers have ported it to Linux as Notepadqq. It is a simple yet powerful text editor which you can use for daily tasks or programming in various languages. - -![][54] - -Despite being a simple text editor it has some amazing features like you can set theme between dark and light color scheme, multiple selection, regular expression search and real-time highlighting. - -``` -$ sudo add-apt-repository ppa:notpadqq-team/notepadqq -$ sudo apt-get update -$ sudo apt-get install notepadqq -``` - -### **49\. Amarok** - -Amarok is an open-source music player developed under KDE projetct. It has an intuitive interface which makes you feel home so you can discover your favorite music easily. Besides Clementine, Amarok is very good choice to have when you are looking for perfect music player for Ubuntu. - -![][55] - -Some of the top features in Amarok include intelligent playlist support, integration support for online services like MP3tunes, Last.fm, Magnatune, etc. - -### **50\. Cheese** - -Cheese is a Linux default webcam application which can be useful to you in some video chat or instant messaging applications. Apart from that you can also use this app to take photos and videos with fancy effects. - -![][56] - -It also sports burst mode which lets you take multiple snaps in quick succession and option to share your photos with friends and family. Cheese come pre-installed with most of the Linux distros but you can also download and install it from Software Center. - -### **51\. MyPaint** - -MyPaint is a free and open-source raster graphics editor which focuses on digital painting rather than image manipulation and post processing. It is cross-platform application and more or less similar to Corel Painter. - -![][57] - -MyPaint could be good alternative to those who use Microsoft Paint application on Windows. It has simple user interface which is fast and powerful. MyPaint is available is Software Center for download. - -### **52\. PlayOnLinux** - -PlayOnLinux is a front-end for WINE emulator which allows you to run Windows applications on Linux. You just need to install Windows applications and game on WINE then you can easily launch applications and games using PlayOnLinux. - -![][58] - -### **53\. Akregator** - -Akregator is a default RSS reader for KDE Plasma Environment developed under KDE project. It has simple user interface and comes with KDE’s Konqueror browser so that you don’t need to switch between apps while reading news feeds. - -![][59] - -Akregator also offers features like desktop notifications, automatic feeds, etc. It is one of the best feed readers you will find for across most of the Linux distros. - -### **54\. Brave** - -Brave is an open-source web browser which blocks ads and trackers so that you can browse your content fast and safely. What it actually does is that it pays to websites and YouTubers on behalf of you. If you prefer contributing to websites and YouTubers rather than seeing advertisements then this browser is for you. - -![][60] - -This is a new concept and could be good browser for those who prefer safe browsing without compromising important data on internet. - -### **55\. Bitcoin Core** - -Bitcoin Core is an official Bitcoin client which is highly secure and reliable. It keeps track of all your transactions and makes sure all transactions are valid. It restricts Bitcoin miners and banks from taking full control of your Bitcoin wallet. - -![][61] - -Bitcoin Core also offers other important features like, private keys backup, cold storage, security notifications. - -``` -$ sudo add-apt-repository ppa:bitcoin/bitcoin -$ sudo apt-get update -$ sudo apt-get install bitcoin-qt -``` - -### **56\. Speedy Duplicate Finder** - -Speedy Duplicate Finder is a cross-platform file finder which helps you find duplicate files on your system and free-up disk space. It is a smart tool which searches for duplicate files on entire hard disk and also features smart filter which helps you find file by file type, extension or size. - -![][62] - -It has a simple and clean user interface which is very easy to handle. As soon as you download it from Software Center you are good to go with disk space clean-up. - -### **57\. Zulip** - -Zulip is a free and open-source group chat application which was acquired by Dropbox. It is written in Python and uses PostgreSQL database. It was designed and developed to be a good alternative to other chat applications like Slack and HipChat. - -![][63] - -Zulip is a feature-rich application with features such as drag and drop files, group chats, private messaging, image previews and many more. It also supports integration with likes of Github, JIRA, Sentry, and hundreds of other services. - -### **58\. Okular** - -Okular is a cross-platform document viewer developed by KDE for KDE desktop environment. It is a simple document viewer and supports file formats like Portable Document Format (PDF), PostScript, DjVu, Microsoft Compiled HTML help, and many other major file formats. - -![][64] - -Okular is one of the best document viewers you should try on Ubuntu as it offers features like commenting on PDF documents, drawing lines, highlighting and much more. You can also extract text from PDF document to text file. - -### **59\. FocusWriter** - -FocusWriter is a distraction-free word processor which hides your desktop screen so that you can only focus on writing. Like you can see in the screenshot below whole Ubuntu screen is hidden, it’s just you and your word processor. But you can always access Ubuntu screen whenever you need it by just moving your mouse cursor to the edges of the screen. - -![][65] - -It is a lightweight word processor with support for file formats like TXT, RTF and ODT files. It also offers fully customizable user interface and features like timers and alarms, daily goals, sound effects and support for translation into 20 languages. - -### **60\. Guake** - -Guake is a cool drop-down terminal for GNOME Desktop Environment. Guake comes in a flash whenever you need it and disappears as soon as your task is completed. You just need to click F12 button to launch or exit it so launching Guake is way faster than launching new Terminal window. - -![][66] - -Guake is a feature-rich terminal with features like support for multiple tabs, ability to save your terminal content to file in few clicks, and fully customizable user interface. - -``` -$ sudo apt-get install guake -``` - -### **61\. KDE Connect** - -KDE Connect is an awesome application on Ubuntu and I would have loved to list this application much higher in this marathon article but competition is intense. Anyways KDE Connect helps you get your Android smartphone notifications directly on Ubuntu desktop. - -![][67] - -With KDE Connect you can do whole lot of other things like check your phones battery level, exchange files between computer and Android phone, clipboard sync, send SMS, and you can also use your phone as wireless mouse or keyboard. - -``` -$ sudo add-apt-repository ppa:webupd8team/indicator-kedeconnect -$ sudo apt-get update -$ sudo apt-get install kdeconnect indicator-kdeconnect -``` - -### **62\. CopyQ** - -CopyQ is a simple but very useful clipboard manager which stores content of the system clipboard whenever any changes you make so that you can search and restore it back whenever you need. It is a great tool to have as it supports text, images, HTML and other formats. - -![][68] - -CopyQ comes pre-loaded with features like drag and drop, copy/paste, edit, remove, sort, create, etc. It also supports integration with text editors like Vim, so it could be very useful tool if you are a programmer. - -``` -$ sudo add-apt-repository ppa:hluk/copyq -$ sudo apt-get update -$ sudo apt-get install copyq -``` - -### **63\. Tilix** - -Tilix is feature-rich advanced GTK3 tiling terminal emulator. If you uses GNOME desktop environment then you’re going to love Tilix as it follows GNOME Human Interface Guidelines. What Tilix emulator offers different than default terminal emulators on most of the Linux distros is it gives you ability to split terminal window into multiple terminal panes. - -![][69] - -Tilix offers features like custom links, image support, multiple panes, drag and drop, persistent layout and many more. It also has support for keyboard shortcuts and you can customize shortcuts from the Preferences settings according to your need. - -``` -$ sudo add-apt-repository ppa:webupd8team/terminix -$ sudo apt-get update -$ sudo apt-get install tilix -``` - -### **64\. Anbox** - -Anbox is an Android emulator which lets you install and run Android apps on your Linux system. It is free and open-source Android emulator that executes Android runtime environment by using Linux Containers. It uses latest Linux technologies and Android releases so that you can run any Android app like any other native application. - -![][70] - -Anbox is one of the modern and feature-rich emulators and offers features like no limit for application use, powerful user interface, and seamless integration with host operating system. - -First you need to install kernel modules. - -``` -$ sudo add-apt-repository ppa:morphis/anbox-support -$ sudo apt-get update -$ sudo apt install anbox-modules-dkms Now install Anbox using snap -$ snap install --devmode -- beta anbox -``` - -### **65\. OpenShot** - -OpenShot is the best open-source video editor you will find for Linux distros. It is a cross-platform video editor which is very easy to use without any compromise with its performance. It supports all the major audio, video and image formats. - -![][71] - -OpenShot has clean user interface and offers features like drag and drop, clip resizing, scaling, trimming, snapping, real-time previews, audio mixing and editing and many other features. - -``` -$ sudo add-apt-repository ppa:openshot.developers/ppa -$ sudo apt-get update -$ sudo apt-get install openshot -qt -``` - -### **66\. Plank** - -If you are looking for cool and simple dock for your Ubuntu desktop then Plank should be #1 choice for you. It is perfect dock and you don’t need to make any tweaks after installation but if you want to, then it has built-in preferences panel where you can customize themes, dock size and position. - -![][72] - -Despite being a simple dock, Plank offers features like item rearrangement by simple drag and drop, pinned and running apps icon, transparent theme support. - -``` -$ sudo add-apt-repository ppa:ricotz/docky -$ sudo apt-get update -$ sudo apt-get install plank -``` - -### **67\. Filezilla** - -Filezilla is a free and cross-platform FTP application which sports FileZilla client and server. It lets you transfer files using FTP and encrypted FTP like FTPS and SFTP and supports IPv6 internet protocol. - -![][73] - -It is simple file transfer application with features like drag and drop, support for various languages used worldwide, powerful user interface for multitasking, control and configures transfer speed and many other features. - -### **68\. Stacer** - -Stacer is an open-source system diagnostic tool and optimizer developed using Electron development framework. It has an excellent user interface and you can clean cache memory, start-up applications, uninstall apps that are no longer needed, monitor background system processes. - -![][74] - -It also lets you check disk, memory and CPU usage and also gives real-time stats of downloads and uploads. It looks like a tough competitor to Ubuntu cleaner but both have unique features that separate them apart. - -``` -$ sudo add-apt-repository ppa:oguzhaninan/stacer -$ sudo apt-get update -$ sudo apt-get install stacer -``` - -### **69\. 4K Video Downloader** - -4K Video Downloader is simple video downloading tool which you can use to download videos, playlists, channels from Vimeo, Facebook, YouTube and other online video streaming sites. It supports downloading YouTube playlists and channels in MP4, MKV, M4A, 3GP and many other video/audio file formats. - -![][75] - -4K Video Downloader is not as simple as you would think, apart from normal video downloads it supports 3D and 360 degree video downloading. It also offers features like in-app proxy setup and direct transfer to iTunes. You can download it from [here][76]. - -### 70\. **Qalculate** - -Qalculate is multi-purpose, cross-platform desktop calculator which is simple but very powerful calculator. It can be used for solving complicated maths problems and equations, currency conversions, and many other daily calculations. - -![][77] - -It has an excellent user interface and offers features such as customizable functions, unit calculations, symbolic calculations, arithmetic, plotting and many other functions you will find in any scientific calculator. - -### **71\. Hiri** - -Hiri is a cross-platform email client developed in Python programming language. It has slick user interface and it can be a good alternative to Microsoft Outlook in terms of features and services offered. This is great email client that can be used for sending and receiving emails, managing contacts, calendars and tasks. - -![][78] - -It is a feature-rich email client that offers features like integrated task manager, email synchronization, email rating, email filtering and many more. - -``` -$ sudo snap install hiri -``` - -### **72\. Sublime Text** - -Sublime Text is a cross-platform source code editor programmed in C++ and Python. It has Python Application Programming Interface (API) and supports all the major programming and markup languages. It is simple and lightweight text editor which can be used as IDE with features like auto-completion, syntax highlighting, split editing, etc. - -![][79] - -Some additional features in this text editor include Goto anything, Goto definition, multiple selections, command palette and fully customizable user interface. - -``` -$ sudo apt-get install sublime-text -``` - -### **73\. TeXstudio** - -TeXstudio is an integrated writing environment for creating and editing LaTex documents. It is an open-source editor which offers features like syntax highlighting, integrated viewer, interactive spelling checker, code folding, drag and drop, etc. - -![][80] - -It is a cross-platform editor and has very simple, lightweight user interface which is easy to use. It ships in with integration for BibTex and BibLatex bibliographies managers and also integrated PDF viewer. You can download TeXstudio installation package from its [website][81] or Ubuntu Software Center. - -### **74\. QtQR** - -QtQR is a Qt based application that lets you create and read QR codes in Ubuntu. It is developed in Python and Qt and has simple and lightweight user interface. You can encode website URL, email, text, SMS, etc. and you can also decode barcode using webcam camera. - -![][82] - -QtQR could prove to be useful tool to have if you generally deal with product sales and services because I don’t think we have any other similar tool to QtQR which requires minimal hardware to function smoothly. - -``` -$ sudo add-apt-repository ppa: qr-tools-developers/qr-tools-stable -$ sudo apt-get update -$ sudo apt-get install qtqr -``` - -### **75\. Kontact** - -Kontact is an integrated personal information manager (PIM) developed by KDE for KDE desktop environment. It is all-in-one software suite that integrates KMail, KOrganizer and KAddressBook into a single user interface from where you can manage all your mails, contacts, schedules, etc. - -![][83] - -It could be very good alternative to Microsoft Outlook as it is fast and highly configurable information manager. It has very good user interface which you will find very easy to use. - -``` -$ sudo apt-get install kontact -``` - -### **76\. NitroShare** - -NitroShare is a cross-platform, open-source network file sharing application. It lets you easily share files between multiple operating systems local network. It is a simple yet powerful application and it automatically detects other devices running NitroShare on local network. - -![][84] - -File transfer speed is what makes NitroShare a stand-out file sharing application as it achieves gigabit speed on capable hardware. There is no need for additional configuration required, you can start file transfer as soon as you install it. - -``` -$ sudo apt-add-repository ppa:george-edison55/nitroshare -$ sudo apt-get update -$ sudo apt-get install nitroshare -``` - -### **77\. Konversation** - -Konversation is an open-source Internet Relay Chat (IRC) client developed for KDE desktop environment. It gives speedy access to Freenode network’s channels where you can find support for most distributions. - -![][85] - -It is simple chat client with features like support for IPv6 connection, SSL server support, bookmarks, on-screen notifications, UTF-8 detection, and additional themes. It has easy to use GUI which is highly configurable. - -``` -$ sudo apt-get install konversation -``` - -### **78\. Discord** - -If you’re hardcore gamer and play online games frequently then I have a great application for you. Discord which is free Voice over Internet Protocol (VoIP) application especially designed for online gamers around the world. It is a cross-platform application and can be used for text and audio chats. - -![][86] - -Discord is very popular VoIP application gaming community and as it is completely free application, it is very good competitor to likes of Skype, Ventrilo and Teamspeak. It also offers features like crystal clear voice quality, modern text chat where you can share images, videos and links. - -### **79\. QuiteRSS** - -QuiteRSS is an open-source news aggregator for RSS and Atom news feeds. It is cross-platform feed reader written in Qt and C++. It has simple user interface which you can tweak in either classic or newspaper mode. It comes integrated with webkit browser out of the box so that you can perform all the tasks under single window. - -![][87] - -QuiteRSS comes with features such as content blocking, automatic scheduled feeds, import/export OPML, system tray integration and many other features you could expect in any feed reader. - -``` -$ sudo apt-get install quiterss -``` - -### **80\. MPV Media Player** - -MPV is a free and open-source media player based on MPlayer and MPlayer 2. It has simple user interface where user just needs to drag and drop audio/video files to play them as there is no option to add media files on GUI. - -![][88] - -One of the things about MPV is that it can play 4K videos effortlessly which is not the case with other media players on Linux distros. It also gives user ability to play videos from online video streaming sites including YouTube and Dailymotion. - -``` -$ sudo add-apt-repository ppa:mc3man/mpv-tests -$ sudo apt-get update -$ sudo apt-get install -y mpv -``` - -### **81\. Plume Creator** - -If you’re a writer then Plume Creator is must have application for you because you will not find other app for Ubuntu with privileges like Plume Creator. Writing and editing stories, chapters is tedious task and Plume Creator will ease this task for you with the help of some amazing tools it has to offer. - -![][89] - -It is an open-source application with minimal user interface which you could find confusing in the beginning but you will get used to it in some time. It offers features like edit notes, synopses, export in HTML and ODT formats support, and rich text editing. - -``` -$ sudo apt-get install plume-creator -``` - -### **82\. Chromium Web Browser** - -Chromium is an open-source web browser developed and distributed by Google. Chromium is very identical to Google Chrome web browser in terms of appearance and features. It is a lightweight and fast web browser with minimalist user interface. - -![][90] - -If you use Google Chrome regularly on Windows and looking for similar browser for Linux then Chromium is the best browser for you as you can login into your Google account to access all your Google services including Gmail. - -### **83\. Simple Weather Indicator** - -Simple Weather Indicator is an open-source weather indicator app developed in Python. It automatically detects your location and shows you weather information like temperature, possibility of rain, humidity, wind speed and visibility. - -![][91] - -Weather indicator comes with configurable options such as location detection, temperature SI unit, location visibility on/off, etc. It is cool app to have which adjusts with your desktop comfortably. - -### **84\. SpeedCrunch** - -SpeedCrunch is a fast and high-precision scientific calculator. It comes preloaded with math functions, user-defined functions, complex numbers and unit conversions support. It has simple user interface which is easy to use. - -![][92] - -This scientific calculator has some amazing features like result preview, syntax highlighting and auto-completion. It is a cross-platform calculator with multi-language support. - -### **85\. Scribus** - -Scribus is a free and open-source desktop publishing application that lets you create posters, magazines and books. It is a cross-platform application based on Qt toolkit and released under GNU general public license. It is a professional application with features like CMYK and ICC color management, Python based scripting engine, and PDF creation. - -![][93] - -Scribus comes with decent user interface which is easy to use and works effortlessly on systems with low hardware. It could be downloaded and installed from Software Center on all the latest Linux distros. - -### **86.** **Cura** - -Cura is an open-source 3D printing application developed by David Braam. Ultimaker Cura is the most popular software in 3D printing world and used by millions of users worldwide. It follows 3 step 3D printing model: Design, Prepare and Print. - -![][94] - -It is a feature-rich 3D printing application with seamless integration support for CAD plug-ins and add-ons. It is very simple and easy to use tool, novice artists can start right away. It supports major file formats like STL, 3MF and OBJ file formats. - -### **87\. Nomacs** - -Nomacs is an open-source, cross-platform image viewer which is supports all the major image formats including RAW and psd images. It has ability to browse images in zip or Microsoft Office files and extract them to a directory. - -![][95] - -Nomacs has very simple user interface with image thumbnails at the top and it offers some basic image manipulation features like crop, resize, rotate, color correction, etc. - -``` -$ sudo add-apt-repository ppa:nomacs/stable -$ sudo apt-get update -$ sudo apt-get install nomacs -``` - -### **88\. BitTicker** - -BitTicker is a live bitcoin-USDT Ticker for Ubuntu. It is a simple tool that connects to bittrex.com market and retrieves the latest price for BTC-USDT and display Ubuntu clock on system tray. - -![][96] - -It is simple but very useful too if you invest in Bitcoin regularly and have to study price fluctuations regulary. - -### **89\. Organize My Files** - -Organize My Files is cross-platform one click file organizer and it is available in Ubuntu as a snap package. It is a simple but powerful tool that will help you find unorganized files in a simple click and take them under control. - -![][97] - -It has intuitive user interface which is powerful and fast. It offers features such as auto organizing, recursive organizing, smart filters and multi folders organizing. - -### **90\. GnuCash** - -GnuCash is financial accounting software licensed under GNU general public license for free usage. It is an ideal software for personal and small business accounting. It has simple user interface which allows you to keep track of bank accounts, stocks, income and expenses. - -![][98] - -GnuCash implements double-entry bookkeeping system and based on professional accounting principle to ensure balanced books and accurate reports. - -### **91\. Calibre** - -Calibre is a cross-platform, open-source solution to all your e-book needs. It is a simple e-book organizer that offers features like displaying, creating, editing e-books, organizing existing e-books into virtual libraries, syncing and many more. - -![][99] - -Calibre also helps you convert e-books into whichever format you need and send them to your e-book reading device. Calibre is a very good tool to have if you regularly read and manage e-books. - -### **92\. MATE Dictionary** - -MATE Dictionary is a simple dictionary basically developed for MATE desktop environment. You just need to type the word and then this dictionary will display the meaning and references for it. - -![][100] - -It is simple and lightweight online dictionary with minimalist user interface. - -### **93\. Converseen** - -Converseen is a free cross-platform batch image processing application that lets you convert, edit, resize, rotate and flip large number of images with a single mouse click. It offers features like renaming bunch of images using prefix/suffix, extract image from a Windows icon file, etc. - -![][101] - -It has very good user interface which is easy to use even if you are a novice user. It can also convert entire PDF file into collection of images. - -### **94\. Tiled Map Editor** - -Tiled is a free software level map editor which you can use to edit the maps in various projections such as orthogonal, isometric and hexagonal. This tool can be very useful for game developers during game engine development cycle. - -![][102] - -Tiled is a versatile map editor which lets you create power boost positions, map layouts, collision areas, and enemy positions. It saves all the data in tmx format. - -### **95.** **Qmmp** - -Qmmp is a free and open-source audio player developed in Qt and C++. It is a cross-platform audio player with user interface very similar to Winamp. It has simple and intuitive user interface, Winamp skins can be used instead of default UI. - -![][103] - -It offers features such as automatic album cover fetching, multiple artists support, additional plug-ins and add-ons support and other features similar to Winamp. - -``` -$ sudo add-apt-repository ppa:forkotov02/ppa -$ sudo apt-get update -$ sudo apt-get install qmmp qmmp-q4 qmmp-plugin-pack-qt4 -``` - -### **96\. Arora** - -Arora is free and open-source web browser which offers features like dedicated download manager, bookmarks, privacy mode and tabbed browsing. - -![][104] - -Arora web browser is developed by Benjamin C. Meyer and it is popular among Linux users for its lightweight nature and flexibility. - -### **97\. XnSketch** - -XnSketch is a cool application for Ubuntu that will help you transform your photos into cartoon or sketch images in few clicks. It sports 18 different effects such as black strokes, white strokes, pencil sketch and others. - -![][105] - -It has an excellent user interface which you will find easy to use. Some additional features in XnSketch include opacity and edge strength adjustment, contrast, brightness and saturation adjustment. - -### **98\. Geany** - -Geany is a simple and lightweight text editor which works like an Integrated Development Environment (IDE). It is a cross-platform text editor and supports all the major programming languages including Python, C++, LaTex, Pascal, C#, etc. - -![][106] - -Geany has simple user interface which resembles to programming editors like Notepad++. It offers IDE like features such as code navigation, auto-completion, syntax highlighting, and extensions support. - -``` -$ sudo apt-get install geany -``` - -### **99\. Mumble** - -Mumble is another Voice over Internet Protocol application very similar to Discord. Mumble is also basically designed for online gamers and uses client-server architecture for end-to-end chat. Voice quality is very good on Mumble and it offers end-to-end encryption to ensure privacy. - -![][107] - -Mumble is an open-source application and features very simple user interface which is easy to use. Mumble is available for download in Ubuntu Software Center. - -``` -$ sudo apt-get install mumble-server -``` - -### **100\. Deluge** - -Deluge is a cross-platform and lightweight BitTorrent client that can be used for downloading files on Ubuntu. BitTorrent client come bundled with many Linux distros but Deluge is the best BitTorrent client which has simple user interface which is easy to use. - -![][108] - -Deluge comes with all the features you will find in BitTorrent clients but one feature that stands out is it gives user ability to access the client from other devices as well so that you can download files to your computer even if you are not at home. - -``` -$ sudo add-apt-repository ppa:deluge-team/ppa -$ sudo apt-get update -$ sudo apt-get install deluge -``` - -So these are my picks for best 100 applications for Ubuntu in 2018 which you should try. All the applications listed here are tested on Ubuntu 18.04 and will definitely work on older versions too. Feel free to share your view about the article at [@LinuxHint][109] and [@SwapTirthakar][110]. - --------------------------------------------------------------------------------- - -via: https://linuxhint.com/100_best_ubuntu_apps/ - -作者:[Swapnil Tirthakar][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://linuxhint.com/author/swapnil/ -[1]:https://linuxhint.com/applications-2018-ubuntu/ -[2]:https://linuxhint.com/wp-content/uploads/2018/06/100-Best-Ubuntu-Apps.png -[3]:https://linuxhint.com/wp-content/uploads/2018/06/Chrome.png -[4]:https://linuxhint.com/wp-content/uploads/2018/06/Steam.png -[5]:https://linuxhint.com/wp-content/uploads/2018/06/Wordpress.png -[6]:https://linuxhint.com/wp-content/uploads/2018/06/VLC.png -[7]:https://linuxhint.com/wp-content/uploads/2018/06/Atom-Text-Editor.png -[8]:https://linuxhint.com/wp-content/uploads/2018/06/GIMP.png -[9]:https://linuxhint.com/wp-content/uploads/2018/06/Google-Play.png -[10]:https://www.googleplaymusicdesktopplayer.com/ -[11]:https://linuxhint.com/wp-content/uploads/2018/06/Franz.png -[12]:https://meetfranz.com/#download -[13]:https://linuxhint.com/wp-content/uploads/2018/06/Synaptic.png -[14]:https://linuxhint.com/wp-content/uploads/2018/06/Skype.png -[15]:https://linuxhint.com/wp-content/uploads/2018/06/VirtualBox.png -[16]:https://linuxhint.com/wp-content/uploads/2018/06/Unity-Tweak-Tool.png -[17]:https://linuxhint.com/wp-content/uploads/2018/06/Ubuntu-Cleaner.png -[18]:https://linuxhint.com/wp-content/uploads/2018/06/Visual-Studio-Code.png -[19]:https://linuxhint.com/wp-content/uploads/2018/06/Corebird.png -[20]:https://linuxhint.com/wp-content/uploads/2018/06/Pixbuf.png -[21]:https://linuxhint.com/wp-content/uploads/2018/06/Clementine.png -[22]:https://linuxhint.com/wp-content/uploads/2016/06/blender.jpg -[23]:https://linuxhint.com/wp-content/uploads/2018/06/Audacity.png -[24]:https://linuxhint.com/wp-content/uploads/2018/06/Vim.png -[25]:https://linuxhint.com/wp-content/uploads/2018/06/Inkscape-1.png -[26]:https://linuxhint.com/wp-content/uploads/2018/06/ShotCut.png -[27]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Screen-Recorder.png -[28]:https://linuxhint.com/wp-content/uploads/2018/06/Telegram.png -[29]:https://linuxhint.com/wp-content/uploads/2018/06/ClamTk.png -[30]:https://linuxhint.com/wp-content/uploads/2018/06/Mailspring.png -[31]:https://linuxhint.com/wp-content/uploads/2018/06/PyCharm.png -[32]:https://linuxhint.com/wp-content/uploads/2018/06/Caffeine.png -[33]:https://linuxhint.com/wp-content/uploads/2018/06/Etcher.png -[34]:https://etcher.io/ -[35]:https://linuxhint.com/wp-content/uploads/2018/06/Neofetch.png -[36]:https://linuxhint.com/wp-content/uploads/2018/06/Liferea.png -[37]:https://linuxhint.com/wp-content/uploads/2018/06/Shutter.png -[38]:https://linuxhint.com/wp-content/uploads/2018/06/Weather.png -[39]:https://linuxhint.com/wp-content/uploads/2018/06/Ramme.png -[40]:https://github.com/terkelg/ramme/releases -[41]:https://linuxhint.com/wp-content/uploads/2018/06/Thunderbird.png -[42]:https://linuxhint.com/wp-content/uploads/2018/06/Pidgin.png -[43]:https://linuxhint.com/wp-content/uploads/2018/06/Krita.png -[44]:https://linuxhint.com/wp-content/uploads/2018/06/Dropbox.png -[45]:https://linuxhint.com/wp-content/uploads/2018/06/kodi.png -[46]:https://linuxhint.com/wp-content/uploads/2018/06/Spotify.png -[47]:https://linuxhint.com/wp-content/uploads/2018/06/Brackets.png -[48]:https://linuxhint.com/wp-content/uploads/2018/06/Bitwarden.png -[49]:https://linuxhint.com/wp-content/uploads/2018/06/Terminator.png -[50]:https://linuxhint.com/wp-content/uploads/2018/06/Yak-Yak.png -[51]:https://linuxhint.com/wp-content/uploads/2018/06/Thonny.png -[52]:https://linuxhint.com/wp-content/uploads/2018/06/Font-Manager.png -[53]:https://linuxhint.com/wp-content/uploads/2018/06/Atril.png -[54]:https://linuxhint.com/wp-content/uploads/2018/06/Notepadqq.png -[55]:https://linuxhint.com/wp-content/uploads/2018/06/Amarok.png -[56]:https://linuxhint.com/wp-content/uploads/2018/06/Cheese.png -[57]:https://linuxhint.com/wp-content/uploads/2018/06/MyPaint.png -[58]:https://linuxhint.com/wp-content/uploads/2018/06/PlayOnLinux.png -[59]:https://linuxhint.com/wp-content/uploads/2018/06/Akregator.png -[60]:https://linuxhint.com/wp-content/uploads/2018/06/Brave.png -[61]:https://linuxhint.com/wp-content/uploads/2018/06/Bitcoin-Core.png -[62]:https://linuxhint.com/wp-content/uploads/2018/06/Speedy-Duplicate-Finder.png -[63]:https://linuxhint.com/wp-content/uploads/2018/06/Zulip.png -[64]:https://linuxhint.com/wp-content/uploads/2018/06/Okular.png -[65]:https://linuxhint.com/wp-content/uploads/2018/06/Focus-Writer.png -[66]:https://linuxhint.com/wp-content/uploads/2018/06/Guake.png -[67]:https://linuxhint.com/wp-content/uploads/2018/06/KDE-Connect.png -[68]:https://linuxhint.com/wp-content/uploads/2018/06/CopyQ.png -[69]:https://linuxhint.com/wp-content/uploads/2018/06/Tilix.png -[70]:https://linuxhint.com/wp-content/uploads/2018/06/Anbox.png -[71]:https://linuxhint.com/wp-content/uploads/2018/06/OpenShot.png -[72]:https://linuxhint.com/wp-content/uploads/2018/06/Plank.png -[73]:https://linuxhint.com/wp-content/uploads/2018/06/FileZilla.png -[74]:https://linuxhint.com/wp-content/uploads/2018/06/Stacer.png -[75]:https://linuxhint.com/wp-content/uploads/2018/06/4K-Video-Downloader.png -[76]:https://www.4kdownload.com/download -[77]:https://linuxhint.com/wp-content/uploads/2018/06/Qalculate.png -[78]:https://linuxhint.com/wp-content/uploads/2018/06/Hiri.png -[79]:https://linuxhint.com/wp-content/uploads/2018/06/Sublime-text.png -[80]:https://linuxhint.com/wp-content/uploads/2018/06/TeXstudio.png -[81]:https://www.texstudio.org/ -[82]:https://linuxhint.com/wp-content/uploads/2018/06/QtQR.png -[83]:https://linuxhint.com/wp-content/uploads/2018/06/Kontact.png -[84]:https://linuxhint.com/wp-content/uploads/2018/06/Nitro-Share.png -[85]:https://linuxhint.com/wp-content/uploads/2018/06/Konversation.png -[86]:https://linuxhint.com/wp-content/uploads/2018/06/Discord.png -[87]:https://linuxhint.com/wp-content/uploads/2018/06/QuiteRSS.png -[88]:https://linuxhint.com/wp-content/uploads/2018/06/MPU-Media-Player.png -[89]:https://linuxhint.com/wp-content/uploads/2018/06/Plume-Creator.png -[90]:https://linuxhint.com/wp-content/uploads/2018/06/Chromium.png -[91]:https://linuxhint.com/wp-content/uploads/2018/06/Simple-Weather-Indicator.png -[92]:https://linuxhint.com/wp-content/uploads/2018/06/SpeedCrunch.png -[93]:https://linuxhint.com/wp-content/uploads/2018/06/Scribus.png -[94]:https://linuxhint.com/wp-content/uploads/2018/06/Cura.png -[95]:https://linuxhint.com/wp-content/uploads/2018/06/Nomacs.png -[96]:https://linuxhint.com/wp-content/uploads/2018/06/Bit-Ticker-1.png -[97]:https://linuxhint.com/wp-content/uploads/2018/06/Organize-My-Files.png -[98]:https://linuxhint.com/wp-content/uploads/2018/06/GNU-Cash.png -[99]:https://linuxhint.com/wp-content/uploads/2018/06/Calibre.png -[100]:https://linuxhint.com/wp-content/uploads/2018/06/MATE-Dictionary.png -[101]:https://linuxhint.com/wp-content/uploads/2018/06/Converseen.png -[102]:https://linuxhint.com/wp-content/uploads/2018/06/Tiled-Map-Editor.png -[103]:https://linuxhint.com/wp-content/uploads/2018/06/Qmmp.png -[104]:https://linuxhint.com/wp-content/uploads/2018/06/Arora.png -[105]:https://linuxhint.com/wp-content/uploads/2018/06/XnSketch.png -[106]:https://linuxhint.com/wp-content/uploads/2018/06/Geany.png -[107]:https://linuxhint.com/wp-content/uploads/2018/06/Mumble.png -[108]:https://linuxhint.com/wp-content/uploads/2018/06/Deluge.png -[109]:https://twitter.com/linuxhint -[110]:https://twitter.com/SwapTirthakar diff --git a/sources/tech/20180725 Put platforms in a Python game with Pygame.md b/sources/tech/20180725 Put platforms in a Python game with Pygame.md deleted file mode 100644 index 759bfc01df..0000000000 --- a/sources/tech/20180725 Put platforms in a Python game with Pygame.md +++ /dev/null @@ -1,590 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Put platforms in a Python game with Pygame) -[#]: via: (https://opensource.com/article/18/7/put-platforms-python-game) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Put platforms in a Python game with Pygame -====== -In part six of this series on building a Python game from scratch, create some platforms for your characters to travel. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/header.png?itok=iq8HFoEJ) - -This is part 6 in an ongoing series about creating video games in Python 3 using the Pygame module. Previous articles are: - -+ [Learn how to program in Python by building a simple dice game][24] -+ [Build a game framework with Python using the Pygame module][25] -+ [How to add a player to your Python game][26] -+ [Using Pygame to move your game character around][27] -+ [What's a hero without a villain? How to add one to your Python game][28] - - -A platformer game needs platforms. - -In [Pygame][1], the platforms themselves are sprites, just like your playable sprite. That's important because having platforms that are objects makes it a lot easier for your player sprite to interact with them. - -There are two major steps in creating platforms. First, you must code the objects, and then you must map out where you want the objects to appear. - -### Coding platform objects - -To build a platform object, you create a class called `Platform`. It's a sprite, just like your [`Player`][2] [sprite][2], with many of the same properties. - -Your `Platform` class needs to know a lot of information about what kind of platform you want, where it should appear in the game world, and what image it should contain. A lot of that information might not even exist yet, depending on how much you have planned out your game, but that's all right. Just as you didn't tell your Player sprite how fast to move until the end of the [Movement article][3], you don't have to tell `Platform` everything upfront. - -Near the top of the script you've been writing in this series, create a new class. The first three lines in this code sample are for context, so add the code below the comment: - -``` -import pygame -import sys -import os -## new code below: - -class Platform(pygame.sprite.Sprite): -# x location, y location, img width, img height, img file     -def __init__(self,xloc,yloc,imgw,imgh,img): -    pygame.sprite.Sprite.__init__(self) -    self.image = pygame.image.load(os.path.join('images',img)).convert() -    self.image.convert_alpha() -    self.image.set_colorkey(ALPHA) -    self.rect = self.image.get_rect() -    self.rect.y = yloc -    self.rect.x = xloc -``` - -When called, this class creates an object onscreen in some X and Y location, with some width and height, using some image file for texture. It's very similar to how players or enemies are drawn onscreen. - -### Types of platforms - -The next step is to map out where all your platforms need to appear. - -#### The tile method - -There are a few different ways to implement a platform game world. In the original side-scroller games, such as Mario Super Bros. and Sonic the Hedgehog, the technique was to use "tiles," meaning that there were a few blocks to represent the ground and various platforms, and these blocks were used and reused to make a level. You have only eight or 12 different kinds of blocks, and you line them up onscreen to create the ground, floating platforms, and whatever else your game needs. Some people find this the easier way to make a game since you just have to make (or download) a small set of level assets to create many different levels. The code, however, requires a little more math. - -![Supertux, a tile-based video game][5] - -[SuperTux][6], a tile-based video game. - -#### The hand-painted method - -Another method is to make each and every asset as one whole image. If you enjoy creating assets for your game world, this is a great excuse to spend time in a graphics application, building each and every part of your game world. This method requires less math, because all the platforms are whole, complete objects, and you tell [Python][7] where to place them onscreen. - -Each method has advantages and disadvantages, and the code you must use is slightly different depending on the method you choose. I'll cover both so you can use one or the other, or even a mix of both, in your project. - -### Level mapping - -Mapping out your game world is a vital part of level design and game programming in general. It does involve math, but nothing too difficult, and Python is good at math so it can help some. - -You might find it helpful to design on paper first. Get a sheet of paper and draw a box to represent your game window. Draw platforms in the box, labeling each with its X and Y coordinates, as well as its intended width and height. The actual positions in the box don't have to be exact, as long as you keep the numbers realistic. For instance, if your screen is 720 pixels wide, then you can't fit eight platforms at 100 pixels each all on one screen. - -Of course, not all platforms in your game have to fit in one screen-sized box, because your game will scroll as your player walks through it. So keep drawing your game world to the right of the first screen until the end of the level. - -If you prefer a little more precision, you can use graph paper. This is especially helpful when designing a game with tiles because each grid square can represent one tile. - -![Example of a level map][9] - -Example of a level map. - -#### Coordinates - -You may have learned in school about the [Cartesian coordinate system][10]. What you learned applies to Pygame, except that in Pygame, your game world's coordinates place `0,0` in the top-left corner of your screen instead of in the middle, which is probably what you're used to from Geometry class. - -![Example of coordinates in Pygame][12] - -Example of coordinates in Pygame. - -The X axis starts at 0 on the far left and increases infinitely to the right. The Y axis starts at 0 at the top of the screen and extends down. - -#### Image sizes - -Mapping out a game world is meaningless if you don't know how big your players, enemies, and platforms are. You can find the dimensions of your platforms or tiles in a graphics program. In [Krita][13], for example, click on the **Image** menu and select **Properties**. You can find the dimensions at the very top of the **Properties** window. - -Alternately, you can create a simple Python script to tell you the dimensions of an image. Open a new text file and type this code into it: - -``` -#!/usr/bin/env python3 - -from PIL import Image -import os.path -import sys - -if len(sys.argv) > 1: -    print(sys.argv[1]) -else: -    sys.exit('Syntax: identify.py [filename]') - -pic = sys.argv[1] -dim = Image.open(pic) -X   = dim.size[0] -Y   = dim.size[1] - -print(X,Y) -``` - -Save the text file as `identify.py`. - -To set up this script, you must install an extra set of Python modules that contain the new keywords used in the script: - -``` -$ pip3 install Pillow --user -``` - -Once that is installed, run your script from within your game project directory: - -``` -$ python3 ./identify.py images/ground.png -(1080, 97) -``` - -The image size of the ground platform in this example is 1080 pixels wide and 97 high. - -### Platform blocks - -If you choose to draw each asset individually, you must create several platforms and any other elements you want to insert into your game world, each within its own file. In other words, you should have one file per asset, like this: - -![One image file per object][15] - -One image file per object. - -You can reuse each platform as many times as you want, just make sure that each file only contains one platform. You cannot use a file that contains everything, like this: - -![Your level cannot be one image file][17] - -Your level cannot be one image file. - -You might want your game to look like that when you've finished, but if you create your level in one big file, there is no way to distinguish a platform from the background, so either paint your objects in their own file or crop them from a large file and save individual copies. - -**Note:** As with your other assets, you can use [GIMP][18], Krita, [MyPaint][19], or [Inkscape][20] to create your game assets. - -Platforms appear on the screen at the start of each level, so you must add a `platform` function in your `Level` class. The special case here is the ground platform, which is important enough to be treated as its own platform group. By treating the ground as its own special kind of platform, you can choose whether it scrolls or whether it stands still while other platforms float over the top of it. It's up to you. - -Add these two functions to your `Level` class: - -``` -def ground(lvl,x,y,w,h): -    ground_list = pygame.sprite.Group() -    if lvl == 1: -        ground = Platform(x,y,w,h,'block-ground.png') -        ground_list.add(ground) - -    if lvl == 2: -        print("Level " + str(lvl) ) - -    return ground_list - -def platform( lvl ): -    plat_list = pygame.sprite.Group() -    if lvl == 1: -        plat = Platform(200, worldy-97-128, 285,67,'block-big.png') -        plat_list.add(plat) -        plat = Platform(500, worldy-97-320, 197,54,'block-small.png') -        plat_list.add(plat) -    if lvl == 2: -        print("Level " + str(lvl) ) -        -    return plat_list -``` - -The `ground` function requires an X and Y location so Pygame knows where to place the ground platform. It also requires the width and height of the platform so Pygame knows how far the ground extends in each direction. The function uses your `Platform` class to generate an object onscreen, and then adds that object to the `ground_list` group. - -The `platform` function is essentially the same, except that there are more platforms to list. In this example, there are only two, but you can have as many as you like. After entering one platform, you must add it to the `plat_list` before listing another. If you don't add a platform to the group, then it won't appear in your game. - -> **Tip:** It can be difficult to think of your game world with 0 at the top, since the opposite is what happens in the real world; when figuring out how tall you are, you don't measure yourself from the sky down, you measure yourself from your feet to the top of your head. -> -> If it's easier for you to build your game world from the "ground" up, it might help to express Y-axis values as negatives. For instance, you know that the bottom of your game world is the value of `worldy`. So `worldy` minus the height of the ground (97, in this example) is where your player is normally standing. If your character is 64 pixels tall, then the ground minus 128 is exactly twice as tall as your player. Effectively, a platform placed at 128 pixels is about two stories tall, relative to your player. A platform at -320 is three more stories. And so on. - -As you probably know by now, none of your classes and functions are worth much if you don't use them. Add this code to your setup section (the first line is just for context, so add the last two lines): - -``` -enemy_list  = Level.bad( 1, eloc ) -ground_list = Level.ground( 1,0,worldy-97,1080,97 ) -plat_list   = Level.platform( 1 ) -``` - -And add these lines to your main loop (again, the first line is just for context): - -``` -enemy_list.draw(world)  # refresh enemies -ground_list.draw(world)  # refresh ground -plat_list.draw(world)  # refresh platforms -``` - -### Tiled platforms - -Tiled game worlds are considered easier to make because you just have to draw a few blocks upfront and can use them over and over to create every platform in the game. There are even sets of tiles for you to use on sites like [OpenGameArt.org][21]. - -The `Platform` class is the same as the one provided in the previous sections. - -The `ground` and `platform` in the `Level` class, however, must use loops to calculate how many blocks to use to create each platform. - -If you intend to have one solid ground in your game world, the ground is simple. You just "clone" your ground tile across the whole window. For instance, you could create a list of X and Y values to dictate where each tile should be placed, and then use a loop to take each value and draw one tile. This is just an example, so don't add this to your code: - -``` -# Do not add this to your code -gloc = [0,656,64,656,128,656,192,656,256,656,320,656,384,656] -``` - -If you look carefully, though, you can see all the Y values are always the same, and the X values increase steadily in increments of 64, which is the size of the tiles. That kind of repetition is exactly what computers are good at, so you can use a little bit of math logic to have the computer do all the calculations for you: - -Add this to the setup part of your script: - -``` -gloc = [] -tx   = 64 -ty   = 64 - -i=0 -while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 - -ground_list = Level.ground( 1,gloc,tx,ty ) -``` - -Now, regardless of the size of your window, Python divides the width of the game world by the width of the tile and creates an array listing each X value. This doesn't calculate the Y value, but that never changes on flat ground anyway. - -To use the array in a function, use a `while` loop that looks at each entry and adds a ground tile at the appropriate location: - -``` -def ground(lvl,gloc,tx,ty): -    ground_list = pygame.sprite.Group() -    i=0 -    if lvl == 1: -        while i < len(gloc): -            ground = Platform(gloc[i],worldy-ty,tx,ty,'tile-ground.png') -            ground_list.add(ground) -            i=i+1 - -    if lvl == 2: -        print("Level " + str(lvl) ) - -    return ground_list -``` - -This is nearly the same code as the `ground` function for the block-style platformer, provided in a previous section above, aside from the `while` loop. - -For moving platforms, the principle is similar, but there are some tricks you can use to make your life easier. - -Rather than mapping every platform by pixels, you can define a platform by its starting pixel (its X value), the height from the ground (its Y value), and how many tiles to draw. That way, you don't have to worry about the width and height of every platform. - -The logic for this trick is a little more complex, so copy this code carefully. There is a `while` loop inside of another `while` loop because this function must look at all three values within each array entry to successfully construct a full platform. In this example, there are only three platforms defined as `ploc.append` statements, but your game probably needs more, so define as many as you need. Of course, some won't appear yet because they're far offscreen, but they'll come into view once you implement scrolling. - -``` -def platform(lvl,tx,ty): -    plat_list = pygame.sprite.Group() -    ploc = [] -    i=0 -    if lvl == 1: -        ploc.append((200,worldy-ty-128,3)) -        ploc.append((300,worldy-ty-256,3)) -        ploc.append((500,worldy-ty-128,4)) -        while i < len(ploc): -            j=0 -            while j <= ploc[i][2]: -                plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'tile.png') -                plat_list.add(plat) -                j=j+1 -            print('run' + str(i) + str(ploc[i])) -            i=i+1 -            -    if lvl == 2: -        print("Level " + str(lvl) ) - -    return plat_list -``` - -To get the platforms to appear in your game world, they must be in your main loop. If you haven't already done so, add these lines to your main loop (again, the first line is just for context): - -``` -        enemy_list.draw(world)  # refresh enemies -        ground_list.draw(world) # refresh ground -        plat_list.draw(world)   # refresh platforms -``` - -Launch your game, and adjust the placement of your platforms as needed. Don't worry that you can't see the platforms that are spawned offscreen; you'll fix that soon. - -Here is the game so far in a picture and in code: - -![Pygame game][23] - -Our Pygame platformer so far. - -``` -    #!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement -# add enemy and basic collision -# add platform - -# GNU All-Permissive License -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved.  This file is offered as-is, -# without any warranty. - -import pygame -import sys -import os - -''' -Objects -''' - -class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     -    def __init__(self,xloc,yloc,imgw,imgh,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)).convert() -        self.image.convert_alpha() -        self.rect = self.image.get_rect() -        self.rect.y = yloc -        self.rect.x = xloc - -class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 -        self.movey = 0 -        self.frame = 0 -        self.health = 10 -        self.score = 1 -        self.images = [] -        for i in range(1,9): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha() -            img.set_colorkey(ALPHA) -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() - -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y - -    def update(self): -        ''' -        Update sprite position -        ''' - -        self.rect.x = self.rect.x + self.movex -        self.rect.y = self.rect.y + self.movey - -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] - -        # collisions -        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -        for enemy in enemy_hit_list: -            self.health -= 1 -            print(self.health) - -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.health -= 1 -            print(self.health) - - -class Enemy(pygame.sprite.Sprite): -    ''' -    Spawn an enemy -    ''' -    def __init__(self,x,y,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)) -        #self.image.convert_alpha() -        #self.image.set_colorkey(ALPHA) -        self.rect = self.image.get_rect() -        self.rect.x = x -        self.rect.y = y -        self.counter = 0 - -    def move(self): -        ''' -        enemy movement -        ''' -        distance = 80 -        speed = 8 - -        if self.counter >= 0 and self.counter <= distance: -            self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: -            self.rect.x -= speed -        else: -            self.counter = 0 - -        self.counter += 1 - -class Level(): -    def bad(lvl,eloc): -        if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return enemy_list - -    def loot(lvl,lloc): -        print(lvl) - -    def ground(lvl,gloc,tx,ty): -        ground_list = pygame.sprite.Group() -        i=0 -        if lvl == 1: -            while i < len(gloc): -                print("blockgen:" + str(i)) -                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') -                ground_list.add(ground) -                i=i+1 - -        if lvl == 2: -            print("Level " + str(lvl) ) - -        return ground_list - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4  # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE  = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 # how fast to move - -eloc = [] -eloc = [200,20] -gloc = [] -#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 #tile size -ty = 64 #tile size - -i=0 -while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 -    print("block: " + str(i)) - -enemy_list = Level.bad( 1, eloc ) -ground_list = Level.ground( 1,gloc,tx,ty ) - -''' -Main loop -''' -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False - -#    world.fill(BLACK) -    world.blit(backdrop, backdropbox) -    player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    for e in enemy_list: -        e.move() -    pygame.display.flip() -    clock.tick(fps) -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/put-platforms-python-game - -作者:[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://www.pygame.org/news -[2]: https://opensource.com/article/17/12/game-python-add-a-player -[3]: https://opensource.com/article/17/12/game-python-moving-player -[4]: /file/403841 -[5]: https://opensource.com/sites/default/files/uploads/supertux.png (Supertux, a tile-based video game) -[6]: https://www.supertux.org/ -[7]: https://www.python.org/ -[8]: /file/403861 -[9]: https://opensource.com/sites/default/files/uploads/layout.png (Example of a level map) -[10]: https://en.wikipedia.org/wiki/Cartesian_coordinate_system -[11]: /file/403871 -[12]: https://opensource.com/sites/default/files/uploads/pygame_coordinates.png (Example of coordinates in Pygame) -[13]: https://krita.org/en/ -[14]: /file/403876 -[15]: https://opensource.com/sites/default/files/uploads/pygame_floating.png (One image file per object) -[16]: /file/403881 -[17]: https://opensource.com/sites/default/files/uploads/pygame_flattened.png (Your level cannot be one image file) -[18]: https://www.gimp.org/ -[19]: http://mypaint.org/about/ -[20]: https://inkscape.org/en/ -[21]: https://opengameart.org/content/simplified-platformer-pack -[22]: /file/403886 -[23]: https://opensource.com/sites/default/files/uploads/pygame_platforms.jpg (Pygame game) -[24]: Learn how to program in Python by building a simple dice game -[25]: https://opensource.com/article/17/12/game-framework-python -[26]: https://opensource.com/article/17/12/game-python-add-a-player -[27]: https://opensource.com/article/17/12/game-python-moving-player -[28]: https://opensource.com/article/18/5/pygame-enemy - diff --git a/sources/tech/20180823 Getting started with Sensu monitoring.md b/sources/tech/20180823 Getting started with Sensu monitoring.md deleted file mode 100644 index 7d0a65e306..0000000000 --- a/sources/tech/20180823 Getting started with Sensu monitoring.md +++ /dev/null @@ -1,290 +0,0 @@ -Getting started with Sensu monitoring -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e) - -Sensu is an open source infrastructure and application monitoring solution that monitors servers, services, and application health, and sends alerts and notifications with third-party integration. Written in Ruby, Sensu can use either [RabbitMQ][1] or [Redis][2] to handle messages. It uses Redis to store data. - -If you want to monitor your cloud infrastructure in a simple and efficient manner, Sensu is a good option. It can be integrated with many of the modern DevOps stacks your organization may already be using, such as [Slack][3], [HipChat][4], or [IRC][5], and it can even send mobile/pager alerts with [PagerDuty][6]. - -Sensu's [modular architecture][7] means every component can be installed on the same server or on completely separate machines. - -### Architecture - -Sensu's main communication mechanism is the Transport. Every Sensu component must connect to the Transport in order to send messages to each other. Transport can use either RabbitMQ (recommended in production) or Redis. - -Sensu Server processes event data and takes action. It registers clients and processes check results and monitoring events using filters, mutators, and handlers. The server publishes check definitions to the clients and the Sensu API provides a RESTful API, providing access to monitoring data and core functionality. - -[Sensu Client][8] executes checks either scheduled by Sensu Server or local checks definitions. Sensu uses a data store (Redis) to keep all the persistent data. Finally, [Uchiwa][9] is the web interface to communicate with Sensu API. - -![sensu_system.png][11] - -### Installing Sensu - -#### Prerequisites - - * One Linux installation to act as the server node (I used CentOS 7 for this article) - - * One or more Linux machines to monitor (clients) - - - - -#### Server side - -Sensu requires Redis to be installed. To install Redis, enable the EPEL repository: -``` -$ sudo yum install epel-release -y - -``` - -Then install Redis: -``` -$ sudo yum install redis -y - -``` - -Modify `/etc/redis.conf` to disable protected mode, listen on every interface, and set a password: -``` -$ sudo sed -i 's/^protected-mode yes/protected-mode no/g' /etc/redis.conf - -$ sudo sed -i 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf - -$ sudo sed -i 's/^# requirepass foobared/requirepass password123/g' /etc/redis.conf - -``` - -Enable and start Redis service: -``` -$ sudo systemctl enable redis -$ sudo systemctl start redis -``` - -Redis is now installed and ready to be used by Sensu. - -Now let’s install Sensu. - -First, configure the Sensu repository and install the packages: -``` -$ sudo tee /etc/yum.repos.d/sensu.repo << EOF -[sensu] -name=sensu -baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ -gpgcheck=0 -enabled=1 -EOF - -$ sudo yum install sensu uchiwa -y -``` - -Let’s create the bare minimum configuration files for Sensu: -``` -$ sudo tee /etc/sensu/conf.d/api.json << EOF -{ -  "api": { -        "host": "127.0.0.1", -        "port": 4567 -  } -} -EOF -``` - -Next, configure `sensu-api` to listen on localhost, with Port 4567: -``` -$ sudo tee /etc/sensu/conf.d/redis.json << EOF -{ -  "redis": { -        "host": "", -        "port": 6379, -        "password": "password123" -  } -} -EOF - - -$ sudo tee /etc/sensu/conf.d/transport.json << EOF -{ -  "transport": { -        "name": "redis" -  } -} -EOF -``` - -In these two files, we configure Sensu to use Redis as the transport mechanism and the address where Redis will listen. Clients need to connect directly to the transport mechanism. These two files will be required on each client machine. -``` -$ sudo tee /etc/sensu/uchiwa.json << EOF -{ -   "sensu": [ -        { -        "name": "sensu", -        "host": "127.0.0.1", -        "port": 4567 -        } -   ], -   "uchiwa": { -        "host": "0.0.0.0", -        "port": 3000 -   } -} -EOF -``` - -In this file, we configure Uchiwa to listen on every interface (0.0.0.0) on Port 3000. We also configure Uchiwa to use `sensu-api` (already configured). - -For security reasons, change the owner of the configuration files you just created: -``` -$ sudo chown -R sensu:sensu /etc/sensu -``` - -Enable and start the Sensu services: -``` -$ sudo systemctl enable sensu-server sensu-api sensu-client -$ sudo systemctl start sensu-server sensu-api sensu-client -$ sudo systemctl enable uchiwa -$ sudo systemctl start uchiwa -``` - -Try accessing the Uchiwa website: http://:3000 - -For production environments, it’s recommended to run a cluster of RabbitMQ as the Transport instead of Redis (a Redis cluster can be used in production too), and to run more than one instance of Sensu Server and API for load balancing and high availability. - -Sensu is now installed. Now let’s configure the clients. - -#### Client side - -To add a new client, you will need to enable Sensu repository on the client machines by creating the file `/etc/yum.repos.d/sensu.repo`. -``` -$ sudo tee /etc/yum.repos.d/sensu.repo << EOF -[sensu] -name=sensu -baseurl=https://sensu.global.ssl.fastly.net/yum/\$releasever/\$basearch/ -gpgcheck=0 -enabled=1 -EOF -``` - -With the repository enabled, install the package Sensu: -``` -$ sudo yum install sensu -y -``` - -To configure `sensu-client`, create the same `redis.json` and `transport.json` created in the server machine, as well as the `client.json` configuration file: -``` -$ sudo tee /etc/sensu/conf.d/client.json << EOF -{ -  "client": { -        "name": "rhel-client", -        "environment": "development", -        "subscriptions": [ -        "frontend" -        ] -  } -} -EOF -``` - -In the name field, specify a name to identify this client (typically the hostname). The environment field can help you filter, and subscription defines which monitoring checks will be executed by the client. - -Finally, enable and start the services and check in Uchiwa, as the new client will register automatically: -``` -$ sudo systemctl enable sensu-client -$ sudo systemctl start sensu-client -``` - -### Sensu checks - -Sensu checks have two components: a plugin and a definition. - -Sensu is compatible with the [Nagios check plugin specification][12], so any check for Nagios can be used without modification. Checks are executable files and are run by the Sensu client. - -Check definitions let Sensu know how, where, and when to run the plugin. - -#### Client side - -Let’s install one check plugin on the client machine. Remember, this plugin will be executed on the clients. - -Enable EPEL and install `nagios-plugins-http` : -``` -$ sudo yum install -y epel-release -$ sudo yum install -y nagios-plugins-http -``` - -Now let’s explore the plugin by executing it manually. Try checking the status of a web server running on the client machine. It should fail as we don’t have a web server running: -``` -$ /usr/lib64/nagios/plugins/check_http -I 127.0.0.1 -connect to address 127.0.0.1 and port 80: Connection refused -HTTP CRITICAL - Unable to open TCP socket -``` - -It failed, as expected. Check the return code of the execution: -``` -$ echo $? -2 - -``` - -The Nagios check plugin specification defines four return codes for the plugin execution: - -| **Plugin return code** | **State** | -|------------------------|-----------| -| 0 | OK | -| 1 | WARNING | -| 2 | CRITICAL | -| 3 | UNKNOWN | - -With this information, we can now create the check definition on the server. - -#### Server side - -On the server machine, create the file `/etc/sensu/conf.d/check_http.json`: -``` -{ -  "checks": { -    "check_http": { -      "command": "/usr/lib64/nagios/plugins/check_http -I 127.0.0.1", -      "interval": 10, -      "subscribers": [ -        "frontend" -      ] -    } -  } -} -``` - -In the command field, use the command we tested before. `Interval` will tell Sensu how frequently, in seconds, this check should be executed. Finally, `subscribers` will define the clients where the check will be executed. - -Restart both sensu-api and sensu-server and confirm that the new check is available in Uchiwa. -``` -$ sudo systemctl restart sensu-api sensu-server -``` - -### What’s next? - -Sensu is a powerful tool, and this article covers just a glimpse of what it can do. See the [documentation][13] to learn more, and visit the Sensu site to learn more about the [Sensu community][14]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/getting-started-sensu-monitoring-solution - -作者:[Michael Zamot][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/mzamot -[1]:https://www.rabbitmq.com/ -[2]:https://redis.io/topics/config -[3]:https://slack.com/ -[4]:https://en.wikipedia.org/wiki/HipChat -[5]:http://www.irc.org/ -[6]:https://www.pagerduty.com/ -[7]:https://docs.sensu.io/sensu-core/1.4/overview/architecture/ -[8]:https://docs.sensu.io/sensu-core/1.4/installation/install-sensu-client/ -[9]:https://uchiwa.io/#/ -[10]:/file/406576 -[11]:https://opensource.com/sites/default/files/uploads/sensu_system.png (sensu_system.png) -[12]:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.html -[13]:https://docs.sensu.io/ -[14]:https://sensu.io/community diff --git a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md b/sources/tech/20180828 Linux for Beginners- Moving Things Around.md deleted file mode 100644 index abefc7c6f5..0000000000 --- a/sources/tech/20180828 Linux for Beginners- Moving Things Around.md +++ /dev/null @@ -1,201 +0,0 @@ -Linux for Beginners: Moving Things Around -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/filesystem-linux.jpg?itok=NQCoYl1f) - -In previous installments of this series, [you learned about directories][1] and how [permissions to access directories work][2]. Most of what you learned in those articles can be applied to files, except how to make a file executable. - -So let's deal with that before moving on. - -### No _.exe_ Needed - -In other operating systems, the nature of a file is often determined by its extension. If a file has a _.jpg_ extension, the OS guesses it is an image; if it ends in _.wav_ , it is an audio file; and if it has an _.exe_ tacked onto the end of the file name, it is a program you can execute. - -This leads to serious problems, like trojans posing as documents. Fortunately, that is not how things work in Linux. Sure, you may see occasional executable file endings in _.sh_ that indicate they are runnable shell scripts, but this is mostly for the benefit of humans eyeballing files, the same way when you use `ls --color`, the names of executable files show up in bright green. - -The fact is most applications have no extension at all. What determines whether a file is really program is the _x_ (for _executable_ ) bit. You can make any file executable by running -``` -chmod a+x some_program - -``` - -regardless of its extension or lack thereof. The `x` in the command above sets the _x_ bit and the `a` says you are setting it for _all_ users. You could also set it only for the group of users that own the file (`g+x`), or for only one user, the owner (`u+x`). - -Although we will be covering creating and running scripts from the command line later in this series, know that you can run a program by writing the path to it and then tacking on the name of the program on the end: -``` -path/to/directory/some_program - -``` - -Or, if you are currently in the same directory, you can use: -``` -./some_program - -``` - -There are other ways of making your program available from anywhere in the directory tree (hint: look up the `$PATH` environment variable), but you will be reading about those when we talk about shell scripting. - -### Copying, Moving, Linking - -Obviously, there are more ways of modifying and handling files from the command line than just playing around with their permissions. Most applications will create a new file if you still try to open a file that doesn't exist. Both -``` -nano test.txt - -``` - -and -``` -vim test.txt - -``` - -([nano][3] and [vim][4] being to popular command line text editors) will create an empty _test.txt_ file for you to edit if _test.txt_ didn't exist beforehand. - -You can also create an empty file by _touching_ it: -``` -touch test.txt - -``` - -Will create a file, but not open it in any application. - -You can use `cp` to make a copy of a file in another location or under a new name: -``` -cp test.txt copy_of_test.txt - -``` - -You can also copy a whole bunch of files: -``` -cp *.png /home/images - -``` - -The instruction above copies all the PNG files in the current directory into an _images/_ directory hanging off of your home directory. The _images/_ directory has to exist before you try this, or `cp` will show an error. Also, be warned that, if you copy a file to a directory that contains another file with the same name, `cp` will silently overwrite the old file with the new one. - -You can use -``` -cp -i *.png /home/images - -``` - -If you want `cp` to warn you of any dangers (the `-i` options stands for _interactive_ ). - -You can also copy whole directories, but you need the `-r` option for that: -``` -cp -rv directory_a/ directory_b - -``` - -The `-r` option stands for _recursive_ , meaning that `cp` will drill down into _directory_a_ , copying over all the files and subdirectories contained within. I personally like to include the `-v` option, as it makes `cp` _verbose_ , meaning that it will show you what it is doing instead of just copying silently and then exiting. - -The `mv` command moves stuff. That is, it changes files from one location to another. In its simplest form, `mv` looks a lot like `cp`: -``` -mv test.txt new_test.txt - -``` - -The command above makes _new_test.txt_ appear and _test.txt_ disappear. -``` -mv *.png /home/images - -``` - -Moves all the PNG files in the current directory to a directory called _images/_ hanging of your home directory. Again you have to be careful you do not overwrite existing files by accident. Use -``` -mv -i *.png /home/images - -``` - -the same way you would with `cp` if you want to be on the safe side. - -Apart from moving versus copying, another difference between `mv` and `cp`is when you move a directory: -``` -mv directory_a/ directory_b - -``` - -No need for a recursive flag here. This is because what you are really doing is renaming the directory, the same way in the first example, you were renaming the file*. In fact, even when you "move" a file from one directory to another, as long as both directories are on the same storage device and partition, you are renaming the file. - -You can do an experiment to prove it. `time` is a tool that lets you measure how long a command takes to execute. Look for a hefty file, something that weighs several hundred MBs or even some GBs (say, something like a long video) and try copying it from one directory to another like this: -``` -$ time cp hefty_file.mkv another_directory/ -real 0m3,868s -user 0m0,016s -sys 0m0,887s - -``` - -In bold is what you have to type into the terminal and below what `time` outputs. The number to focus on is the one on the first line, _real_ time. It takes nearly 4 seconds to copy the 355 MBs of _hefty_file.mkv_ to _another_directory/_. - -Now let's try moving it: -``` -$ time mv hefty_file.mkv another_directory/ -real 0m0,004s -user 0m0,000s -sys 0m0,003s - -``` - -Moving is nearly instantaneous! This is counterintuitive, since it would seem that `mv` would have to copy the file and then delete the original. That is two things `mv` has to do versus `cp`'s one. But, somehow, `mv` is 1000 times faster. - -That is because the file system's structure, with all its tree of directories, only exists for the users convenience. At the beginning of each partition there is something called a _partition table_ that tells the operating system where to find each file on the actual physical disk. On the disk, data is not split up into directories or even files. [There are tracks, sectors and clusters instead][5]. When you "move" a file within the same partition, what the operating system does is just change the entry for that file in the partition table, but it still points to the same cluster of information on the disk. - -Yes! Moving is a lie! At least within the same partition that is. If you try and move a file to a different partition or a different device, `mv` is still fast, but is noticeably slower than moving stuff around within the same partition. That is because this time there is actually copying and erasing of data going on. - -### Renaming - -There are several distinct command line `rename` utilities around. None are fixtures like `cp` or `mv` and they can work in slightly different ways. What they all have in common is that they are used to change _parts_ of the names of files. - -In Debian and Ubuntu, the default `rename` utility uses [regular expressions][6] (patterns of strings of characters) to mass change files in a directory. The instruction: -``` -rename 's/\.JPEG$/.jpg/' * - -``` - -will change all the extensions of files with the extension _JPEG_ to _jpg_. The file _IMG001.JPEG_ becomes _IMG001.jpg_ , _my_pic.JPEG_ becomes _my_pic.jpg_ , and so on. - -Another version of `rename` available by default in Manjaro, a derivative of Arch, is much simpler, but arguably less powerful: -``` -rename .JPEG .jpg * - -``` - -This does the same renaming as you saw above. In this version, `.JPEG` is the string of characters you want to change, `.jpg` is what you want to change it to, and `*` represents all the files in the current directory. - -The bottom line is that you are better off using `mv` if all you want to do is rename one file or directory, and that's because `mv` is realiably the same in all distributions everywhere. - -### Learning more - -Check out the both `mv` and `cp`'s _man_ pages to learn more. Run -``` -man cp - -``` - -or -``` -man mv - -``` - -to read about all the options these commands come with and which make them more powerful and safer to use. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/8/linux-beginners-moving-things-around - -作者:[Paul Brown][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/bro66 -[1]: https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 -[3]: https://www.nano-editor.org/ -[4]: https://www.vim.org/ -[5]: https://en.wikipedia.org/wiki/Disk_sector -[6]: https://en.wikipedia.org/wiki/Regular_expression diff --git a/sources/tech/20180902 Learning BASIC Like It-s 1983.md b/sources/tech/20180902 Learning BASIC Like It-s 1983.md deleted file mode 100644 index 5790ef6e88..0000000000 --- a/sources/tech/20180902 Learning BASIC Like It-s 1983.md +++ /dev/null @@ -1,184 +0,0 @@ -Learning BASIC Like It's 1983 -====== -I was not yet alive in 1983. This is something that I occasionally regret. I am especially sorry that I did not experience the 8-bit computer era as it was happening, because I think the people that first encountered computers when they were relatively simple and constrained have a huge advantage over the rest of us. - -Today, (almost) everyone knows how to use a computer, but very few people, even in the computing industry, grasp all of what is going on inside of any single machine. There are now [so many layers of software][1] doing so many different things that one struggles to identify the parts that are essential. In 1983, though, home computers were unsophisticated enough that a diligent person could learn how a particular computer worked through and through. That person is today probably less mystified than I am by all the abstractions that modern operating systems pile on top of the hardware. I expect that these layers of abstractions were easy to understand one by one as they were introduced; today, new programmers have to try to understand them all by working top to bottom and backward in time. - -Many famous programmers, particularly in the video game industry, started programming games in childhood on 8-bit computers like the Apple II and the Commodore 64. John Romero, Richard Garriott, and Chris Roberts are all examples. It’s easy to see how this happened. In the 8-bit computer era, many games were available only as printed BASIC listings in computer magazines and [books][2]. If you wanted to play one of those games, you had to type in the whole program by hand. Inevitably, you would get something wrong, so you would have to debug your program. By the time you got it working, you knew enough about how the program functioned to start modifying it yourself. If you were an avid gamer, you became a good programmer almost by necessity. - -I also played computer games throughout my childhood. But the games I played came on CD-ROMs. I sometimes found myself having to google how to fix a crashing installer, which would involve editing the Windows Registry or something like that. This kind of minor troubleshooting may have made me comfortable enough with computers to consider studying computer science in college. But it never taught me anything crucial about how computers worked or how to control them. - -Now, of course, I tell computers what to do for a living. All the same, I can’t help feeling that I missed out on some fundamental insight afforded only to those that grew up programming simpler computers. What would it have been like to encounter computers for the first time in the early 1980s? How would that have been different from the experience of using a computer today? - -This post is going to be a little different from the usual Two-Bit History post because I’m going to try to imagine an answer to these questions. - -### 1983 - -It was just last week that you saw [the Commodore 64 ad][3] on TV. Now that M*A*S*H was over, you were in the market for something new to do on Monday nights. This Commodore 64 thing looked even better than the Apple II that Rudy’s family had in their basement. Plus, the ad promised that the new computer would soon bring friends “knocking down” your door. You knew several people at school that would rather be hanging out at your house than Rudy’s anyway, if only they could play Zork there. - -So you persuaded your parents to buy one. Your mother said that they would consider it only if having a home computer meant that you stayed away from the arcade. You reluctantly agreed. Your father thought he would start tracking the family’s finances in MultiPlan, the spreadsheet program he had heard about, which is why the computer got put in the living room. A year later, though, you would be the only one still using it. You were finally allowed to put it on the desk in your bedroom, right under your Police poster. - -(Your sister protested this decision, but it was 1983 and computers [weren’t for her][4].) - -Dad picked it up from [ComputerLand][5] on the way home from work. The two of you laid the box down next to the TV and opened it. “WELCOME TO THE WORLD OF FRIENDLY COMPUTING,” said the packaging. Twenty minutes later, you weren’t convinced—the two of you were still trying to connect the Commodore to the TV set and wondering whether the TV’s antenna cable was the 75-ohm or 300-ohm coax type. But eventually you were able to turn your TV to channel 3 and see a grainy, purple image. - -![Commodore 64 startup screen][6] - -`READY`, the computer reported. Your father pushed the computer toward you, indicating that you should be the first to give it a try. `HELLO`, you typed, carefully hunting for each letter. The computer’s response was baffling. - -![Commodore 64 syntax error][7] - -You tried typing in a few different words, but the response was always the same. Your father said that you had better read through the rest of the manual. That would be no mean feat—[the manual that came with the Commodore 64][8] was a small book. But that didn’t bother you, because the introduction to the manual foreshadowed wonders. - -The Commodore 64, it claimed, had “the most advanced picture maker in the microcomputer industry,” which would allow you “to design your own pictures in four different colors, just like the ones you see on arcade type video games.” The Commodore 64 also had “built-in music and sound effects that rival many well known music synthesizers.” All of these tools would be put in your hands, because the manual would walk you through it all: - -> Just as important as all the available hardware is the fact that this USER’S GUIDE will help you develop your understanding of computers. It won’t tell you everything there is to know about computers, but it will refer you to a wide variety of publications for more detailed information about the topics presented. Commodore wants you to really enjoy your new COMMODORE 64. And to have fun, remember: programming is not the kind of thing you can learn in a day. Be patient with yourself as you go through the USER’S GUIDE. - -That night, in bed, you read through the entire first three chapters—”Setup,” “Getting Started,” and “Beginning BASIC Programming”—before finally succumbing to sleep with the manual splayed across your chest. - -### Commodore BASIC - -Now, it’s Saturday morning and you’re eager to try out what you’ve learned. One of the first things the manual teaches you how to do is change the colors on the display. You follow the instructions, pressing `CTRL-9` to enter reverse type mode and then holding down the space bar to create long lines. You swap between colors using `CTRL-1` through `CTRL-8`, reveling in your sudden new power over the TV screen. - -![Commodore 64 color bands][9] - -As cool as this is, you realize it doesn’t count as programming. In order to program the computer, you learned last night, you have to speak to it in a language called BASIC. To you, BASIC seems like something out of Star Wars, but BASIC is, by 1983, almost two decades old. It was invented by two Dartmouth professors, John Kemeny and Tom Kurtz, who wanted to make computing accessible to undergraduates in the social sciences and humanities. It was widely available on minicomputers and popular in college math classes. It then became standard on microcomputers after Bill Gates and Paul Allen wrote the MicroSoft BASIC interpreter for the Altair. But the manual doesn’t explain any of this and you won’t learn it for many years. - -One of the first BASIC commands the manual suggests you try is the `PRINT` command. You type in `PRINT "COMMODORE 64"`, slowly, since it takes you a while to find the quotation mark symbol above the `2` key. You hit `RETURN` and this time, instead of complaining, the computer does exactly what you told it to do and displays “COMMODORE 64” on the next line. - -Now you try using the `PRINT` command on all sorts of different things: two numbers added together, two numbers multiplied together, even several decimal numbers. You stop typing out `PRINT` and instead use `?`, since the manual has advised you that `?` is an abbreviation for `PRINT` often used by expert programmers. You feel like an expert already, but then you remember that you haven’t even made it to chapter three, “Beginning BASIC Programming.” - -You get there soon enough. The chapter begins by prompting you to write your first real BASIC program. You type in `NEW` and hit `RETURN`, which gives you a clean slate. You then type your program in: - -``` -10 ?"COMMODORE 64" -20 GOTO 10 -``` - -The 10 and the 20, the manual explains, are line numbers. They order the statements for the computer. They also allow the programmer to refer to other lines of the program in certain commands, just like you’ve done here with the `GOTO` command, which directs the program back to line 10. “It is good programming practice,” the manual opines, “to number lines in increments of 10—in case you need to insert some statements later on.” - -You type `RUN` and stare as the screen clogs with “COMMODORE 64,” repeated over and over. - -![Commodore 64 showing result of printing "Commodore 64" repeatedly][10] - -You’re not certain that this isn’t going to blow up your computer. It takes you a second to remember that you are supposed to hit the `RUN/STOP` key to break the loop. - -The next few sections of the manual teach you about variables, which the manual tells you are like “a number of boxes within the computer that can each hold a number or a string of text characters.” Variables that end in a `%` symbol are whole numbers, while variables ending in a `$` symbol are strings of characters. All other variables are something called “floating point” variables. The manual warns you to be careful with variable names because only the first two letters of the name are actually recognized by the computer, even though nothing stops you from making a name as long as you want it to be. (This doesn’t particularly bother you, but you could see how 30 years from now this might strike someone as completely insane.) - -You then learn about the `IF... THEN...` and `FOR... NEXT...` constructs. With all these new tools, you feel equipped to tackle the next big challenge the manual throws at you. “If you’re the ambitious type,” it goads, “type in the following program and see what happens.” The program is longer and more complicated than any you have seen so far, but you’re dying to know what it does: - -``` -10 REM BOUNCING BALL -20 PRINT "{CLR/HOME}" -25 FOR X = 1 TO 10 : PRINT "{CRSR/DOWN}" : NEXT -30 FOR BL = 1 TO 40 -40 PRINT " ●{CRSR LEFT}";:REM (● is a Shift-Q) -50 FOR TM = 1 TO 5 -60 NEXT TM -70 NEXT BL -75 REM MOVE BALL RIGHT TO LEFT -80 FOR BL = 40 TO 1 STEP -1 -90 PRINT " {CRSR LEFT}{CRSR LEFT}●{CRSR LEFT}"; -100 FOR TM = 1 TO 5 -110 NEXT TM -120 NEXT BL -130 GOTO 20 -``` - -The program above takes advantage of one of the Commodore 64’s coolest features. Non-printable command characters, when passed to the `PRINT` command as part of a string, just do the action they usually perform instead of printing to the screen. This allows you to replay arbitrary chains of commands by printing strings from within your programs. - -It takes you a long time to type in the above program. You make several mistakes and have to re-enter some of the lines. But eventually you are able to type `RUN` and behold a masterpiece: - -![Commodore 64 bouncing ball][11] - -You think that this is a major contender for the coolest thing you have ever seen. You forget about it almost immediately though, because once you’ve learned about BASIC’s built-in functions like `RND` (which returns a random number) and `CHR$` (which returns the character matching a given number code), the manual shows you a program that many years from now will still be famous enough to be made the title of an [essay anthology][12]: - -``` -10 PRINT "{CLR/HOME}" -20 PRINT CHR$(205.5 + RND(1)); -40 GOTO 20 -``` - -When run, the above program produces a random maze: - -![Commodore 64 maze program][13] - -This is definitely the coolest thing you have ever seen. - -### PEEK and POKE - -You’ve now made it through the first four chapters of the Commodore 64 manual, including the chapter titled “Advanced BASIC,” so you’re feeling pretty proud of yourself. You’ve learned a lot this Saturday morning. But this afternoon (after a quick lunch break), you’re going to learn something that will make this magical machine in your living room much less mysterious. - -The next chapter in the manual is titled “Advanced Color and Graphic Commands.” It starts off by revisiting the colored bars that you were able to type out first thing this morning and shows you how you can do the same thing from a program. It then teaches you how to change the background colors of the screen. - -In order to do this, you need to use the BASIC `PEEK` and `POKE` commands. Those commands allow you to, respectively, examine and write to a memory address. The Commodore 64 has a main background color and a border color. Each is controlled by a specially designated memory address. You can write any color value you would like to those addresses to make the background or border that color. - -The manual explains: - -> Just as variables can be thought of as a representation of “boxes” within the machine where you placed your information, you can also think of some specially defined “boxes” within the computer that represent specific memory locations. -> -> The Commodore 64 looks at these memory locations to see what the screen’s background and border color should be, what characters are to be displayed on the screen—and where—and a host of other tasks. - -You write a program to cycle through all the available combinations of background and border color: - -``` -10 FOR BA = 0 TO 15 -20 FOR BO = 0 TO 15 -30 POKE 53280, BA -40 POKE 53281, BO -50 FOR X = 1 TO 500 : NEXT X -60 NEXT BO : NEXT BA -``` - -While the `POKE` commands, with their big operands, looked intimidating at first, now you see that the actual value of the number doesn’t matter that much. Obviously, you have to get the number right, but all the number represents is a “box” that Commodore just happened to store at address 53280. This box has a special purpose: Commodore uses it to determine what color the screen’s background should be. - -![Commodore 64 changing background colors][14] - -You think this is pretty neat. Just by writing to a special-purpose box in memory, you can control a fundamental property of the computer. You aren’t sure how the Commodore 64’s circuitry takes the value you write in memory and changes the color of the screen, but you’re okay not knowing that. At least you understand everything up to that point. - -### Special Boxes - -You don’t get through the entire manual that Saturday, since you are now starting to run out of steam. But you do eventually read all of it. In the process, you learn about many more of the Commodore 64’s special-purpose boxes. There are boxes you can write to control what is on screen—one box, in fact, for every place a character might appear. In chapter six, “Sprite Graphics,” you learn about the special-purpose boxes that allow you to define images that can be moved around and even scaled up and down. In chapter seven, “Creating Sound,” you learn about the boxes you can write to in order to make your Commodore 64 sing “Michael Row the Boat Ashore.” The Commodore 64, it turns out, has very little in the way of what you would later learn is called an API. Controlling the Commodore 64 mostly involves writing to memory addresses that have been given special meaning by the circuitry. - -The many years you ultimately spend writing to those special boxes stick with you. Even many decades later, when you find yourself programming a machine with an extensive graphics or sound API, you know that, behind the curtain, the API is ultimately writing to those boxes or something like them. You will sometimes wonder about younger programmers that have only ever used APIs, and wonder what they must think the API is doing for them. Maybe they think that the API is calling some other, hidden API. But then what do think that hidden API is calling? You will pity those younger programmers, because they must be very confused indeed. - -If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][15] on Twitter or subscribe to the [RSS feed][16] to make sure you know when a new post is out. - -Previously on TwoBitHistory… - -> Have you ever wondered what a 19th-century computer program would look like translated into C? -> -> This week's post: A detailed look at how Ada Lovelace's famous program worked and what it was trying to do. -> -> — TwoBitHistory (@TwoBitHistory) [August 19, 2018][17] - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2018/09/02/learning-basic.html - -作者:[Two-Bit History][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://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: https://www.youtube.com/watch?v=kZRE7HIO3vk -[2]: https://en.wikipedia.org/wiki/BASIC_Computer_Games -[3]: https://www.youtube.com/watch?v=ZekAbt2o6Ms -[4]: https://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding -[5]: https://www.youtube.com/watch?v=MA_XtT3VAVM -[6]: https://twobithistory.org/images/c64_startup.png -[7]: https://twobithistory.org/images/c64_error.png -[8]: ftp://www.zimmers.net/pub/cbm/c64/manuals/C64_Users_Guide.pdf -[9]: https://twobithistory.org/images/c64_colors.png -[10]: https://twobithistory.org/images/c64_print_loop.png -[11]: https://twobithistory.org/images/c64_ball.gif -[12]: http://10print.org/ -[13]: https://twobithistory.org/images/c64_maze.gif -[14]: https://twobithistory.org/images/c64_background.gif -[15]: https://twitter.com/TwoBitHistory -[16]: https://twobithistory.org/feed.xml -[17]: https://twitter.com/TwoBitHistory/status/1030974776821665793?ref_src=twsrc%5Etfw diff --git a/sources/tech/20180914 A day in the life of a log message.md b/sources/tech/20180914 A day in the life of a log message.md deleted file mode 100644 index 8d60ec9fe6..0000000000 --- a/sources/tech/20180914 A day in the life of a log message.md +++ /dev/null @@ -1,57 +0,0 @@ -A day in the life of a log message -====== - -Navigating a modern distributed system from the perspective of a log message. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plane_travel_world_international.png?itok=jG3sYPty) - -Chaotic systems tend to be unpredictable. This is especially evident when architecting something as complex as a distributed system. Left unchecked, this unpredictability can waste boundless amounts of time. This is why every single component of a distributed system, no matter how small, must be designed to fit together in a streamlined way. - -[Kubernetes][1] provides a promising model for abstracting compute resources—but even it must be reconciled with other distributed platforms such as [Apache Kafka][2] to ensure reliable data delivery. If someone were to integrate these two platforms, how would it work? Furthermore, if you were to trace something as simple as a log message through such a system, what would it look like? This article will focus on how a log message from an application running inside [OKD][3], the Origin Community Distribution of Kubernetes that powers Red Hat OpenShift, gets to a data warehouse through Kafka. - -### OKD-defined environment - -Such a journey begins in OKD, since the container platform completely overlays the hardware it abstracts. This means that the log message waits to be written to **stdout** or **stderr** streams by an application residing in a container. From there, the log message is redirected onto the node's filesystem by a container engine such as [CRI-O][4]. - -![](https://opensource.com/sites/default/files/uploads/logmessagepathway.png) - -ithin OpenShift, one or more containers are encapsulated within virtual compute nodes known as pods. In fact, all applications running within OKD are abstracted as pods. This allows the applications to be manipulated in a uniform way. This also greatly simplifies communication between distributed components, since pods are systematically addressable through IP addresses and [load-balanced services][5] . So when the log message is taken from the node's filesystem by a log-collector application, it can easily be delivered to another pod running within OpenShift. - -### Two peas in a pod - -To ensure ubiquitous dispersal of the log message throughout the distributed system, the log collector needs to deliver the log message into a Kafka cluster data hub running within OpenShift. Through Kafka, the log message can be delivered to the consuming applications in a reliable and fault-tolerant way with low latency. However, in order to reap the benefits of Kafka within an OKD-defined environment, Kafka needs to be fully integrated into OKD. - -Running a [Strimzi operator][6] will instantiate all Kafka components as pods and integrate them to run within an OKD environment. This includes Kafka brokers for queuing log messages, Kafka connectors for reading and writing from Kafka brokers, and Zookeeper nodes for managing the Kafka cluster state. Strimzi can also instantiate the log collector to double as a Kafka connector, allowing the log collector to feed the log messages directly into a Kafka broker pod running within OKD. - -### Kafka inside OKD - -When the log-collector pod delivers the log message to a Kafka broker, the collector writes to a single broker partition, appending the message to the end of the partition. One of the advantages of using Kafka is that it decouples the log collector from the log's final destination. Thanks to the decoupling, the log collector doesn't care whether the logs end up in [Elasticsearch][7], Hadoop, Amazon S3, or all of them at the same time. Kafka is well-connected to all infrastructure, so the Kafka connectors can take the log message wherever it needs to go. - -Once written to a Kafka broker's partition, the log message is replicated across the broker partitions within the Kafka cluster. This is a very powerful concept on its own; combined with the self-healing features of the platform, it creates a very resilient distributed system. For example, when a node becomes unavailable, the applications running on the node are almost instantaneously spawned on healthy node(s). So even if a node with the Kafka broker is lost or damaged, the log message is guaranteed to survive as many deaths as it was replicated and a new Kafka broker will quickly take the original's place. - -### Off to storage - -After it is committed to a Kafka topic, the log message waits to be consumed by a Kafka connector sink, which relays the log message to either an analytics engine or logging warehouse. Upon delivery to its final destination, the log message could be studied for anomaly detection, queried for immediate root-cause analysis, or used for other purposes. Either way, the log message is delivered by Kafka to its destination in a safe and reliable manner. - -OKD and Kafka are powerful distributed platforms that are evolving rapidly. It is vital to create systems that can abstract the complicated nature of distributed computing without compromising performance. After all, how can we boast of systemwide efficiency if we cannot simplify the journey of a single log message? - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/9/life-log-message - -作者:[Josef Karásek][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者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/jkarasek -[1]: https://kubernetes.io/ -[2]: https://kafka.apache.org/ -[3]: https://www.okd.io/ -[4]: http://cri-o.io/ -[5]: https://kubernetes.io/docs/concepts/services-networking/service/ -[6]: http://strimzi.io/ -[7]: https://www.elastic.co/ diff --git a/sources/tech/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md b/sources/tech/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md deleted file mode 100644 index 60c2cb7937..0000000000 --- a/sources/tech/20181003 Oomox - Customize And Create Your Own GTK2, GTK3 Themes.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Oomox – Customize And Create Your Own GTK2, GTK3 Themes) -[#]: via: (https://www.ostechnix.com/oomox-customize-and-create-your-own-gtk2-gtk3-themes/) -[#]: author: (EDITOR https://www.ostechnix.com/author/editor/) - -Oomox – Customize And Create Your Own GTK2, GTK3 Themes -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-720x340.png) - -Theming and Visual customization is one of the main advantages of Linux. Since all the code is open, you can change how your Linux system looks and behaves to a greater degree than you ever could with Windows/Mac OS. GTK theming is perhaps the most popular way in which people customize their Linux desktops. The GTK toolkit is used by a wide variety of desktop environments like Gnome, Cinnamon, Unity, XFCE, and budgie. This means that a single theme made for GTK can be applied to any of these Desktop Environments with little changes. - -There are a lot of very high quality popular GTK themes out there, such as **Arc** , **Numix** , and **Adapta**. But if you want to customize these themes and create your own visual design, you can use **Oomox**. - -The Oomox is a graphical app for customizing and creating your own GTK theme complete with your own color, icon and terminal style. It comes with several presets, which you can apply on a Numix, Arc, or Materia style theme to create your own GTK theme. - -### Installing Oomox - -On Arch Linux and its variants: - -Oomox is available on [**AUR**][1], so you can install it using any AUR helper programs like [**Yay**][2]. - -``` -$ yay -S oomox - -``` - -On Debian/Ubuntu/Linux Mint, download `oomox.deb`package from [**here**][3] and install it as shown below. As of writing this guide, the latest version was **oomox_1.7.0.5.deb**. - -``` -$ sudo dpkg -i oomox_1.7.0.5.deb -$ sudo apt install -f - -``` - -On Fedora, Oomox is available in third-party **COPR** repository. - -``` -$ sudo dnf copr enable tcg/themes -$ sudo dnf install oomox - -``` - -Oomox is also available as a [**Flatpak app**][4]. Make sure you have installed Flatpak as described in [**this guide**][5]. And then, install and run Oomox using the following commands: - -``` -$ flatpak install flathub com.github.themix_project.Oomox - -$ flatpak run com.github.themix_project.Oomox - -``` - -For other Linux distributions, go to the Oomox project page (Link is given at the end of this guide) on Github and compile and install it manually from source. - -### Customize And Create Your Own GTK2, GTK3 Themes - -**Theme Customization** - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-1-1.png) - -You can change the colour of practically every UI element, like: - - 1. Headers - 2. Buttons - 3. Buttons inside Headers - 4. Menus - 5. Selected Text - - - -To the left, there are a number of presets, like the Cars theme, modern themes like Materia, and Numix, and retro themes. Then, at the top of the main window, there’s an option called **Theme Style** , that lets you set the overall visual style of the theme. You can choose from between Numix, Arc, and Materia. - -With certain styles like Numix, you can even change things like the Header Gradient, Outline Width and Panel Opacity. You can also add a Dark Mode for your theme that will be automatically created from the default theme. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-2.png) - -**Iconset Customization** - -You can customize the iconset that will be used for the theme icons. There are 2 options – Gnome Colors and Archdroid. You an change the base, and stroke colours of the iconset. - -**Terminal Customization** - -You can also customize the terminal colours. The app has several presets for this, but you can customize the exact colour code for each colour value like red, green,black, and so on. You can also auto swap the foreground and background colours. - -**Spotify Theme** - -A unique feature this app has is that you can theme the spotify app to your liking. You can change the foreground, background, and accent color of the spotify app to match the overall GTK theme. - -Then, just press the **Apply Spotify Theme** button, and you’ll get this window: - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-3.png) - -Just hit apply, and you’re done. - -**Exporting your Theme** - -Once you’re done customizing the theme to your liking, you can rename it by clicking the rename button at the top left: - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-4.png) - -And then, just hit **Export Theme** to export the theme to your system. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Oomox-5.png) - -You can also just export just the Iconset or the terminal theme. - -After this, you can open any Visual Customization app for your Desktop Environment, like Tweaks for Gnome based DEs, or the **XFCE Appearance Settings** , and select your exported GTK and Shell theme. - -### Verdict - -If you are a Linux theme junkie, and you know exactly how each button, how each header in your system should look like, Oomox is worth a look. For extreme customizers, it lets you change virtually everything about how your system looks. For people who just want to tweak an existing theme a little bit, it has many, many presets so you can get what you want without a lot of effort. - -Have you tried it? What are your thoughts on Oomox? Put them in the comments below! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/oomox-customize-and-create-your-own-gtk2-gtk3-themes/ - -作者:[EDITOR][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/editor/ -[1]: https://aur.archlinux.org/packages/oomox/ -[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ -[3]: https://github.com/themix-project/oomox/releases -[4]: https://flathub.org/apps/details/com.github.themix_project.Oomox -[5]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ diff --git a/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md deleted file mode 100644 index efad192bb2..0000000000 --- a/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md +++ /dev/null @@ -1,214 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Auk7F7) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline) -[#]: via: (https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/) -[#]: author: ([Prakash Subramanian](https://www.2daygeek.com/author/prakash/)) -[#]: url: ( ) - -Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline -====== - -Getting internet is not a big deal now a days, however there will be a limitation on technology. - -I was really surprise to see the technology growth but in the same time there will be fall in everywhere. - -Whenever you search anything about other Linux distributions most of the time you will get a third party links in the first place but for Arch Linux every time you would get the Arch Wiki page for your results. - -As Arch Wiki has most of the solution other than third party websites. - -As of now, you might used web browser to get a solution for your Arch Linux system but you no need to do the same for now. - -There is a solution is available in command line to perform this action much faster way and the utility called arch-wiki-man. If you are Arch Linux lover, i would suggest you to read **[Arch Linux Post Installation guide][1]** which helps you to tweak your system for day to day use. - -### What is arch-wiki-man? - -[arch-wiki-man][2] tool allows user to search the arch wiki pages right from the command line (CLI) instantly without internet connection. It allows user to access and search an entire wiki pages as a Linux man page. - -Also, you no need to switch to GUI. Updates are pushed automatically every two days so, your local copy of the Arch Wiki pages will be upto date. The tool name is `awman`. awman stands for Arch Wiki Man. - -We had already wrote similar kind of topic called **[Arch Wiki Command Line Utility][3]** (arch-wiki-cli) which allows user search Arch Wiki from command line but make sure you should have internet to use this utility. - -### How to Install arch-wiki-man tool? - -arch-wiki-man utility is available in AUR repository so, we need to use AUR helper to install it. There are many AUR helper is available and we had wrote an article about **[Yaourt AUR helper][4]** and **[Packer AUR helper][5]** which are very famous AUR helper. - -``` -$ yaourt -S arch-wiki-man - -or - -$ packer -S arch-wiki-man -``` - -Alternatively we can install it using npm package manager. Make sure, you should have installed **[NodeJS][6]** on your system. If so, run the following command to install it. - -``` -$ npm install -g arch-wiki-man -``` - -### How to Update the local Arch Wiki copy? - -As updated previously, updates are pushed automatically every two days and it can be done by running the following command. - -``` -$ sudo awman-update -[sudo] password for daygeek: -[email protected] /usr/lib/node_modules/arch-wiki-man -└── [email protected] - -arch-wiki-md-repo has been successfully updated or reinstalled. -``` - -awman-update is faster and more convenient method to get the update. However, you can get the updates by reinstalling this package using the following command. - -``` -$ yaourt -S arch-wiki-man - -or - -$ packer -S arch-wiki-man -``` - -### How to Use Arch Wiki from command line? - -It’s very simple interface and easy to use. To search anything, just run `awman` followed by the search term. The general syntax is as follow. - -``` -$ awman Search-Term -``` - -### How to Search Multiple Matches? - -If you would like to list all the results titles comes with `installation` string, run the following command format. If the output comes with multiple results then you will get a selection menu to navigate each item. - -``` -$ awman installation -``` - -![][8] - -Detailed page screenshot. -![][9] - -### Search a given string in Titles & Descriptions - -The `-d` or `--desc-search` option allow users to search a given string in titles and descriptions. - -``` -$ awman -d mirrors - -or - -$ awman --desc-search mirrors -? Select an article: (Use arrow keys) -❯ [1/3] Mirrors: Related articles - [2/3] DeveloperWiki-NewMirrors: Contents - [3/3] Powerpill: Powerpill is a pac -``` - -### Search a given string in Contents - -The `-k` or `--apropos` option allow users to search a given string in content as well. Make a note, this option significantly slower your search as this scan entire wiki page content. - -``` -$ awman -k openjdk - -or - -$ awman --apropos openjdk -? Select an article: (Use arrow keys) -❯ [1/26] Hadoop: Related articles - [2/26] XDG Base Directory support: Related articles - [3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first. - [4/26] Android: Related articles - [5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul.. - [6/26] LibreOffice: Related articles - [7/26] Browser plugins: Related articles -(Move up and down to reveal more choices) -``` - -### Open the search results in a web browser - -The `-w` or `--web` option allow users to open the search results in a web browser. - -``` -$ awman -w AUR helper - -or - -$ awman --web AUR helper -``` - -![][10] - -### Search in other languages - -The `-w` or `--web` option allow users to open the search results in a web browser. To see a list of supported language, run the following command. - -``` -$ awman --list-languages -arabic -bulgarian -catalan -chinesesim -chinesetrad -croatian -czech -danish -dutch -english -esperanto -finnish -greek -hebrew -hungarian -indonesian -italian -korean -lithuanian -norwegian -polish -portuguese -russian -serbian -slovak -spanish -swedish -thai -ukrainian -``` - -Run the awman command with your preferred language to see the results with different language other than English. - -``` -$ awman -l chinesesim deepin -``` - -![][11] - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/ - -作者:[Prakash Subramanian][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.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/ -[2]: https://github.com/greg-js/arch-wiki-man -[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/ -[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ -[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ -[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/ -[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png -[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png -[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png -[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md deleted file mode 100644 index e1e6a7f25e..0000000000 --- a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md +++ /dev/null @@ -1,745 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) -[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop -====== - -Laptop battery is highly optimized for Windows OS, that i had realized when i was using Windows OS in my laptop but it’s not same for Linux. - -Over the years Linux has improved a lot for battery optimization but still we need make some necessary things to improve laptop battery life in Linux. - -When i think about battery life, i got few options for that but i felt TLP is a better solutions for me so, i’m going with it. - -In this tutorial we are going to discuss about TLP in details to improve battery life. - -We had written three articles previously in our site about **[laptop battery saving utilities][1]** for Linux **[PowerTOP][2]** and **[Battery Charging State][3]**. - -### What is TLP? - -[TLP][4] is a free opensource advanced power management tool that improve your battery life without making any configuration change. - -Since it comes with a default configuration already optimized for battery life, so you may just install and forget it. - -Also, it is highly customizable to fulfill your specific requirements. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. - -TLP runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only. - -All TLP settings are stored in `/etc/default/tlp`. The default configuration provides optimized power saving out of the box. - -The following TLP settings is available for customization and you need to make the necessary changes accordingly if you want it. - -### TLP Features - - * Kernel laptop mode and dirty buffer timeouts - * Processor frequency scaling including “turbo boost” / “turbo core” - * Limit max/min P-state to control power dissipation of the CPU - * HWP energy performance hints - * Power aware process scheduler for multi-core/hyper-threading - * Processor performance versus energy savings policy (x86_energy_perf_policy) - * Hard disk advanced power magement level (APM) and spin down timeout (per disk) - * AHCI link power management (ALPM) with device blacklist - * PCIe active state power management (PCIe ASPM) - * Runtime power management for PCI(e) bus devices - * Radeon graphics power management (KMS and DPM) - * Wifi power saving mode - * Power off optical drive in drive bay - * Audio power saving mode - * I/O scheduler (per disk) - * USB autosuspend with device blacklist/whitelist (input devices excluded automatically) - * Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown - * Restore radio device state on system startup (from previous shutdown). - * Radio device wizard: switch radios upon network connect/disconnect and dock/undock - * Disable Wake On LAN - * Integrated WWAN and bluetooth state is restored after suspend/hibernate - * Untervolting of Intel processors – requires kernel with PHC-Patch - * Battery charge thresholds – ThinkPads only - * Recalibrate battery – ThinkPads only - - - -### How to Install TLP in Linux - -TLP package is available in most of the distributions official repository so, use the distributions **[Package Manager][5]** to install it. - -For **`Fedora`** system, use **[DNF Command][6]** to install TLP. - -``` -$ sudo dnf install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm -$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm -$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo dnf install smartmontools -``` - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install TLP. - -``` -$ sudo apt install tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ sudo apt-get install tp-smapi-dkms acpi-call-dkms -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo apt-get install smartmontools -``` - -When the official package becomes outdated for Ubuntu based systems then use the following PPA repository which provides an up-to-date version. Run the following commands to install TLP using the PPA. - -``` -$ sudo apt-get install tlp tlp-rdw -``` - -For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install TLP. - -``` -$ sudo pacman -S tlp tlp-rdw -``` - -ThinkPads require an additional packages. - -``` -$ pacman -S tp_smapi acpi_call -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo pacman -S smartmontools -``` - -Enable TLP & TLP-Sleep service on boot for Arch Linux based systems. - -``` -$ sudo systemctl enable tlp.service -$ sudo systemctl enable tlp-sleep.service -``` - -You should also mask the following services to avoid conflicts and assure proper operation of TLP’s radio device switching options for Arch Linux based systems. - -``` -$ sudo systemctl mask systemd-rfkill.service -$ sudo systemctl mask systemd-rfkill.socket -``` - -For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install TLP. - -``` -$ sudo yum install tlp tlp-rdw -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo yum install smartmontools -``` - -For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install TLP. - -``` -$ sudo zypper install TLP -``` - -Install smartmontool to display S.M.A.R.T. data in tlp-stat. - -``` -$ sudo zypper install smartmontools -``` - -After successfully TLP installed, use the following command to start the service. - -``` -$ systemctl start tlp.service -``` - -To show battery information. - -``` -$ sudo tlp-stat -b -or -$ sudo tlp-stat --battery - ---- TLP 1.1 -------------------------------------------- - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] -/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] -/sys/class/power_supply/BAT0/power_now = 0 [mW] -/sys/class/power_supply/BAT0/status = Full - -Charge = 100.0 [%] -Capacity = 81.4 [%] -``` - -To show disk information. - -``` -$ sudo tlp-stat -d -or -$ sudo tlp-stat --disk - ---- TLP 1.1 -------------------------------------------- - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25775 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on -``` - -To show PCI device information. - -``` -$ sudo tlp-stat -e -or -$ sudo tlp-stat --pcie - ---- TLP 1.1 -------------------------------------------- - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) -``` - -To show graphics card information. - -``` -$ sudo tlp-stat -g -or -$ sudo tlp-stat --graphics - ---- TLP 1.1 -------------------------------------------- - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) -``` - -To show Processor information. - -``` -$ sudo tlp-stat -p -or -$ sudo tlp-stat --processor - ---- TLP 1.1 -------------------------------------------- - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. -``` - -To show system data information. - -``` -$ sudo tlp-stat -s -or -$ sudo tlp-stat --system - ---- TLP 1.1 -------------------------------------------- - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 596 sec(s) ago -Mode = battery -Power source = battery -``` - -To show temperatures and fan speed information. - -``` -$ sudo tlp-stat -t -or -$ sudo tlp-stat --temp - ---- TLP 1.1 -------------------------------------------- - -+++ Temperatures -CPU temp = 36 [°C] -Fan speed = (not available) -``` - -To show USB device data information. - -``` -$ sudo tlp-stat -u -or -$ sudo tlp-stat --usb - ---- TLP 1.1 -------------------------------------------- - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) -``` - -To show warnings. - -``` -$ sudo tlp-stat -w -or -$ sudo tlp-stat --warn - ---- TLP 1.1 -------------------------------------------- - -No warnings detected. -``` - -Status report with configuration and all active settings. - -``` -$ sudo tlp-stat - ---- TLP 1.1 -------------------------------------------- - -+++ Configured Settings: /etc/default/tlp -TLP_ENABLE=1 -TLP_DEFAULT_MODE=AC -TLP_PERSISTENT_DEFAULT=0 -DISK_IDLE_SECS_ON_AC=0 -DISK_IDLE_SECS_ON_BAT=2 -MAX_LOST_WORK_SECS_ON_AC=15 -MAX_LOST_WORK_SECS_ON_BAT=60 -CPU_HWP_ON_AC=balance_performance -CPU_HWP_ON_BAT=balance_power -SCHED_POWERSAVE_ON_AC=0 -SCHED_POWERSAVE_ON_BAT=1 -NMI_WATCHDOG=0 -ENERGY_PERF_POLICY_ON_AC=performance -ENERGY_PERF_POLICY_ON_BAT=power -DISK_DEVICES="sda sdb" -DISK_APM_LEVEL_ON_AC="254 254" -DISK_APM_LEVEL_ON_BAT="128 128" -SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" -SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" -AHCI_RUNTIME_PM_TIMEOUT=15 -PCIE_ASPM_ON_AC=performance -PCIE_ASPM_ON_BAT=powersave -RADEON_POWER_PROFILE_ON_AC=default -RADEON_POWER_PROFILE_ON_BAT=low -RADEON_DPM_STATE_ON_AC=performance -RADEON_DPM_STATE_ON_BAT=battery -RADEON_DPM_PERF_LEVEL_ON_AC=auto -RADEON_DPM_PERF_LEVEL_ON_BAT=auto -WIFI_PWR_ON_AC=off -WIFI_PWR_ON_BAT=on -WOL_DISABLE=Y -SOUND_POWER_SAVE_ON_AC=0 -SOUND_POWER_SAVE_ON_BAT=1 -SOUND_POWER_SAVE_CONTROLLER=Y -BAY_POWEROFF_ON_AC=0 -BAY_POWEROFF_ON_BAT=0 -BAY_DEVICE="sr0" -RUNTIME_PM_ON_AC=on -RUNTIME_PM_ON_BAT=auto -RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon pcieport" -USB_AUTOSUSPEND=0 -USB_BLACKLIST_BTUSB=0 -USB_BLACKLIST_PHONE=0 -USB_BLACKLIST_PRINTER=1 -USB_BLACKLIST_WWAN=1 -RESTORE_DEVICE_STATE_ON_STARTUP=0 - -+++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) - -+++ TLP Status -State = enabled -Last run = 11:04:00 IST, 684 sec(s) ago -Mode = battery -Power source = battery - -+++ Processor -CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz - -/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate -/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave -/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power -/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power - -/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] -/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] -/sys/devices/system/cpu/intel_pstate/no_turbo = 0 -/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] -/sys/devices/system/cpu/intel_pstate/num_pstates = 28 - -x86_energy_perf_policy: program not installed. - -/sys/module/workqueue/parameters/power_efficient = Y -/proc/sys/kernel/nmi_watchdog = 0 - -+++ Undervolting -PHC kernel not available. - -+++ Temperatures -CPU temp = 42 [°C] -Fan speed = (not available) - -+++ File System -/proc/sys/vm/laptop_mode = 2 -/proc/sys/vm/dirty_writeback_centisecs = 6000 -/proc/sys/vm/dirty_expire_centisecs = 6000 -/proc/sys/vm/dirty_ratio = 20 -/proc/sys/vm/dirty_background_ratio = 10 - -+++ Storage Devices -/dev/sda: - Model = WDC WD10SPCX-24HWST1 - Firmware = 02.01A02 - APM Level = 128 - Status = active/idle - Scheduler = mq-deadline - - Runtime PM: control = on, autosuspend_delay = (not available) - - SMART info: - 4 Start_Stop_Count = 18787 - 5 Reallocated_Sector_Ct = 0 - 9 Power_On_Hours = 606 [h] - 12 Power_Cycle_Count = 1792 - 193 Load_Cycle_Count = 25777 - 194 Temperature_Celsius = 31 [°C] - - -+++ AHCI Link Power Management (ALPM) -/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm -/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm - -+++ AHCI Host Controller Runtime Power Management -/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on -/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on - -+++ PCIe Active State Power Management -/sys/module/pcie_aspm/parameters/policy = powersave - -+++ Intel Graphics -/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) -/sys/module/i915/parameters/enable_fbc = 1 (enabled) -/sys/module/i915/parameters/enable_psr = 0 (disabled) -/sys/module/i915/parameters/modeset = -1 (use per-chip default) - -+++ Wireless -bluetooth = on -wifi = on -wwan = none (no device) - -hci0(btusb) : bluetooth, not connected -wlp8s0(iwlwifi) : wifi, connected, power management = on - -+++ Audio -/sys/module/snd_hda_intel/parameters/power_save = 1 -/sys/module/snd_hda_intel/parameters/power_save_controller = Y - -+++ Runtime Power Management -Device blacklist = (not configured) -Driver blacklist = amdgpu nouveau nvidia radeon pcieport - -/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) -/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) -/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) -/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) -/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) -/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) -/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) -/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) -/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) -/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) -/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) -/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) -/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) -/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) -/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) - -+++ USB -Autosuspend = disabled -Device whitelist = (not configured) -Device blacklist = (not configured) -Bluetooth blacklist = disabled -Phone blacklist = disabled -WWAN blacklist = enabled - -Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) -Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) -Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) -Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) -Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) - -+++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] -/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] -/sys/class/power_supply/BAT0/power_now = 12185 [mW] -/sys/class/power_supply/BAT0/status = Discharging - -Charge = 97.0 [%] -Capacity = 86.2 [%] -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ - -作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ -[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ -[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ -[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html -[5]: https://www.2daygeek.com/category/package-management/ -[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ diff --git a/sources/tech/20181218 Using Pygame to move your game character around.md b/sources/tech/20181218 Using Pygame to move your game character around.md deleted file mode 100644 index 96daf8da7d..0000000000 --- a/sources/tech/20181218 Using Pygame to move your game character around.md +++ /dev/null @@ -1,353 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Pygame to move your game character around) -[#]: via: (https://opensource.com/article/17/12/game-python-moving-player) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Using Pygame to move your game character around -====== -In the fourth part of this series, learn how to code the controls needed to move a game character. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python4-game.png?itok=tXFHaLdt) - -In the first article in this series, I explained how to use Python to create a simple, [text-based dice game][1]. In the second part, we began building a game from scratch, starting with [creating the game's environment][2]. And, in the third installment, we [created a player sprite][3] and made it spawn in your (rather empty) game world. As you've probably noticed, a game isn't much fun if you can't move your character around. In this article, we'll use Pygame to add keyboard controls so you can direct your character's movement. - -There are functions in Pygame to add other kinds of controls, but since you certainly have a keyboard if you're typing out Python code, that's what we'll use. Once you understand keyboard controls, you can explore other options on your own. - -You created a key to quit your game in the second article in this series, and the principle is the same for movement. However, getting your character to move is a little more complex. - -Let's start with the easy part: setting up the controller keys. - -### Setting up keys for controlling your player sprite - -Open your Python game script in IDLE, Ninja-IDE, or a text editor. - -Since the game must constantly "listen" for keyboard events, you'll be writing code that needs to run continuously. Can you figure out where to put code that needs to run constantly for the duration of the game? - -If you answered "in the main loop," you're correct! Remember that unless code is in a loop, it will run (at most) only once—and it may not run at all if it's hidden away in a class or function that never gets used. - -To make Python monitor for incoming key presses, add this code to the main loop. There's no code to make anything happen yet, so use `print` statements to signal success. This is a common debugging technique. - -``` -while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False - -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right') -            if event.key == pygame.K_UP or event.key == ord('w'): -            print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print('left stop') -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print('right stop') -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False     -``` - -Some people prefer to control player characters with the keyboard characters W, A, S, and D, and others prefer to use arrow keys. Be sure to include both options. - -**Note: **It's vital that you consider all of your users when programming. If you write code that works only for you, it's very likely that you'll be the only one who uses your application. More importantly, if you seek out a job writing code for money, you are expected to write code that works for everyone. Giving your users choices, such as the option to use either arrow keys or WASD, is a sign of a good programmer. - -Launch your game using Python, and watch the console window for output as you press the right, left, and up arrows, or the A, D, and W keys. - -``` -$ python ./your-name_game.py -  left -  left stop -  right -  right stop -  jump -``` - -This confirms that Pygame detects key presses correctly. Now it's time to do the hard work of making the sprite move. - -### Coding the player movement function - -To make your sprite move, you must create a property for your sprite that represents movement. When your sprite is not moving, this variable is set to `0`. - -If you are animating your sprite, or should you decide to animate it in the future, you also must track frames to enable the walk cycle to stay on track. - -Create the variables in the Player class. The first two lines are for context (you already have them in your code, if you've been following along), so add only the last three: - -``` -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 # move along X -        self.movey = 0 # move along Y -        self.frame = 0 # count frames -``` - -With those variables set, it's time to code the sprite's movement. - -The player sprite doesn't need to respond to control all the time; sometimes it will not be moving. The code that controls the sprite, therefore, is only one small part of all the things the player sprite will do. When you want to make an object in Python do something independent of the rest of its code, you place your new code in a function. Python functions start with the keyword `def`, which stands for define. - -Make a function in your Player class to add some number of pixels to your sprite's position on screen. Don't worry about how many pixels you add yet; that will be decided in later code. - -``` -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -``` - -To move a sprite in Pygame, you have to tell Python to redraw the sprite in its new location—and where that new location is. - -Since the Player sprite isn't always moving, the updates need to be only one function within the Player class. Add this function after the `control` function you created earlier. - -To make it appear that the sprite is walking (or flying, or whatever it is your sprite is supposed to do), you need to change its position on screen when the appropriate key is pressed. To get it to move across the screen, you redefine its position, designated by the `self.rect.x` and `self.rect.y` properties, to its current position plus whatever amount of `movex` or `movey` is applied. (The number of pixels the move requires is set later.) - -``` -    def update(self): -        ''' -        Update sprite position -        ''' -        self.rect.x = self.rect.x + self.movex         -``` - -Do the same thing for the Y position: - -``` -        self.rect.y = self.rect.y + self.movey -``` - -For animation, advance the animation frames whenever your sprite is moving, and use the corresponding animation frame as the player image: - -``` -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[self.frame//ani] - -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > 3*ani: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] -``` - -Tell the code how many pixels to add to your sprite's position by setting a variable, then use that variable when triggering the functions of your Player sprite. - -First, create the variable in your setup section. In this code, the first two lines are for context, so just add the third line to your script: - -``` -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10  # how many pixels to move -``` - -Now that you have the appropriate function and variable, use your key presses to trigger the function and send the variable to your sprite. - -Do this by replacing the `print` statements in your main loop with the Player sprite's name (player), the function (.control), and how many steps along the X axis and Y axis you want the player sprite to move with each loop. - -``` -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') - -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False -``` - -Remember, `steps` is a variable representing how many pixels your sprite moves when a key is pressed. If you add 10 pixels to the location of your player sprite when you press D or the right arrow, then when you stop pressing that key you must subtract 10 (`-steps`) to return your sprite's momentum back to 0. - -Try your game now. Warning: it won't do what you expect. - -Why doesn't your sprite move yet? Because the main loop doesn't call the `update` function. - -Add code to your main loop to tell Python to update the position of your player sprite. Add the line with the comment: - -``` -    player.update()  # update player position -    player_list.draw(world) -    pygame.display.flip() -    clock.tick(fps) -``` - -Launch your game again to witness your player sprite move across the screen at your bidding. There's no vertical movement yet because those functions will be controlled by gravity, but that's another lesson for another article. - -In the meantime, if you have access to a joystick, try reading Pygame's documentation for its [joystick][4] module and see if you can make your sprite move that way. Alternately, see if you can get the [mouse][5] to interact with your sprite. - -Most importantly, have fun! - -### All the code used in this tutorial - -For your reference, here is all the code used in this series of articles so far. - -``` -#!/usr/bin/env python3 -# draw a world -# add a player and player control -# add player movement - -# GNU All-Permissive License -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - -import pygame -import sys -import os - -''' -Objects -''' - -class Player(pygame.sprite.Sprite): - ''' - Spawn a player - ''' - def __init__(self): - pygame.sprite.Sprite.__init__(self) - self.movex = 0 - self.movey = 0 - self.frame = 0 - self.images = [] - for i in range(1,5): - img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() - img.convert_alpha() - img.set_colorkey(ALPHA) - self.images.append(img) - self.image = self.images[0] - self.rect = self.image.get_rect() - - def control(self,x,y): - ''' - control player movement - ''' - self.movex += x - self.movey += y - - def update(self): - ''' - Update sprite position - ''' - - self.rect.x = self.rect.x + self.movex - self.rect.y = self.rect.y + self.movey - - # moving left - if self.movex < 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[self.frame//ani] - - # moving right - if self.movex > 0: - self.frame += 1 - if self.frame > 3*ani: - self.frame = 0 - self.image = self.images[(self.frame//ani)+4] - - -''' -Setup -''' -worldx = 960 -worldy = 720 - -fps = 40 # frame rate -ani = 4 # animation cycles -clock = pygame.time.Clock() -pygame.init() -main = True - -BLUE = (25,25,200) -BLACK = (23,23,23 ) -WHITE = (254,254,254) -ALPHA = (0,255,0) - -world = pygame.display.set_mode([worldx,worldy]) -backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() -backdropbox = world.get_rect() -player = Player() # spawn player -player.rect.x = 0 -player.rect.y = 0 -player_list = pygame.sprite.Group() -player_list.add(player) -steps = 10 # how fast to move - -''' -Main loop -''' -while main == True: - for event in pygame.event.get(): - if event.type == pygame.QUIT: - pygame.quit(); sys.exit() - main = False - - if event.type == pygame.KEYDOWN: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(-steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(steps,0) - if event.key == pygame.K_UP or event.key == ord('w'): - print('jump') - - if event.type == pygame.KEYUP: - if event.key == pygame.K_LEFT or event.key == ord('a'): - player.control(steps,0) - if event.key == pygame.K_RIGHT or event.key == ord('d'): - player.control(-steps,0) - if event.key == ord('q'): - pygame.quit() - sys.exit() - main = False - -# world.fill(BLACK) - world.blit(backdrop, backdropbox) - player.update() - player_list.draw(world) #refresh player position - pygame.display.flip() - clock.tick(fps) -``` - -You've come far and learned much, but there's a lot more to do. In the next few articles, you'll add enemy sprites, emulated gravity, and lots more. In the mean time, practice with Python! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/12/game-python-moving-player - -作者:[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/article/17/10/python-101 -[2]: https://opensource.com/article/17/12/program-game-python-part-2-creating-game-world -[3]: https://opensource.com/article/17/12/program-game-python-part-3-spawning-player -[4]: http://pygame.org/docs/ref/joystick.html -[5]: http://pygame.org/docs/ref/mouse.html#module-pygame.mouse diff --git a/sources/tech/20181228 The office coffee model of concurrent garbage collection.md b/sources/tech/20181228 The office coffee model of concurrent garbage collection.md new file mode 100644 index 0000000000..825eb4b536 --- /dev/null +++ b/sources/tech/20181228 The office coffee model of concurrent garbage collection.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The office coffee model of concurrent garbage collection) +[#]: via: (https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +The office coffee model of concurrent garbage collection +====== + +Garbage collection is a field with its own terminology. Concepts like like _mutator_ s, _card marking_ , and _write barriers_ create a hurdle to understanding how garbage collectors work. Here’s an analogy to explain the operations of a concurrent garbage collector using everyday items found in the workplace. + +Before we discuss the operation of _concurrent_ garbage collection, let’s introduce the dramatis personae. In offices around the world you’ll find one of these: + +![][1] + +In the workplace coffee is a natural resource. Employees visit the break room and fill their cups as required. That is, until the point someone goes to fill their cup only to discover the pot is _empty_! + +Immediately the office is thrown into chaos. Meeting are called. Investigations are held. The perpetrator who took the last cup without refilling the machine is found and [reprimanded][2]. Despite many passive aggressive notes the situation keeps happening, thus a committee is formed to decide if a larger coffee pot should be requisitioned. Once the coffee maker is again full office productivity slowly returns to normal. + +This is the model of _stop the world_ garbage collection. The various parts of your program proceed through their day consuming memory, or in our analogy coffee, without a care about the next allocation that needs to be made. Eventually one unlucky attempt to allocate memory is made only to find the heap, or the coffee pot, exhausted, triggering a stop the world garbage collection. + +* * * + +Down the road at a more enlightened workplace, management have adopted a different strategy for mitigating their break room’s coffee problems. Their policy is simple: if the pot is more than half full, fill your cup and be on your way. However, if the pot is less than half full, _before_ filling your cup, you must add a little coffee and a little water to the top of the machine. In this way, by the time the next person arrives for their re-up, the level in the pot will hopefully have risen higher than when the first person found it. + +This policy does come at a cost to office productivity. Rather than filling their cup and hoping for the best, each worker may, depending on the aggregate level of consumption in the office, have to spend a little time refilling the percolator and topping up the water. However, this is time spent by a person who was already heading to the break room. It costs a few extra minutes to maintain the coffee machine, but does not impact their officemates who aren’t in need of caffeination. If several people take a break at the same time, they will all find the level in the pot below the half way mark and all proceed to top up the coffee maker–the more consumption, the greater the rate the machine will be refilled, although this takes a little longer as the break room becomes congested. + +This is the model of _concurrent garbage collection_ as practiced by the Go runtime (and probably other language runtimes with concurrent collectors). Rather than each heap allocation proceeding blindly until the heap is exhausted, leading to a long stop the world pause, concurrent collection algorithms spread the work of walking the heap to find memory which is no longer reachable over the parts of the program allocating memory. In this way the parts of the program which allocate memory each pay a small cost–in terms of latency–for those allocations rather than the whole program being forced to halt when the heap is exhausted. + +Lastly, in keeping with the office coffee model, if the rate of coffee consumption in the office is so high that management discovers that their staff are always in the break room trying desperately to refill the coffee machine, it’s time to invest in a machine with a bigger pot–or in garbage collection terms, grow the heap. + +### Related posts: + + 1. [Visualising the Go garbage collector][3] + 2. [A whirlwind tour of Go’s runtime environment variables][4] + 3. [Why is a Goroutine’s stack infinite ?][5] + 4. [Introducing Go 2.0][6] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/wp-content/uploads/2018/12/20181204175004_79256.jpg +[2]: https://www.youtube.com/watch?v=ww86iaucd2A +[3]: https://dave.cheney.net/2014/07/11/visualising-the-go-garbage-collector (Visualising the Go garbage collector) +[4]: https://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables (A whirlwind tour of Go’s runtime environment variables) +[5]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutine’s stack infinite ?) +[6]: https://dave.cheney.net/2016/10/25/introducing-go-2-0 (Introducing Go 2.0) diff --git a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md index 724a1c35a3..dcc89034db 100644 --- a/sources/tech/20181231 Troubleshooting hardware problems in Linux.md +++ b/sources/tech/20181231 Troubleshooting hardware problems in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (suphgcm) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20190104 Take to the virtual skies with FlightGear.md b/sources/tech/20190104 Take to the virtual skies with FlightGear.md deleted file mode 100644 index b6122e8aff..0000000000 --- a/sources/tech/20190104 Take to the virtual skies with FlightGear.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Take to the virtual skies with FlightGear) -[#]: via: (https://opensource.com/article/19/1/flightgear) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) - -Take to the virtual skies with FlightGear -====== -Dreaming of piloting a plane? Try open source flight simulator FlightGear. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/flightgear_cockpit_plane_sky.jpg?itok=LRy0lpOS) - -If you've ever dreamed of piloting a plane, you'll love [FlightGear][1]. It's a full-featured, [open source][2] flight simulator that runs on Linux, MacOS, and Windows. - -The FlightGear project began in 1996 due to dissatisfaction with commercial flight simulation programs, which were not scalable. Its goal was to create a sophisticated, robust, extensible, and open flight simulator framework for use in academia and pilot training or by anyone who wants to play with a flight simulation scenario. - -### Getting started - -FlightGear's hardware requirements are fairly modest, including an accelerated 3D video card that supports OpenGL for smooth framerates. It runs well on my Linux laptop with an i5 processor and only 4GB of RAM. Its documentation includes an [online manual][3]; a [wiki][4] with portals for [users][5] and [developers][6]; and extensive tutorials (such as one for its default aircraft, the [Cessna 172p][7]) to teach you how to operate it. - -It's easy to install on both [Fedora][8] and [Ubuntu][9] Linux. Fedora users can consult the [Fedora installation page][10] to get FlightGear running. - -On Ubuntu 18.04, I had to install a repository: - -``` -$ sudo add-apt-repository ppa:saiarcot895/flightgear -$ sudo apt-get update -$ sudo apt-get install flightgear -``` - -Once the installation finished, I launched it from the GUI, but you can also launch the application from a terminal by entering: - -``` -$ fgfs -``` - -### Configuring FlightGear - -The menu on the left side of the application window provides configuration options. - -![](https://opensource.com/sites/default/files/uploads/flightgear_menu.png) - -**Summary** returns you to the application's home screen. - -**Aircraft** shows the aircraft you have installed and offers the option to install up to 539 other aircraft available in FlightGear's default "hangar." I installed a Cessna 150L, a Piper J-3 Cub, and a Bombardier CRJ-700. Some of the aircraft (including the CRJ-700) have tutorials to teach you how to fly a commercial jet; I found the tutorials informative and accurate. - -![](https://opensource.com/sites/default/files/uploads/flightgear_aircraft.png) - -To select an aircraft to pilot, highlight it and click on **Fly!** at the bottom of the menu. I chose the default Cessna 172p and found the cockpit depiction extremely accurate. - -![](https://opensource.com/sites/default/files/uploads/flightgear_cockpit-view.png) - -The default airport is Honolulu, but you can change it in the **Location** menu by providing your favorite airport's [ICAO airport code][11] identifier. I found some small, local, non-towered airports like Olean and Dunkirk, New York, as well as larger airports including Buffalo, O'Hare, and Raleigh—and could even choose a specific runway. - -Under **Environment** , you can adjust the time of day, the season, and the weather. The simulation includes advance weather modeling and the ability to download current weather from [NOAA][12]. - -**Settings** provides an option to start the simulation in Paused mode by default. Also in Settings, you can select multi-player mode, which allows you to "fly" with other players on FlightGear supporters' global network of servers that allow for multiple users. You must have a moderately fast internet connection to support this functionality. - -The **Add-ons** menu allows you to download aircraft and additional scenery. - -### Take flight - -To "fly" my Cessna, I used a Logitech joystick that worked well. You can calibrate your joystick using an option in the **File** menu at the top. - -Overall, I found the simulation very accurate and think the graphics are great. Try FlightGear yourself — I think you will find it a very fun and complete simulation package. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/1/flightgear - -作者:[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]: http://home.flightgear.org/ -[2]: http://wiki.flightgear.org/GNU_General_Public_License -[3]: http://flightgear.sourceforge.net/getstart-en/getstart-en.html -[4]: http://wiki.flightgear.org/FlightGear_Wiki -[5]: http://wiki.flightgear.org/Portal:User -[6]: http://wiki.flightgear.org/Portal:Developer -[7]: http://wiki.flightgear.org/Cessna_172P -[8]: http://rpmfind.net/linux/rpm2html/search.php?query=flightgear -[9]: https://launchpad.net/~saiarcot895/+archive/ubuntu/flightgear -[10]: https://apps.fedoraproject.org/packages/FlightGear/ -[11]: https://en.wikipedia.org/wiki/ICAO_airport_code -[12]: https://www.noaa.gov/ diff --git a/sources/tech/20190107 Aliases- To Protect and Serve.md b/sources/tech/20190107 Aliases- To Protect and Serve.md deleted file mode 100644 index 783c59dc41..0000000000 --- a/sources/tech/20190107 Aliases- To Protect and Serve.md +++ /dev/null @@ -1,176 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Aliases: To Protect and Serve) -[#]: via: (https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Aliases: To Protect and Serve -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/prairie-path_1920.jpg?itok=wRARsM7p) - -Happy 2019! Here in the new year, we’re continuing our series on aliases. By now, you’ve probably read our [first article on aliases][1], and it should be quite clear how they are the easiest way to save yourself a lot of trouble. You already saw, for example, that they helped with muscle-memory, but let's see several other cases in which aliases come in handy. - -### Aliases as Shortcuts - -One of the most beautiful things about Linux's shells is how you can use zillions of options and chain commands together to carry out really sophisticated operations in one fell swoop. All right, maybe beauty is in the eye of the beholder, but let's agree that this feature published practical. - -The downside is that you often come up with recipes that are often hard to remember or cumbersome to type. Say space on your hard disk is at a premium and you want to do some New Year's cleaning. Your first step may be to look for stuff to get rid off in you home directory. One criteria you could apply is to look for stuff you don't use anymore. `ls` can help with that: - -``` -ls -lct -``` - -The instruction above shows the details of each file and directory (`-l`) and also shows when each item was last accessed (`-c`). It then orders the list from most recently accessed to least recently accessed (`-t`). - -Is this hard to remember? You probably don’t use the `-c` and `-t` options every day, so perhaps. In any case, defining an alias like - -``` -alias lt='ls -lct' -``` - -will make it easier. - -Then again, you may want to have the list show the oldest files first: - -``` -alias lo='lt -F | tac' -``` - -![aliases][3] - -Figure 1: The lt and lo aliases in action. - -[Used with permission][4] - -There are a few interesting things going here. First, we are using an alias (`lt`) to create another alias -- which is perfectly okay. Second, we are passing a new parameter to `lt` (which, in turn gets passed to `ls` through the definition of the `lt` alias). - -The `-F` option appends special symbols to the names of items to better differentiate regular files (that get no symbol) from executable files (that get an `*`), files from directories (end in `/`), and all of the above from links, symbolic and otherwise (that end in an `@` symbol). The `-F` option is throwback to the days when terminals where monochrome and there was no other way to easily see the difference between items. You use it here because, when you pipe the output from `lt` through to `tac` you lose the colors from `ls`. - -The third thing to pay attention to is the use of piping. Piping happens when you pass the output from an instruction to another instruction. The second instruction can then use that output as its own input. In many shells (including Bash), you pipe something using the pipe symbol (`|`). - -In this case, you are piping the output from `lt -F` into `tac`. `tac`'s name is a bit of a joke. You may have heard of `cat`, the instruction that was nominally created to con _cat_ enate files together, but that in practice is used to print out the contents of a file to the terminal. `tac` does the same, but prints out the contents it receives in reverse order. Get it? `cat` and `tac`. Developers, you so funny! - -The thing is both `cat` and `tac` can also print out stuff piped over from another instruction, in this case, a list of files ordered chronologically. - -So... after that digression, what comes out of the other end is the list of files and directories of the current directory in inverse order of freshness. - -The final thing you have to bear in mind is that, while `lt` will work the current directory and any other directory... - -``` -# This will work: -lt -# And so will this: -lt /some/other/directory -``` - -... `lo` will only work with the current directory: - -``` -# This will work: -lo -# But this won't: -lo /some/other/directory -``` - -This is because Bash expands aliases into their components. When you type this: - -``` -lt /some/other/directory -``` - -Bash REALLY runs this: - -``` -ls -lct /some/other/directory -``` - -which is a valid Bash command. - -However, if you type this: - -``` -lo /some/other/directory -``` - -Bash tries to run this: - -``` -ls -lct -F | tac /some/other/directory -``` - -which is not a valid instruction, because `tac` mainly because _/some/other/directory_ is a directory, and `cat` and `tac` don't do directories. - -### More Alias Shortcuts - - * `alias lll='ls -R'` prints out the contents of a directory and then drills down and prints out the contents of its subdirectories and the subdirectories of the subdirectories, and so on and so forth. It is a way of seeing everything you have under a directory. - - * `mkdir='mkdir -pv'` let's you make directories within directories all in one go. With the base form of `mkdir`, to make a new directory containing a subdirectory you have to do this: - -``` - mkdir newdir -mkdir newdir/subdir -``` - -Or this: - -``` -mkdir -p newdir/subdir -``` - -while with the alias you would only have to do this: - -``` -mkdir newdir/subdir -``` - -Your new `mkdir` will also tell you what it is doing while is creating new directories. - - - - -### Aliases as Safeguards - -The other thing aliases are good for is as safeguards against erasing or overwriting your files accidentally. At this stage you have probably heard the legendary story about the new Linux user who ran: - -``` -rm -rf / -``` - -as root, and nuked the whole system. Then there's the user who decided that: - -``` -rm -rf /some/directory/ * -``` - -was a good idea and erased the complete contents of their home directory. Notice how easy it is to overlook that space separating the directory path and the `*`. - -Both things can be avoided with the `alias rm='rm -i'` alias. The `-i` option makes `rm` ask the user whether that is what they really want to do and gives you a second chance before wreaking havoc in your file system. - -The same goes for `cp`, which can overwrite a file without telling you anything. Create an alias like `alias cp='cp -i'` and stay safe! - -### Next Time - -We are moving more and more into scripting territory. Next time, we'll take the next logical step and see how combining instructions on the command line gives you really interesting and sophisticated solutions to everyday admin problems. - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve - -作者:[Paul Brown][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/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/blog/learn/2019/1/aliases-protect-and-serve -[2]: https://www.linux.com/files/images/fig01png-0 -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fig01_0.png?itok=crqTm_va (aliases) -[4]: https://www.linux.com/licenses/category/used-permission diff --git a/sources/tech/20190108 Avoid package names like base, util, or common.md b/sources/tech/20190108 Avoid package names like base, util, or common.md new file mode 100644 index 0000000000..b2c70b0b2e --- /dev/null +++ b/sources/tech/20190108 Avoid package names like base, util, or common.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Avoid package names like base, util, or common) +[#]: via: (https://dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Avoid package names like base, util, or common +====== + +Writing a good Go package starts with its name. Think of your package’s name as an elevator pitch, you have to describe what it does using just one word. + +A common cause of poor package names are _utility packages_. These are packages where helpers and utility code congeal. These packages contain an assortment of unrelated functions, as such their utility is hard to describe in terms of what the package _provides_. This often leads to a package’s name being derived from what the package _contains_ —utilities. + +Package names like `utils` or `helpers` are commonly found in projects which have developed deep package hierarchies and want to share helper functions without introducing import loops. Extracting utility functions to new package breaks the import loop, but as the package stems from a design problem in the project, its name doesn’t reflect its purpose, only its function in breaking the import cycle. + +> [A little] duplication is far cheaper than the wrong abstraction. + +— [Sandy Metz][1] + +My recommendation to improve the name of `utils` or `helpers` packages is to analyse where they are imported and move the relevant functions into the calling package. Even if this results in some code duplication this is preferable to introducing an import dependency between two packages. In the case where utility functions are used in many places, prefer multiple packages, each focused on a single aspect with a correspondingly descriptive name. + +Packages with names like `base` or `common` are often found when functionality common to two or more related facilities, for example common types between a client and server or a server and its mock, has been refactored into a separate package. Instead the solution is to reduce the number of packages by combining client, server, and common code into a single package named after the facility the package provides. + +For example, the `net/http` package does not have `client` and `server` packages, instead it has `client.go` and `server.go` files, each holding their respective types. `transport.go` holds for the common message transport code used by both HTTP clients and servers. + +Name your packages after what they _provide_ , not what they _contain_. + +### Related posts: + + 1. [Simple profiling package moved, updated][2] + 2. [The package level logger anti pattern][3] + 3. [How to include C code in your Go package][4] + 4. [Why I think Go package management is important][5] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://www.sandimetz.com/blog/2016/1/20/the-wrong-abstraction +[2]: https://dave.cheney.net/2014/10/22/simple-profiling-package-moved-updated (Simple profiling package moved, updated) +[3]: https://dave.cheney.net/2017/01/23/the-package-level-logger-anti-pattern (The package level logger anti pattern) +[4]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package) +[5]: https://dave.cheney.net/2013/10/10/why-i-think-go-package-management-is-important (Why I think Go package management is important) diff --git a/sources/tech/20190108 How To Understand And Identify File types in Linux.md b/sources/tech/20190108 How To Understand And Identify File types in Linux.md deleted file mode 100644 index c1c4ca4c0a..0000000000 --- a/sources/tech/20190108 How To Understand And Identify File types in Linux.md +++ /dev/null @@ -1,359 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Understand And Identify File types in Linux) -[#]: via: (https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Understand And Identify File types in Linux -====== - -We all are knows, that everything is a file in Linux which includes Hard Disk, Graphics Card, etc. - -When you are navigating the Linux filesystem most of the files are fall under regular files and directories. - -But it has other file types as well for different purpose which fall in five categories. - -So, it’s very important to understand the file types in Linux that helps you in many ways. - -If you can’t believe this, you just gone through the complete article then you come to know how important is. - -If you don’t understand the file types you can’t make any changes on that without fear. - -If you made the changes wrongly that damage your system very badly so be careful when you are doing that. - -Files are very important in Linux because all the devices and daemon’s were stored as a file in Linux system. - -### How Many Types of File is Available in Linux? - -As per my knowledge, totally 7 types of files are available in Linux with 3 Major categories. The details are below. - - * Regular File - * Directory File - * Special Files (This category having five type of files) - * Link File - * Character Device File - * Socket File - * Named Pipe File - * Block File - - - -Refer the below table for better understanding of file types in Linux. -| Symbol | Meaning | -| – | Regular File. It starts with underscore “_”. | -| d | Directory File. It starts with English alphabet letter “d”. | -| l | Link File. It starts with English alphabet letter “l”. | -| c | Character Device File. It starts with English alphabet letter “c”. | -| s | Socket File. It starts with English alphabet letter “s”. | -| p | Named Pipe File. It starts with English alphabet letter “p”. | -| b | Block File. It starts with English alphabet letter “b”. | - -### Method-1: Manual Way to Identify File types in Linux - -If you are having good knowledge in Linux then you can easily identify the files type with help of above table. - -#### How to view the Regular files in Linux? - -Use the below command to view the Regular files in Linux. Regular files are available everywhere in Linux filesystem. -The Regular files color is `WHITE` - -``` -# ls -la | grep ^- --rw-------. 1 mageshm mageshm 1394 Jan 18 15:59 .bash_history --rw-r--r--. 1 mageshm mageshm 18 May 11 2012 .bash_logout --rw-r--r--. 1 mageshm mageshm 176 May 11 2012 .bash_profile --rw-r--r--. 1 mageshm mageshm 124 May 11 2012 .bashrc --rw-r--r--. 1 root root 26 Dec 27 17:55 liks --rw-r--r--. 1 root root 104857600 Jan 31 2006 test100.dat --rw-r--r--. 1 root root 104874307 Dec 30 2012 test100.zip --rw-r--r--. 1 root root 11536384 Dec 30 2012 test10.zip --rw-r--r--. 1 root root 61 Dec 27 19:05 test2-bzip2.txt --rw-r--r--. 1 root root 61 Dec 31 14:24 test3-bzip2.txt --rw-r--r--. 1 root root 60 Dec 27 19:01 test-bzip2.txt -``` - -#### How to view the Directory files in Linux? - -Use the below command to view the Directory files in Linux. Directory files are available everywhere in Linux filesystem. The Directory files colour is `BLUE` - -``` -# ls -la | grep ^d -drwxr-xr-x. 3 mageshm mageshm 4096 Dec 31 14:24 links/ -drwxrwxr-x. 2 mageshm mageshm 4096 Nov 16 15:44 perl5/ -drwxr-xr-x. 2 mageshm mageshm 4096 Nov 16 15:37 public_ftp/ -drwxr-xr-x. 3 mageshm mageshm 4096 Nov 16 15:37 public_html/ -``` - -#### How to view the Link files in Linux? - -Use the below command to view the Link files in Linux. Link files are available everywhere in Linux filesystem. -Two type of link files are available, it’s Soft link and Hard link. The Link files color is `LIGHT TURQUOISE` - -``` -# ls -la | grep ^l -lrwxrwxrwx. 1 root root 31 Dec 7 15:11 s-link-file -> /links/soft-link/test-soft-link -lrwxrwxrwx. 1 root root 38 Dec 7 15:12 s-link-folder -> /links/soft-link/test-soft-link-folder -``` - -#### How to view the Character Device files in Linux? - -Use the below command to view the Character Device files in Linux. Character Device files are available only in specific location. - -It’s available under `/dev` directory. The Character Device files color is `YELLOW` - -``` -# ls -la | grep ^c -crw-------. 1 root root 5, 1 Jan 28 14:05 console -crw-rw----. 1 root root 10, 61 Jan 28 14:05 cpu_dma_latency -crw-rw----. 1 root root 10, 62 Jan 28 14:05 crash -crw-rw----. 1 root root 29, 0 Jan 28 14:05 fb0 -crw-rw-rw-. 1 root root 1, 7 Jan 28 14:05 full -crw-rw-rw-. 1 root root 10, 229 Jan 28 14:05 fuse -``` - -#### How to view the Block files in Linux? - -Use the below command to view the Block files in Linux. The Block files are available only in specific location. -It’s available under `/dev` directory. The Block files color is `YELLOW` - -``` -# ls -la | grep ^b -brw-rw----. 1 root disk 7, 0 Jan 28 14:05 loop0 -brw-rw----. 1 root disk 7, 1 Jan 28 14:05 loop1 -brw-rw----. 1 root disk 7, 2 Jan 28 14:05 loop2 -brw-rw----. 1 root disk 7, 3 Jan 28 14:05 loop3 -brw-rw----. 1 root disk 7, 4 Jan 28 14:05 loop4 -``` - -#### How to view the Socket files in Linux? - -Use the below command to view the Socket files in Linux. The Socket files are available only in specific location. -The Socket files color is `PINK` - -``` -# ls -la | grep ^s -srw-rw-rw- 1 root root 0 Jan 5 16:36 system_bus_socket -``` - -#### How to view the Named Pipe files in Linux? - -Use the below command to view the Named Pipe files in Linux. The Named Pipe files are available only in specific location. The Named Pipe files color is `YELLOW` - -``` -# ls -la | grep ^p -prw-------. 1 root root 0 Jan 28 14:06 replication-notify-fifo| -prw-------. 1 root root 0 Jan 28 14:06 stats-mail| -``` - -### Method-2: How to Identify File types in Linux Using file Command? - -The file command allow us to determine various file types in Linux. There are three sets of tests, performed in this order: filesystem tests, magic tests, and language tests to identify file types. - -#### How to view the Regular files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Regular file. The file command will read the given file contents and display exactly what kind of file it is. - -That’s why we are seeing different results for each Regular files. See the below various results for Regular files. - -``` -# file 2daygeek_access.log -2daygeek_access.log: ASCII text, with very long lines - -# file powertop.html -powertop.html: HTML document, ASCII text, with very long lines - -# file 2g-test -2g-test: JSON data - -# file powertop.txt -powertop.txt: HTML document, UTF-8 Unicode text, with very long lines - -# file 2g-test-05-01-2019.tar.gz -2g-test-05-01-2019.tar.gz: gzip compressed data, last modified: Sat Jan 5 18:22:20 2019, from Unix, original size 450560 -``` - -#### How to view the Directory files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Directory file. See the results below. - -``` -# file Pictures/ -Pictures/: directory -``` - -#### How to view the Link files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Link file. See the results below. - -``` -# file log -log: symbolic link to /run/systemd/journal/dev-log -``` - -#### How to view the Character Device files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Character Device file. See the results below. - -``` -# file vcsu -vcsu: character special (7/64) -``` - -#### How to view the Block files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Block file. See the results below. - -``` -# file sda1 -sda1: block special (8/1) -``` - -#### How to view the Socket files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Socket file. See the results below. - -``` -# file system_bus_socket -system_bus_socket: socket -``` - -#### How to view the Named Pipe files in Linux Using file Command? - -Simple enter the file command on your terminal and followed by Named Pipe file. See the results below. - -``` -# file pipe-test -pipe-test: fifo (named pipe) -``` - -### Method-3: How to Identify File types in Linux Using stat Command? - -The stat command allow us to check file types or file system status. This utility giving more information than file command. It shows lot of information about the given file such as Size, Block Size, IO Block Size, Inode Value, Links, File permission, UID, GID, File Access, Modify and Change time details. - -#### How to view the Regular files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Regular file. - -``` -# stat 2daygeek_access.log - File: 2daygeek_access.log - Size: 14406929 Blocks: 28144 IO Block: 4096 regular file -Device: 10301h/66305d Inode: 1727555 Links: 1 -Access: (0644/-rw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2019-01-03 14:05:26.430328867 +0530 -Modify: 2019-01-03 14:05:26.460328868 +0530 -Change: 2019-01-03 14:05:26.460328868 +0530 - Birth: - -``` - -#### How to view the Directory files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Directory file. See the results below. - -``` -# stat Pictures/ - File: Pictures/ - Size: 4096 Blocks: 8 IO Block: 4096 directory -Device: 10301h/66305d Inode: 1703982 Links: 3 -Access: (0755/drwxr-xr-x) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2018-11-24 03:22:11.090000828 +0530 -Modify: 2019-01-05 18:27:01.546958817 +0530 -Change: 2019-01-05 18:27:01.546958817 +0530 - Birth: - -``` - -#### How to view the Link files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Link file. See the results below. - -``` -# stat /dev/log - File: /dev/log -> /run/systemd/journal/dev-log - Size: 28 Blocks: 0 IO Block: 4096 symbolic link -Device: 6h/6d Inode: 278 Links: 1 -Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root) -Access: 2019-01-05 16:36:31.033333447 +0530 -Modify: 2019-01-05 16:36:30.766666768 +0530 -Change: 2019-01-05 16:36:30.766666768 +0530 - Birth: - -``` - -#### How to view the Character Device files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Character Device file. See the results below. - -``` -# stat /dev/vcsu - File: /dev/vcsu - Size: 0 Blocks: 0 IO Block: 4096 character special file -Device: 6h/6d Inode: 16 Links: 1 Device type: 7,40 -Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 5/ tty) -Access: 2019-01-05 16:36:31.056666781 +0530 -Modify: 2019-01-05 16:36:31.056666781 +0530 -Change: 2019-01-05 16:36:31.056666781 +0530 - Birth: - -``` - -#### How to view the Block files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Block file. See the results below. - -``` -# stat /dev/sda1 - File: /dev/sda1 - Size: 0 Blocks: 0 IO Block: 4096 block special file -Device: 6h/6d Inode: 250 Links: 1 Device type: 8,1 -Access: (0660/brw-rw----) Uid: ( 0/ root) Gid: ( 994/ disk) -Access: 2019-01-05 16:36:31.596666806 +0530 -Modify: 2019-01-05 16:36:31.596666806 +0530 -Change: 2019-01-05 16:36:31.596666806 +0530 - Birth: - -``` - -#### How to view the Socket files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Socket file. See the results below. - -``` -# stat /var/run/dbus/system_bus_socket - File: /var/run/dbus/system_bus_socket - Size: 0 Blocks: 0 IO Block: 4096 socket -Device: 15h/21d Inode: 576 Links: 1 -Access: (0666/srw-rw-rw-) Uid: ( 0/ root) Gid: ( 0/ root) -Access: 2019-01-05 16:36:31.823333482 +0530 -Modify: 2019-01-05 16:36:31.810000149 +0530 -Change: 2019-01-05 16:36:31.810000149 +0530 - Birth: - -``` - -#### How to view the Named Pipe files in Linux Using stat Command? - -Simple enter the stat command on your terminal and followed by Named Pipe file. See the results below. - -``` -# stat pipe-test - File: pipe-test - Size: 0 Blocks: 0 IO Block: 4096 fifo -Device: 10301h/66305d Inode: 1705583 Links: 1 -Access: (0644/prw-r--r--) Uid: ( 1000/ daygeek) Gid: ( 1000/ daygeek) -Access: 2019-01-06 02:00:03.040394731 +0530 -Modify: 2019-01-06 02:00:03.040394731 +0530 -Change: 2019-01-06 02:00:03.040394731 +0530 - Birth: - -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-understand-and-identify-file-types-in-linux/ - -作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 diff --git a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md b/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md deleted file mode 100644 index 3bad5ba969..0000000000 --- a/sources/tech/20190109 GoAccess - A Real-Time Web Server Log Analyzer And Interactive Viewer.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer) -[#]: via: (https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/) -[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) - -GoAccess – A Real-Time Web Server Log Analyzer And Interactive Viewer -====== - -Analyzing a log file is a big headache for Linux administrators as it’s capturing a lot of things. - -Most of the newbies and L1 administrators doesn’t know how to analyze this. - -If you have good knowledge to analyze a logs then you will be a legend for NIX system. - -There are many tools available in Linux to analyze the logs easily. - -GoAccess is one of the tool which allow users to analyze web server logs easily. - -We will be going to discuss in details about GoAccess tool in this article. - -### What is GoAccess? - -GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser. - -GoAccess has minimal requirements, it’s written in C and requires only ncurses. - -It will support Apache, Nginx and Lighttpd logs. It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly. - -GoAccess parses the specified web log file and outputs the data to the X terminal and browser. - -GoAccess was designed to be a fast, terminal-based log analyzer. Its core idea is to quickly analyze and view web server statistics in real time without needing to use your browser. - -Terminal output is the default output, it has the capability to generate a complete, self-contained, real-time HTML report, as well as a JSON, and CSV report. - -GoAccess allows any custom log format and the following (Combined Log Format (XLF/ELF) Apache | Nginx & Common Log Format (CLF) Apache) predefined log format options are included, but not limited to. - -### GoAccess Features - - * **`Completely Real Time:`** All the metrics are updated every 200 ms on the terminal and every second on the HTML output. - * **`Track Application Response Time:`** Track the time taken to serve the request. Extremely useful if you want to track pages that are slowing down your site. - * **`Visitors:`** Determine the amount of hits, visitors, bandwidth, and metrics for slowest running requests by the hour, or date. - * **`Metrics per Virtual Host:`** Have multiple Virtual Hosts (Server Blocks)? It features a panel that displays which virtual host is consuming most of the web server resources. - - - -### How to Install GoAccess? - -I would advise users to install GoAccess from distribution official repository with help of Package Manager. It is available in most of the distributions official repository. - -As we know, we will be getting bit outdated package for standard release distribution and rolling release distributions always include latest package. - -If you are running the OS with standard release distributions, i would suggest you to check the alternative options such as PPA or Official GoAccess maintainer repository, etc, to get a latest package. - -For **`Debian/Ubuntu`** systems, use **[APT-GET Command][1]** or **[APT Command][2]** to install GoAccess on your systems. - -``` -# apt install goaccess -``` - -To get a latest GoAccess package, use the below GoAccess official repository. - -``` -$ echo "deb https://deb.goaccess.io/ $(lsb_release -cs) main" | sudo tee -a /etc/apt/sources.list.d/goaccess.list -$ wget -O - https://deb.goaccess.io/gnugpg.key | sudo apt-key add - -$ sudo apt-get update -$ sudo apt-get install goaccess -``` - -For **`RHEL/CentOS`** systems, use **[YUM Package Manager][3]** to install GoAccess on your systems. - -``` -# yum install goaccess -``` - -For **`Fedora`** system, use **[DNF Package Manager][4]** to install GoAccess on your system. - -``` -# dnf install goaccess -``` - -For **`ArchLinux/Manjaro`** based systems, use **[Pacman Package Manager][5]** to install GoAccess on your systems. - -``` -# pacman -S goaccess -``` - -For **`openSUSE Leap`** system, use **[Zypper Package Manager][6]** to install GoAccess on your system. - -``` -# zypper install goaccess - -# zypper ar -f obs://server:http - -# zypper ref && zypper in goaccess -``` - -### How to Use GoAccess? - -After successful installation of GoAccess. Just enter the goaccess command and followed by the web server log location to view it. - -``` -# goaccess [options] /path/to/Web Server/access.log - -# goaccess /var/log/apache/2daygeek_access.log -``` - -When you execute the above command, it will ask you to select the **Log Format Configuration**. -![][8] - -I had tested this with Apache access log. The Apache log is splitted in fifteen section. The details are below. The main section shows the summary about the fifteen section. - -The below screenshots included four sessions such as Unique Visitors, Requested files, Static Requests, Not found URLs. -![][9] - -The below screenshots included four sessions such as Visitor Hostnames and IPs, Operating Systems, Browsers, Time Distribution. -![][10] - -The below screenshots included four sessions such as Referrers URLs, Referring Sites, Google’s search engine results, HTTP status codes. -![][11] - -If you would like to generate a html report, use the following format. - -Initially i got an error when i was trying to generate the html report. - -``` -# goaccess 2daygeek_access.log -a > report.html - -GoAccess - version 1.3 - Nov 23 2018 11:28:19 -Config file: No config file used - -Fatal error has occurred -Error occurred at: src/parser.c - parse_log - 2764 -No time format was found on your conf file.Parsing... [0] [0/s] -``` - -It says “No time format was found on your conf file”. To overcome this issue, add the “COMBINED” log format option on it. - -``` -# goaccess -f 2daygeek_access.log --log-format=COMBINED -o 2daygeek.html -Parsing...[0,165] [50,165/s] -``` - -![][12] - -GoAccess allows you to access and analyze the real-time log filtering and parsing. - -``` -# tail -f /var/log/apache/2daygeek_access.log | goaccess - -``` - -For more details navigate to man or help page. - -``` -# man goaccess -or -# goaccess --help -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer/ - -作者:[Vinoth 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.2daygeek.com/author/vinoth/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ -[2]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ -[3]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ -[4]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ -[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ -[6]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ -[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[8]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-1.png -[9]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-2.png -[10]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-3.png -[11]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-4.png -[12]: https://www.2daygeek.com/wp-content/uploads/2019/01/goaccess-a-real-time-web-server-log-analyzer-and-interactive-viewer-5.png diff --git a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md b/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md deleted file mode 100644 index fbd8b9d120..0000000000 --- a/sources/tech/20190111 Top 5 Linux Distributions for Productivity.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top 5 Linux Distributions for Productivity) -[#]: via: (https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) - -Top 5 Linux Distributions for Productivity -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_main.jpg?itok=2IKyg_7_) - -I have to confess, this particular topic is a tough one to address. Why? First off, Linux is a productive operating system by design. Thanks to an incredibly reliable and stable platform, getting work done is easy. Second, to gauge effectiveness, you have to consider what type of work you need a productivity boost for. General office work? Development? School? Data mining? Human resources? You see how this question can get somewhat complicated. - -That doesn’t mean, however, that some distributions aren’t able to do a better job of configuring and presenting that underlying operating system into an efficient platform for getting work done. Quite the contrary. Some distributions do a much better job of “getting out of the way,” so you don’t find yourself in a work-related hole, having to dig yourself out and catch up before the end of day. These distributions help strip away the complexity that can be found in Linux, thereby making your workflow painless. - -Let’s take a look at the distros I consider to be your best bet for productivity. To help make sense of this, I’ve divided them into categories of productivity. That task itself was challenging, because everyone’s productivity varies. For the purposes of this list, however, I’ll look at: - - * General Productivity: For those who just need to work efficiently on multiple tasks. - - * Graphic Design: For those that work with the creation and manipulation of graphic images. - - * Development: For those who use their Linux desktops for programming. - - * Administration: For those who need a distribution to facilitate their system administration tasks. - - * Education: For those who need a desktop distribution to make them more productive in an educational environment. - - - - -Yes, there are more categories to be had, many of which can get very niche-y, but these five should fill most of your needs. - -### General Productivity - -For general productivity, you won’t get much more efficient than [Ubuntu][1]. The primary reason for choosing Ubuntu for this category is the seamless integration of apps, services, and desktop. You might be wondering why I didn’t choose Linux Mint for this category? Because Ubuntu now defaults to the GNOME desktop, it gains the added advantage of GNOME Extensions (Figure 1). - -![GNOME Clipboard][3] - -Figure 1: The GNOME Clipboard Indicator extension in action. - -[Used with permission][4] - -These extensions go a very long way to aid in boosting productivity (so Ubuntu gets the nod over Mint). But Ubuntu didn’t just accept a vanilla GNOME desktop. Instead, they tweaked it to make it slightly more efficient and user-friendly, out of the box. And because Ubuntu contains just the right mixture of default, out-of-the-box, apps (that just work), it makes for a nearly perfect platform for productivity. - -Whether you need to write a paper, work on a spreadsheet, code a new app, work on your company website, create marketing images, administer a server or network, or manage human resources from within your company HR tool, Ubuntu has you covered. The Ubuntu desktop distribution also doesn’t require the user to jump through many hoops to get things working … it simply works (and quite well). Finally, thanks to it’s Debian base, Ubuntu makes installing third-party apps incredibly easy. - -Although Ubuntu tends to be the go-to for nearly every list of “top distributions for X,” it’s very hard to argue against this particular distribution topping the list of general productivity distributions. - -### Graphic Design - -If you’re looking to up your graphic design productivity, you can’t go wrong with [Fedora Design Suite][5]. This Fedora respin was created by the team responsible for all Fedora-related art work. Although the default selection of apps isn’t a massive collection of tools, those it does include are geared specifically for the creation and manipulation of images. - -With apps like GIMP, Inkscape, Darktable, Krita, Entangle, Blender, Pitivi, Scribus, and more (Figure 2), you’ll find everything you need to get your image editing jobs done and done well. But Fedora Design Suite doesn’t end there. This desktop platform also includes a bevy of tutorials that cover countless subjects for many of the installed applications. For anyone trying to be as productive as possible, this is some seriously handy information to have at the ready. I will say, however, the tutorial entry in the GNOME Favorites is nothing more than a link to [this page][6]. - -![Fedora Design Suite Favorites][8] - -Figure 2: The Fedora Design Suite Favorites menu includes plenty of tools for getting your graphic design on. - -[Used with permission][4] - -Those that work with a digital camera will certainly appreciate the inclusion of the Entangle app, which allows you to control your DSLR from the desktop. - -### Development - -Nearly all Linux distributions are great platforms for programmers. However, one particular distributions stands out, above the rest, as one of the most productive tools you’ll find for the task. That OS comes from [System76][9] and it’s called [Pop!_OS][10]. Pop!_OS is tailored specifically for creators, but not of the artistic type. Instead, Pop!_OS is geared toward creators who specialize in developing, programming, and making. If you need an environment that is not only perfected suited for your development work, but includes a desktop that’s sure to get out of your way, you won’t find a better option than Pop!_OS (Figure 3). - -What might surprise you (given how “young” this operating system is), is that Pop!_OS is also one of the single most stable GNOME-based platforms you’ll ever use. This means Pop!_OS isn’t just for creators and makers, but anyone looking for a solid operating system. One thing that many users will greatly appreciate with Pop!_OS, is that you can download an ISO specifically for your video hardware. If you have Intel hardware, [download][10] the version for Intel/AMD. If your graphics card is NVIDIA, download that specific release. Either way, you are sure go get a solid platform for which to create your masterpiece. - -![Pop!_OS][12] - -Figure 3: The Pop!_OS take on GNOME Overview. - -[Used with permission][4] - -Interestingly enough, with Pop!_OS, you won’t find much in the way of pre-installed development tools. You won’t find an included IDE, or many other dev tools. You can, however, find all the development tools you need in the Pop Shop. - -### Administration - -If you’re looking to find one of the most productive distributions for admin tasks, look no further than [Debian][13]. Why? Because Debian is not only incredibly reliable, it’s one of those distributions that gets out of your way better than most others. Debian is the perfect combination of ease of use and unlimited possibility. On top of which, because this is the distribution for which so many others are based, you can bet if there’s an admin tool you need for a task, it’s available for Debian. Of course, we’re talking about general admin tasks, which means most of the time you’ll be using a terminal window to SSH into your servers (Figure 4) or a browser to work with web-based GUI tools on your network. Why bother making use of a desktop that’s going to add layers of complexity (such as SELinux in Fedora, or YaST in openSUSE)? Instead, chose simplicity. - -![Debian][15] - -Figure 4: SSH’ing into a remote server on Debian. - -[Used with permission][4] - -And because you can select which desktop you want (from GNOME, Xfce, KDE, Cinnamon, MATE, LXDE), you can be sure to have the interface that best matches your work habits. - -### Education - -If you are a teacher or student, or otherwise involved in education, you need the right tools to be productive. Once upon a time, there existed the likes of Edubuntu. That distribution never failed to be listed in the top of education-related lists. However, that distro hasn’t been updated since it was based on Ubuntu 14.04. Fortunately, there’s a new education-based distribution ready to take that title, based on openSUSE. This spin is called [openSUSE:Education-Li-f-e][16] (Linux For Education - Figure 5), and is based on openSUSE Leap 42.1 (so it is slightly out of date). - -openSUSE:Education-Li-f-e includes tools like: - - * Brain Workshop - A dual n-back brain exercise - - * GCompris - An educational software suite for young children - - * gElemental - A periodic table viewer - - * iGNUit - A general purpose flash card program - - * Little Wizard - Development environment for children based on Pascal - - * Stellarium - An astronomical sky simulator - - * TuxMath - An math tutor game - - * TuxPaint - A drawing program for young children - - * TuxType - An educational typing tutor for children - - * wxMaxima - A cross platform GUI for the computer algebra system - - * Inkscape - Vector graphics program - - * GIMP - Graphic image manipulation program - - * Pencil - GUI prototyping tool - - * Hugin - Panorama photo stitching and HDR merging program - - -![Education][18] - -Figure 5: The openSUSE:Education-Li-f-e distro has plenty of tools to help you be productive in or for school. - -[Used with permission][4] - -Also included with openSUSE:Education-Li-f-e is the [KIWI-LTSP Server][19]. The KIWI-LTSP Server is a flexible, cost effective solution aimed at empowering schools, businesses, and organizations all over the world to easily install and deploy desktop workstations. Although this might not directly aid the student to be more productive, it certainly enables educational institutions be more productive in deploying desktops for students to use. For more information on setting up KIWI-LTSP, check out the openSUSE [KIWI-LTSP quick start guide][20]. - -Learn more about Linux through the free ["Introduction to Linux" ][21]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2019/1/top-5-linux-distributions-productivity - -作者:[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.ubuntu.com/ -[2]: /files/images/productivity1jpg -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_1.jpg?itok=yxez3X1w (GNOME Clipboard) -[4]: /licenses/category/used-permission -[5]: https://labs.fedoraproject.org/en/design-suite/ -[6]: https://fedoraproject.org/wiki/Design_Suite/Tutorials -[7]: /files/images/productivity2jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_2.jpg?itok=ke0b8qyH (Fedora Design Suite Favorites) -[9]: https://system76.com/ -[10]: https://system76.com/pop -[11]: /files/images/productivity3jpg-0 -[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_3_0.jpg?itok=8UkCUfsD (Pop!_OS) -[13]: https://www.debian.org/ -[14]: /files/images/productivity4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_4.jpg?itok=c9yD3Xw2 (Debian) -[16]: https://en.opensuse.org/openSUSE:Education-Li-f-e -[17]: /files/images/productivity5jpg -[18]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/productivity_5.jpg?itok=oAFtV8nT (Education) -[19]: https://en.opensuse.org/Portal:KIWI-LTSP -[20]: https://en.opensuse.org/SDB:KIWI-LTSP_quick_start -[21]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/sources/tech/20190127 Eliminate error handling by eliminating errors.md b/sources/tech/20190127 Eliminate error handling by eliminating errors.md new file mode 100644 index 0000000000..6eac4740eb --- /dev/null +++ b/sources/tech/20190127 Eliminate error handling by eliminating errors.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Eliminate error handling by eliminating errors) +[#]: via: (https://dave.cheney.net/2019/01/27/eliminate-error-handling-by-eliminating-errors) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Eliminate error handling by eliminating errors +====== + +Go 2 aims to improve the overhead of [error handling][1], but do you know what is better than an improved syntax for handling errors? Not needing to handle errors at all. Now, I’m not saying “delete your error handling code”, instead I’m suggesting changing your code so you don’t have as many errors to handle. + +This article draws inspiration from a chapter in John Ousterhout’s, _[A philosophy of Software Design,][2]_ “Define Errors Out of Existence”. I’m going to try to apply his advice to Go. + +* * * + +Here’s a function to count the number of lines in a file, + +``` +func CountLines(r io.Reader) (int, error) { + var ( + br = bufio.NewReader(r) + lines int + err error + ) + + for { + _, err = br.ReadString('\n') + lines++ + if err != nil { + break + } + } + + if err != io.EOF { + return 0, err + } + return lines, nil + } +``` + +We construct a `bufio.Reader`, then sit in a loop calling the `ReadString` method, incrementing a counter until we reach the end of the file, then we return the number of lines read. That’s the code we _wanted_ to write, instead `CountLines` is made more complicated by its error handling. For example, there is this strange construction: + +``` +_, err = br.ReadString('\n') +lines++ +if err != nil { + break +} +``` + +We increment the count of lines _before_ checking the error—​that looks odd. The reason we have to write it this way is `ReadString` will return an error if it encounters an end-of-file—`io.EOF`—before hitting a newline character. This can happen if there is no trailing newline. + +To address this problem, we rearrange the logic to increment the line count, then see if we need to exit the loop.1 + +But we’re not done checking errors yet. `ReadString` will return `io.EOF` when it hits the end of the file. This is expected, `ReadString` needs some way of saying _stop, there is nothing more to read_. So before we return the error to the caller of `CountLine`, we need to check if the error was _not_ `io.EOF`, and in that case propagate it up, otherwise we return `nil` to say that everything worked fine. This is why the final line of the function is not simply + +``` +return lines, err +``` + +I think this is a good example of Russ Cox’s [observation that error handling can obscure the operation of the function][3]. Let’s look at an improved version. + +``` +func CountLines(r io.Reader) (int, error) { + sc := bufio.NewScanner(r) + lines := 0 + + for sc.Scan() { + lines++ + } + + return lines, sc.Err() +} +``` + +This improved version switches from using `bufio.Reader` to `bufio.Scanner`. Under the hood `bufio.Scanner` uses `bufio.Reader` adding a layer of abstraction which helps remove the error handling which obscured the operation of our previous version of `CountLines` 2 + +The method `sc.Scan()` returns `true` if the scanner _has_ matched a line of text and _has not_ encountered an error. So, the body of our `for` loop will be called only when there is a line of text in the scanner’s buffer. This means our revised `CountLines` correctly handles the case where there is no trailing newline, It also correctly handles the case where the file is empty. + +Secondly, as `sc.Scan` returns `false` once an error is encountered, our `for` loop will exit when the end-of-file is reached or an error is encountered. The `bufio.Scanner` type memoises the first error it encounters and we recover that error once we’ve exited the loop using the `sc.Err()` method. + +Lastly, `buffo.Scanner` takes care of handling `io.EOF` and will convert it to a `nil` if the end of file was reached without encountering another error. + +* * * + +My second example is inspired by Rob Pikes’ _[Errors are values][4]_ blog post. + +When dealing with opening, writing and closing files, the error handling is present but not overwhelming as, the operations can be encapsulated in helpers like `ioutil.ReadFile` and `ioutil.WriteFile`. However, when dealing with low level network protocols it often becomes necessary to build the response directly using I/O primitives, thus the error handling can become repetitive. Consider this fragment of a HTTP server which is constructing a HTTP/1.1 response. + +``` +type Header struct { + Key, Value string +} + +type Status struct { + Code int + Reason string +} + +func WriteResponse(w io.Writer, st Status, headers []Header, body io.Reader) error { + _, err := fmt.Fprintf(w, "HTTP/1.1 %d %s\r\n", st.Code, st.Reason) + if err != nil { + return err + } + + for _, h := range headers { + _, err := fmt.Fprintf(w, "%s: %s\r\n", h.Key, h.Value) + if err != nil { + return err + } + } + + if _, err := fmt.Fprint(w, "\r\n"); err != nil { + return err + } + + _, err = io.Copy(w, body) + return err +} +``` + +First we construct the status line using `fmt.Fprintf`, and check the error. Then for each header we write the header key and value, checking the error each time. Lastly we terminate the header section with an additional `\r\n`, check the error, and copy the response body to the client. Finally, although we don’t need to check the error from `io.Copy`, we do need to translate it from the two return value form that `io.Copy` returns into the single return value that `WriteResponse` expects. + +Not only is this a lot of repetitive work, each operation—fundamentally writing bytes to an `io.Writer`—has a different form of error handling. But we can make it easier on ourselves by introducing a small wrapper type. + +``` +type errWriter struct { + io.Writer + err error +} + +func (e *errWriter) Write(buf []byte) (int, error) { + if e.err != nil { + return 0, e.err + } + + var n int + n, e.err = e.Writer.Write(buf) + return n, nil +} +``` + +`errWriter` fulfils the `io.Writer` contract so it can be used to wrap an existing `io.Writer`. `errWriter` passes writes through to its underlying writer until an error is detected. From that point on, it discards any writes and returns the previous error. + +``` +func WriteResponse(w io.Writer, st Status, headers []Header, body io.Reader) error { + ew := &errWriter{Writer: w} + fmt.Fprintf(ew, "HTTP/1.1 %d %s\r\n", st.Code, st.Reason) + + for _, h := range headers { + fmt.Fprintf(ew, "%s: %s\r\n", h.Key, h.Value) + } + + fmt.Fprint(ew, "\r\n") + io.Copy(ew, body) + + return ew.err +} +``` + +Applying `errWriter` to `WriteResponse` dramatically improves the clarity of the code. Each of the operations no longer needs to bracket itself with an error check. Reporting the error is moved to the end of the function by inspecting the `ew.err` field, avoiding the annoying translation from `io.Copy`’s return values. + +* * * + +When you find yourself faced with overbearing error handling, try to extract some of the operations into a helper type. + + 1. This logic _still_ isn’t correct, can you spot the bug? + 2. `bufio.Scanner` can scan for any pattern, by default it looks for newlines. + + + +### Related posts: + + 1. [Error handling vs. exceptions redux][5] + 2. [Stack traces and the errors package][6] + 3. [Subcommand handling in Go][7] + 4. [Constant errors][8] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/27/eliminate-error-handling-by-eliminating-errors + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md +[2]: https://www.amazon.com/Philosophy-Software-Design-John-Ousterhout/dp/1732102201 +[3]: https://www.youtube.com/watch?v=6wIP3rO6On8 +[4]: https://blog.golang.org/errors-are-values +[5]: https://dave.cheney.net/2014/11/04/error-handling-vs-exceptions-redux (Error handling vs. exceptions redux) +[6]: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package (Stack traces and the errors package) +[7]: https://dave.cheney.net/2013/11/07/subcommand-handling-in-go (Subcommand handling in Go) +[8]: https://dave.cheney.net/2016/04/07/constant-errors (Constant errors) diff --git a/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md b/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md deleted file mode 100644 index 366e75846d..0000000000 --- a/sources/tech/20190129 7 Methods To Identify Disk Partition-FileSystem UUID On Linux.md +++ /dev/null @@ -1,159 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 Methods To Identify Disk Partition/FileSystem UUID On Linux) -[#]: via: (https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -7 Methods To Identify Disk Partition/FileSystem UUID On Linux -====== - -As a Linux administrator you should aware of that how do you check partition UUID or filesystem UUID. - -Because most of the Linux systems are mount the partitions with UUID. The same has been verified in the `/etc/fstab` file. - -There are many utilities are available to check UUID. In this article we will show you how to check UUID in many ways and you can choose the one which is suitable for you. - -### What Is UUID? - -UUID stands for Universally Unique Identifier which helps Linux system to identify a hard drives partition instead of block device file. - -libuuid is part of the util-linux-ng package since kernel version 2.15.1 and it’s installed by default in Linux system. - -The UUIDs generated by this library can be reasonably expected to be unique within a system, and unique across all systems. - -It’s a 128 bit number used to identify information in computer systems. UUIDs were originally used in the Apollo Network Computing System (NCS) and later UUIDs are standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). - -UUIDs are represented as 32 hexadecimal (base 16) digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). - -For example: d92fa769-e00f-4fd7-b6ed-ecf7224af7fa - -Sample of my /etc/fstab file. - -``` -# cat /etc/fstab - -# /etc/fstab: static file system information. -# -# Use 'blkid' to print the universally unique identifier for a device; this may -# be used with UUID= as a more robust way to name devices that works even if -# disks are added and removed. See fstab(5). -# -# -UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f / ext4 defaults,noatime 0 1 -UUID=a2092b92-af29-4760-8e68-7a201922573b swap swap defaults,noatime 0 2 -``` - -We can check this using the following seven commands. - - * **`blkid Command:`** locate/print block device attributes. - * **`lsblk Command:`** lsblk lists information about all available or the specified block devices. - * **`hwinfo Command:`** hwinfo stands for hardware information tool is another great utility that used to probe for the hardware present in the system. - * **`udevadm Command:`** udev management tool. - * **`tune2fs Command:`** adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems. - * **`dumpe2fs Command:`** dump ext2/ext3/ext4 filesystem information. - * **`Using by-uuid Path:`** The directory contains UUID and real block device files, UUIDs were symlink with real block device files. - - - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing blkid Command? - -blkid is a command-line utility to locate/print block device attributes. It uses libblkid library to get disk partition UUID in Linux system. - -``` -# blkid -/dev/sda1: UUID="d92fa769-e00f-4fd7-b6ed-ecf7224af7fa" TYPE="ext4" PARTUUID="eab59449-01" -/dev/sdc1: UUID="d17e3c31-e2c9-4f11-809c-94a549bc43b7" TYPE="ext2" PARTUUID="8cc8f9e5-01" -/dev/sdc3: UUID="ca307aa4-0866-49b1-8184-004025789e63" TYPE="ext4" PARTUUID="8cc8f9e5-03" -/dev/sdc5: PARTUUID="8cc8f9e5-05" -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing lsblk Command? - -lsblk lists information about all available or the specified block devices. The lsblk command reads the sysfs filesystem and udev db to gather information. - -If the udev db is not available or lsblk is compiled without udev support than it tries to read LABELs, UUIDs and filesystem types from the block device. In this case root permissions are necessary. The command prints all block devices (except RAM disks) in a tree-like format by default. - -``` -# lsblk -o name,mountpoint,size,uuid -NAME MOUNTPOINT SIZE UUID -sda 30G -└─sda1 / 20G d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -sdb 10G -sdc 10G -├─sdc1 1G d17e3c31-e2c9-4f11-809c-94a549bc43b7 -├─sdc3 1G ca307aa4-0866-49b1-8184-004025789e63 -├─sdc4 1K -└─sdc5 1G -sdd 10G -sde 10G -sr0 1024M -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing by-uuid path? - -The directory contains UUID and real block device files, UUIDs were symlink with real block device files. - -``` -# ls -lh /dev/disk/by-uuid/ -total 0 -lrwxrwxrwx 1 root root 10 Jan 29 08:34 ca307aa4-0866-49b1-8184-004025789e63 -> ../../sdc3 -lrwxrwxrwx 1 root root 10 Jan 29 08:34 d17e3c31-e2c9-4f11-809c-94a549bc43b7 -> ../../sdc1 -lrwxrwxrwx 1 root root 10 Jan 29 08:34 d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -> ../../sda1 -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing hwinfo Command? - -**[hwinfo][1]** stands for hardware information tool is another great utility that used to probe for the hardware present in the system and display detailed information about varies hardware components in human readable format. - -``` -# hwinfo --block | grep by-uuid | awk '{print $3,$7}' -/dev/sdc1, /dev/disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 -/dev/sdc3, /dev/disk/by-uuid/ca307aa4-0866-49b1-8184-004025789e63 -/dev/sda1, /dev/disk/by-uuid/d92fa769-e00f-4fd7-b6ed-ecf7224af7fa -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing udevadm Command? - -udevadm expects a command and command specific options. It controls the runtime behavior of systemd-udevd, requests kernel events, manages the event queue, and provides simple debugging mechanisms. - -``` -udevadm info -q all -n /dev/sdc1 | grep -i by-uuid | head -1 -S: disk/by-uuid/d17e3c31-e2c9-4f11-809c-94a549bc43b7 -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing tune2fs Command? - -tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2, ext3, or ext4 filesystems. The current values of these options can be displayed by using the -l option. - -``` -# tune2fs -l /dev/sdc1 | grep UUID -Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 -``` - -### How To Check Disk Partition/FileSystem UUID In Linux Uusing dumpe2fs Command? - -dumpe2fs prints the super block and blocks group information for the filesystem present on device. - -``` -# dumpe2fs /dev/sdc1 | grep UUID -dumpe2fs 1.43.5 (04-Aug-2017) -Filesystem UUID: d17e3c31-e2c9-4f11-809c-94a549bc43b7 -``` - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/check-partitions-uuid-filesystem-uuid-universally-unique-identifier-linux/ - -作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 -[1]: https://www.2daygeek.com/hwinfo-check-display-detect-system-hardware-information-linux/ diff --git a/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md b/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md new file mode 100644 index 0000000000..75ad9e93c6 --- /dev/null +++ b/sources/tech/20190129 You shouldn-t name your variables after their types for the same reason you wouldn-t name your pets -dog- or -cat.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”) +[#]: via: (https://dave.cheney.net/2019/01/29/you-shouldnt-name-your-variables-after-their-types-for-the-same-reason-you-wouldnt-name-your-pets-dog-or-cat) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat” +====== + +The name of a variable should describe its contents, not the _type_ of the contents. Consider this example: + +``` +var usersMap map[string]*User +``` + +What are some good properties of this declaration? We can see that it’s a map, and it has something to do with the `*User` type, so that’s probably good. But `usersMap` _is_ a map and Go, being a statically typed language, won’t let us accidentally use a map where a different type is required, so the `Map` suffix as a safety precaution is redundant. + +Now, consider what happens if we declare other variables using this pattern: + +``` +var ( + companiesMap map[string]*Company + productsMap map[string]*Products +) +``` + +Now we have three map type variables in scope, `usersMap`, `companiesMap`, and `productsMap`, all mapping `string`s to different `struct` types. We know they are maps, and we also know that their declarations prevent us from using one in place of another—​the compiler will throw an error if we try to use `companiesMap` where the code is expecting a `map[string]*User`. In this situation it’s clear that the `Map` suffix does not improve the clarity of the code, its just extra boilerplate to type. + +My suggestion is avoid any suffix that resembles the _type_ of the variable. Said another way, if `users` isn’t descriptive enough, then `usersMap` won’t be either. + +This advice also applies to function parameters. For example: + +``` +type Config struct { + // +} + +func WriteConfig(w io.Writer, config *Config) +``` + +Naming the `*Config` parameter `config` is redundant. We know it’s a pointer to a `Config`, it says so right there in the declaration. Instead consider if `conf` will do, or maybe just `c` if the lifetime of the variable is short enough. + +This advice is more than just a desire for brevity. If there is more that one `*Config` in scope at any one time, calling them `config1` and `config2` is less descriptive than calling them `original` and `updated` . The latter are less likely to be accidentally transposed—something the compiler won’t catch—while the former differ only in a one character suffix. + +Finally, don’t let package names steal good variable names. The name of an imported identifier includes its package name. For example the `Context` type in the `context` package will be known as `context.Context` when imported into another package . This makes it impossible to use `context` as a variable or type, unless of course you rename the import, but that’s throwing good after bad. This is why the local declaration for `context.Context` types is traditionally `ctx`. eg. + +``` +func WriteLog(ctx context.Context, message string) +``` + +* * * + +A variable’s name should be independent of its type. You shouldn’t name your variables after their types for the same reason you wouldn’t name your pets “dog” or “cat”. You shouldn’t include the name of your type in the name of your variable for the same reason. + +### Related posts: + + 1. [On declaring variables][1] + 2. [Go, without package scoped variables][2] + 3. [A whirlwind tour of Go’s runtime environment variables][3] + 4. [Declaration scopes in Go][4] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/01/29/you-shouldnt-name-your-variables-after-their-types-for-the-same-reason-you-wouldnt-name-your-pets-dog-or-cat + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2014/05/24/on-declaring-variables (On declaring variables) +[2]: https://dave.cheney.net/2017/06/11/go-without-package-scoped-variables (Go, without package scoped variables) +[3]: https://dave.cheney.net/2015/11/29/a-whirlwind-tour-of-gos-runtime-environment-variables (A whirlwind tour of Go’s runtime environment variables) +[4]: https://dave.cheney.net/2016/12/15/declaration-scopes-in-go (Declaration scopes in Go) diff --git a/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md b/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md new file mode 100644 index 0000000000..78e0d0ecfd --- /dev/null +++ b/sources/tech/20190131 VA Linux- The Linux Company That Once Ruled NASDAQ.md @@ -0,0 +1,147 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (VA Linux: The Linux Company That Once Ruled NASDAQ) +[#]: via: (https://itsfoss.com/story-of-va-linux/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +VA Linux: The Linux Company That Once Ruled NASDAQ +====== + +This is our first article in the Linux and open source history series. We will be covering more trivia, anecdotes and other nostalgic events from the past. + +At its time, _VA Linux_ was indeed a crusade to free the world from Microsoft’s domination. + +On a historical incident in December 1999, the shares of a private firm skyrocketed from just $30 to a whopping $239 within just a day of its [IPO][1]! It was a record-breaking development that day. + +The company was _VA Linux_ , a firm with only 200 employees that was based on the idea of deploying Intel Hardware with Linux and FOSS, had begun a fantastic journey [on the likes of Sun and Dell][2]. + +It traded with a symbol LNUX and gained around 700 percent on its first day of trading. But hardly one year later, the [LNUX stocks were selling below $9 per share][3]. + +How come a successful Linux based company become a subsidiary of [Gamestop][4], a gaming company? + +Let us look back into the highs and lows of this record-breaking Linux corporation by knowing their history in brief. + +### How did it all actually begin? + +In the year 1993, a graduate student at Stanford University wanted to own a powerful workstation but could not afford to buy expensive [Sun][5] Workstations, which used to be sold at extremely high prices of $7,000 per system at that time. + +So, he decided to do build one on his own ([DIY][6] [FTW][7]!). Using an Intel 486-chip running at just 33 megahertz, he installed Linux and finally had a machine that was twice as fast as Sun’s but at a much lower price tag: $2,000. + +That student was none other than _VA Research_ founder [Larry Augustin][8], whose idea was loved by many at that exciting time in the Stanford campus. People started buying machines with similar configurations from him and his friend and co-founder, James Vera. This is how _VA Research_ was formed. + +![VA Linux founder, Larry Augustin][9] + +> Once software goes into the GPL, you can’t take it back. People can stop contributing, but the code that exists, people can continue to develop on it. +> +> Without a doubt, a futuristic quote from VA Linux founder, Larry Augustin, 10 years ago | Read the whole interview [here][10] + +#### Some screenshots of their web domains from the early days + +![Linux Powered Machines on sale on varesearch.com | July 15, 1997][11] + +![varesearch.com reveals emerging growth | February 16, 1998][12] + +![On June 26, 2001, they transitioned from hardware to software | valinux.com as on June 22, 2001][13] + +### The spectacular rise and the devastating fall of VA Linux + +VA Research had a big year in 1999 and perhaps it was the biggest for them as they acquired many growing companies and competitors at that time, along with starting many innovative initiatives. The next year in 2000, they created a subsidiary in Japan named _VA Linux Systems Japan K.K._ They were at their peak that year. + +After they transitioned completely from hardware to software, stock prices started to fall drastically since 2002. It all happened because of slower-than-expected sales growth from new customers in the dot-com sector. In the later years they sold off a few brands and top employees also resigned in 2010. + +Gamestop finally [acquired][14] Geeknet Inc. (the new name of VA Linux) for $140 million on June 2, 2015. + +In case you’re curious for a detailed chronicle, I have separately created this [timeline][15], highlighting events year-wise. + +![Image Credit: Wikipedia][16] + +### What happened to VA Linux afterward? + +Geeknet owned by Gamestop is now an online retailer for the global geek community as [ThinkGeek][17]. + +SourceForge and Slashdot were what still kept them linked with Linux and Open Source until _Dice Holdings_ acquired Slashdot, SourceForge, and Freecode. + +An [article][18] from 2016 sadly quotes in its final paragraph: + +> “Being acquired by a company that caters to gamers and does not have anything in particular to do with open source software may be a lackluster ending for what was once a spectacularly valuable Linux business.” + +Did we note Linux and Gamers? Does Linux really not have anything to do with Gaming? Are these two terms really so far apart? What about [Gaming on Linux][19]? What about [Open Source Games][20]? + +How could have the stalwarts from _VA Linux_ with years and years of experience in the Linux arena contributed to the Linux Gaming community? What could have happened had [Valve][21] (who are currently so [dedicated][22] towards Linux Gaming) acquired _VA Linux_ instead of Gamestop? Can we ponder? + +The seeds of ideas that were planted by _VA Research_ will continue to inspire the Linux and FOSS community because of its significant contributions in the world of Open Source. At _It’s FOSS,_ our heartfelt salute goes out to those noble ideas! + +Want to feel the nostalgia? Use the [timeline][15] dates with the [Way Back Machine][23] to check out previously owned _VA_ domains like _valinux.com_ or _varesearch.com_ in the past three decades! You can even check _linux.com_ that was once owned by _VA Linux Systems_. + +But wait, are we really done here? What happened to the subsidiary named _VA Linux Systems Japan K.K._? Well, it’s [a different story there][24] and still going strong with the original ideologies of _VA Linux_! + +![VA Linux booth circa 2000 | Image Credit: Storem][25] + +#### _VA Linux_ Subsidiary Still Operational in Japan! + +VA Linux is still operational through its [Japanese subsidiary][26]. It provides the following services: + + * Failure Analysis and Support Services: [_VA Quest_][27] + * Entrusted Development Service + * Consulting Service + + + +_VA_ _Quest_ , in particular, continues its services as a failure-analysis solution for tracking down and dealing with kernel bugs which might be getting in its customers’ way since 2005. [Tetsuro Yogo][28] took over as the New President and CEO on April 3, 2017. Check out their timeline [here][29]! They are also [on GitHub][30]! + +You can also read about a recent development reported on August 2 last year, on this [translated][31] version of a Japanese IT news page. It’s an update about _VA Linux_ providing technical support service of “[Kubernetes][32]” container management software in Japan. + +Its good to know that their 18-year-old subsidiary is still doing well in Japan and the name of _VA Linux_ continues to flourish there even today! + +What are your views? Do you want to share anything on _VA Linux_? Please let us know in the comments section below. + +I hope you liked this first article in the Linux history series. If you know such interesting facts from the past that you would like us to cover here, please let us know. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/story-of-va-linux/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Initial_public_offering +[2]: https://www.forbes.com/1999/05/03/feat.html +[3]: https://www.channelfutures.com/open-source/open-source-history-the-spectacular-rise-and-fall-of-va-linux +[4]: https://www.gamestop.com/ +[5]: http://www.sun.com/ +[6]: https://en.wikipedia.org/wiki/Do_it_yourself +[7]: https://www.urbandictionary.com/define.php?term=FTW +[8]: https://www.linkedin.com/in/larryaugustin/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Linux-Founder-Larry-Augustin.jpg?ssl=1 +[10]: https://www.linuxinsider.com/story/SourceForges-Larry-Augustin-A-Better-Way-to-Build-Web-Apps-62155.html +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Research-com-Snapshot-July-15-1997.jpg?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Research-com-Snapshot-Feb-16-1998.jpg?ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/09/VA-Linux-com-Snapshot-June-22-2001.jpg?ssl=1 +[14]: http://geekgirlpenpals.com/geeknet-parent-company-to-thinkgeek-entered-agreement-with-gamestop/ +[15]: https://medium.com/@avimanyu786/a-timeline-of-va-linux-through-the-years-6813e2bd4b13 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/LNUX-stock-fall.png?ssl=1 +[17]: https://www.thinkgeek.com/ +[18]: https://www.channelfutures.com/open-source/open-source-history-spectacular-rise-and-fall-va-linux +[19]: https://itsfoss.com/linux-gaming-distributions/ +[20]: https://en.wikipedia.org/wiki/Open-source_video_game +[21]: https://www.valvesoftware.com/ +[22]: https://itsfoss.com/steam-play-proton/ +[23]: https://archive.org/web/web.php +[24]: https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fwww.valinux.co.jp%2Fcorp%2Fstatement%2F&edit-text= +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/va-linux-team-booth.jpg?resize=800%2C600&ssl=1 +[26]: https://www.valinux.co.jp/english/ +[27]: https://www.linux.com/news/va-linux-announces-linux-failure-analysis-service +[28]: https://www.linkedin.com/in/yogo45/ +[29]: https://www.valinux.co.jp/english/about/timeline/ +[30]: https://github.com/vaj +[31]: https://translate.google.com/translate?sl=auto&tl=en&js=y&prev=_t&hl=en&ie=UTF-8&u=https%3A%2F%2Fit.impressbm.co.jp%2Farticles%2F-%2F16499 +[32]: https://en.wikipedia.org/wiki/Kubernetes diff --git a/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md b/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md new file mode 100644 index 0000000000..15349fbf32 --- /dev/null +++ b/sources/tech/20190202 CrossCode is an Awesome 16-bit Sci-Fi RPG Game.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (CrossCode is an Awesome 16-bit Sci-Fi RPG Game) +[#]: via: (https://itsfoss.com/crosscode-game/) +[#]: author: (Phillip Prado https://itsfoss.com/author/phillip/) + +CrossCode is an Awesome 16-bit Sci-Fi RPG Game +====== + +What starts off as an obvious sci-fi 16-bit 2D action RPG quickly turns into a JRPG inspired pseudo-MMO open-world puzzle platformer. Though at first glance this sounds like a jumbled mess, [CrossCode][1] manages to bundle all of its influences into a seamless gaming experience that feels nothing shy of excellent. + +Note: CrossCode is not open source software. We have covered it because it is Linux specific. + +![][2] + +### Story + +You play as Lea, a girl who has forgotten her identity, where she comes from, and how to speak. As you walk through the early parts of the story, you come to find that you are a character in a digital world — a video game. But not just any video game — an MMO. And you, Lea, must venture into the digital world known as CrossWorlds in order to unravel the secrets of your past. + +As you progress through the game, you unveil more and more about yourself, learning how you got to this point in the first place. This doesn’t sound too crazy of a story, but the gameplay implementation and appropriately paced storyline make for quite a captivating experience. + +The story unfolds at a satisfying speed and the character’s development is genuinely gratifying — both fictionally and mechanically. The only critique I had was that it felt like the introductory segment took a little too long — dragging the tutorial into the gameplay for quite some time, and keeping the player from getting into the real meat of the game. + +All-in-all, CrossCode’s story did not leave me wanting, not even in the slightest. It’s deep, fun, heartwarming, intelligent, and all while never sacrificing great character development. Without spoiling anything, I will say that if you are someone that enjoys a good story, you will need to give CrossCode a look. + +![][3] + +### Gameplay + +Yes, the story is great and all, but if there is one place that CrossCode truly shines, it has to be its gameplay. The game’s mechanics are fast-paced, challenging, intuitive, and downright fun! + +You start off with a dodge, block, melee, and ranged attack, each slowly developing overtime as the character tree is unlocked. This all-too-familiar mix of combat elements balances skill and hack-n-slash mechanics in a way that doesn’t conflict with one another. + +The game utilizes this mix of skills to create some amazing puzzle solving and combat that helps CrossCode’s gameplay truly stand out. Whether you are making your way through one of the four main dungeons, or you are taking a boss head on, you can’t help but periodically stop and think “wow, this game is great!” + +Though this has to be the game’s strongest feature, it can also be the game’s biggest downfall. Part of the reason that the story and character progression is so satisfying is because the combat and puzzle mechanics can be incredibly challenging, and that’s putting it lightly. + +There are times in which CrossCode’s gameplay feels downright impossible. Bosses take an expert amount of focus, and dungeons require all of the patience you can muster up just to simply finish them. + +![][4] + +The game requires a type of dexterity I have not quite had to master yet. I mean, sure there are more challenging puzzle games out there, yes there are more difficult platformers, and of course there are more grueling RPGs, but adding all of these elements into one game while spurring the player along with an alluring story requires a level of mechanical balance that I haven’t found in many other games. + +And though there were times I felt the gameplay was flat out punishing, I was constantly reminded that this is simply not the case. Death doesn’t cause serious character regression, you can take a break from dungeons when you feel overwhelmed, and there is a plethora of checkpoints throughout the game’s most difficult parts to help the player along. + +Where other games fall short by giving the player nothing to lose, this reality redeems CrossCode amid its rigorous gameplay. CrossCode may be one of the only games I know that takes two common flaws in games and holds the tension between them so well that it becomes one of the game’s best strengths. + +![][5] + +### Design + +One of the things that surprised me most about CrossCode was how well it’s world and sound design come together. Right off the bat, from the moment you boot the game up, it is clear the developers meant business when designing CrossCode. + +Being in a fictional MMO world, the game’s character ensemble is vibrant and distinctive, each having its own tone and personality. The games sound and motion graphics are tactile and responsive, giving the player a healthy amount of feedback during gameplay. And the soundtrack behind the game is simply beautiful, ebbing and flowing between intense moments of combat to blissful moments of exploration. + +If I had to fault CrossCode in this category it would have to be in the size of the map. Yes, the dungeons are long, and yes, the CrossWorlds map looks gigantic, but I still wanted more to explore outside crippling dungeons. The game is beautiful and fluid, but akin to RPG games of yore — aka. Zelda games pre-Breath of the Wild — I wish there was just a little more for me to freely explore. + +It is obvious that the developers really cared about this aspect of the game, and you can tell they spent an incredible amount of time developing its design. CrossCode set itself up for success here in its plot and content, and the developers capitalize on the opportunity, knocking another category out of the park. + +![][6] + +### Conclusion + +In the end, it is obvious how I feel about this game. And just in case you haven’t caught on yet…I love it. It holds a near perfect balance between being difficult and rewarding, simple and complex, linear and open, making CrossCode one of [the best Linux games][7] out there. + +Developed by [Radical Fish Games][8], CrossCode was officially released for Linux on September 21, 2018, seven years after development began. You can pick up the game over on [Steam][9], [GOG][10], or [Humble Bundle][11]. + +If you play games regularly, you may want to [subscribe to Humble Monthly][12] ([affiliate][13] link). For $12 per month, you’ll get games worth over $100 (not all for Linux). Over 450,000 gamers worldwide use Humble Monthly. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/crosscode-game/ + +作者:[Phillip Prado][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/phillip/ +[b]: https://github.com/lujun9972 +[1]: http://www.cross-code.com/en/home +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Level-up.png?fit=800%2C451&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Equpiment.png?fit=800%2C451&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-character-development.png?fit=800%2C451&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-Environment.png?fit=800%2C451&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/CrossCode-dungeon.png?fit=800%2C451&ssl=1 +[7]: https://itsfoss.com/free-linux-games/ +[8]: http://www.radicalfishgames.com/ +[9]: https://store.steampowered.com/app/368340/CrossCode/ +[10]: https://www.gog.com/game/crosscode +[11]: https://www.humblebundle.com/store/crosscode +[12]: https://www.humblebundle.com/monthly?partner=itsfoss +[13]: https://itsfoss.com/affiliate-policy/ diff --git a/sources/tech/20190204 7 Best VPN Services For 2019.md b/sources/tech/20190204 7 Best VPN Services For 2019.md deleted file mode 100644 index 5916e330d6..0000000000 --- a/sources/tech/20190204 7 Best VPN Services For 2019.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Modrisco) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 Best VPN Services For 2019) -[#]: via: (https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/) -[#]: author: (Editor https://www.ostechnix.com/author/editor/) - -7 Best VPN Services For 2019 -====== - -At least 67 percent of global businesses in the past three years have faced data breaching. The breaching has been reported to expose hundreds of millions of customers. Studies show that an estimated 93 percent of these breaches would have been avoided had data security fundamentals been considered beforehand. - -Understand that poor data security can be extremely costly, especially to a business and could quickly lead to widespread disruption and possible harm to your brand reputation. Although some businesses can pick up the pieces the hard way, there are still those that fail to recover. Today however, you are fortunate to have access to data and network security software. - -![](https://www.ostechnix.com/wp-content/uploads/2019/02/vpn-1.jpeg) - -As you start 2019, keep off cyber-attacks by investing in a **V** irtual **P** rivate **N** etwork commonly known as **VPN**. When it comes to online privacy and security, there are many uncertainties. There are hundreds of different VPN providers, and picking the right one means striking just the right balance between pricing, services, and ease of use. - -If you are looking for a solid 100 percent tested and secure VPN, you might want to do your due diligence and identify the best match. Here are the top 7 Best tried and tested VPN services For 2019. - -### 1. Vpnunlimitedapp - -With VPN Unlimited, you have total security. This VPN allows you to use any WIFI without worrying that your personal data can be leaked. With AES-256, your data is encrypted and protected against prying third-parties and hackers. This VPN ensures you stay anonymous and untracked on all websites no matter the location. It offers a 7-day trial and a variety of protocol options: OpenVPN, IKEv2, and KeepSolid Wise. Demanding users are entitled to special extras such as a personal server, lifetime VPN subscription, and personal IP options. - -### 2. VPN Lite - -VPN Lite is an easy-to-use and **free VPN service** that allows you to browse the internet at no charges. You remain anonymous and your privacy is protected. It obscures your IP and encrypts your data meaning third parties are not able to track your activities on all online platforms. You also get to access all online content. With VPN Lite, you get to access blocked sites in your state. You can also gain access to public WIFI without the worry of having sensitive information tracked and hacked by spyware and hackers. - -### 3. HotSpot Shield - -Launched in 2005, this is a popular VPN embraced by the majority of users. The VPN protocol here is integrated by at least 70 percent of the largest security companies globally. It is also known to have thousands of servers across the globe. It comes with two free options. One is completely free but supported by online advertisements, and the second one is a 7-day trial which is the flagship product. It contains military grade data encryption and protects against malware. HotSpot Shield guaranteed secure browsing and offers lightning-fast speeds. - -### 4. TunnelBear - -This is the best way to start if you are new to VPNs. It comes to you with a user-friendly interface complete with animated bears. With the help of TunnelBear, users are able to connect to servers in at least 22 countries at great speeds. It uses **AES 256-bit encryption** guaranteeing no data logging meaning your data stays protected. You also get unlimited data for up to five devices. - -### 5. ProtonVPN - -This VPN offers you a strong premium service. You may suffer from reduced connection speeds, but you also get to enjoy its unlimited data. It features an intuitive interface easy to use, and comes with a multi-platform compatibility. Proton’s servers are said to be specifically optimized for torrenting and thus cannot give access to Netflix. You get strong security features such as protocols and encryptions meaning your browsing activities remain secure. - -### 6. ExpressVPN - -This is known as the best offshore VPN for unblocking and privacy. It has gained recognition for being the top VPN service globally resulting from solid customer support and fast speeds. It offers routers that come with browser extensions and custom firmware. ExpressVPN also has an admirable scope of quality apps, plenty of servers, and can only support up to three devices. - -It’s not entirely free, and happens to be one of the most expensive VPNs on the market today because it is fully packed with the most advanced features. With it comes a 30-day money-back guarantee, meaning you can freely test this VPN for a month. Good thing is; it is completely risk-free. If you need a VPN for a short duration to bypass online censorship for instance, this could, be your go-to solution. You don’t want to give trials to a spammy, slow, free program. - -It is also one of the best ways to enjoy online streaming as well as outdoor security. Should you need to continue using it, you only have to renew or cancel your free trial if need be. Express VPN has over 2000 servers across 90 countries, unblocks Netflix, gives lightning fast connections, and gives users total privacy. - -### 7. PureVPN - -While this VPN may not be completely free, it falls under the most budget-friendly services on this list. Users can sign up for a free seven days trial and later choose one of its paid plans. With this VPN, you get to access 750-plus servers in at least 140 countries. There is also access to easy installation on almost all devices. All its paid features can still be accessed within the free trial window. That includes unlimited data transfers, IP leakage protection, and ISP invisibility. The supproted operating systems are iOS, Android, Windows, Linux, and macOS. - -### Summary - -With the large variety of available freemium VPN services today, why not take that opportunity to protect yourself and your customers? Understand that there are some great VPN services. Even the most secure free service however, cannot be touted as risk free. You might want to upgrade to a premium one for increased protection. Premium VPN allows you to test freely offering risk-free money-back guarantee. Whether you plan to sign up for a paid VPN or commit to a free one, it is highly advisable to have a VPN. - -**About the author:** - -**Renetta K. Molina** is a tech enthusiast and fitness enthusiast. She writes about technology, apps, WordPress and a variety of other topics. In her free time, she likes to play golf and read books. She loves to learn and try new things. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/7-best-opensource-vpn-services-for-2019/ - -作者:[Editor][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.ostechnix.com/author/editor/ -[b]: https://github.com/lujun9972 diff --git a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md index 13b441f85d..7ce1201c4f 100644 --- a/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md +++ b/sources/tech/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (ustblixin) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md new file mode 100644 index 0000000000..e8722c63cc --- /dev/null +++ b/sources/tech/20190205 Installing Kali Linux on VirtualBox- Quickest - Safest Way.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Installing Kali Linux on VirtualBox: Quickest & Safest Way) +[#]: via: (https://itsfoss.com/install-kali-linux-virtualbox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Installing Kali Linux on VirtualBox: Quickest & Safest Way +====== + +_**This tutorial shows you how to install Kali Linux on Virtual Box in Windows and Linux in the quickest way possible.**_ + +[Kali Linux][1] is one of the [best Linux distributions for hacking][2] and security enthusiasts. + +Since it deals with a sensitive topic like hacking, it’s like a double-edged sword. We have discussed it in the detailed Kali Linux review in the past so I am not going to bore you with the same stuff again. + +While you can install Kali Linux by replacing the existing operating system, using it via a virtual machine would be a better and safer option. + +With Virtual Box, you can use Kali Linux as a regular application in your Windows/Linux system. It’s almost the same as running VLC or a game in your system. + +Using Kali Linux in a virtual machine is also safe. Whatever you do inside Kali Linux will NOT impact your ‘host system’ (i.e. your original Windows or Linux operating system). Your actual operating system will be untouched and your data in the host system will be safe. + +![][3] + +### How to install Kali Linux on VirtualBox + +I’ll be using [VirtualBox][4] here. It is a wonderful open source virtualization solution for just about anyone (professional or personal use). It’s available free of cost. + +In this tutorial, we will talk about Kali Linux in particular but you can install almost any other OS whose ISO file exists or a pre-built virtual machine save file is available. + +**Note:** _The same steps apply for Windows/Linux running VirtualBox._ + +As I already mentioned, you can have either Windows or Linux installed as your host. But, in this case, I have Windows 10 installed (don’t hate me!) where I try to install Kali Linux in VirtualBox step by step. + +And, the best part is – even if you happen to use a Linux distro as your primary OS, the same steps will be applicable! + +Wondering, how? Let’s see… + +[Subscribe to Our YouTube Channel for More Linux Videos][5] + +### Step by Step Guide to install Kali Linux on VirtualBox + +_We are going to use a custom Kali Linux image made for VirtualBox specifically. You can also download the ISO file for Kali Linux and create a new virtual machine – but why do that when you have an easy alternative?_ + +#### 1\. Download and install VirtualBox + +The first thing you need to do is to download and install VirtualBox from Oracle’s official website. + +[Download VirtualBox][6] + +Once you download the installer, just double click on it to install VirtualBox. It’s the same for [installing VirtualBox on Ubuntu][7]/Fedora Linux as well. + +#### 2\. Download ready-to-use virtual image of Kali Linux + +After installing it successfully, head to [Offensive Security’s download page][8] to download the VM image for VirtualBox. If you change your mind to utilize [VMware][9], that is available too. + +![][10] + +As you can see the file size is well over 3 GB, you should either use the torrent option or download it using a [download manager][11]. + +[Kali Linux Virtual Image][8] + +#### 3\. Install Kali Linux on Virtual Box + +Once you have installed VirtualBox and downloaded the Kali Linux image, you just need to import it to VirtualBox in order to make it work. + +Here’s how to import the VirtualBox image for Kali Linux: + +**Step 1** : Launch VirtualBox. You will notice an **Import** button – click on it + +![Click on Import button][12] + +**Step 2:** Next, browse the file you just downloaded and choose it to be imported (as you can see in the image below). The file name should start with ‘kali linux‘ and end with . **ova** extension. + +![Importing Kali Linux image][13] + +**S** Once selected, proceed by clicking on **Next**. + +**Step 3** : Now, you will be shown the settings for the virtual machine you are about to import. So, you can customize them or not – that is your choice. It is okay if you go with the default settings. + +You need to select a path where you have sufficient storage available. I would never recommend the **C:** drive on Windows. + +![Import hard drives as VDI][14] + +Here, the hard drives as VDI refer to virtually mount the hard drives by allocating the storage space set. + +After you are done with the settings, hit **Import** and wait for a while. + +**Step 4:** You will now see it listed. So, just hit **Start** to launch it. + +You might get an error at first for USB port 2.0 controller support, you can disable it to resolve it or just follow the on-screen instruction of installing an additional package to fix it. And, you are done! + +![Kali Linux running in VirtualBox][15] + +The default username in Kali Linux is root and the default password is toor. You should be able to login to the system with it. + +Do note that you should [update Kali Linux][16] before trying to install a new applications or trying to hack your neighbor’s WiFi. + +I hope this guide helps you easily install Kali Linux on Virtual Box. Of course, Kali Linux has a lot of useful tools in it for penetration testing – good luck with that! + +**Tip** : Both Kali Linux and Ubuntu are Debian-based. If you face any issues or error with Kali Linux, you may follow the tutorials intended for Ubuntu or Debian on the internet. + +### Bonus: Free Kali Linux Guide Book + +If you are just starting with Kali Linux, it will be a good idea to know how to use Kali Linux. + +Offensive Security, the company behind Kali Linux, has created a guide book that explains the basics of Linux, basics of Kali Linux, configuration, setups. It also has a few chapters on penetration testing and security tools. + +Basically, it has everything you need to get started with Kali Linux. And the best thing is that the book is available to download for free. + +[Download Kali Linux Revealed for FREE][17] + +Let us know in the comments below if you face an issue or simply share your experience with Kali Linux on VirtualBox. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kali-linux-virtualbox/ + +作者:[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.kali.org/ +[2]: https://itsfoss.com/linux-hacking-penetration-testing/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box.png?resize=800%2C450&ssl=1 +[4]: https://www.virtualbox.org/ +[5]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[6]: https://www.virtualbox.org/wiki/Downloads +[7]: https://itsfoss.com/install-virtualbox-ubuntu/ +[8]: https://www.offensive-security.com/kali-linux-vm-vmware-virtualbox-image-download/ +[9]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-virtual-box-image.jpg?resize=800%2C347&ssl=1 +[11]: https://itsfoss.com/4-best-download-managers-for-linux/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-import-kali-linux.jpg?ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-linux-next.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/vmbox-kali-linux-settings.jpg?ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/kali-linux-on-windows-virtualbox.jpg?resize=800%2C429&ssl=1 +[16]: https://linuxhandbook.com/update-kali-linux/ +[17]: https://kali.training/downloads/Kali-Linux-Revealed-1st-edition.pdf diff --git a/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md b/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md new file mode 100644 index 0000000000..603ae570eb --- /dev/null +++ b/sources/tech/20190206 Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI) +[#]: via: (https://itsfoss.com/flowblade-video-editor-release/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Flowblade 2.0 is Here with New Video Editing Tools and a Refreshed UI +====== + +[Flowblade][1] is one of the rare [video editors that are only available for Linux][2]. It is not the feature set – but the simplicity, flexibility, and being an open source project that counts. + +However, with Flowblade 2.0 – released recently – it is now more powerful and useful. A lot of new tools along with a complete overhaul in the workflow can be seen. + +In this article, we shall take a look at what’s new with Flowblade 2.0. + +### New Features in Flowblade 2.0 + +Here are some of the major new changes in the latest release of Flowblade. + +#### GUI Updates + +![Flowblade 2.0][3] + +This was a much needed change. I’m always looking for open source solutions that works as expected along with a great GUI. + +So, in this update, you will observe a new custom theme set as the default – which looks good though. + +Overall, the panel design, the toolbox and stuff has been taken care of to make it look modern. The overhaul considers small changes like the cursor icon upon tool selection and so on. + +#### Workflow Overhaul + +No matter what features you get to utilize, the workflow matters to people who regularly edit videos. So, it has to be intuitive. + +With the recent release, they have made sure that you can configure and set the workflow as per your preference. Well, that is definitely flexible because not everyone has the same requirement. + +#### New Tools + +![Flowblade Video Editor Interface][4] + +**Keyframe tool** : This enables editing and adjusting the Volume and Brightness [keyframes][5] on timeline. + +**Multitrim** : A combination of trill, roll, and slip tool. + +**Cut:** Available now as a tool in addition to the traditional cut at the playhead. + +**Ripple trim:** It is a mode of Trim tool – not often used by many – now available as a separate tool. + +#### More changes? + +In addition to these major changes listed above, they have added some keyframe editing updates and compositors ( _AlphaXOR, Alpha Out, and Alpha_ ) to utilize alpha channel data to combine images. + +A lot of more tiny little changes have taken place as well – you can check those out in the official [changelog][6] on GitHub. + +### Installing Flowblade 2.0 + +If you use Debian or Ubuntu based Linux distributions, there are .deb binaries available for easily installing Flowblade 2.0. + +For the rest, you’ll have to [install it using the source code][7]. + +All the files are available on it’s GitHub page. You can download it from the page below. + +[Download Flowblade 2.0][8] + +### Wrapping Up + +If you are interested in video editing, perhaps you would like to follow the development of [Olive][9], a new open source video editor in development. + +Now that you know about the latest changes and additions. What do you think about Flowblade 2.0 as a video editor? Is it good enough for you? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/flowblade-video-editor-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/jliljebl/flowblade +[2]: https://itsfoss.com/best-video-editing-software-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/flowblade-2.jpg?ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/flowblade-2-1.jpg?resize=800%2C450&ssl=1 +[5]: https://en.wikipedia.org/wiki/Key_frame +[6]: https://github.com/jliljebl/flowblade/blob/master/flowblade-trunk/docs/RELEASE_NOTES.md +[7]: https://itsfoss.com/install-software-from-source-code/ +[8]: https://github.com/jliljebl/flowblade/releases/tag/v2.0 +[9]: https://itsfoss.com/olive-video-editor/ diff --git a/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md b/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md new file mode 100644 index 0000000000..7b51459c6b --- /dev/null +++ b/sources/tech/20190207 Review of Debian System Administrator-s Handbook.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Review of Debian System Administrator’s Handbook) +[#]: via: (https://itsfoss.com/debian-administrators-handbook/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Review of Debian System Administrator’s Handbook +====== + +_**Debian System Administrator’s Handbook is a free-to-download book that covers all the essential part of Debian that a sysadmin might need.**_ + +This has been on my to-do review list for quite some time. The book was started by two French Debian Developers Raphael Hertzog and Roland Mas to increase awareness about the Debian project in France. The book was a huge hit among francophone Linux users. The English translation followed soon after that. + +### Debian Administrator’s Handbook + +![][1] + +[Debian Administrator’s Handbook][2] is targeted from a newbie who may be looking to understand what the [Debian project][3] is all about to somebody who might be running a Debian in a production server. + +The latest version of the book covers Debian 8 while the current stable version is Debian 9. But it doesn’t mean that book is outdated and is of no use to Debian 9 users. Most of the part of the book is valid for all Debian and Linux users. + +Let me give you a quick summary of what this book covers. + +#### Section 1 – Debian Project + +The first section sets the tone of the book where it gives a solid foundation to somebody who might be looking into Debian as to what it actually means. Some of it will probably be updated to match the current scenario. + +#### Section 2 – Using fictional case studies for different needs + +The second section deals with the various case-scenarios as to where Debian could be used. The idea being how Debian can be used in various hierarchical or functional scenarios. One aspect which I felt that should have stressed upon is the culture mindshift and openness which at least should have been mentioned. + +#### Section 3 & 4- Setups and Installation + +The third section goes into looking in existing setups. I do think it should have stressed more into documenting existing setups, migrating partial services and users before making a full-fledged transition. While all of the above seem minor points, I have seen many of them come and bit me on the back during a transition. + +Section Four covers the various ways you could install, how the installation process flows and things to keep in mind before installing a Debian System. Unfortunately, UEFI was not present at that point so it was not talked about. + +#### Section 5 & 6 – Packaging System and Updates + +Section Five starts on how a binary package is structured and then goes on to tell how a source package is structured as well. It does mention several gotchas or tricky ways in which a sys-admin can be caught. + +Section Six is perhaps where most of the sysadmins spend most of the time apart from troubleshooting which is another chapter altogether. While it starts from many of the most often used sysadmin commands, the interesting point which I liked was on page 156 which is on better solver algorithims. + +#### Section 7 – Solving Problems and finding Relevant Solutions + +Section Seven, on the other hand, speaks of the various problem scenarios and various ways when you find yourself with a problem. In Debian and most GNU/Linux distributions, the keyword is ‘patience’. If you are patient then many problems in Debian are resolved or can be resolved after a good night’s sleep. + +#### Section 8 – Basic Configuration, Network, Accounts, Printing + +Section Eight introduces you to the basics of networking and having single or multiple user accounts on the workstation. It goes a bit into user and group configuration and practices then gives a brief introduction to the bash shell and gets a brief overview of the [CUPS][4] printing daemon. There is much to explore here. + +#### Section 9 – Unix Service + +Section 9 starts with the introduction to specific Unix services. While it starts with the much controversial, hated and reviled in many quarters [systemd][5], they also shared System V which is still used by many a sysadmin. + +#### Section 10, 11 & 12 – Networking and Adminstration + +Section 10 makes you dive into network infrastructure where it goes into the basics of Virtual Private Networks (OpenVPN), OpenSSH, the PKI credentials and some basics of information security. It also gets into basics of DNS, DHCP and IPv6 and ends with some tools which could help in troubleshooting network issues. + +Section 11 starts with basic configuration and workflow of mail server and postfix. It tries to a bit into depth as there is much to play with. It then goes into the popular web server Apache, FTP File server, NFS and CIFS with Windows shares via Samba. Again, much to explore therein. + +Section 12 starts with Advanced Administration topics such as RAID, LVM, when one is better than the other. Then gets into Virtualization, Xen and give brief about lxc. Again, there is much more to explore than shared herein. + +![Author Raphael Hertzog at a Debian booth circa 2013 | Image Credit][6] + +#### Section 13 – Workstation + +Section 13 shares about having schemas for xserver, display managers, window managers, menu management, the different desktops i.e. GNOME, KDE, XFCE and others. It does mention about lxde in the others. The one omission I felt which probably will be updated in a new release would be [Wayland][7] and [Xwayland][8]. Again much to explore in this section as well. This is rectified in the conclusion + +#### Section 14 – Security + +Section 14 is somewhat comprehensive on what constitues security and bits of threats analysis but stops short as it shares in the introduction of the chapter itself that it’s a vast topic. + +#### Section 15 – Creating a Debian package + +Section 15 explains the tools and processes to ‘ _debianize_ ‘ an application so it becomes part of the Debian archive and available for distribution on the 10 odd hardware architectures that Debian supports. + +### Pros and Cons + +Where Raphael and Roland have excelled is at breaking the visual monotony of the book by using a different style and structure wherever possible from the rest of the reading material. This compels the reader to refresh her eyes while at the same time focus on the important matter at the hand. The different visual style also indicates that this is somewhat more important from the author’s point of view. + +One of the drawbacks, if I may call it that, is the absolute absence of humor in the book. + +### Final Thoughts + +I have been [using Debian][9] for a decade so lots of it was a refresher for myself. Some of it is outdated if I look it from a buster perspective but is invaluable as a historical artifact. + +If you are looking to familiarize yourself with Debian or looking to run Debian 8 or 9 as a production server for your business wouldn’t be able to recommend a better book than this. + +### Download Debian Administrator’s Handbook + +The Debian Handbook has been available in every Debian release after 2012. The [liberation][10] of the Debian Handbook was done in 2012 using [ulule][11]. + +You can download an electronic version of the Debian Administrator’s Handbook in PDF, ePub or Mobi format from the link below: + +[Download Debian Administrator’s Handbook][12] + +You can also buy the book paperback edition of the book if you want to support the amazing work of the authors. + +[Buy the paperback edition][13] + +Lastly, if you want to motivate Raphael, you can reward by donating to his PayPal [account][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-administrators-handbook/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/Debian-Administrators-Handbook-review.png?resize=800%2C450&ssl=1 +[2]: https://debian-handbook.info/ +[3]: https://www.debian.org/ +[4]: https://www.cups.org +[5]: https://itsfoss.com/systemd-features/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/stand-debian-Raphael.jpg?resize=800%2C600&ssl=1 +[7]: https://wayland.freedesktop.org/ +[8]: https://en.wikipedia.org/wiki/X.Org_Server#XWayland +[9]: https://itsfoss.com/reasons-why-i-love-debian/ +[10]: https://debian-handbook.info/liberation/ +[11]: https://www.ulule.com/debian-handbook/ +[12]: https://debian-handbook.info/get/now/ +[13]: https://debian-handbook.info/get/ +[14]: https://raphaelhertzog.com/ diff --git a/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md b/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md new file mode 100644 index 0000000000..3b9af595d6 --- /dev/null +++ b/sources/tech/20190214 The Earliest Linux Distros- Before Mainstream Distros Became So Popular.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Earliest Linux Distros: Before Mainstream Distros Became So Popular) +[#]: via: (https://itsfoss.com/earliest-linux-distros/) +[#]: author: (Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/) + +The Earliest Linux Distros: Before Mainstream Distros Became So Popular +====== + +In this throwback history article, we’ve tried to look back into how some of the earliest Linux distributions evolved and came into being as we know them today. + +![][1] + +In here we have tried to explore how the idea of popular distros such as Red Hat, Debian, Slackware, SUSE, Ubuntu and many others came into being after the first Linux kernel became available. + +As Linux was initially released in the form of a kernel in 1991, the distros we know today was made possible with the help of numerous collaborators throughout the world with the creation of shells, libraries, compilers and related packages to make it a complete Operating System. + +### 1\. The first known “distro” by HJ Lu + +The way we know Linux distributions today goes back to 1992, when the first known distro-like tools to get access to Linux were released by HJ Lu. It consisted of two 5.25” floppy diskettes: + +![Linux 0.12 Boot and Root Disks | Photo Credit][2] + + * **LINUX 0.12 BOOT DISK** : The “boot” disk was used to boot the system first. + * **LINUX 0.12 ROOT DISK** : The second “root” disk for getting a command prompt for access to the Linux file system after booting. + + + +To install 0.12 on a hard drive, one had to use a hex editor to edit its master boot record (MBR) and that was quite a complex process, especially during that era. + +Feeling too nostalgic? + +You can [install cool-retro-term application][3] that gives you a Linux terminal in the vintage looks of the 90’s computers. + +### 2\. MCC Interim Linux + +![MCC Linux 0.99.14, 1993 | Image Credit][4] + +Initially released in the same year as “LINUX 0.12” by Owen Le Blanc of Manchester Computing Centre in England, MCC Interim Linux was the first Linux distribution for novice users with a menu driven installer and end user/programming tools. Also in the form of a collection of diskettes, it could be installed on a system to provide a basic text-based environment. + +MCC Interim Linux was much more user-friendly than 0.12 and the installation process on a hard drive was much easier and similar to modern ways. It did not require using a hex editor to edit the MBR. + +Though it was first released in February 1992, it was also available for download through FTP since November that year. + +### 3\. TAMU Linux + +![TAMU Linux | Image Credit][5] + +TAMU Linux was developed by Aggies at Texas A&M with the Texas A&M Unix & Linux Users Group in May 1992 and was called TAMU 1.0A. It was the first Linux distribution to offer the X Window System instead of just a text based operating system. + +### 4\. Softlanding Linux System (SLS) + +![SLS Linux 1.05, 1994 | Image Credit][6] + +“Gentle Touchdowns for DOS Bailouts” was their slogan! SLS was released by Peter McDonald in May 1992. SLS was quite widely used and popular during its time and greatly promoted the idea of Linux. But due to a decision by the developers to change the executable format in the distro, users stopped using it. + +Many of the popular distros the present community is most familiar with, evolved via SLS. Two of them are: + + * **Slackware** : One of the earliest Linux distros, Slackware was created by Patrick Volkerding in 1993. Slackware is based on SLS and was one of the very first Linux distributions. + * **Debian** : An initiative by Ian Murdock, Debian was also released in 1993 after moving on from the SLS model. The very popular Ubuntu distro we know today is based on Debian. + + + +### 5\. Yggdrasil + +![LGX Yggdrasil Fall 1993 | Image Credit][7] + +Released on December 1992, Yggdrasil was the first distro to give birth to the idea of Live Linux CDs. It was developed by Yggdrasil Computing, Inc., founded by Adam J. Richter in Berkeley, California. It could automatically configure itself on system hardware as “Plug-and-Play”, which is a very regular and known feature in today’s time. The later versions of Yggdrasil included a hack for running any proprietary MS-DOS CD-ROM driver within Linux. + +![Yggdrasil’s Plug-and-Play Promo | Image Credit][8] + +Their motto was “Free Software For The Rest of Us”. + +In the late 90s, one very popular distro was [Mandriva][9], first released in 1998, by unifying the French _Mandrake Linux_ distribution with the Brazilian _Conectiva Linux_ distribution. It had a release lifetime of 18 months for updates related to Linux and system software and desktop based updates were released every year. It also had server versions with 5 years of support. Now we have [Open Mandriva][10]. + +If you have more nostalgic distros to share from the earliest days of Linux release, please share with us in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/earliest-linux-distros/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/earliest-linux-distros.png?resize=800%2C450&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Linux-0.12-Floppies.jpg?ssl=1 +[3]: https://itsfoss.com/cool-retro-term/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/MCC-Interim-Linux-0.99.14-1993.jpg?fit=800%2C600&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/TAMU-Linux.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/01/SLS-1.05-1994.jpg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/LGX_Yggdrasil_CD_Fall_1993.jpg?fit=781%2C800&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/01/Yggdrasil-Linux-Summer-1994.jpg?ssl=1 +[9]: https://en.wikipedia.org/wiki/Mandriva_Linux +[10]: https://www.openmandriva.org/ diff --git a/sources/tech/20190218 Talk, then code.md b/sources/tech/20190218 Talk, then code.md new file mode 100644 index 0000000000..a4352ffdbf --- /dev/null +++ b/sources/tech/20190218 Talk, then code.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: (zianglei) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Talk, then code) +[#]: via: (https://dave.cheney.net/2019/02/18/talk-then-code) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Talk, then code +====== + +The open source projects that I contribute to follow a philosophy which I describe as _talk, then code_. I think this is generally a good way to develop software and I want to spend a little time talking about the benefits of this methodology. + +### Avoiding hurt feelings + +The most important reason for discussing the change you want to make is it avoids hurt feelings. Often I see a contributor work hard in isolation on a pull request only to find their work is rejected. This can be for a bunch of reasons; the PR is too large, the PR doesn’t follow the local style, the PR fixes an issue which wasn’t important to the project or was recently fixed indirectly, and many more. + +The underlying cause of all these issues is a lack of communication. The goal of the _talk, then code_ philosophy is not to impede or frustrate, but to ensure that a feature lands correctly the first time, without incurring significant maintenance debt, and neither the author of the change, or the reviewer, has to carry the emotional burden of dealing with hurt feelings when a change appears out of the blue with an implicit “well, I’ve done the work, all you have to do is merge it, right?” + +### What does discussion look like? + +Every new feature or bug fix should be discussed with the maintainer(s) of the project before work commences. It’s fine to experiment privately, but do not send a change without discussing it first. + +The definition of _talk_ for simple changes can be as little as a design sketch in a GitHub issue. If your PR fixes a bug, you should link to the bug it fixes. If there isn’t one, you should raise a bug and wait for the maintainers to acknowledge it before sending a PR. This might seem a little backward–who wouldn’t want a bug fixed–but consider the bug could be a misunderstanding in how the software works or it could be a symptom of a larger problem that needs further investigation. + +For more complicated changes, especially feature requests, I recommend that a design document be circulated and agreed upon before sending code. This doesn’t have to be a full blown document, a sketch in an issue may be sufficient, but the key is to reach agreement using words, before locking it in stone with code. + +In all cases you shouldn’t proceed to send code until there is a positive agreement from the maintainer that the approach is one they are happy with. A pull request is for life, not just for Christmas. + +### Code review, not design by committee + +A code review is not the place for arguments about design. This is for two reasons. First, most code review tools are not suitable for long comment threads, GitHub’s PR interface is very bad at this, Gerrit is better, but few have a team of admins to maintain a Gerrit instance. More importantly, disagreements at the code review stage suggests there wasn’t agreement on how the change should be implemented. + +* * * + +Talk about what you want to code, then code what you talked about. Please don’t do it the other way around. + +### Related posts: + + 1. [How to include C code in your Go package][1] + 2. [Let’s talk about logging][2] + 3. [The value of TDD][3] + 4. [Suggestions for contributing to an Open Source project][4] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/02/18/talk-then-code + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2013/09/07/how-to-include-c-code-in-your-go-package (How to include C code in your Go package) +[2]: https://dave.cheney.net/2015/11/05/lets-talk-about-logging (Let’s talk about logging) +[3]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD) +[4]: https://dave.cheney.net/2016/03/12/suggestions-for-contributing-to-an-open-source-project (Suggestions for contributing to an Open Source project) diff --git a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md b/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md deleted file mode 100644 index c7609f5022..0000000000 --- a/sources/tech/20190219 5 Good Open Source Speech Recognition-Speech-to-Text Systems.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 Good Open Source Speech Recognition/Speech-to-Text Systems) -[#]: via: (https://fosspost.org/lists/open-source-speech-recognition-speech-to-text) -[#]: author: (Simon James https://fosspost.org/author/simonjames) - -5 Good Open Source Speech Recognition/Speech-to-Text Systems -====== - -![](https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/open-source-speech-recognition-speech-to-text.png?resize=1237%2C527&ssl=1) - -A speech-to-text (STT) system is as its name implies; A way of transforming the spoken words via sound into textual files that can be used later for any purpose. - -Speech-to-text technology is extremely useful. It can be used for a lot of applications such as a automation of transcription, writing books/texts using your own sound only, enabling complicated analyses on information using the generated textual files and a lot of other things. - -In the past, the speech-to-text technology was dominated by proprietary software and libraries; Open source alternatives didn’t exist or existed with extreme limitations and no community around. This is changing, today there are a lot of open source speech-to-text tools and libraries that you can use right now. - -Here we list 5 of them. - -### Open Source Speech Recognition Libraries - -#### Project DeepSpeech - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 15 open source speech recognition][1] - -This project is made by Mozilla; The organization behind the Firefox browser. It’s a 100% free and open source speech-to-text library that also implies the machine learning technology using TensorFlow framework to fulfill its mission. - -In other words, you can use it to build training models yourself to enhance the underlying speech-to-text technology and get better results, or even to bring it to other languages if you want. You can also easily integrate it to your other machine learning projects that you are having on TensorFlow. Sadly it sounds like the project is currently only supporting English by default. - -It’s also available in many languages such as Python (3.6); Which allows you to have it working in seconds: - -``` -pip3 install deepspeech -deepspeech --model models/output_graph.pbmm --alphabet models/alphabet.txt --lm models/lm.binary --trie models/trie --audio my_audio_file.wav -``` - -You can also install it using npm: - -``` -npm install deepspeech -``` - -For more information, refer to the [project’s homepage][2]. - -#### Kaldi - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 17 open source speech recognition][3] - -Kaldi is an open source speech recognition software written in C++, and is released under the Apache public license. It works on Windows, macOS and Linux. Its development started back in 2009. - -Kaldi’s main features over some other speech recognition software is that it’s extendable and modular; The community is providing tons of 3rd-party modules that you can use for your tasks. Kaldi also supports deep neural networks, and offers an [excellent documentation on its website][4]. - -While the code is mainly written in C++, it’s “wrapped” by Bash and Python scripts. So if you are looking just for the basic usage of converting speech to text, then you’ll find it easy to accomplish that via either Python or Bash. - -[Project’s homepage][5]. - -#### Julius - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 19 open source speech recognition][6] - -Probably one of the oldest speech recognition software ever; It’s development started in 1991 at the University of Kyoto, and then its ownership was transferred to an independent project team in 2005. - -Julius main features include its ability to perform real-time STT processes, low memory usage (Less than 64MB for 20000 words), ability to produce N-best/Word-graph output, ability to work as a server unit and a lot more. This software was mainly built for academic and research purposes. It is written in C, and works on Linux, Windows, macOS and even Android (on smartphones). - -Currently it supports both English and Japanese languages only. The software is probably availbale to install easily in your Linux distribution’s repository; Just search for julius package in your package manager. The latest version was [released][7] around one and half months ago. - -[Project’s homepage][8]. - -#### Wav2Letter++ - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 21 open source speech recognition][9] - -If you are looking for something modern, then this one is for you. Wav2Letter++ is an open source speech recognition software that was released by Facebook’s AI Research Team just 2 months ago. The code is released under the BSD license. - -Facebook is [describing][10] its library as “the fastest state-of-the-art speech recognition system available”. The concepts on which this tool is built makes it optimized for performance by default; Facebook’s also-new machine learning library [FlashLight][11] is used as the underlying core of Wav2Letter++. - -Wav2Letter++ needs you first to build a training model for the language you desire by yourself in order to train the algorithms on it. No pre-built support of any language (including English) is available; It’s just a machine-learning-driven tool to convert speech to text. It was written in C++, hence the name (Wav2Letter++). - -[Project’s homepage][12]. - -#### DeepSpeech2 - -![5 Good Open Source Speech Recognition/Speech-to-Text Systems 23 open source speech recognition][13] - -Researchers at the Chinese giant Baidu are also working on their own speech-to-text engine, called DeepSpeech2. It’s an end-to-end open source engine that uses the “PaddlePaddle” deep learning framework for converting both English & Mandarin Chinese languages speeches into text. The code is released under BSD license. - -The engine can be trained on any model and for any language you desire. The models are not released with the code; You’ll have to build them yourself, just like the other software. DeepSpeech2’s source code is written in Python; So it should be easy for you to get familiar with it if that’s the language you use. - -[Project’s homepage][14]. - -### Conclusion - -The speech recognition category is still mainly dominated by proprietary software giants like Google and IBM (which do provide their own closed-source commercial services for this), but the open source alternatives are promising. Those 5 open source speech recognition engines should get you going in building your application, all of them are still under heavy development by time. In few years, we expect open source to become the norm for those technologies just like in the other industries. - -If you have any other recommendations for this list, or comments in general, we’d love to hear them below! - -** - -Shares - - --------------------------------------------------------------------------------- - -via: https://fosspost.org/lists/open-source-speech-recognition-speech-to-text - -作者:[Simon James][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://fosspost.org/author/simonjames -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/hero_speech-machine-learning2.png?resize=820%2C280&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 16 open source speech recognition) -[2]: https://github.com/mozilla/DeepSpeech -[3]: https://i0.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-19-1134.png?resize=591%2C138&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 18 open source speech recognition) -[4]: http://kaldi-asr.org/doc/index.html -[5]: http://kaldi-asr.org -[6]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/mic_web.png?resize=385%2C100&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 20 open source speech recognition) -[7]: https://github.com/julius-speech/julius/releases -[8]: https://github.com/julius-speech/julius -[9]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/fully_convolutional_ASR.png?resize=850%2C177&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 22 open source speech recognition) -[10]: https://code.fb.com/ai-research/wav2letter/ -[11]: https://github.com/facebookresearch/flashlight -[12]: https://github.com/facebookresearch/wav2letter -[13]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/ds2.png?resize=850%2C313&ssl=1 (5 Good Open Source Speech Recognition/Speech-to-Text Systems 24 open source speech recognition) -[14]: https://github.com/PaddlePaddle/DeepSpeech diff --git a/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md b/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md new file mode 100644 index 0000000000..92c6ded8c3 --- /dev/null +++ b/sources/tech/20190220 Decentralized Slack Alternative Riot Releases its First Stable Version.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Decentralized Slack Alternative Riot Releases its First Stable Version) +[#]: via: (https://itsfoss.com/riot-stable-release/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Decentralized Slack Alternative Riot Releases its First Stable Version +====== + +Remember [Riot messenger][1]? It’s a decentralized, encrypted open source messaging software based on the [Matrix protocol][2]. + +I wrote a [detailed tutorial on using Riot on Linux desktop][3]. The software was in beta back then. The first stable version, Riot 1.0 has been released a few days ago. Wonder what’s new? + +![][4] + +### New Features in Riot 1.0 + +Let’s look at some of the changes which were introduced in the move to Riot 1.0. + +#### New Looks and Branding + +![][5] + +The first thing that you see is the welcome screen which has a nice background and also a refreshed sky and dark blue logo which is cleaner and clearer than the previous logo. + +The welcome screen gives you the option to sign into an existing riot account on either matrix.org or any other homeserver or create an account. There is also the option to talk with the Riot Bot and have a room directory listing. + +#### Changing Homeservers and Making your own homeserver + +![Make your own homeserver][6] + +As you can see, here you can change the homeserver. The idea of riot as was shared before is to have [de-centralized][7] chat services, without foregoing the simplicity that centralized services offer. For those who want to run their own homeservers, you need the new [matrix-syanpse 0.99.1.1 reference homeserver][8]. + +You can find an unofficial list of matrix homeservers listed [here][9] although it’s far from complete. + +#### Internationalization and Languages. + +One of the more interesting things are that the UI and everything is now il8n-aware and has been translated to catala, dansk, duetsch, Spanish along with English (US) which is/was the default when I installed. We can hope to see some more improvements in language support going ahead. + +#### Favoriting a channel + +![Favoriting a channel in Riot][10] + +One of the things that has changed from last time is how you favorite a channel. Now as you can see, you select the channel, click on the three vertical dots in it and then either favorite or do whatever you want with it. + +#### Making changes to your profile and Settings + +![Riot Different settings you can do. ][11] + +Just clicking the drop-down box beside your Avatar you get the settings box. You click on the box and it gives a wide variety of settings you can change. + +As you can see there are lot more choices and the language is easier than before. + +#### Encryption and E2E + +![Riot encryption screen][12] + +One of the big things which riot has been talked about is Encryption and end-to-end encryption. This is still a work in progress. + +The new release brings the focus on two enhancements in encryption: key backup and emoji device verification (still in progress). + +With Riot 1.0, you can automatically backup your keys on your server. This key itself will be encrypted with a password so that it is stored securely. With this, you’ll never lose your encrypted message because you won’t lose your encryption key. + +You will soon be able to verify your device with emoji now which is easier than matching long strings, isn’t it? + +**In the end** + +Using Riot requires a bit of patience. Once you get the hang of it, there is nothing like it. This decentralized messaging app becomes an important tool in the arsenal of privacy cautious people. + +Riot is an important tool in the continuous effort to keep our data secure and privacy intact. The new major release makes it even more awesome. What do you think? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/riot-stable-release/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://about.riot.im/ +[2]: https://matrix.org/blog/home/ +[3]: https://itsfoss.com/riot-desktop/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-messenger.jpg?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-im-web-1.0-welcome-screen.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-change-homeservers.jpg?resize=800%2C420&ssl=1 +[7]: https://medium.com/s/story/why-decentralization-matters-5e3f79f7638e +[8]: https://github.com/matrix-org/synapse/releases/tag/v0.99.1.1 +[9]: https://www.hello-matrix.net/public_servers.php +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-channel-preferences.jpg?resize=800%2C420&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-settings-1-e1550427251686.png?ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/02/riot-web-1.0-encryption.jpg?fit=800%2C572&ssl=1 diff --git a/sources/tech/20190301 Emacs for (even more of) the win.md b/sources/tech/20190301 Emacs for (even more of) the win.md deleted file mode 100644 index c1697f3cae..0000000000 --- a/sources/tech/20190301 Emacs for (even more of) the win.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Emacs for (even more of) the win) -[#]: via: (https://so.nwalsh.com/2019/03/01/emacs) -[#]: author: (Norman Walsh https://so.nwalsh.com) - -Emacs for (even more of) the win -====== - -I use Emacs every day. I rarely notice it. But when I do, it usually brings me joy. - ->If you are a professional writer…Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. - -I’ve been using [Emacs][1] for well over twenty years. I use it for writing almost anything and everything (I edit Scala and Java in [IntelliJ][2]). I read my email in it. If it can be done in Emacs, that’s where I prefer to do it. - -Although I’ve used Emacs for literally decades, I realized around the new year that very little about my use of Emacs had changed in the past decade or more. New editing modes had come along, of course, I’d picked up a package or two, and I did adopt [Helm][3] a few years ago, but mostly it just did all the heavy lifting that I required of it, day in and day out without complaining or getting in my way. On the one hand, that’s a testament to how good it is. On the other hand, that’s an invitation to dig in and see what I’ve missed. - -At about the same time, I resolved to improve several aspects of my work life: - - * **Better meeting management.** I’m lead on a couple of projects at work and those projects have meetings, both regularly scheduled and ad hoc; some of them I run, some of them, I only attend. - -I realized I’d become sloppy about my participation in meetings. It’s all too easy sit in a room where there’s a meeting going on but actually read email and work on other items. (I strongly oppose the “no laptops” rule in meetings, but that’s a topic for another day.) - -There are a couple of problems with sloppy participation. First, it’s disrespectful to the person who convened the meeting and the other participants. That’s actually sufficient reason not to do it, but I think there’s another problem: it disguises the cost of meetings. - -If you’re in a meeting but also answering your email and maybe fixing a bug, then that meeting didn’t cost anything (or as much). If meetings are cheap, then there will be more of them. - -I want fewer, shorter meetings. I don’t want to disguise their cost, I want them to be perceived as damned expensive and to be avoided unless absolutely necessary. - -Sometimes, they are absolutely necessary. And I appreciate that a quick meeting can sometimes resolve an issue quickly. But if I have ten short meetings a day, let’s not pretend that I’m getting anything else productive accomplished. - -I resolved to take notes at all the meetings I attend. I’m not offering to take minutes, necessarily, but I am taking minutes of a sort. It keeps me focused on the meeting and not catching up on other things. - - * **Better time management.** There are lots and lots of things that I need or want to do, both professionally and personally. I’ve historically kept track off some of them in issue lists, some in saved email threads (in Emacs and [Gmail][4], for slightly different types of reminders), in my calendar, on “todo lists” of various sorts on my phone, and on little scraps of paper. And probably other places as well. - -I resolved to keep them all in one place. Not because I think there’s one place that’s uniformly best or better, but because I hope to accomplish two things. First, by having them all in one place, I hope to be able to develop a better and more holistic view of where I’m putting my energies. Second, because I want to develop a habitn. “A settled or regular tendency or practice, especially one that is hard to give up.” of recording, tracking, and preserving them. - - * **Better accountability.** If you work in certain science or engineering disciplines, you will have developed the habit of keeping a [lab notebook][5]. Alas, I did not. But I resolved to do so. - -I’m not interested in the legal aspects that encourage bound pages or scribing only in permanent marker. What I’m interested in is developing the habit of keeping a record. My goal is to have a place to jot down ideas and design sketches and the like. If I have sudden inspiration or if I think of an edge case that isn’t in the test suite, I want my instinct to be to write it in my journal instead of scribbling it on a scrap of paper or promising myself that I’ll remember it. - - - - -This confluence of resolutions led me quickly and more-or-less directly to [Org][6]. There is a large, active, and loyal community of Org users. I’ve played with it in the past (I even [wrote about it][7], at least in passing, a couple of years ago) and I tinkered long enough to [integrate MarkLogic][8] into it. (Boy has that paid off in the last week or two!) - -But I never used it. - -I am now using it. I take minutes in it, I record all of my todo items in it, and I keep a journal in it. I’m not sure there’s much value in me attempting to wax eloquent about it or enumerate all its features, you’ll find plenty of either with a quick web search. - -If you use Emacs, you should be using Org. If you don’t use Emacs, I’m confident you wouldn’t be the first person who started because of Org. It does a lot. It takes a little time to learn your way around and remember the shortcuts, but I think it’s worth it. (And if you carry an [iOS][9] device in your pocket, I recommend [beorg][10] for recording items while you’re on the go.) - -Naturally, I worked out how to [get XML out of it][11]⊕“Worked out” sure is a funny way to spell “hacked together in elisp.”. And from there, how to turn it back into the markup my weblog expects (and do so at the push of a button in Emacs, of course). So this is the first posting written in Org. It won’t be the last. - -P.S. Happy birthday [little weblog][12]. - --------------------------------------------------------------------------------- - -via: https://so.nwalsh.com/2019/03/01/emacs - -作者:[Norman Walsh][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://so.nwalsh.com -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Emacs -[2]: https://en.wikipedia.org/wiki/IntelliJ_IDEA -[3]: https://emacs-helm.github.io/helm/ -[4]: https://en.wikipedia.org/wiki/Gmail -[5]: https://en.wikipedia.org/wiki/Lab_notebook -[6]: https://en.wikipedia.org/wiki/Org-mode -[7]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/BalisageVol17-Walsh01.html -[8]: https://github.com/ndw/ob-ml-marklogic/ -[9]: https://en.wikipedia.org/wiki/IOS -[10]: https://beorgapp.com/ -[11]: https://github.com/ndw/org-to-xml -[12]: https://so.nwalsh.com/2017/03/01/helloWorld diff --git a/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md b/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md deleted file mode 100644 index d9d42b7a2f..0000000000 --- a/sources/tech/20190302 Create a Custom System Tray Indicator For Your Tasks on Linux.md +++ /dev/null @@ -1,187 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lujun9972) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Create a Custom System Tray Indicator For Your Tasks on Linux) -[#]: via: (https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux) -[#]: author: (M.Hanny Sabbagh https://fosspost.org/author/mhsabbagh) - -Create a Custom System Tray Indicator For Your Tasks on Linux -====== - -System Tray icons are still considered to be an amazing functionality today. By just right-clicking on the icon, and then selecting which actions you would like to take, you may ease your life a lot and save many unnecessary clicks on daily basis. - -When talking about useful system tray icons, examples like Skype, Dropbox and VLC do come to mind: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 11][1] - -However, system tray icons can actually be quite a lot more useful; By simply building one yourself for your own needs. In this tutorial, we’ll explain how to do that for you in very simple steps. - -### Prerequisites - -We are going to build a custom system tray indicator using Python. Python is probably installed by default on all the major Linux distributions, so just check it’s there (version 2.7). Additionally, we’ll need the gir1.2-appindicator3 package installed. It’s the library allowing us to easily create system tray indicators. - -To install it on Ubuntu/Mint/Debian: - -``` -sudo apt-get install gir1.2-appindicator3 -``` - -On Fedora: - -``` -sudo dnf install libappindicator-gtk3 -``` - -For other distributions, just search for any packages containing appindicator. - -On GNOME Shell, system tray icons are removed starting from 3.26. You’ll need to install the [following extension][2] (Or possibly other extensions) to re-enable the feature on your desktop. Otherwise, you won’t be able to see the indicator we are going to create here. - -### Basic Code - -Here’s the basic code of the indicator: - -``` -#!/usr/bin/python -import os -from gi.repository import Gtk as gtk, AppIndicator3 as appindicator - -def main(): - indicator = appindicator.Indicator.new("customtray", "semi-starred-symbolic", appindicator.IndicatorCategory.APPLICATION_STATUS) - indicator.set_status(appindicator.IndicatorStatus.ACTIVE) - indicator.set_menu(menu()) - gtk.main() - -def menu(): - menu = gtk.Menu() - - command_one = gtk.MenuItem('My Notes') - command_one.connect('activate', note) - menu.append(command_one) - - exittray = gtk.MenuItem('Exit Tray') - exittray.connect('activate', quit) - menu.append(exittray) - - menu.show_all() - return menu - -def note(_): - os.system("gedit $HOME/Documents/notes.txt") - -def quit(_): - gtk.main_quit() - -if __name__ == "__main__": - main() -``` - -We’ll explain how the code works later. But for know, just save it in a text file under the name tray.py, and run it using Python: - -``` -python tray.py -``` - -You’ll see the indicator working as follows: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 13][3] - -Now, to explain how we did the magic: - - * The first 3 lines of the code are nothing more than just specifying the Python path and importing the libraries we are going to use in our indicator. - - * def main() : This is the main function of the indicator. Under it we write the code to initialize and build the indicator. - - * indicator = appindicator.Indicator.new(“customtray”, “semi-starred-symbolic”, appindicator.IndicatorCategory.APPLICATION_STATUS) : Here we are specially creating a new indicator and calling it `customtray` . This is the special name of the indicator so that the system doesn’t mix it with other indicators that may be running. Also, we used the `semi-starred-symbolic` icon name as the default icon for our indicator. You could possibly change thing to any other things; Say `firefox` (if you want to see Firefox icon being used for the indicator), or any other icon name you would like. The last part regarding the `APPLICATION_STATUS` is just ordinary code for the categorization/scope of that indicator. - - * `indicator.set_status(appindicator.IndicatorStatus.ACTIVE)` : This line just turns the indicator on. - - * `indicator.set_menu(menu())` : Here, we are saying that we want to use the `menu()` function (which we’ll define later) for creating the menu items of our indicator. This is important so that when you click on the indicator, you can see a list of possible actions to take. - - * `gtk.main()` : Just run the main GTK loop. - - * Under `menu()` you’ll see that we are creating the actions/items we want to provide using our indicator. `command_one = gtk.MenuItem(‘My Notes’)` simply initializes the first menu item with the text “My notes”, and then `command_one.connect(‘activate’, note)` connects the `activate` signal of that menu item to the `note()` function defined later; In other words, we are telling our system here: “When this menu item is clicked, run the note() function”. Finally, `menu.append(command_one)` adds that menu item to the list. - - * The lines regarding `exittray` are just for creating an exit menu item to close the indicator any time you want. - - * `menu.show_all()` and `return menu` are just ordinary codes for returning the menu list to the indicator. - - * Under `note(_)` you’ll see the code that must be executed when the “My Notes” menu item is clicked. Here, we just wrote `os.system(“gedit $HOME/Documents/notes.txt”)` ; The `os.system` function is a function that allows us to run shell commands from inside Python, so here we wrote a command to open a file called `notes.txt` under the `Documents` folder in our home directory using the `gedit` editor. This for example can be your daily notes taking program from now on! - -### Adding your Needed Tasks - -There are only 2 things you need to touch in the code: - - 1. Define a new menu item under `menu()` for your desired task. - - 2. Create a new function to run a specific action when that menu item is clicked. - - -So, let’s say that you want to create a new menu item, which when clicked, plays a specific video/audio file on your hard disk using VLC? To do it, simply add the following 3 lines in line 17: - -``` -command_two = gtk.MenuItem('Play video/audio') -command_two.connect('activate', play) -menu.append(command_two) -``` - -And the following lines in line 30: - -``` -def play(_): - os.system("vlc /home//Videos/somevideo.mp4") -``` - -Replace /home//Videos/somevideo.mp4 with the path to the video/audio file you want. Now save the file and run the indicator again: - -``` -python tray.py -``` - -This is how you’ll see it now: - -![Create a Custom System Tray Indicator For Your Tasks on Linux 15][4] - -And when you click on the newly-created menu item, VLC will start playing! - -To create other items/tasks, simply redo the steps again. Just be careful to replace command_two with another name, like command_three, so that no clash between variables happen. And then define new separate functions like what we did with the play(_) function. - -The possibilities are endless from here; I am using this way for example to fetch some data from the web (using the urllib2 library) and display them for me any time. I am also using it for playing an mp3 file in the background using the mpg123 command, and I am defining another menu item to killall mpg123 to stop playing that audio whenever I want. CS:GO on Steam for example takes a huge time to exit (the window doesn’t close automatically), so as a workaround for this, I simply minimize the window and click on a menu item that I created which will execute killall -9 csgo_linux64. - -You can use this indicator for anything: Updating your system packages, possibly running some other scripts any time you want.. Literally anything. - -### Autostart on Boot - -We want our system tray indicator to start automatically on boot, we don’t want to run it manually each time. To do that, simply add the following command to your startup applications (after you replace the path to the tray.py file with yours): - -``` -nohup python /home//tray.py & -``` - -The very next time you reboot your system, the indicator will start working automatically after boot! - -### Conclusion - -You now know how to create your own system tray indicator for any task that you may want. This method should save you a lot of time depending on the nature and number of tasks you need to run on daily basis. Some users may prefer creating aliases from the command line, but this will require you to always open the terminal window or have a drop-down terminal emulator available, while here, the system tray indicator is always working and available for you. - -Have you used this method to run your tasks before? Would love to hear your thoughts. - - --------------------------------------------------------------------------------- - -via: https://fosspost.org/tutorials/custom-system-tray-icon-indicator-linux - -作者:[M.Hanny Sabbagh][a] -选题:[lujun9972][b] -译者:[lujun9972](https://github.com/lujun9972) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fosspost.org/author/mhsabbagh -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/Screenshot-at-2019-02-28-0808.png?resize=407%2C345&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 12) -[2]: https://extensions.gnome.org/extension/1031/topicons/ -[3]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1041.png?resize=434%2C140&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 14) -[4]: https://i2.wp.com/fosspost.org/wp-content/uploads/2019/03/Screenshot-at-2019-03-02-1141.png?resize=440%2C149&ssl=1 (Create a Custom System Tray Indicator For Your Tasks on Linux 16) diff --git a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md b/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md deleted file mode 100644 index 44d5531d83..0000000000 --- a/sources/tech/20190307 How to Restart a Network in Ubuntu -Beginner-s Tip.md +++ /dev/null @@ -1,208 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Restart a Network in Ubuntu [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/restart-network-ubuntu) -[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) - -How to Restart a Network in Ubuntu [Beginner’s Tip] -====== - -You’re [using an Ubuntu-based system and you just can’t seem to connect to your network][1]? You’d be surprised how many problems can a simple restart fix. - -In this article, I’ll go over multiple ways you can restart network in Ubuntu and other Linux distributions, so you can use whatever suits your needs. The methods are basically divided into two parts: - -![Ubuntu Restart Network][2] - -### Restart network in Ubuntu using command line - -If you are using Ubuntu server edition, you are already in the terminal. If you are using the desktop edition, you can access the terminal using Ctrl+Alt+T [keyboard shortcut in Ubuntu][3]. - -Now you have several commands at your disposal to restart network in Ubuntu. Some (or perhaps most) commands mentioned here should be applicable for restarting network in Debian and other Linux distributions as well. - -#### 1\. network manager service - -This is the easiest way to restart your network using the command line. It’s equivalent to the graphical way of doing it (restarts the Network-Manager service). - -``` -sudo service network-manager restart -``` - -The network icon should disappear for a moment and then reappear. - -#### 2\. systemd - -The **service** command is just a wrapper for this method (and also for init.d scripts and Upstart commands). The **systemctl** command is much more versatile than **service**. This is what I usually prefer. - -``` -sudo systemctl restart NetworkManager.service -``` - -The network icon (again) should disappear for a moment. To check out other **systemctl** options, you can refer to its man page. - -#### 3\. nmcli - -This is yet another tool for handling networks on a Linux machine. It is a pretty powerful tool that I find very practical. Many sysadmins prefer it since it is easy to use. - -There are two steps to this method: turning the network off, and then turning it back on. - -``` -sudo nmcli networking off -``` - -The network will shut down and the icon will disappear. To turn it back on: - -``` -sudo nmcli networking on -``` - -You can check out the man page of nmcli for more options. - -#### 4\. ifup & ifdown - -This commands handle a network interface directly, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the [must know networking commands in Linux][4]. - -To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on. - -A good practice would be to combine both of these commands: - -``` -sudo ifdown -a && sudo ifup -a -``` - -**Note:** This method will not make the network icon in your systray disappear, and yet you won’t be able to have a connection of any sort. - -**Bonus tool: nmtui (click to expand)** - -This is another method often used by system administrators. It is a text menu for managing networks right in your terminal. - -``` -nmtui -``` - -This should open up the following menu: - -![nmtui Menu][5] - -**Note** that in **nmtui** , you can select another option by using the **up** and **down arrow keys**. - -Select **Activate a connection** : - -![nmtui Menu Select "Activate a connection"][6] - -Press **Enter**. This should now open the **connections** menu. - -![nmtui Connections Menu][7] - -Here, go ahead and select the network with a **star (*)** next to it. In my case, it’s MGEO72. - -![Select your connection in the nmtui connections menu.][8] - -Press **Enter**. This should **deactivate** your connection. - -![nmtui Connections Menu with no active connection][9] - -Select the connection you want to activate: - -![Select the connection you want in the nmtui connections menu.][10] - -Press **Enter**. This should reactivate the selected connection. - -![nmtui Connections Menu][11] - -Press **Tab** twice to select **Back** : - -![Select "Back" in the nmtui connections menu.][12] - -Press **Enter**. This should bring you back to the **nmtui** main menu. - -![nmtui Main Menu][13] - -Select **Quit** : - -![nmtui Quit Main Menu][14] - -This should exit the application and bring you back to your terminal. - -That’s it! You have successfully restarted your network - -### Restart network in Ubuntu graphically - -This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section. - -NM-applet is the system tray applet indicator for [NetworkManager][15]. That’s what we’re going to use to restart our network. - -First of all, check out your top panel. You should find a network icon in your system tray (in my case, it is a Wi-Fi icon, since that’s what I use). - -Go ahead and click on that icon (or the sound or battery icon). This will open up the menu. Select “Turn Off” here. - -![Restart network in Ubuntu][16]Turn off your network - -The network icon should now disappear from the top panel. This means the network has been successfully turned off. - -Click again on your systray to reopen the menu. Select “Turn On”. - -![Restarting network in Ubuntu][17]Turn the network back on - -Congratulations! You have now restarted your network. - -#### Bonus Tip: Refresh available network list - -Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that. - -Ubuntu doesn’t have a ‘refresh wifi networks’ option directly. It’s sort of hidden. - -You’ll have to open the setting menu again and this time, click on “Select Network”. - -![Refresh wifi network list in Ubuntu][18]Select Network to change your WiFi connection - -Now, you won’t see the list of available wireless networks immediately. When you open the networks list, it takes around 5 seconds to refresh and show up other available wireless networks. - -![Select another wifi network in Ubuntu][19]Wait for around 5- seconds to see other available networks - -And here, you can select the network of your choice and click connect. That’s it. - -**Wrapping Up** - -Restarting your network or connection is something that every Linux user has to go through at some point in their experience. - -We hope that we helped you with plenty of methods for handling such issues! - -What do you use to restart/handle your network? Is there something we missed? Leave us a comment below. - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/restart-network-ubuntu - -作者:[Sergiu][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/sergiu/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/fix-no-wireless-network-ubuntu/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/ubuntu-restart-network.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/ubuntu-shortcuts/ -[4]: https://itsfoss.com/basic-linux-networking-commands/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu.png?fit=800%2C602&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu_select_option.png?fit=800%2C579&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_on.png?fit=800%2C585&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_select_connection_on.png?fit=800%2C576&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_off.png?fit=800%2C572&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_select_connection_off.png?fit=800%2C566&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_on-1.png?fit=800%2C585&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_connection_menu_back.png?fit=800%2C585&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmtui_menu_select_option-1.png?fit=800%2C579&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/nmui_menu_quit.png?fit=800%2C580&ssl=1 -[15]: https://wiki.gnome.org/Projects/NetworkManager -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/restart-network-ubuntu-1.jpg?resize=800%2C400&ssl=1 -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/restart-network-ubuntu-2.jpg?resize=800%2C400&ssl=1 -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/select-wifi-network-ubuntu.jpg?resize=800%2C400&ssl=1 -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/select-wifi-network-ubuntu-1.jpg?resize=800%2C400&ssl=1 -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/ubuntu-restart-network.png?fit=800%2C450&ssl=1 diff --git a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md b/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md deleted file mode 100644 index 1114863bf7..0000000000 --- a/sources/tech/20190308 Virtual filesystems in Linux- Why we need them and how they work.md +++ /dev/null @@ -1,196 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Virtual filesystems in Linux: Why we need them and how they work) -[#]: via: (https://opensource.com/article/19/3/virtual-filesystems-linux) -[#]: author: (Alison Chariken ) - -Virtual filesystems in Linux: Why we need them and how they work -====== -Virtual filesystems are the magic abstraction that makes the "everything is a file" philosophy of Linux possible. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ) - -What is a filesystem? According to early Linux contributor and author [Robert Love][1], "A filesystem is a hierarchical storage of data adhering to a specific structure." However, this description applies equally well to VFAT (Virtual File Allocation Table), Git, and [Cassandra][2] (a [NoSQL database][3]). So what distinguishes a filesystem? - -### Filesystem basics - -The Linux kernel requires that for an entity to be a filesystem, it must also implement the **open()** , **read()** , and **write()** methods on persistent objects that have names associated with them. From the point of view of [object-oriented programming][4], the kernel treats the generic filesystem as an abstract interface, and these big-three functions are "virtual," with no default definition. Accordingly, the kernel's default filesystem implementation is called a virtual filesystem (VFS). - - -![][5] -If we can open(), read(), and write(), it is a file as this console session shows. - -VFS underlies the famous observation that in Unix-like systems "everything is a file." Consider how weird it is that the tiny demo above featuring the character device /dev/console actually works. The image shows an interactive Bash session on a virtual teletype (tty). Sending a string into the virtual console device makes it appear on the virtual screen. VFS has other, even odder properties. For example, it's [possible to seek in them][6]. - -The familiar filesystems like ext4, NFS, and /proc all provide definitions of the big-three functions in a C-language data structure called [file_operations][7] . In addition, particular filesystems extend and override the VFS functions in the familiar object-oriented way. As Robert Love points out, the abstraction of VFS enables Linux users to blithely copy files to and from foreign operating systems or abstract entities like pipes without worrying about their internal data format. On behalf of userspace, via a system call, a process can copy from a file into the kernel's data structures with the read() method of one filesystem, then use the write() method of another kind of filesystem to output the data. - -The function definitions that belong to the VFS base type itself are found in the [fs/*.c files][8] in kernel source, while the subdirectories of fs/ contain the specific filesystems. The kernel also contains filesystem-like entities such as cgroups, /dev, and tmpfs, which are needed early in the boot process and are therefore defined in the kernel's init/ subdirectory. Note that cgroups, /dev, and tmpfs do not call the file_operations big-three functions, but directly read from and write to memory instead. - -The diagram below roughly illustrates how userspace accesses various types of filesystems commonly mounted on Linux systems. Not shown are constructs like pipes, dmesg, and POSIX clocks that also implement struct file_operations and whose accesses therefore pass through the VFS layer. - -![How userspace accesses various types of filesystems][9] -VFS are a "shim layer" between system calls and implementors of specific file_operations like ext4 and procfs. The file_operations functions can then communicate either with device-specific drivers or with memory accessors. tmpfs, devtmpfs and cgroups don't make use of file_operations but access memory directly. - -VFS's existence promotes code reuse, as the basic methods associated with filesystems need not be re-implemented by every filesystem type. Code reuse is a widely accepted software engineering best practice! Alas, if the reused code [introduces serious bugs][10], then all the implementations that inherit the common methods suffer from them. - -### /tmp: A simple tip - -An easy way to find out what VFSes are present on a system is to type **mount | grep -v sd | grep -v :/** , which will list all mounted filesystems that are not resident on a disk and not NFS on most computers. One of the listed VFS mounts will assuredly be /tmp, right? - -![Man with shocked expression][11] -Everyone knows that keeping /tmp on a physical storage device is crazy! credit: - -Why is keeping /tmp on storage inadvisable? Because the files in /tmp are temporary(!), and storage devices are slower than memory, where tmpfs are created. Further, physical devices are more subject to wear from frequent writing than memory is. Last, files in /tmp may contain sensitive information, so having them disappear at every reboot is a feature. - -Unfortunately, installation scripts for some Linux distros still create /tmp on a storage device by default. Do not despair should this be the case with your system. Follow simple instructions on the always excellent [Arch Wiki][12] to fix the problem, keeping in mind that memory allocated to tmpfs is not available for other purposes. In other words, a system with a gigantic tmpfs with large files in it can run out of memory and crash. Another tip: when editing the /etc/fstab file, be sure to end it with a newline, as your system will not boot otherwise. (Guess how I know.) - -### /proc and /sys - -Besides /tmp, the VFSes with which most Linux users are most familiar are /proc and /sys. (/dev relies on shared memory and has no file_operations). Why two flavors? Let's have a look in more detail. - -The procfs offers a snapshot into the instantaneous state of the kernel and the processes that it controls for userspace. In /proc, the kernel publishes information about the facilities it provides, like interrupts, virtual memory, and the scheduler. In addition, /proc/sys is where the settings that are configurable via the [sysctl command][13] are accessible to userspace. Status and statistics on individual processes are reported in /proc/ directories. - -![Console][14] -/proc/meminfo is an empty file that nonetheless contains valuable information. - -The behavior of /proc files illustrates how unlike on-disk filesystems VFS can be. On the one hand, /proc/meminfo contains the information presented by the command **free**. On the other hand, it's also empty! How can this be? The situation is reminiscent of a famous article written by Cornell University physicist N. David Mermin in 1985 called "[Is the moon there when nobody looks?][15] Reality and the quantum theory." The truth is that the kernel gathers statistics about memory when a process requests them from /proc, and there actually is nothing in the files in /proc when no one is looking. As [Mermin said][16], "It is a fundamental quantum doctrine that a measurement does not, in general, reveal a preexisting value of the measured property." (The answer to the question about the moon is left as an exercise.) - -![Full moon][17] -The files in /proc are empty when no process accesses them. ([Source][18]) - -The apparent emptiness of procfs makes sense, as the information available there is dynamic. The situation with sysfs is different. Let's compare how many files of at least one byte in size there are in /proc versus /sys. - -![](https://opensource.com/sites/default/files/uploads/virtualfilesystems_6-filesize.png) - -Procfs has precisely one, namely the exported kernel configuration, which is an exception since it needs to be generated only once per boot. On the other hand, /sys has lots of larger files, most of which comprise one page of memory. Typically, sysfs files contain exactly one number or string, in contrast to the tables of information produced by reading files like /proc/meminfo. - -The purpose of sysfs is to expose the readable and writable properties of what the kernel calls "kobjects" to userspace. The only purpose of kobjects is reference-counting: when the last reference to a kobject is deleted, the system will reclaim the resources associated with it. Yet, /sys constitutes most of the kernel's famous "[stable ABI to userspace][19]" which [no one may ever, under any circumstances, "break."][20] That doesn't mean the files in sysfs are static, which would be contrary to reference-counting of volatile objects. - -The kernel's stable ABI instead constrains what can appear in /sys, not what is actually present at any given instant. Listing the permissions on files in sysfs gives an idea of how the configurable, tunable parameters of devices, modules, filesystems, etc. can be set or read. Logic compels the conclusion that procfs is also part of the kernel's stable ABI, although the kernel's [documentation][19] doesn't state so explicitly. - -![Console][21] -Files in sysfs describe exactly one property each for an entity and may be readable, writable or both. The "0" in the file reveals that the SSD is not removable. - -### Snooping on VFS with eBPF and bcc tools - -The easiest way to learn how the kernel manages sysfs files is to watch it in action, and the simplest way to watch on ARM64 or x86_64 is to use eBPF. eBPF (extended Berkeley Packet Filter) consists of a [virtual machine running inside the kernel][22] that privileged users can query from the command line. Kernel source tells the reader what the kernel can do; running eBPF tools on a booted system shows instead what the kernel actually does. - -Happily, getting started with eBPF is pretty easy via the [bcc][23] tools, which are available as [packages from major Linux distros][24] and have been [amply documented][25] by Brendan Gregg. The bcc tools are Python scripts with small embedded snippets of C, meaning anyone who is comfortable with either language can readily modify them. At this count, [there are 80 Python scripts in bcc/tools][26], making it highly likely that a system administrator or developer will find an existing one relevant to her/his needs. - -To get a very crude idea about what work VFSes are performing on a running system, try the simple [vfscount][27] or [vfsstat][28], which show that dozens of calls to vfs_open() and its friends occur every second. - -![Console - vfsstat.py][29] -vfsstat.py is a Python script with an embedded C snippet that simply counts VFS function calls. - -For a less trivial example, let's watch what happens in sysfs when a USB stick is inserted on a running system. - -![Console when USB is inserted][30] -Watch with eBPF what happens in /sys when a USB stick is inserted, with simple and complex examples. - -In the first simple example above, the [trace.py][31] bcc tools script prints out a message whenever the sysfs_create_files() command runs. We see that sysfs_create_files() was started by a kworker thread in response to the USB stick insertion, but what file was created? The second example illustrates the full power of eBPF. Here, trace.py is printing the kernel backtrace (-K option) plus the name of the file created by sysfs_create_files(). The snippet inside the single quotes is some C source code, including an easily recognizable format string, that the provided Python script [induces a LLVM just-in-time compiler][32] to compile and execute inside an in-kernel virtual machine. The full sysfs_create_files() function signature must be reproduced in the second command so that the format string can refer to one of the parameters. Making mistakes in this C snippet results in recognizable C-compiler errors. For example, if the **-I** parameter is omitted, the result is "Failed to compile BPF text." Developers who are conversant with either C or Python will find the bcc tools easy to extend and modify. - -When the USB stick is inserted, the kernel backtrace appears showing that PID 7711 is a kworker thread that created a file called "events" in sysfs. A corresponding invocation with sysfs_remove_files() shows that removal of the USB stick results in removal of the events file, in keeping with the idea of reference counting. Watching sysfs_create_link() with eBPF during USB stick insertion (not shown) reveals that no fewer than 48 symbolic links are created. - -What is the purpose of the events file anyway? Using [cscope][33] to find the function [__device_add_disk()][34] reveals that it calls disk_add_events(), and either "media_change" or "eject_request" may be written to the events file. Here, the kernel's block layer is informing userspace about the appearance and disappearance of the "disk." Consider how quickly informative this method of investigating how USB stick insertion works is compared to trying to figure out the process solely from the source. - -### Read-only root filesystems make embedded devices possible - -Assuredly, no one shuts down a server or desktop system by pulling out the power plug. Why? Because mounted filesystems on the physical storage devices may have pending writes, and the data structures that record their state may become out of sync with what is written on the storage. When that happens, system owners will have to wait at next boot for the [fsck filesystem-recovery tool][35] to run and, in the worst case, will actually lose data. - -Yet, aficionados will have heard that many IoT and embedded devices like routers, thermostats, and automobiles now run Linux. Many of these devices almost entirely lack a user interface, and there's no way to "unboot" them cleanly. Consider jump-starting a car with a dead battery where the power to the [Linux-running head unit][36] goes up and down repeatedly. How is it that the system boots without a long fsck when the engine finally starts running? The answer is that embedded devices rely on [a read-only root fileystem][37] (ro-rootfs for short). - -![Photograph of a console][38] -ro-rootfs are why embedded systems don't frequently need to fsck. Credit (with permission): - -A ro-rootfs offers many advantages that are less obvious than incorruptibility. One is that malware cannot write to /usr or /lib if no Linux process can write there. Another is that a largely immutable filesystem is critical for field support of remote devices, as support personnel possess local systems that are nominally identical to those in the field. Perhaps the most important (but also most subtle) advantage is that ro-rootfs forces developers to decide during a project's design phase which system objects will be immutable. Dealing with ro-rootfs may often be inconvenient or even painful, as [const variables in programming languages][39] often are, but the benefits easily repay the extra overhead. - -Creating a read-only rootfs does require some additional amount of effort for embedded developers, and that's where VFS comes in. Linux needs files in /var to be writable, and in addition, many popular applications that embedded systems run will try to create configuration dot-files in $HOME. One solution for configuration files in the home directory is typically to pregenerate them and build them into the rootfs. For /var, one approach is to mount it on a separate writable partition while / itself is mounted as read-only. Using bind or overlay mounts is another popular alternative. - -### Bind and overlay mounts and their use by containers - -Running **[man mount][40]** is the best place to learn about bind and overlay mounts, which give embedded developers and system administrators the power to create a filesystem in one path location and then provide it to applications at a second one. For embedded systems, the implication is that it's possible to store the files in /var on an unwritable flash device but overlay- or bind-mount a path in a tmpfs onto the /var path at boot so that applications can scrawl there to their heart's delight. At next power-on, the changes in /var will be gone. Overlay mounts provide a union between the tmpfs and the underlying filesystem and allow apparent modification to an existing file in a ro-rootfs, while bind mounts can make new empty tmpfs directories show up as writable at ro-rootfs paths. While overlayfs is a proper filesystem type, bind mounts are implemented by the [VFS namespace facility][41]. - -Based on the description of overlay and bind mounts, no one will be surprised that [Linux containers][42] make heavy use of them. Let's spy on what happens when we employ [systemd-nspawn][43] to start up a container by running bcc's mountsnoop tool: - -![Console - system-nspawn invocation][44] -The system-nspawn invocation fires up the container while mountsnoop.py runs. - -And let's see what happened: - -![Console - Running mountsnoop][45] -Running mountsnoop during the container "boot" reveals that the container runtime relies heavily on bind mounts. (Only the beginning of the lengthy output is displayed) - -Here, systemd-nspawn is providing selected files in the host's procfs and sysfs to the container at paths in its rootfs. Besides the MS_BIND flag that sets bind-mounting, some of the other flags that the "mount" system call invokes determine the relationship between changes in the host namespace and in the container. For example, the bind-mount can either propagate changes in /proc and /sys to the container, or hide them, depending on the invocation. - -### Summary - -Understanding Linux internals can seem an impossible task, as the kernel itself contains a gigantic amount of code, leaving aside Linux userspace applications and the system-call interface in C libraries like glibc. One way to make progress is to read the source code of one kernel subsystem with an emphasis on understanding the userspace-facing system calls and headers plus major kernel internal interfaces, exemplified here by the file_operations table. The file operations are what makes "everything is a file" actually work, so getting a handle on them is particularly satisfying. The kernel C source files in the top-level fs/ directory constitute its implementation of virtual filesystems, which are the shim layer that enables broad and relatively straightforward interoperability of popular filesystems and storage devices. Bind and overlay mounts via Linux namespaces are the VFS magic that makes containers and read-only root filesystems possible. In combination with a study of source code, the eBPF kernel facility and its bcc interface makes probing the kernel simpler than ever before. - -Much thanks to [Akkana Peck][46] and [Michael Eager][47] for comments and corrections. - -Alison Chaiken will present [Virtual filesystems: why we need them and how they work][48] at the 17th annual Southern California Linux Expo ([SCaLE 17x][49]) March 7-10 in Pasadena, Calif. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/virtual-filesystems-linux - -作者:[Alison Chariken][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.pearson.com/us/higher-education/program/Love-Linux-Kernel-Development-3rd-Edition/PGM202532.html -[2]: http://cassandra.apache.org/ -[3]: https://en.wikipedia.org/wiki/NoSQL -[4]: http://lwn.net/Articles/444910/ -[5]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_1-console.png (Console) -[6]: https://lwn.net/Articles/22355/ -[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/fs.h -[8]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs -[9]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_2-shim-layer.png (How userspace accesses various types of filesystems) -[10]: https://lwn.net/Articles/774114/ -[11]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_3-crazy.jpg (Man with shocked expression) -[12]: https://wiki.archlinux.org/index.php/Tmpfs -[13]: http://man7.org/linux/man-pages/man8/sysctl.8.html -[14]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_4-proc-meminfo.png (Console) -[15]: http://www-f1.ijs.si/~ramsak/km1/mermin.moon.pdf -[16]: https://en.wikiquote.org/wiki/David_Mermin -[17]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_5-moon.jpg (Full moon) -[18]: https://commons.wikimedia.org/wiki/Moon#/media/File:Full_Moon_Luc_Viatour.jpg -[19]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/stable -[20]: https://lkml.org/lkml/2012/12/23/75 -[21]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_7-sysfs.png (Console) -[22]: https://events.linuxfoundation.org/sites/events/files/slides/bpf_collabsummit_2015feb20.pdf -[23]: https://github.com/iovisor/bcc -[24]: https://github.com/iovisor/bcc/blob/master/INSTALL.md -[25]: http://brendangregg.com/ebpf.html -[26]: https://github.com/iovisor/bcc/tree/master/tools -[27]: https://github.com/iovisor/bcc/blob/master/tools/vfscount_example.txt -[28]: https://github.com/iovisor/bcc/blob/master/tools/vfsstat.py -[29]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_8-vfsstat.png (Console - vfsstat.py) -[30]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_9-ebpf.png (Console when USB is inserted) -[31]: https://github.com/iovisor/bcc/blob/master/tools/trace_example.txt -[32]: https://events.static.linuxfound.org/sites/events/files/slides/bpf_collabsummit_2015feb20.pdf -[33]: http://northstar-www.dartmouth.edu/doc/solaris-forte/manuals/c/user_guide/cscope.html -[34]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/block/genhd.c#n665 -[35]: http://www.man7.org/linux/man-pages/man8/fsck.8.html -[36]: https://wiki.automotivelinux.org/_media/eg-rhsa/agl_referencehardwarespec_v0.1.0_20171018.pdf -[37]: https://elinux.org/images/1/1f/Read-only_rootfs.pdf -[38]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_10-code.jpg (Photograph of a console) -[39]: https://www.meetup.com/ACCU-Bay-Area/events/drpmvfytlbqb/ -[40]: http://man7.org/linux/man-pages/man8/mount.8.html -[41]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/sharedsubtree.txt -[42]: https://coreos.com/os/docs/latest/kernel-modules.html -[43]: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html -[44]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_11-system-nspawn.png (Console - system-nspawn invocation) -[45]: https://opensource.com/sites/default/files/uploads/virtualfilesystems_12-mountsnoop.png (Console - Running mountsnoop) -[46]: http://shallowsky.com/ -[47]: http://eagercon.com/ -[48]: https://www.socallinuxexpo.org/scale/17x/presentations/virtual-filesystems-why-we-need-them-and-how-they-work -[49]: https://www.socallinuxexpo.org/ diff --git a/sources/tech/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md b/sources/tech/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md deleted file mode 100644 index 17e7747ce9..0000000000 --- a/sources/tech/20190311 Blockchain 2.0- Redefining Financial Services -Part 3.md +++ /dev/null @@ -1,63 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (sanfusu) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Blockchain 2.0: Redefining Financial Services [Part 3]) -[#]: via: (https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/) -[#]: author: (EDITOR https://www.ostechnix.com/author/editor/) - -Blockchain 2.0: Redefining Financial Services [Part 3] -====== - -![](https://www.ostechnix.com/wp-content/uploads/2019/03/Financial-Services-1-720x340.png) - -The [**previous article of this series**][1] focused on building context to bring forth why moving our existing monetary system to a futuristic [**blockchain**][2] system is the next natural step in the evolution of “money”. We looked at the features of a blockchain platform which would aid in such a move. However, the financial markets are far more complex and composed of numerous other instruments that people trade rather than just a currency. - -This part will explore the features of blockchain which will enable institutions to transform and interlace traditional banking and financing systems with it. As previously discussed, and proved, if enough people participate in a given blockchain n­­etwork and support the protocols for transactions, the nominal value that can be attributed to the “token” increases and becomes more stable. Take, for instance, Bitcoin (BTC). Like the simple paper currency, we’re all used to, cryptocurrencies such as Bitcoin and Ether can be utilized for all the former’s purposes from buying food to ships and from loaning money to insurance. - -Chances are you are already involved with a bank or any other financial institution that makes use of blockchain ledger technology. The most significant uses of blockchain tech in the finance industry will be in setting up payments infrastructure, fund transfer technologies, and digital identity management. The latter two have traditionally been handled by legacy systems in the financial services industry. These systems are slowly being migrated to blockchain systems owing to their efficiency in handling work like this. The blockchain also offers high-quality data analytics solutions to these firms, an aspect that is quickly gaining prominence because of recent developments in data sciences.[1] - -Considering the start-ups and projects at the cutting edge of innovation in this space first seems warranted due to their products or services already doing the rounds in the market today. - -Starting with PayPal, an online payments company started in 1998, and now among the largest of such platforms, it is considered to be a benchmark in terms of operations and technical prowess. PayPal derives largely from the existing monetary system. Its contribution to innovation came by how it collected and leveraged consumer data to provide services online at instantaneous speeds. Online transactions are taken for granted today with minimal innovation in the industry in terms of the tech that it’s based on. Having a solid foundation is a good thing, but that won’t give anyone an edge over their competition in this fast-paced IT world with new standards and technology being pioneered every other day. In 2014 PayPal subsidiary, **Braintree** announced partnerships with popular cryptocurrency payment solutions including **Coinbase** and **GoCoin** , in a bid to gradually integrate Bitcoin and other popular cryptocurrencies into its service platform. This basically gave its consumers a chance to explore and experience the side of what’s to come under the familiar umbrella cover and reliability of PayPal. In fact, ride-hailing company **Uber** had an exclusive partnership with Braintree to allow customers to pay for rides using Bitcoin.[2][3] - -**Ripple** is making it easier for people to operate between multiple blockchains. Ripple has been in the headlines for moving ahead with regional banks in the US, for instance, to facilitate transferring money bilaterally to other regional banks without the need for a 3rd party intermediary resulting in reduced cost and time overheads. Ripple’s **Codius platform** allows for interoperability between blockchains and opens the doors to smart contracts programmed into the system for minimal tampering and confusion. Built on technology that is highly advanced, secure and scalable to suit needs, Ripple’s platform currently has names such as UBS and Standard Chartered on their client’s list. Many more are expected to join in.[4][5] - -**Kraken** , a US-based cryptocurrency exchange operating in locations around the globe is known for their reliable **crypto quant** estimates even providing Bitcoin pricing data real time to the Bloomberg terminal. In 2015, they partnered with **Fidor Bank** to form what was then the world’s first Cryptocurrency Bank offering customers banking services and products which dealt with cryptocurrencies.[6] - -**Circle** , another FinTech company is currently among the largest of its sorts involved with allowing users to invest and trade in cryptocurrency derived assets, similar to traditional money market assets.[7] - -Companies such as **Wyre** and **Stellar** today have managed to bring down the lead time involved in international wire transfers from an average of 3 days to under 6 hours. Claims have been made saying that once a proper regulatory system is in place the same 6 hours can be brought down to a matter of seconds.[8] - -Now while all of the above have focused on the start-up projects involved, it has to be remembered that the reach and capabilities of the older more respectable financial institutions should not be ignored. Institutions that have existed for decades if not centuries moving billions of dollars worldwide are equally interested in leveraging the blockchain and its potential. - -As we already mentioned in the previous article, **JP Morgan** recently unveiled their plans to exploit cryptocurrencies and the underlying ledger like the functionality of the blockchain for enterprises. The project, called **Quorum** , is defined as an **“Enterprise-ready distributed ledger and smart contract platform”**. The main goal being that gradually the bulk of the bank’s operations would one day be migrated to Quorum thus cutting significant investments that firms such as JP Morgan need to make in order to guarantee privacy, security, and transparency. They’re claimed to be the only player in the industry now to have complete ownership over the whole stack of the blockchain, protocol, and token system. They also released a cryptocurrency called **JPM Coin** meant to be used in transacting high volume settlements instantaneously. JPM coin is among the first “stable coins” to be backed by a major bank such as JP Morgan. A stable coin is a cryptocurrency whose price is linked to an existing major monetary system. Quorum is also touted for its capabilities to process almost 100 transactions a second which is leaps and bounds ahead of its contemporaries.[9] - -**Barclay’s** , a British multinational financial giant is reported to have registered two blockchain-based patents supposedly with the aim of streamlining fund transfers and KYC procedures. Barclay’s proposals though are more aimed toward improving their banking operations’ efficiency. One of the application deals with creating a private blockchain network for storing KYC details of consumers. Once verified, stored and confirmed, these details are immutable and nullifies the need for further verifications down the line. If implemented the protocol will do away with the need for multiple verifications of KYC details. Developing and densely populated countries such as India where a bulk of the population is yet to be inducted into a formal banking system will find the innovative KYC system useful in reducing random errors and lead times involved in the process[10]. Barclay’s is also rumored to be exploring the capabilities of a blockchain system to address credit status ratings and insurance claims. - -Such blockchain backed systems are designed to eliminate needless maintenance costs and leverage the power of smart contracts for enterprises which operate in industries where discretion, security, and speed determine competitive advantage. Being enterprise products, they’re built on protocols that ensure complete transaction and contract privacy along with a consensus mechanism which essentially nullifies corruption and bribery. - -**PwC’s Global Fintech Report** from 2017 states that by 2020, an estimated 77% of all Fintech companies are estimated to switch to blockchain based technologies and processes concerning their operations. A whopping 90 percent of their respondents said that they were planning to adopt blockchain technology as part of an in-production system by 2020. Their judgments are not misplaced as significant cost savings and transparency gains from a regulatory point of view are guaranteed by moving to a blockchain based system.[11] - -Since regulatory capabilities are built into the blockchain platform by default the migration of firms from legacy systems to modern networks running blockchain ledgers is a welcome move for industry regulators as well. Transactions and trade movements can be verified and tracked on the fly once and for all rather than after. This, in the long run, will likely result in better regulation and risk management. Not to mention improved accountability from the part of firms and individuals alike.[11] - -While considerable investments in the space and leaping innovations are courtesy of large investments by established corporates it is misleading to think that such measures wouldn’t permeate the benefits to the end user. As banks and financial institutions start to adopt the blockchain, it will result in increased cost savings and efficiency for them which will ultimately mean good for the end consumer too. The added benefits of transparency and fraud protection will improve customer sentiments and more importantly improve the trust that people place on the banking and financial system. A much-needed revolution in the financial services industry is possible with blockchains and their integration into traditional services. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/ - -作者:[EDITOR][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.ostechnix.com/author/editor/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/blockchain-2-0-revolutionizing-the-financial-system/ -[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ diff --git a/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md b/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md new file mode 100644 index 0000000000..b720bd8f96 --- /dev/null +++ b/sources/tech/20190314 Open Source is Eating the Startup Ecosystem- A Guide for Assessing the Value Creation of Startups.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source is Eating the Startup Ecosystem: A Guide for Assessing the Value Creation of Startups) +[#]: via: (https://www.linux.com/BLOG/2019/3/OPEN-SOURCE-EATING-STARTUP-ECOSYSTEM-GUIDE-ASSESSING-VALUE-CREATION-STARTUPS) +[#]: author: (Ibrahim Haddad https://www.linux.com/USERS/IBRAHIM) + +Open Source is Eating the Startup Ecosystem: A Guide for Assessing the Value Creation of Startups +====== + +![Open Source][1] + +If you want a deeper understanding of defining, implementing, and improving open source compliance programs within your organizations—this ebook is a must read. Download now. + +[Creative Commons Zero][2] + +Unsplash + +In the last few years, we have witnessed the unprecedented growth of open source in all industries—from the increased adoption of open source software in products and services, to the extensive growth in open source contributions and the releasing of proprietary technologies under an open source license. It has been an incredible experience to be a part of. + +![Open Source][3] + +[The Linux Foundation][4] + +As many have stated, Open Source is the New Normal, Open Source is Eating the World, Open Source is Eating Software, etc. all of which are true statements. To that extent, I’d like to add one more maxim: Open Source is Eating the Startup Ecosystem. It is almost impossible to find a technology startup today that does not rely in one shape or form on open source software to boot up its operation and develop its product offering. As a result, we are operating in a space where open source due diligence is now a mandatory exercise in every M&A transaction. These exercises evaluate the open source practices of an organization and scope out all open source software used in product(s)/service(s) and how it interacts with proprietary components—all of which is necessary to assess the value creation of the company in relation to open source software. + +Being intimately involved in this space has allowed me to observe, learn, and apply many open source best practices. I decided to chronicle these learnings in an ebook as a contribution to the [OpenChain project][5]: [Assessment of Open Source Practices as part of Due Diligence in Merger and Acquisition Transactions][6]. This ebook addresses the basic question of: How does one evaluate open source practices in a given organization that is an acquisition target? We address this question by offering a path to evaluate these practices along with appropriate checklists for reference. Essentially, it explains how the acquirer and the target company can prepare for this due diligence, offers an explanation of the audit process, and provides general recommended practices for ensuring open source compliance. + +If is important to note that not every organization will see a need to implement every practice we recommend. Some organizations will find alternative practices or implementation approaches to achieve the same results. Appropriately, an organization will adapt its open source approach based upon the nature and amount of the open source it uses, the licenses that apply to open source it uses, the kinds of products it distributes or services it offers, and the design of the products or services themselves + +If you are involved in assessing the open source and compliance practices of organizations, or involved in an M&A transaction focusing on open source due diligence, or simply want to have a deeper level of understanding of defining, implementing, and improving open source compliance programs within your organizations—this ebook is a must read. [Download the Brief][6]. + +This article originally appeared at the [Linux Foundation.][7] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/BLOG/2019/3/OPEN-SOURCE-EATING-STARTUP-ECOSYSTEM-GUIDE-ASSESSING-VALUE-CREATION-STARTUPS + +作者:[Ibrahim Haddad][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/IBRAHIM +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/open-alexandre-godreau-510220-unsplash.jpg?itok=2udo1XKo (Open Source) +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/assessmentofopensourcepractices_ebook_mockup-768x994.png?itok=qpLKAVGR (Open Source) +[4]: /LICENSES/CATEGORY/LINUX-FOUNDATION +[5]: https://www.openchainproject.org/ +[6]: https://www.linuxfoundation.org/open-source-management/2019/03/assessment-open-source-practices/ +[7]: https://www.linuxfoundation.org/blog/2019/03/open-source-is-eating-the-startup-ecosystem-a-guide-for-assessing-the-value-creation-of-startups/ diff --git a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md index 70f292e827..1700970688 100644 --- a/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md +++ b/sources/tech/20190315 How to create portable documents with CBZ and DjVu.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to create portable documents with CBZ and DjVu) [#]: via: (https://opensource.com/article/19/3/comic-book-archive-djvu) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to create portable documents with CBZ and DjVu ====== diff --git a/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md b/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md new file mode 100644 index 0000000000..78d8741c17 --- /dev/null +++ b/sources/tech/20190315 Mageia Linux Is a Modern Throwback to the Underdog Days.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mageia Linux Is a Modern Throwback to the Underdog Days) +[#]: via: (https://www.linux.com/BLOG/LEARN/2019/3/MAGEIA-LINUX-MODERN-THROWBACK-UNDERDOG-DAYS) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +Mageia Linux Is a Modern Throwback to the Underdog Days +====== + +![Welcome to Mageia][1] + +The Mageia Welcome App is a boon for new Linux users. + +[Used with permission][2] + +I’ve been using Linux long enough to remember Linux Mandrake. I recall, at one of my first-ever Linux conventions, hanging out with the MandrakeSoft crew and being starstruck to think that they were creating a Linux distribution that was sure to bring about world domination for the open source platform. + +Well, that didn’t happen. In fact, Linux Mandrake didn’t even stand the test of time. It was renamed Mandriva and rebranded. Mandriva retained popularity but eventually came to a halt in 2011. The company disbanded, sending all those star developers to other projects. Of course, rising from the ashes of Mandrake Linux came the likes of [OpenMandriva][3], as well as another distribution called [Mageia Linux][4]. + +Like OpenMandriva, Mageia Linux is a fork of Mandriva. It was created (by a group of former Mandriva employees) in 2010 and first released in 2011, so there was next to no downtime between the end of Mandriva and the release of Mageia. Since then, Mageia has existed in the shadows of bigger, more popular flavors of Linux (e.g., Ubuntu, Mint, Fedora, Elementary OS, etc.), but it’s never faltered. As of this writing, Mageia is listed as number 26 on the [Distrowatch][5] Page Hit Ranking chart and is enjoying release number 6.1. + +### What Sets Mageia Apart? + +This question has become quite important when looking at Linux distributions, considering just how many distros there are—many of which are hard to tell apart. If you’ve seen one KDE, GNOME, or Xfce distribution, you’ve seen them all, right? Anyone who's used Linux enough knows this statement is not even remotely true. For many distributions, though, the differences lie in the subtleties. It’s not about what you do with the desktop; it’s how you put everything together to improve the user experience. + +Mageia Linux defaults to the KDE desktop and does as good a job as any other distribution at presenting KDE to users. But before you start using KDE, you should note some differences between Mageia and other distributions. To start, the installation is quite simple, but it’s slightly askew from what might expect. In similar fashion to most modern distributions, you boot up the live instance and click on the Install icon (Figure 1). + +![Installing Mageia][6] + +Figure 1: Installing Mageia from the Live instance. + +[Used with permission][2] + +Once you’ve launched the installation app, it’s fairly straightforward, although not quite as simple as some other versions of Linux. New users might hesitate when they are presented with the partition choice between Use free space or Custom disk partition (Remember, I’m talking about new users here). This type of user might prefer a bit simpler verbiage. Consider this: What if you were presented (at the partition section) by two choices: + + * Basic Install + + * Custom Install + + + + +The Basic install path would choose a fairly standard set of options (e.g., using the whole disk for installation and placing the bootloader in the proper/logical place). In contrast, the Custom install would allow the user to install in a non-default fashion (for dual boot, etc.) and choose where the bootloader would go and what options to apply. + +The next possible confusing step (again, for new users) is the bootloader (Figure 2). For those who have installed Linux before, this option is a no-brainer. For new users, even understanding what a bootloader does can be a bit of an obstacle. + +![bootloader][7] + +Figure 2: Configuring the Mageia bootloader. + +[Used with permission][2] + +The bootloader configuration screen also allows you to password protect GRUB2. Because of the layout of this screen, it could be confused as the root user password. It’s not. If you don’t want to password protect GRUB2, leave this blank. In the final installation screen (Figure 3), you can set any bootloader options you might want. Once again, we find a window that could cause confusion with new users. + +![bootloader options][8] + +Figure 3: Advanced bootloader options can be configured here. + +[Used with permission][2] + +Click Finish and the installation will complete. You might have noticed the absence of user configuration or root user password options. With the first stage of the installation complete, you reboot the machine, remove the installer media, and (when the machine reboots) you’ll then be prompted to configure both the root user password and a standard user account (Figure 4). + +![Configuring your users][9] + +Figure 4: Configuring your users. + +[Used with permission][2] + +And that’s all there is to the Mageia installation. + +### Welcome to Mageia + +Once you log into Mageia, you’ll be greeted by something every Linux distribution should use—a welcome app (Figure 5). + +![welcome app][10] + +Figure 5: The Mageia welcome app is a new user’s best friend. + +[Used with permission][2] + +From this welcome app, you can get information about the distribution, get help, and join communities. The importance of having such an approach to greet users at login cannot be overstated. When new users log into Linux for the first time, they want to know that help is available, should they need it. Mageia Linux has done an outstanding job with this feature. Granted, all this app does is serve as a means to point users to various websites, but it’s important information for users to have at the ready. + +Beyond the welcome app, the Mageia Control Center (Figure 6) also helps Mageia stand out. This one-stop-shop is where users can take care of installing/updating software, configuring media sources for installation, configure update frequency, manage/configure hardware, configure network devices (e.g., VPNs, proxies, and more), configure system services, view logs, open an administrator console, create network shares, and so much more. This is as close to the openSUSE YaST tool as you’ll find (without using either SUSE or openSUSE). + +![Control Center][11] + +Figure 6: The Mageia Control Center is an outstanding system management tool. + +[Used with permission][2] + +Beyond those two tools, you’ll find everything else you need to work. Mageia Linux comes with the likes of LibreOffice, Firefox, KMail, GIMP, Clementine, VLC, and more. Out of the box, you’d be hard pressed to find another tool you need to install to get your work done. It’s that complete a distribution. + +### Target Audience + +Figuring out the Mageia Linux target audience is a tough question to answer. If new users can get past the somewhat confusing installation (which isn’t really that challenging, just slightly misleading), using Mageia Linux is a dream. + +The slick, barely modified KDE desktop, combined with the welcome app and control center make for a desktop Linux that will let users of all skill levels feel perfectly at home. If the developers could tighten up the verbiage on the installation, Mageia Linux could be one of the greatest new user Linux experiences available. Until then, new users should make sure they understand what they’re getting into with the installation portion of this take on the Linux platform. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/BLOG/LEARN/2019/3/MAGEIA-LINUX-MODERN-THROWBACK-UNDERDOG-DAYS + +作者:[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.linux.com/sites/lcom/files/styles/rendered_file/public/mageia-main.jpg?itok=ZmkbMxfM (Welcome to Mageia) +[2]: /LICENSES/CATEGORY/USED-PERMISSION +[3]: https://www.openmandriva.org/ +[4]: https://www.mageia.org/en/ +[5]: https://distrowatch.com/ +[6]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_1.jpg?itok=RYXPU70j (Installing Mageia) +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_2.jpg?itok=m2IPxgA4 (bootloader) +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_3.jpg?itok=Bs2PPrMF (bootloader options) +[9]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_4.jpg?itok=YZBIZ0Ua (Configuring your users) +[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_5.jpg?itok=gYcTfUKv (welcome app) +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/mageia_6.jpg?itok=eSl2qpPp (Control Center) diff --git a/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md b/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md deleted file mode 100644 index 8d1df5a7c5..0000000000 --- a/sources/tech/20190315 Sweet Home 3D- An open source tool to help you decide on your dream home.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Sweet Home 3D: An open source tool to help you decide on your dream home) -[#]: via: (https://opensource.com/article/19/3/tool-find-home) -[#]: author: (Jeff Macharyas (Community Moderator) ) - -Sweet Home 3D: An open source tool to help you decide on your dream home -====== - -Interior design application makes it easy to render your favorite house—real or imaginary. - -![Houses in a row][1] - -I recently accepted a new job in Virginia. Since my wife was working and watching our house in New York until it sold, it was my responsibility to go out and find a new house for us and our cat. A house that she would not see until we moved into it! - -I contracted with a real estate agent and looked at a few houses, taking many pictures and writing down illegible notes. At night, I would upload the photos into a Google Drive folder, and my wife and I would review them simultaneously over the phone while I tried to remember whether the room was on the right or the left, whether it had a fan, etc. - -Since this was a rather tedious and not very accurate way to present my findings, I went in search of an open source solution to better illustrate what our future dream house would look like that wouldn't hinge on my fuzzy memory and blurry photos. - -[Sweet Home 3D][2] did exactly what I wanted it to do. Sweet Home 3D is available on Sourceforge and released under the GNU General Public License. The [website][3] is very informative, and I was able to get it up and running in no time. Sweet Home 3D was developed by Paris-based Emmanuel Puybaret of eTeks. - -### Hanging the drywall - -I downloaded Sweet Home 3D onto my MacBook Pro and added a PNG version of a flat floorplan of a house to use as a background base map. - -From there, it was a simple matter of using the Rooms palette to trace the pattern and set the "real life" dimensions. After I mapped the rooms, I added the walls, which I could customize by color, thickness, height, etc. - -![Sweet Home 3D floorplan][5] - -Now that I had the "drywall" built, I downloaded various pieces of "furniture" from a large array that includes actual furniture as well as doors, windows, shelves, and more. Each item downloads as a ZIP file, so I created a folder of all my uncompressed pieces. I could customize each piece of furniture, and repetitive items, such as doors, were easy to copy-and-paste into place. - -Once I had all my walls and doors and windows in place, I used the application's 3D view to navigate through the house. Drawing upon my photos and memory, I made adjustments to all the objects until I had a close representation of the house. I could have spent more time modifying the house by adding textures, additional furniture, and objects, but I got it to the point I needed. - -![Sweet Home 3D floorplan][7] - -After I finished, I exported the plan as an OBJ file, which can be opened in a variety of programs, such as [Blender][8] and Preview on the Mac, to spin the house around and examine it from various angles. The Video function was most useful, as I could create a starting point, draw a path through the house, and record the "journey." I exported the video as a MOV file, which I opened and viewed on the Mac using QuickTime. - -My wife was able to see (almost) exactly what I saw, and we could even start arranging furniture ahead of the move, too. Now, all I have to do is load up the moving truck and head south. - -Sweet Home 3D will also prove useful at my new job. I was looking for a way to improve the map of the college's buildings and was planning to just re-draw it in [Inkscape][9] or Illustrator or something. However, since I have the flat map, I can use Sweet Home 3D to create a 3D version of the floorplan and upload it to our website to make finding the bathrooms so much easier! - -### An open source crime scene? - -An interesting aside: according to the [Sweet Home 3D blog][10], "the French Forensic Police Office (Scientific Police) recently chose Sweet Home 3D as a tool to design plans [to represent roads and crime scenes]. This is a concrete application of the recommendation of the French government to give the preference to free open source solutions." - -This is one more bit of evidence of how open source solutions are being used by citizens and governments to create personal projects, solve crimes, and build worlds. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/tool-find-home - -作者:[Jeff Macharyas (Community Moderator)][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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) -[2]: https://sourceforge.net/projects/sweethome3d/ -[3]: http://www.sweethome3d.com/ -[4]: /file/426441 -[5]: https://opensource.com/sites/default/files/uploads/virginia-house-create-screenshot.png (Sweet Home 3D floorplan) -[6]: /file/426451 -[7]: https://opensource.com/sites/default/files/uploads/virginia-house-3d-screenshot.png (Sweet Home 3D floorplan) -[8]: https://opensource.com/article/18/5/blender-hotkey-cheat-sheet -[9]: https://opensource.com/article/19/1/inkscape-cheat-sheet -[10]: http://www.sweethome3d.com/blog/2018/12/10/customization_for_the_forensic_police.html diff --git a/sources/tech/20190317 How To Configure sudo Access In Linux.md b/sources/tech/20190317 How To Configure sudo Access In Linux.md deleted file mode 100644 index f147c07d55..0000000000 --- a/sources/tech/20190317 How To Configure sudo Access In Linux.md +++ /dev/null @@ -1,301 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Configure sudo Access In Linux?) -[#]: via: (https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) - -How To Configure sudo Access In Linux? -====== - -The root user has all the controls in Linux system. - -root user is the most powerful user in the Linux system and can perform any action in the system. - -If any users wants to perform some actions, don’t provide the root access to anybody because if he/she done anything wrong there is no option/way to rectify it. - -To fix this, what will be the solution? - -We can grant sudo permission to the corresponding user to overcome this situation. - -The sudo command offers a mechanism for providing trusted users with administrative access to a system without sharing the password of the root user. - -They can perform most of the administrative operations but not all operations like root. - -### What Is sudo? - -sudo is a program, which can be used by a normal users to execute a command as the super user or another user, as specified by the security policy. - -sudo users access is controlled by `/etc/sudoers` file. - -### What Is An Advantage Of sudo Users? - -sudo is a safe way to run a command in Linux system if you are not familiar on it. - - * The Linux system keeps a logs into the `/var/log/secure` and `/var/log/auth.log` file where you can verify what actions was made by the sudo user. - * Every time, it will prompt a password to perform the current action. So, you will be getting a time to verify the action, which you are going to perform. If you feel it’s not a correct action then you can safely exit there itself without perform the current action. - - - -It’s different for RHEL based systems such as Redhat (RHEL), CentOS and Oracle Enterprise Linux (OEL) and Debian based systems such as Debian, Ubuntu and LinuxMint. - -We will tech you, how to perform this on both the distributions in this article. - -It can be done in three ways in both the distributions. - - * Add a user into corresponding groups. For RHEL based system, we need to add a user into `wheel` group. For Debian based system, we need to add a user into `sudo` or `admin` groups. - * Add a user into `/etc/group` file manually. - * Add a user into `/etc/sudoers` file using visudo. - - - -### How To Configure sudo Access In RHEL/CentOS/OEL Systems? - -It can be done on RHEL based systems such as Redhat (RHEL), CentOS and Oracle Enterprise Linux (OEL) using following three methods. - -### Method-1: How To Grant The Super User Access To A Normal User In Linux Using wheel Group? - -Wheel is a special group in the RHEL based systems that provides additional privileges that empower a user to execute restricted commands as the super user. - -Make a note that the `wheel` group should be enabled in the `/etc/sudoers` file to gain this access. - -``` -# grep -i wheel /etc/sudoers - -## Allows people in group wheel to run all commands -%wheel ALL=(ALL) ALL -# %wheel ALL=(ALL) NOPASSWD: ALL -``` - -I assume that we had already created an user account to perform this. In my case, I’m going to use `daygeek` user account. - -Run the following command to add an user into wheel group. - -``` -# usermod -aG wheel daygeek -``` - -We can doube confirm this by running the following command. - -``` -# getent group wheel -wheel:x:10:daygeek -``` - -I’m going to check whether `daygeek` user can access a file which is owned by the root user. - -``` -$ tail -5 /var/log/secure -tail: cannot open _/var/log/secure_ for reading: Permission denied -``` - -I was getting an error when i try to access the `/var/log/secure` file as a normal user. I’m going to access the same file with sudo, let’s see the magic. - -``` -$ sudo tail -5 /var/log/secure -[sudo] password for daygeek: -Mar 17 07:01:56 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure -Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) -Mar 17 07:01:56 CentOS7 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 07:05:10 CentOS7 sudo: daygeek : TTY=pts/0 ; PWD=/home/daygeek ; USER=root ; COMMAND=/bin/tail -5 /var/log/secure -Mar 17 07:05:10 CentOS7 sudo: pam_unix(sudo:session): session opened for user root by daygeek(uid=0) -``` - -### Method-2: How To Grant The Super User Access To A Normal User In RHEL/CentOS/OEL using /etc/group file? - -We can manually add an user into the wheel group by editing the `/etc/group` file. - -Just open the file then append the corresponding user in the appropriate group to achieve this. - -``` -$ grep -i wheel /etc/group -wheel:x:10:daygeek,user1 -``` - -In this example, I’m going to use `user1` user account. - -I’m going to check whether `user1` user has sudo access or not by restarting the `Apache` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart httpd -[sudo] password for user1: - -$ sudo grep -i user1 /var/log/secure -[sudo] password for user1: -Mar 17 07:09:47 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd -Mar 17 07:10:40 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/systemctl restart httpd -Mar 17 07:12:35 CentOS7 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/bin/grep -i httpd /var/log/secure -``` - -### Method-3: How To Grant The Super User Access To A Normal User In Linux Using /etc/sudoers file? - -sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under wheel group. - -Just append the desired user into /etc/suoders file by using visudo command. - -``` -# grep -i user2 /etc/sudoers -user2 ALL=(ALL) ALL -``` - -In this example, I’m going to use `user2` user account. - -I’m going to check whether `user2` user has sudo access or not by restarting the `MariaDB` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart mariadb -[sudo] password for user2: - -$ sudo grep -i mariadb /var/log/secure -[sudo] password for user2: -Mar 17 07:23:10 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart mariadb -Mar 17 07:26:52 CentOS7 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/grep -i mariadb /var/log/secure -``` - -### How To Configure sudo Access In Debian/Ubuntu Systems? - -It can be done on Debian based systems such as Debian based systems such as Debian, Ubuntu and LinuxMint using following three methods. - -### Method-1: How To Grant The Super User Access To A Normal User In Linux Using sudo or admin Groups? - -sudo or admin is a special group in the Debian based systems that provides additional privileges that empower a user to execute restricted commands as the super user. - -Make a note that the `sudo` or `admin` group should be enabled in the `/etc/sudoers` file to gain this access. - -``` -# grep -i 'sudo\|admin' /etc/sudoers - -# Members of the admin group may gain root privileges -%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -%sudo ALL=(ALL:ALL) ALL -``` - -I assume that we had already created an user account to perform this. In my case, I’m going to use `2gadmin` user account. - -Run the following command to add an user into sudo group. - -``` -# usermod -aG sudo 2gadmin -``` - -We can doube confirm this by running the following command. - -``` -# getent group sudo -sudo:x:27:2gadmin -``` - -I’m going to check whether `2gadmin` user can access a file which is owned by the root user. - -``` -$ less /var/log/auth.log -/var/log/auth.log: Permission denied -``` - -I was getting an error when i try to access the `/var/log/auth.log` file as a normal user. I’m going to access the same file with sudo, let’s see the magic. - -``` -$ sudo tail -5 /var/log/auth.log -[sudo] password for 2gadmin: -Mar 17 20:39:47 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/bin/bash -Mar 17 20:39:47 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) -Mar 17 20:40:23 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 20:40:48 Ubuntu18 sudo: 2gadmin : TTY=pts/0 ; PWD=/home/2gadmin ; USER=root ; COMMAND=/usr/bin/tail -5 /var/log/auth.log -Mar 17 20:40:48 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by 2gadmin(uid=0) -``` - -Alternatively we can perform the same by adding an user to `admin` group. - -Run the following command to add an user into sudo group. - -``` -# usermod -aG admin user1 -``` - -We can doube confirm this by running the following command. - -``` -# getent group admin -admin:x:1011:user1 -``` - -Let’s see the output. - -``` -$ sudo tail -2 /var/log/auth.log -[sudo] password for user1: -Mar 17 20:53:36 Ubuntu18 sudo: user1 : TTY=pts/0 ; PWD=/home/user1 ; USER=root ; COMMAND=/usr/bin/tail -2 /var/log/auth.log -Mar 17 20:53:36 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user1(uid=0) -``` - -### Method-2: How To Grant The Super User Access To A Normal User In Debian/Ubuntu using /etc/group file? - -We can manually add an user into the sudo or admin group by editing the `/etc/group` file. - -Just open the file then append the corresponding user in the appropriate group to achieve this. - -``` -$ grep -i sudo /etc/group -sudo:x:27:2gadmin,user2 -``` - -In this example, I’m going to use `user2` user account. - -I’m going to check whether `user2` user has sudo access or not by restarting the `Apache` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart apache2 -[sudo] password for user2: - -$ sudo tail -f /var/log/auth.log -[sudo] password for user2: -Mar 17 21:01:04 Ubuntu18 systemd-logind[559]: New session 22 of user user2. -Mar 17 21:01:04 Ubuntu18 systemd: pam_unix(systemd-user:session): session opened for user user2 by (uid=0) -Mar 17 21:01:33 Ubuntu18 sudo: user2 : TTY=pts/0 ; PWD=/home/user2 ; USER=root ; COMMAND=/bin/systemctl restart apache2 -``` - -### Method-3: How To Grant The Super User Access To A Normal User In Linux Using /etc/sudoers file? - -sudo users access is controlled by `/etc/sudoers` file. So, simply add an user into the sudoers file under sudo or admin group. - -Just append the desired user into /etc/suoders file by using visudo command. - -``` -# grep -i user3 /etc/sudoers -user3 ALL=(ALL:ALL) ALL -``` - -In this example, I’m going to use `user3` user account. - -I’m going to check whether `user3` user has sudo access or not by restarting the `MariaDB` service in the system. let’s see the magic. - -``` -$ sudo systemctl restart mariadb -[sudo] password for user3: - -$ sudo tail -f /var/log/auth.log -[sudo] password for user3: -Mar 17 21:12:32 Ubuntu18 systemd-logind[559]: New session 24 of user user3. -Mar 17 21:12:49 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/bin/systemctl restart mariadb -Mar 17 21:12:49 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) -Mar 17 21:12:53 Ubuntu18 sudo: pam_unix(sudo:session): session closed for user root -Mar 17 21:13:08 Ubuntu18 sudo: user3 : TTY=pts/0 ; PWD=/home/user3 ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/auth.log -Mar 17 21:13:08 Ubuntu18 sudo: pam_unix(sudo:session): session opened for user root by user3(uid=0) -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/how-to-configure-sudo-access-in-linux/ - -作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ -[b]: https://github.com/lujun9972 diff --git a/sources/tech/20190318 Let-s try dwm - dynamic window manager.md b/sources/tech/20190318 Let-s try dwm - dynamic window manager.md new file mode 100644 index 0000000000..48f44a33cb --- /dev/null +++ b/sources/tech/20190318 Let-s try dwm - dynamic window manager.md @@ -0,0 +1,150 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Let’s try dwm — dynamic window manager) +[#]: via: (https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/) +[#]: author: (Adam Šamalík https://fedoramagazine.org/author/asamalik/) + +Let’s try dwm — dynamic window manager +====== + +![][1] + +If you like efficiency and minimalism, and are looking for a new window manager for your Linux desktop, you should try _dwm_ — dynamic window manager. Written in under 2000 standard lines of code, dwm is extremely fast yet powerful and highly customizable window manager. + +You can dynamically choose between tiling, monocle and floating layouts, organize your windows into multiple workspaces using tags, and quickly navigate through using keyboard shortcuts. This article helps you get started using dwm. + +## **Installation** + +To install dwm on Fedora, run: + +``` +$ sudo dnf install dwm dwm-user +``` + +The _dwm_ package installs the window manager itself, and the _dwm-user_ package significantly simplifies configuration which will be explained later in this article. + +Additionally, to be able to lock the screen when needed, we’ll also install _slock_ — a simple X display locker. + +``` +$ sudo dnf install slock +``` + +However, you can use a different one based on your personal preference. + +## **Quick start** + +To start dwm, choose the _dwm-user_ option on the login screen. + +![][2] + +After you log in, you’ll see a very simple desktop. In fact, the only thing there will be a bar at the top listing our nine tags that represent workspaces and a _[]=_ symbol that represents the layout of your windows. + +### Launching applications + +Before looking into the layouts, first launch some applications so you can play with the layouts as you go. Apps can be started by pressing _Alt+p_ and typing the name of the app followed by _Enter_. There’s also a shortcut _Alt+Shift+Enter_ for opening a terminal. + +Now that some apps are running, have a look at the layouts. + +### Layouts + +There are three layouts available by default: the tiling layout, the monocle layout, and the floating layout. + +The tiling layout, represented by _[]=_ on the bar, organizes windows into two main areas: master on the left, and stack on the right. You can activate the tiling layout by pressing _Alt+t._ + +![][3] + +The idea behind the tiling layout is that you have your primary window in the master area while still seeing the other ones in the stack. You can quickly switch between them as needed. + +To swap windows between the two areas, hover your mouse over one in the stack area and press _Alt+Enter_ to swap it with the one in the master area. + +![][4] + +The monocle layout, represented by _[N]_ on the top bar, makes your primary window take the whole screen. You can switch to it by pressing _Alt+m_. + +Finally, the floating layout lets you move and resize your windows freely. The shortcut for it is _Alt+f_ and the symbol on the top bar is _> <>_. + +### Workspaces and tags + +Each window is assigned to a tag (1-9) listed at the top bar. To view a specific tag, either click on its number using your mouse or press _Alt+1..9._ You can even view multiple tags at once by clicking on their number using the secondary mouse button. + +Windows can be moved between different tags by highlighting them using your mouse, and pressing _Alt+Shift+1..9._ + +## **Configuration** + +To make dwm as minimalistic as possible, it doesn’t use typical configuration files. Instead, you modify a C header file representing the configuration, and recompile it. But don’t worry, in Fedora it’s as simple as just editing one file in your home directory and everything else happens in the background thanks to the _dwm-user_ package provided by the maintainer in Fedora. + +First, you need to copy the file into your home directory using a command similar to the following: + +``` +$ mkdir ~/.dwm +$ cp /usr/src/dwm-VERSION-RELEASE/config.def.h ~/.dwm/config.h +``` + +You can get the exact path by running _man dwm-start._ + +Second, just edit the _~/.dwm/config.h_ file. As an example, let’s configure a new shortcut to lock the screen by pressing _Alt+Shift+L_. + +Considering we’ve installed the _slock_ package mentioned earlier in this post, we need to add the following two lines into the file to make it work: + +Under the _/* commands */_ comment, add: + +``` +static const char *slockcmd[] = { "slock", NULL }; +``` + +And the following line into _static Key keys[]_ : + +``` +{ MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } }, +``` + +In the end, it should look like as follows: (added lines are highlighted) + +``` +... + /* commands */ + static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ + static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; + static const char *termcmd[] = { "st", NULL }; + static const char *slockcmd[] = { "slock", NULL }; + + static Key keys[] = { + /* modifier key function argument */ + { MODKEY|ShiftMask, XK_l, spawn, {.v = slockcmd } }, + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + ... +``` + +Save the file. + +Finally, just log out by pressing _Alt+Shift+q_ and log in again. The scripts provided by the _dwm-user_ package will recognize that you have changed the _config.h_ file in your home directory and recompile dwm on login. And becuse dwm is so tiny, it’s fast enough you won’t even notice it. + +You can try locking your screen now by pressing _Alt+Shift+L_ , and then logging back in again by typing your password and pressing enter. + +## **Conclusion** + +If you like minimalism and want a very fast yet powerful window manager, dwm might be just what you’ve been looking for. However, it probably isn’t for beginners. There might be a lot of additional configuration you’ll need to do in order to make it just as you like it. + +To learn more about dwm, see the project’s homepage at . + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ + +作者:[Adam Šamalík][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/dwm-magazine-image-816x345.png +[2]: https://fedoramagazine.org/wp-content/uploads/2019/03/choosing-dwm-1024x469.png +[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/dwm-desktop-1024x593.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-2019-03-15-at-11.12.32-1024x592.png diff --git a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md b/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md deleted file mode 100644 index 9e85b82f2c..0000000000 --- a/sources/tech/20190319 Blockchain 2.0- Blockchain In Real Estate -Part 4.md +++ /dev/null @@ -1,50 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Blockchain 2.0: Blockchain In Real Estate [Part 4]) -[#]: via: (https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/) -[#]: author: (EDITOR https://www.ostechnix.com/author/editor/) - -Blockchain 2.0: Blockchain In Real Estate [Part 4] -====== - -![](https://www.ostechnix.com/wp-content/uploads/2019/03/Blockchain-In-Real-Estate-720x340.png) - -### Blockchain 2.0: Smart‘er’ Real Estate - -The [**previous article**][1] of this series explored the features of blockchain which will enable institutions to transform and interlace **traditional banking** and **financing systems** with it. This part will explore – **Blockchain in real estate**. The real estate industry is ripe for a revolution. It’s among the most actively traded most significant asset classes known to man. However, filled with regulatory hurdles and numerous possibilities of fraud and deceit, it’s also one of the toughest to participate in. The distributed ledger capabilities of the blockchain utilizing an appropriate consensus algorithm are touted as the way forward for the industry which is traditionally regarded as conservative in its attitude to change. - -Real estate has always been a very conservative industry in terms of its myriad operations. Somewhat rightfully so as well. A major economic crisis such as the 2008 financial crisis or the great depression from the early half of the 20th century managed to destroy the industry and its participants. However, like most products of economic value, the real estate industry is resilient and this resilience is rooted in its conservative nature. - -The global real estate market comprises an asset class worth **$228 trillion dollars** [1]. Give or take. Other investment assets such as stocks, bonds, and shares combined are only worth **$170 trillion**. Obviously, any and all transactions implemented in such an industry is naturally carefully planned and meticulously executed, for the most part. For the most part, because real estate is also notorious for numerous instances of fraud and devastating loses which ensue them. The industry because of the very conservative nature of its operations is also tough to navigate. It’s heavily regulated with complex laws creating an intertwined web of nuances that are just too difficult for an average person to understand fully. This makes entry and participation near impossible for most people. If you’ve ever been involved in one such deal, you’ll know how heavy and long the paper trail was. - -This hard reality is now set to change, albeit a slow and gradual transformation. The very reasons the industry has stuck to its hardy tested roots all this while can finally give way to its modern-day counterpart. The backbone of the real estate industry has always been its paper records. Land deeds, titles, agreements, rental insurance, proofs, and declarations etc., are just the tip of the iceberg here. If you’ve noticed the pattern here, this should be obvious, the distributed ledger technology that is blockchain, fits in perfectly with the needs here. Forget paper records, conventional database systems are also points of major failure. They can be modified by multiple participants, is not tamper proof or un-hackable, has a complicated set of ever-changing regulatory parameters making auditing and verifying data a nightmare. The blockchain perfectly solves all of these issues and more. - -Starting with a trivial albeit an important example to show just how bad the current record management practices are in the real estate sector, consider the **Title Insurance business** [2], [3]. Title Insurance is used to hedge against the possibility of the land’s titles and ownership records being inadmissible and hence unenforceable. An insurance product such as this is also referred to as an indemnity cover. It is by law required in many cases that properties have title insurance, especially when dealing with property that has changed hands multiple times over the years. Mortgage firms might insist on the same as well when they back real estate deals. The fact that a product of this kind has existed since the 1850s and that it does business worth at least **$1.5 trillion a year in the US alone** is a testament to the statement at the start. A revolution in terms of how these records are maintained is imperative to have in this situation and the blockchain provides a sustainable solution. Title fraud averages around $100k per case on average as per the **American Land Title Association** and 25% of all titles involved in transactions have an issue regarding their documents[4]. The blockchain allows for setting up an immutable permanent database that will track the property itself, recording each and every transaction or investment that has gone into it. Such a ledger system will make life easier for everyone involved in the real estate industry including one-time home buyers and make financial products such as Title Insurance basically irrelevant. Converting a physical asset such as real estate to a digital asset like this is unconventional and is extant only in theory at the moment. However, such a change is imminent sooner rather than later[5]. - -Among the areas in which blockchain will have the most impact within real estate is as highlighted above in maintaining a transparent and secure title management system for properties. A blockchain based record of the property can contain information about the property, its location, history of ownership, and any related public record of the same[6]. This will permit closing real estate deals fast and obliviates the need for 3rd party monitoring and oversight. Tasks such as real estate appraisal and tax calculations become matters of tangible objective parameters rather than subjective measures and guesses because of reliable historical data which is publicly verifiable. **UBITQUITY** is one such platform that offers customized blockchain-based solutions to enterprise customers. The platform allows customers to keep track of all property details, payment records, mortgage records and even allows running smart contracts that’ll take care of taxation and leasing automatically[7]. - -This brings us to the second biggest opportunity and use case of blockchains in real estate. Since the sector is highly regulated by numerous 3rd parties apart from the counterparties involved in the trade, due-diligence and financial evaluations can be significantly time-consuming. These processes are predominantly carried out using offline channels and paperwork needs to travel for days before a final evaluation report comes out. This is especially true for corporate real estate deals and forms a bulk of the total billable hours charged by consultants. In case the transaction is backed by a mortgage, duplication of these processes is unavoidable. Once combined with digital identities for the people and institutions involved along with the property, the current inefficiencies can be avoided altogether and transactions can take place in a matter of seconds. The tenants, investors, institutions involved, consultants etc., could individually validate the data and arrive at a critical consensus thereby validating the property records for perpetuity[8]. This increases the accuracy of verification manifold. Real estate giant **RE/MAX** has recently announced a partnership with service provider **XYO Network Partners** for building a national database of real estate listings in Mexico. They hope to one day create one of the largest (as of yet) decentralized real estate title registry in the world[9]. - -However, another significant and arguably a very democratic change that the blockchain can bring about is with respect to investing in real estate. Unlike other investment asset classes where even small household investors can potentially participate, real estate often requires large hands-down payments to participate. Companies such as **ATLANT** and **BitOfProperty** tokenize the book value of a property and convert them into equivalents of a cryptocurrency. These tokens are then put for sale on their exchanges similar to how stocks and shares are traded. Any cash flow that the real estate property generates afterward is credited or debited to the token owners depending on their “share” in the property[4]. - -However, even with all of that said, Blockchain technology is still in very early stages of adoption in the real estate sector and current regulations are not exactly defined for it to be either[8]. Concepts such as distributed applications, distributed anonymous organizations, smart contracts etc., are unheard of in the legal domain in many countries. A complete overhaul of existing regulations and guidelines once all the stakeholders are well educated on the intricacies of the blockchain is the most pragmatic way forward. Again, it’ll be a slow and gradual change to go through, however a much-needed one nonetheless. The next article of the series will look at how **“Smart Contracts”** , such as those implemented by companies such as UBITQUITY and XYO are created and executed in the blockchain. - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/blockchain-2-0-blockchain-in-real-estate/ - -作者:[EDITOR][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.ostechnix.com/author/editor/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/blockchain-2-0-redefining-financial-services/ diff --git a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md index 28a50d8a43..d8bb34395b 100644 --- a/sources/tech/20190319 How to set up a homelab from hardware to firewall.md +++ b/sources/tech/20190319 How to set up a homelab from hardware to firewall.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to set up a homelab from hardware to firewall) [#]: via: (https://opensource.com/article/19/3/home-lab) -[#]: author: (Michael Zamot (Red Hat) https://opensource.com/users/mzamot) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) How to set up a homelab from hardware to firewall ====== diff --git a/sources/tech/20190320 4 cool terminal multiplexers.md b/sources/tech/20190320 4 cool terminal multiplexers.md deleted file mode 100644 index e8650b4f56..0000000000 --- a/sources/tech/20190320 4 cool terminal multiplexers.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 cool terminal multiplexers) -[#]: via: (https://fedoramagazine.org/4-cool-terminal-multiplexers/) -[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) - -4 cool terminal multiplexers -====== - -![][1] - -The Fedora OS is comfortable and easy for lots of users. It has a stunning desktop that makes it easy to get everyday tasks done. Under the hood is all the power of a Linux system, and the terminal is the easiest way for power users to harness it. By default terminals are simple and somewhat limited. However, a _terminal multiplexer_ allows you to turn your terminal into an even more incredible powerhouse. This article shows off some popular terminal multiplexers and how to install them. - -Why would you want to use one? Well, for one thing, it lets you logout of your system while _leaving your terminal session undisturbed_. It’s incredibly useful to logout of your console, secure it, travel somewhere else, then remotely login with SSH and continue where you left off. Here are some utilities to check out. - -One of the oldest and most well-known terminal multiplexers is _screen._ However, because the code is no longer maintained, this article focuses on more recent apps. (“Recent” is relative — some of these have been around for years!) - -### Tmux - -The _tmux_ utility is one of the most widely used replacements for _screen._ It has a highly configurable interface. You can program tmux to start up specific kinds of sessions based on your needs. You’ll find a lot more about tmux in this article published earlier: - -> [Use tmux for a more powerful terminal][2] - -Already a tmux user? You might like [this additional article on making your tmux sessions more effective][3]. - -To install tmux, use the _sudo_ command along with _dnf_ , since you’re probably in a terminal already: - -``` -$ sudo dnf install tmux -``` - -To start learning, run the _tmux_ command. A single pane window starts with your default shell. Tmux uses a _modifier key_ to signal that a command is coming next. This key is **Ctrl+B** by default. If you enter **Ctrl+B, C** you’ll create a new window with a shell in it. - -Here’s a hint: Use **Ctrl+B, ?** to enter a help mode that lists all the keys you can use. To keep things simple, look for the lines starting with _bind-key -T prefix_ at first. These are keys you can use right after the modifier key to configure your tmux session. You can hit **Ctrl+C** to exit the help mode back to tmux. - -To completely exit tmux, use the standard _exit_ command or _Ctrl+D_ keystroke to exit all the shells. - -### Dvtm - -You might have recently seen the Magazine article on [dwm, a dynamic window manager][4]. Like dwm, _dvtm_ is for tiling window management — but in a terminal. It’s designed to adhere to the legacy UNIX philosophy of “do one thing well” — in this case managing windows in a terminal. - -Installing dvtm is easy as well. However, if you want the logout functionality mentioned earlier, you’ll also need the _abduco_ package which handles session management for dvtm. - -``` -$ sudo dnf install dvtm abduco -``` - -The dvtm utility has many keystrokes already mapped to allow you to manage windows in the terminal. By default, it uses **Ctrl+G** as its modifier key. This keystroke tells dvtm that the following character is going to be a command it should process. For instance, **Ctrl+G, C** creates a new window and **Ctrl+G, X** removes it. - -For more information on using dvtm, check out the dvtm [home page][5] which includes numerous tips and get-started information. - -### Byobu - -While _byobu_ isn’t truly a multiplexer on its own — it wraps _tmux_ or even the older _screen_ to add functions — it’s worth covering here too. Byobu makes terminal multiplexers better for novices, by adding a help menu and window tabs that are slightly easier to navigate. - -Of course it’s available in the Fedora repos as well. To install, use this command: - -``` -$ sudo dnf install byobu -``` - -By default the _byobu_ command runs _screen_ underneath, so you might want to run _byobu-tmux_ to wrap _tmux_ instead. You can then use the **F9** key to open up a help menu for more information to help you get started. - -### Mtm - -The _mtm_ utility is one of the smallest multiplexers you’ll find. In fact, it’s only about 1000 lines of code! You might find it helpful if you’re in a limited environment such as old hardware, a minimal container, and so forth. To get started, you’ll need a couple packages. - -``` -$ sudo dnf install git ncurses-devel make gcc -``` - -Then clone the repository where mtm lives: - -``` -$ git clone https://github.com/deadpixi/mtm.git -``` - -Change directory into the _mtm_ folder and build the program: - -``` -$ make -``` - -You might receive a few warnings, but when you’re done, you’ll have the very small _mtm_ utility. Run it with this command: - -``` -$ ./mtm -``` - -You can find all the documentation for the utility [on its GitHub page][6]. - -These are just some of the terminal multiplexers out there. Got one you’d like to recommend? Leave a comment below with your tips and enjoy building windows in your terminal! - -* * * - -_Photo by _[ _Michael_][7]_ on [Unsplash][8]._ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/4-cool-terminal-multiplexers/ - -作者:[Paul W. Frields][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/pfrields/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/tmuxers-4-816x345.jpg -[2]: https://fedoramagazine.org/use-tmux-more-powerful-terminal/ -[3]: https://fedoramagazine.org/4-tips-better-tmux-sessions/ -[4]: https://fedoramagazine.org/lets-try-dwm-dynamic-window-manger/ -[5]: http://www.brain-dump.org/projects/dvtm/#why -[6]: https://github.com/deadpixi/mtm -[7]: https://unsplash.com/photos/48yI_ZyzuLo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[8]: https://unsplash.com/search/photos/windows?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md index cb590455a5..5f940e9b0b 100644 --- a/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md +++ b/sources/tech/20190320 Choosing an open messenger client- Alternatives to WhatsApp.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Choosing an open messenger client: Alternatives to WhatsApp) [#]: via: (https://opensource.com/article/19/3/open-messenger-client) -[#]: author: (Chris Hermansen (Community Moderator) https://opensource.com/users/clhermansen) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) Choosing an open messenger client: Alternatives to WhatsApp ====== diff --git a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md index d8366df720..c4200355e4 100644 --- a/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md +++ b/sources/tech/20190320 Getting started with Jaeger to build an Istio service mesh.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (Getting started with Jaeger to build an Istio service mesh) [#]: via: (https://opensource.com/article/19/3/getting-started-jaeger) -[#]: author: (Daniel Oh (Red Hat) https://opensource.com/users/daniel-oh) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) Getting started with Jaeger to build an Istio service mesh ====== diff --git a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md index fee3a8cc4c..0e4be0aa01 100644 --- a/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md +++ b/sources/tech/20190321 How to use Spark SQL- A hands-on tutorial.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use Spark SQL: A hands-on tutorial) [#]: via: (https://opensource.com/article/19/3/apache-spark-and-dataframes-tutorial) -[#]: author: (Dipanjan (DJ) Sarkar (Red Hat) https://opensource.com/users/djsarkar) +[#]: author: (Dipanjan Sarkar https://opensource.com/users/djsarkar) How to use Spark SQL: A hands-on tutorial ====== diff --git a/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md b/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md new file mode 100644 index 0000000000..52f02edc95 --- /dev/null +++ b/sources/tech/20190321 NVIDIA Jetson Nano is a -99 Raspberry Pi Rival for AI Development.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NVIDIA Jetson Nano is a $99 Raspberry Pi Rival for AI Development) +[#]: via: (https://itsfoss.com/nvidia-jetson-nano/) +[#]: author: (Atharva Lele https://itsfoss.com/author/atharva/) + +NVIDIA Jetson Nano is a $99 Raspberry Pi Rival for AI Development +====== + +At the [GPU Technology Conference][1] NVIDIA announced the [Jetson Nano Module][2] and the [Jetson Nano Developer Kit][3]. Compared to other Jetson boards which cost between $299 and $1099, the Jetson Nano bears a low cost of $99. This puts it within the reach of many developers, educators, and researchers who could not spend hundreds of dollars to get such a product. + +![The Jetson Nano Development Kit \(left\) and the Jetson Nano Module \(right\)][4] + +### Bringing back AI development from ‘cloud’ + +In the last few years, we have seen a lot of [advances in AI research][5]. Traditionally AI computing was always done in the cloud, where there was plenty of processing power available. + +Recently, there’s been a trend in shifting this computation away from the cloud and do it locally. This is called [Edge Computing][6]. Now at the embedded level, products which could do such complex calculations required for AI and Machine Learning were sparse, but we’re seeing a great explosion these days in this product segment. + +Products like the [SparkFun Edge][7] and [OpenMV Board][8] are good examples. The Jetson Nano, is NVIDIA’s latest offering in this market. When connected to your system, it will be able to supply the processing power needed for Machine Learning and AI tasks without having to rely on the cloud. + +This is great for privacy as well as saving on internet bandwidth. It is also more secure since your data always stays on the device itself. + +### Jetson Nano focuses on smaller AI projects + +![Jetson Nano powered JetBot][9] + +Previously released Jetson Boards like the [TX2][10] and [AGX Xavier][11] were used in products like drones and cars, the Jetson Nano is targeting smaller projects, projects where you need to have the processing power which boards like the [Raspberry Pi][12] cannot provide. + +Did you know? + +NVIDIA’s JetPack SDK provides a ‘complete desktop Linux environment based on Ubuntu 18.04 LTS’. In other words, the Jetson Nano is powered by Ubuntu Linux. + +### NVIDIA Jetson Nano Specifications + +For $99, you get 472 GFLOPS of processing power due to 128 NVIDIA Maxwell Architecture CUDA Cores, a quad-core ARM A57 processor, 4GB of LP-DDR4 RAM, 16GB of on-board storage, and 4k video encode/decode capabilities. The port selection is also pretty decent with the Nano having Gigabit Ethernet, MIPI Camera, Display outputs, and a couple of USB ports (1×3.0, 3×2.0). Full range of specifications can be found [here][13]. + +CPU | Quad-core ARM® Cortex®-A57 MPCore processor +---|--- +GPU | NVIDIA Maxwell™ architecture with 128 NVIDIA CUDA® cores +RAM | 4 GB 64-bit LPDDR4 +Storage | 16 GB eMMC 5.1 Flash +Camera | 12 lanes (3×4 or 4×2) MIPI CSI-2 DPHY 1.1 (1.5 Gbps) +Connectivity | Gigabit Ethernet +Display Ports | HDMI 2.0 and DP 1.2 +USB Ports | 1 USB 3.0 and 3 USB 2.0 +Other | 1 x1/2/4 PCIE, 1x SDIO / 2x SPI / 6x I2C / 2x I2S / GPIOs +Size | 69.6 mm x 45 mm + +Along with good hardware, you get support for the majority of popular AI frameworks like TensorFlow, PyTorch, Keras, etc. It also has support for NVIDIA’s [JetPack][14] and [DeepStream][15] SDKs, same as the more expensive TX2 and AGX Boards. + +“Jetson Nano makes AI more accessible to everyone — and is supported by the same underlying architecture and software that powers our nation’s supercomputer. Bringing AI to the maker movement opens up a whole new world of innovation, inspiring people to create the next big thing.” said Deepu Talla, VP and GM of Autonomous Machines at NVIDIA. + +[Subscribe to It’s FOSS YouTube Channel][16] + +**What do you think of Jetson Nano?** + +The availability of Jetson Nano differs from country to country. + +The [Intel Neural Stick][17], is also one such accelerator which is competitively prices at $79. It’s good to see competition stirring up at these lower price points from the big manufacturers. + +I’m looking forward to getting my hands on the product if possible. + +What do you guys think about a product like this? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nvidia-jetson-nano/ + +作者:[Atharva Lele][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/atharva/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/gtc/ +[2]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/ +[3]: https://developer.nvidia.com/embedded/buy/jetson-nano-devkit +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/03/jetson-nano-family-press-image-hd.jpg?ssl=1 +[5]: https://itsfoss.com/nanotechnology-open-science-ai/ +[6]: https://en.wikipedia.org/wiki/Edge_computing +[7]: https://www.sparkfun.com/news/2886 +[8]: https://openmv.io/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/03/nvidia_jetson_bot.jpg?ssl=1 +[10]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-tx2/ +[11]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-agx-xavier/ +[12]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[13]: https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/#specifications +[14]: https://developer.nvidia.com/embedded/jetpack +[15]: https://developer.nvidia.com/deepstream-sdk +[16]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[17]: https://software.intel.com/en-us/movidius-ncs-get-started diff --git a/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md b/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md new file mode 100644 index 0000000000..f3f1f7c72b --- /dev/null +++ b/sources/tech/20190321 Top 10 New Linux SBCs to Watch in 2019.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 10 New Linux SBCs to Watch in 2019) +[#]: via: (https://www.linux.com/blog/2019/3/top-10-new-linux-sbcs-watch-2019) +[#]: author: (Eric Brown https://www.linux.com/users/ericstephenbrown) + +Top 10 New Linux SBCs to Watch in 2019 +====== + +![UP Xtreme][1] + +Aaeon's Linux-ready UP Xtreme SBC. + +[Used with permission][2] + +A recent [Global Market Insights report][3] projects the single board computer market will grow from $600 million in 2018 to $1 billion by 2025. Yet, you don’t need to read a market research report to realize the SBC market is booming. Driven by the trends toward IoT and AI-enabled edge computing, new boards keep rolling off the assembly lines, many of them [tailored for highly specific applications][4]. + +Much of the action has been in Linux-compatible boards, including the insanely popular Raspberry Pi. The number of different vendors and models has exploded thanks in part to the rise of [community-backed, open-spec SBCs][5]. + +Here we examine 10 of the most intriguing, Linux-driven SBCs among the many products announced in the last four weeks that bookended the recent [Embedded World show][6] in Nuremberg. (There was also some [interesting Linux software news][7] at the show.) Two of the SBCs—the Intel Whiskey Lake based UP Xtreme and Nvidia Jetson Nano driven Jetson Nano Dev Kit—were announced only this week. + +Our mostly open source list also includes a few commercial boards. Processors range from the modest, Cortex-A7 driven STM32MP1 to the high-powered Whiskey Lake and Snapdragon 845. Mid-range models include Google’s i.MX8M powered Coral Dev Board and a similarly AI-enhanced, TI AM5729 based BeagleBone AI. Deep learning acceleration chips—and standard RPi 40-pin or 96Boards expansion connectors—are common themes among most of these boards. + +The SBCs are listed in reverse chronological order according to their announcement dates. The links in the product names go to recent LinuxGizmos reports, which link to vendor product pages. + +**[UP Xtreme][8]** —The latest in Aaeon’s line of community-backed SBCs taps Intel’s 8th Gen Whiskey Lake-U CPUs, which maintain a modest 15W TDP while boosting performance with up to quad-core, dual threaded configurations. Depending on when it ships, this Linux-ready model will likely be the most powerful community-backed SBC around -- and possibly the most expensive. + +The SBC supports up to 16GB DDR4 and 128GB eMMC and offers 4K displays via HDMI, DisplayPort, and eDP. Other features include SATA, 2x GbE, 4x USB 3.0, and 40-pin “HAT” and 100-pin GPIO add-on board connectors. You also get mini-PCIe and dual M.2 slots that support wireless modems and more SATA options. The slots also support Aaeon’s new AI Core X modules, which offer Intel’s latest Movidius Myriad X VPUs for 1TOPS neural processing acceleration. + +**[Jetson Nano Dev Kit][9]** —Nvidia just announced a low-end Jetson Nano compute module that’s sort of like a smaller (70 x 45mm) version of the old Jetson TX1. It offers the same 4x Cortex-A57 cores but has an even lower-end 128-core Maxwell GPU. The module has half the RAM and flash (4GB/16GB) of the TX1 and TX2, and no WiFi/Bluetooth radios. Like the hexa-core Jetson TX2, however, it supports 4K video and the GPU offers similar CUDA-X deep learning libraries. + +Although Nvidia has backed all its Linux-driven Jetson modules with development kits, the Jetson Nano Dev Kit is its first community-backed, maker-oriented kit. It does not appear to offer open specifications, but it costs only $99 and there’s a forum and other community resources. Many of the specs match or surpass the Raspberry Pi 3B+, including the addition of a 40-pin GPIO. Highlights include an M.2 slot, GbE with Power-over-Ethernet, HDMI 2.0 and eDP links, and 4x USB 3.0 ports. + +**[Coral Dev Board][10]** —Google’s very first Linux maker board arrived earlier this month featuring an NXP i.MX8M and Google’s Edge TPU AI chip—a stripped-down version of Google’s TPU Unit is designed to run TensorFlow Lite ML models. The $150, Raspberry Pi-like Coral Dev Board was joined by a similarly Edge TPU-enabled Coral USB Accelerator USB stick. These will be followed by an Edge TPU based Coral PCIe Accelerator and a Coral SOM compute module. All these devices are backed with schematics, community resources, and other open-spec resources. + +The Coral Dev Board combines the Edge TPU chip with NXP’s quad-core, 1.5GHz Cortex-A53 i.MX8M with a 3D Vivante GPU/VPU and a Cortex-M4 MCU. The SBC is even more like the Raspberry Pi 3B+ than Nvidia’s Dev Kit, mimicking the size and much of the layout and I/O, including the 40-pin GPIO connector. Highlights include 4K-ready GbE, HDMI 2.0a, 4-lane MIPI-DSI and CSI, and USB 3.0 host and Type-C ports. + +**[SBC-C43][11]** —Seco’s commercial, industrial temperature SBC-C43 board is the first SBC based on NXP’s high-end, up to hexa-core i.MX8. The 3.5-inch SBC supports the i.MX8 QuadMax with 2x Cortex-A72 cores and 4x Cortex-A53 cores, the QuadPlus with a single Cortex-A72 and 4x -A53, and the Quad with no -A72 cores and 4x -A53. There are also 2x Cortex-M4F real-time cores and 2x Vivante GPU/VPU cores. Yocto Project, Wind River Linux, and Android are available. + +The feature-rich SBC-C43 supports up to 8GB DDR4 and 32GB eMMC, both soldered for greater reliability. Highlights include dual GbE, HDMI 2.0a in and out ports, WiFi/Bluetooth, and a variety of industrial interfaces. Dual M.2 slots support SATA, wireless, and more. + +**[Nitrogen8M_Mini][12]** —This Boundary Devices cousin to the earlier, i.MX8M based Nitrogen8M is available for $135, with shipments due this Spring. The open-spec Nitrogen8M_Mini is the first SBC to feature NXP’s new i.MX8M Mini SoC. The Mini uses a more advanced 14LPC FinFET process than the i.MX8M, resulting in lower power consumption and higher clock rates for both the 4x Cortex-A53 (1.5GHz to 2GHz) and Cortex-M4 (400MHz) cores. The drawback is that you’re limited to HD video resolution. + +Supported with Linux and Android, the Nitrogen8M_Mini ships with 2GB to 4GB LPDDR4 RAM and 8GB to 128GB eMMC. MIPI-DSI and -CSI interfaces support optional touchscreens and cameras, respectively. A GbE port is standard and PoE and WiFi/BT are optional. Other features include 3x USB ports, one or two PCIe slots, and optional -40 to 85°C support. A Nitrogen8M_Mini SOM module with similar specs is also in the works. + +**[Pine H64 Model B][13]** —Pine64’s latest hacker board was teased in late January as part of an [ambitious roll-out][14] of open source products, including a laptop, tablet, and phone. The Raspberry Pi semi-clone, which recently went on sale for $39 (2GB) or $49 (3GB), showcases the high-end, but low-cost Allwinner H64. The quad -A53 SoC is notable for its 4K video with HDR support. + +The Pine H64 Model B offers up to 128GB eMMC storage, WiFi/BT, and a GbE port. I/O includes 2x USB 2.0 and single USB 3.0 and HDMI 2.0a ports plus SPDIF audio and an RPi-like 40-pin connector. Images include Android 7.0 and an “in progress” Armbian Debian Stretch. + +**[AI-ML Board][15]** —Arrow unveiled this i.MX8X based SBC early this month along with a similarly 96Boards CE Extended format, i.MX8M based Thor96 SBC. While there are plenty of i.MX8M boards these days, we’re more intrigued with the lowest-end i.MX8X member of the i.MX8 family. The AI-ML Board is the first SBC we’ve seen to feature the low-power i.MX8X, which offers up to 4x 64-bit, 1.2GHz Cortex-A35 cores, a 4-shader, 4K-ready Vivante GPU/VPU, a Cortex-M4F chip, and a Tensilica HiFi 4 DSP. + +The open-spec, Yocto Linux driven AI-ML Board is targeted at low-power, camera-equipped applications such as drones. The board has 2GB LPDDR4, Ethernet, WiFi/BT, and a pair each of MIPI-DSI and USB 3.0 ports. Cameras are controlled via the 96Boards 60-pin, high-power GPIO connector, which is joined by the usual 40-pin low-power link. The launch is expected June 1. + +**[BeagleBone AI][16]** —The long-awaited successor to the Cortex-A8 AM3358 based BeagleBone family of boards advances to TIs dual-core Cortex-A15 AM5729, with similar PowerVR GPU and MCU-like PRU cores. The real story, however, is the AI firepower enabled by the SoC’s dual TI C66x DSPs and four embedded-vision-engine (EVE) neural processing cores. BeagleBoard.org claims that calculations for computer-vision models using EVE run at 8x times the performance per watt compared to the similar, but EVE-less, AM5728. The EVE and DSP chips are supported through a TIDL machine learning OpenCL API and pre-installed tools. + +Due to go on sale in April for about $100, the Linux-powered BeagleBone AI is based closely on the BeagleBone Black and offers backward header, mechanical, and software compatibility. It doubles the RAM to 1GB and quadruples the eMMC storage to 16GB. You now get GbE and high-speed WiFi, as well as a USB Type-C port. + +**[Robotics RB3 Platform (DragonBoard 845c)][17]** —Qualcomm and Thundercomm are initially launching their 96Boards CE form factor, Snapdragon 845-based upgrade to the Snapdragon 820-based [DragonBoard 820c][18] SBC as part of a Qualcomm Robotics RB3 Platform. Yet, 96Boards.org has already posted a [DragonBoard 845c product page][17], and we imagine the board will be available in the coming months without all the robotics bells and whistles. A compute module version is also said to be in the works. + +The 10nm, octa-core, “Kryo” based Snapdragon 845 is one of the most powerful Arm SoCs around. It features an advanced Adreno 630 GPU with “eXtended Reality” (XR) VR technology and a Hexagon 685 DSP with a third-gen Neural Processing Engine (NPE) for AI applications. On the RB3 kit, the board’s expansion connectors are pre-stocked with Qualcomm cellular and robotics camera mezzanines. The $449 and up kit also includes standard 4K video and tracking cameras, and there are optional Time-of-Flight (ToF) and stereo SLM camera depth cameras. The SBC runs Linux with ROS (Robot Operating System). + +**[Avenger96][19]** —Like Arrow’s AI-ML Board, the Avenger96 is a 96Boards CE Extended SBC aimed at low-power IoT applications. Yet, the SBC features an even more power-efficient (and slower) SoC: ST’s recently announced [STM32MP153][20]. The Avenger96 runs Linux on the high-end STM32MP157 model, which has dual, 650MHz Cortex-A7 cores, a Cortex-M4, and a Vivante 3D GPU. + +This sandwich-style board features an Avenger96 module with the STM32MP157 SoC, 1GB of DDR3L, 2MB SPI flash, and a power management IC. It’s unclear if the 8GB eMMC and WiFi-ac/Bluetooth 4.2 module are on the module or carrier board. The Avenger96 SBC is further equipped with GbE, HDMI, micro-USB OTG, and dual USB 2.0 host ports. There’s also a microSD slot and the usual 40- and 60-pin GPIO connectors. The board is expected to go on sale in April. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/top-10-new-linux-sbcs-watch-2019 + +作者:[Eric Brown][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/ericstephenbrown +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/aaeon_upxtreme.jpg?itok=QnwAt3mp (UP Xtreme) +[2]: /LICENSES/CATEGORY/USED-PERMISSION +[3]: https://www.globenewswire.com/news-release/2019/02/13/1724445/0/en/Single-Board-Computer-Market-to-surpass-1bn-by-2025-Global-Market-Insights-Inc.html +[4]: https://www.linux.com/blog/2019/1/linux-hacker-board-trends-2018-and-beyond +[5]: http://linuxgizmos.com/catalog-of-122-open-spec-linux-hacker-boards/ +[6]: https://www.embedded-world.de/en +[7]: https://www.linux.com/news/2019/2/embedded-linux-software-highlights-embedded-world +[8]: http://linuxgizmos.com/latest-up-board-combines-whiskey-lake-with-ai-core-x-modules/ +[9]: http://linuxgizmos.com/trimmed-down-jetson-nano-modules-ships-on-99-linux-dev-kit/ +[10]: http://linuxgizmos.com/google-launches-i-mx8m-dev-board-with-edge-tpu-ai-chip/ +[11]: http://linuxgizmos.com/first-i-mx8-quadmax-sbc-breaks-cover/ +[12]: http://linuxgizmos.com/open-spec-nitrogen8m_mini-sbc-ships-along-with-new-mini-based-som/ +[13]: http://linuxgizmos.com/revised-allwiner-h64-based-pine-h64-sbc-has-rpi-size-and-gpio/ +[14]: https://www.linux.com/blog/2019/2/pine64-launch-open-source-phone-laptop-tablet-and-camera +[15]: http://linuxgizmos.com/arrows-latest-96boards-sbcs-tap-i-mx8x-and-i-mx8m/ +[16]: http://linuxgizmos.com/beaglebone-ai-sbc-features-dual-a15-soc-with-eve-ai-cores/ +[17]: http://linuxgizmos.com/robotics-kit-runs-linux-on-new-dragonboard-845c-96boards-sbc/ +[18]: http://linuxgizmos.com/debian-driven-dragonboard-expands-to-96boards-extended-spec/ +[19]: http://linuxgizmos.com/sandwich-style-96boards-sbc-runs-linux-on-sts-new-cortex-a7-m4-soc/ +[20]: https://www.linux.com/news/2019/2/st-spins-its-first-linux-powered-cortex-soc diff --git a/sources/tech/20190322 12 open source tools for natural language processing.md b/sources/tech/20190322 12 open source tools for natural language processing.md index 99031acf68..9d2822926f 100644 --- a/sources/tech/20190322 12 open source tools for natural language processing.md +++ b/sources/tech/20190322 12 open source tools for natural language processing.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (12 open source tools for natural language processing) [#]: via: (https://opensource.com/article/19/3/natural-language-processing-tools) -[#]: author: (Dan Barker (Community Moderator) https://opensource.com/users/barkerd427) +[#]: author: (Dan Barker https://opensource.com/users/barkerd427) 12 open source tools for natural language processing ====== diff --git a/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md b/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md new file mode 100644 index 0000000000..2d794f2d29 --- /dev/null +++ b/sources/tech/20190322 How to set up Fedora Silverblue as a gaming station.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up Fedora Silverblue as a gaming station) +[#]: via: (https://fedoramagazine.org/set-up-fedora-silverblue-gaming-station/) +[#]: author: (Michal Konečný https://fedoramagazine.org/author/zlopez/) + +How to set up Fedora Silverblue as a gaming station +====== + +![][1] + +This article gives you a step by step guide to turn your Fedora Silverblue into an awesome gaming station with the help of Flatpak and Steam. + +Note: Do you need the NVIDIA proprietary driver on Fedora 29 Silverblue for a complete experience? Check out [this blog post][2] for pointers. + +### Add the Flathub repository + +This process starts with a clean Fedora 29 Silverblue installation with a user already created for you. + +First, go to and enable the Flathub repository on your system. To do this, click the _Quick setup_ button on the main page. + +![Quick setup button on flathub.org/home][3] + +This redirects you to where you should click on the Fedora icon. + +![Fedora icon on flatpak.org/setup][4] + +Now you just need to click on _Flathub repository file._ Open the downloaded file with the _Software Install_ application. + +![Flathub repository file button on flatpak.org/setup/Fedora][5] + +The GNOME Software application opens. Next, click on the _Install_ button. This action needs _sudo_ permissions, because it installs the Flathub repository for use by the whole system. + +![Install button in GNOME Software][6] + +### Install the Steam flatpak + +You can now search for the S _team_ flatpak in _GNOME Software_. If you can’t find it, try rebooting — or logout and login — in case _GNOME Software_ didn’t read the metadata. That happens automatically when you next login. + +![Searching for Steam][7] + +Click on the _Steam_ row and the _Steam_ page opens in _GNOME Software._ Next, click on _Install_. + +![Steam page in GNOME Software][8] + +And now you have installed _Steam_ flatpak on your system. + +### Enable Steam Play in Steam + +Now that you have _Steam_ installed, launch it and log in. To play Windows games too, you need to enable _Steam Play_ in _Steam._ To enable it, choose _Steam > Settings_ from the menu in the main window. + +![Settings button in Steam][9] + +Navigate to the _Steam Play_ section. You should see the option _Enable Steam Play for supported titles_ is already ticked, but it’s recommended you also tick the _Enable Steam Play_ option for all other titles. There are plenty of games that are actually playable, but not whitelisted yet on _Steam._ To see which games are playable, visit [ProtonDB][10] and search for your favorite game. Or just look for the games with the most platinum reports. + +![Steam Play settings menu on Steam][11] + +If you want to know more about Steam Play, you can read the [article][12] about it here on Fedora Magazine: + +> [Play Windows games on Fedora with Steam Play and Proton][12] + +### Appendix + +You’re now ready to play plenty of games on Linux. Please remember to share your experience with others using the _Contribute_ button on [ProtonDB][10] and report bugs you find on [GitHub][13], because sharing is nice. 🙂 + +* * * + +_Photo by _[ _Hardik Sharma_][14]_ on _[_Unsplash_][15]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/set-up-fedora-silverblue-gaming-station/ + +作者:[Michal Konečný][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zlopez/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/silverblue-gaming-816x345.jpg +[2]: https://blogs.gnome.org/alexl/2019/03/06/nvidia-drivers-in-fedora-silverblue/ +[3]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-29-00.png +[4]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-36-35-1024x713.png +[5]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-45-12.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-12-57-37.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-08-21.png +[8]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-13-59-1024x769.png +[9]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-30-20.png +[10]: https://www.protondb.com/ +[11]: https://fedoramagazine.org/wp-content/uploads/2019/03/Screenshot-from-2019-03-15-13-41-53.png +[12]: https://fedoramagazine.org/play-windows-games-steam-play-proton/ +[13]: https://github.com/ValveSoftware/Proton +[14]: https://unsplash.com/photos/I7rXyzBNVQM?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[15]: https://unsplash.com/search/photos/video-game-laptop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md b/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md new file mode 100644 index 0000000000..3de297db06 --- /dev/null +++ b/sources/tech/20190325 Contribute at the Fedora Test Day for Fedora Modularity.md @@ -0,0 +1,50 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Contribute at the Fedora Test Day for Fedora Modularity) +[#]: via: (https://fedoramagazine.org/contribute-at-the-fedora-test-day-for-fedora-modularity/) +[#]: author: (Sumantro Mukherjee https://fedoramagazine.org/author/sumantrom/) + +Contribute at the Fedora Test Day for Fedora Modularity +====== + +![][1] + +Modularity lets you keep the right version of an application, language runtime, or other software on your Fedora system even as the operating system is updated. You can read more about Modularity in general on the [Fedora documentation site][2]. + +The Modularity folks have been working on Modules for everyone. As a result, the Fedora Modularity and QA teams have organized a test day for **Tuesday, March 26, 2019**. Refer to the [wiki page][3] for links to the test images you’ll need to participate. Read on for more information on the test day. + +### How do test days work? + +A test day is an event where anyone can help make sure changes in Fedora work well in an upcoming release. Fedora community members often participate, and the public is welcome at these events. If you’ve never contributed before, this is a perfect way to get started. + +To contribute, you only need to be able to do the following things: + + * Download test materials, which include some large files + * Read and follow directions step by step + + + +The [wiki page][3] for the modularity test day has a lot of good information on what and how to test. After you’ve done some testing, you can log your results in the test day [web application][4]. If you’re available on or around the day of the event, please do some testing and report your results. + +Happy testing, and we hope to see you on test day. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/contribute-at-the-fedora-test-day-for-fedora-modularity/ + +作者:[Sumantro Mukherjee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/sumantrom/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2015/03/test-days-945x400.png +[2]: https://docs.fedoraproject.org/en-US/modularity/ +[3]: https://fedoraproject.org/wiki/Test_Day:2019-03-26_Modularity_Test_Day +[4]: http://testdays.fedorainfracloud.org/events/61 diff --git a/sources/tech/20190325 Getting started with Vim- The basics.md b/sources/tech/20190325 Getting started with Vim- The basics.md deleted file mode 100644 index 545a60ce94..0000000000 --- a/sources/tech/20190325 Getting started with Vim- The basics.md +++ /dev/null @@ -1,222 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Vim: The basics) -[#]: via: (https://opensource.com/article/19/3/getting-started-vim) -[#]: author: (Bryant Son (Red Hat, Community Moderator) https://opensource.com/users/brson) - -Getting started with Vim: The basics -====== - -Learn to use Vim enough to get by at work or for a new project. - -![Person standing in front of a giant computer screen with numbers, data][1] - -I remember the very first time I encountered Vim. I was a university student, and the computers in the computer science department's lab were installed with Ubuntu Linux. While I had been exposed to different Linux variations (like RHEL) even before my college years (Red Hat sold its CDs at Best Buy!), this was the first time I needed to use the Linux operating system regularly, because my classes required me to do so. Once I started using Linux, like many others before and after me, I began to feel like a "real programmer." - -![Real Programmers comic][2] - -Real Programmers, by [xkcd][3] - -Students could use a graphical text editor like [Kate][4], which was installed on the lab computers by default. For students who could use the shell but weren't used to the console-based editor, the popular choice was [Nano][5], which provided good interactive menus and an experience similar to Windows' graphical text editor. - -I used Nano sometimes, but I heard awesome things about [Vi/Vim][6] and [Emacs][7] and really wanted to give them a try (mainly because they looked cool, and I was also curious to see what was so great about them). Using Vim for the first time scared me—I did not want to mess anything up! But once I got the hang of it, things became much easier and I could appreciate the editor's powerful capabilities. As for Emacs, well, I sort of gave up, but I'm happy I stuck with Vim. - -In this article, I will walk through Vim (based on my personal experience) just enough so you can get by with it as an editor on a Linux system. This will neither make you an expert nor even scratch the surface of many of Vim's powerful capabilities. But the starting point always matters, and I want to make the beginning experience as easy as possible, and you can explore the rest on your own. - -### Step 0: Open a console window - -Before jumping into Vim, you need to do a little preparation. Open a console terminal from your Linux operating system. (Since Vim is also available on MacOS, Mac users can use these instructions, also.) - -Once a terminal window is up, type the **ls** command to list the current directory. Then, type **mkdir Tutorial** to create a new directory called **Tutorial**. Go inside the directory by typing **cd Tutorial**. - -![Create a folder][8] - -That's it for preparation. Now it's time to move on to the fun part—starting to use Vim. - -### Step 1: Create and close a Vim file without saving - -Remember when I said I was scared to use Vim at first? Well, the scary part was thinking, "what if I change an existing file and mess things up?" After all, several computer science assignments required me to work on existing files by modifying them. I wanted to know: _How can I open and close a file without saving my changes?_ - -The good news is you can use the same command to create or open a file in Vim: **vim , where **< FILE_NAME>** represents the target file name you want to create or modify. Let's create a file named **HelloWorld.java** by typing **vim HelloWorld.java**. - -Hello, Vim! Now, here is a very important concept in Vim, possibly the most important to remember: Vim has multiple modes. Here are three you need to know to do Vim basics: - -Mode | Description ----|--- -Normal | Default; for navigation and simple editing -Insert | For explicitly inserting and modifying text -Command Line | For operations like saving, exiting, etc. - -Vim has other modes, like Visual, Select, and Ex-Mode, but Normal, Insert, and Command Line modes are good enough for us. - -You are now in Normal mode. If you have text, you can move around with your arrow keys or other navigation keystrokes (which you will see later). To make sure you are in Normal mode, simply hit the **Esc** (Escape) key. - -> **Tip:** **Esc** switches to Normal mode. Even though you are already in Normal mode, hit **Esc** just for practice's sake. - -Now, this will be interesting. Press **:** (the colon key) followed by **q!** (i.e., **:q!** ). Your screen will look like this: - -![Editing Vim][9] - -Pressing the colon in Normal mode switches Vim to Command Line mode, and the **:q!** command quits the Vim editor without saving. In other words, you are abandoning all changes. You can also use **ZQ** ; choose whichever option is more convenient. - -Once you hit **Enter** , you should no longer be in Vim. Repeat the exercise a few times, just to get the hang of it. Once you've done that, move on to the next section to learn how to make a change to this file. - -### Step 2: Make and save modifications in Vim - -Reopen the file by typing **vim HelloWorld.java** and pressing the **Enter** key. Insert mode is where you can make changes to a file. First, hit **Esc** to make sure you are in Normal mode, then press **i** to go into Insert mode. (Yes, that is the letter **i**.) - -In the lower-left, you should see **\-- INSERT --**. This means you are in Insert mode. - -![Vim insert mode][10] - -Type some Java code. You can type anything you want, but here is an example for you to follow. Your screen will look like this: - - -``` -public class HelloWorld { - public static void main([String][11][] args) { - } -} -``` -Very pretty! Notice how the text is highlighted in Java syntax highlight colors. Because you started the file in Java, Vim will detect the syntax color. - -Save the file. Hit **Esc** to leave Insert mode and enter Command Line mode. Type **:** and follow that with **x!** (i.e., a colon followed by x and !). Hit **Enter** to save the file. You can also type **wq** to perform the same operation. - -Now you know how to enter text using Insert mode and save the file using **:x!** or **:wq**. - -### Step 3: Basic navigation in Vim - -While you can always use your friendly Up, Down, Left, and Right arrow buttons to move around a file, that would be very difficult in a large file with almost countless lines. It's also helpful to be able to be able to jump around within a line. Although Vim has a ton of awesome navigation features, the first one I want to show you is how to go to a specific line. - -Press the **Esc** key to make sure you are in Normal mode, then type **:set number** and hit **Enter** . - -Voila! You see line numbers on the left side of each line. - -![Showing Line Numbers][12] - -OK, you may say, "that's cool, but how do I jump to a line?" Again, make sure you are in Normal mode, then press **: **, where **< LINE_NUMBER>** is the number of the line you want to go to, and press **Enter**. Try moving to line 2. - -``` -:2 -``` - -Now move to line 3. - -![Jump to line 3][13] - -But imagine a scenario where you are dealing with a file that is 1,000 lines long and you want to go to the end of the file. How do you get there? Make sure you are in Normal mode, then type **:$** and press **Enter**. - -You will be on the last line! - -Now that you know how to jump among the lines, as a bonus, let's learn how to move to the end of a line. Make sure you are on a line with some text, like line 3, and type **$**. - -![Go to the last character][14] - -You're now at the last character on the line. In this example, the open curly brace is highlighted to show where your cursor moved to, and the closing curly brace is highlighted because it is the opening curly brace's matching character. - -That's it for basic navigation in Vim. Wait, don't exit the file, though. Let's move to basic editing in Vim. Feel free to grab a cup of coffee or tea, though. - -### Step 4: Basic editing in Vim - -Now that you know how to navigate around a file by hopping onto the line you want, you can use that skill to do some basic editing in Vim. Switch to Insert mode. (Remember how to do that, by hitting the **i** key?) Sure, you can edit by using the keyboard to delete or insert characters, but Vim offers much quicker ways to edit files. - -Move to line 3, where it shows **public static void main(String[] args) {**. Quickly hit the **d** key twice in succession. Yes, that is **dd**. If you did it successfully, you will see a screen like this, where line 3 is gone, and every following line moved up by one (i.e., line 4 became line 3). - -![Deleting A Line][15] - -That's the _delete_ command. Don't fear! Hit **u** and you will see the deleted line recovered. Whew. This is the _undo_ command. - -![Undoing a change in Vim][16] - -The next lesson is learning how to copy and paste text, but first, you need to learn how to highlight text in Vim. Press **v** and move your Left and Right arrow buttons to select and deselect text. This feature is also very useful when you are showing code to others and want to identify the code you want them to see. - -![Highlighting text in Vim][17] - -Move to line 4, where it says **System.out.println("Hello, Opensource");**. Highlight all of line 4. Done? OK, while line 4 is still highlighted, press **y**. This is called _yank_ mode, and it will copy the text to the clipboard. Next, create a new line underneath by entering **o**. Note that this will put you into Insert mode. Get out of Insert mode by pressing **Esc** , then hit **p** , which stands for _paste_. This will paste the copied text from line 3 to line 4. - -![Pasting in Vim][18] - -As an exercise, repeat these steps but also modify the text on your newly created lines. Also, make sure the lines are aligned well. - -> **Hint:** You need to switch back and forth between Insert mode and Command Line mode to accomplish this task. - -Once you are finished, save the file with the **x!** command. That's all for basic editing in Vim. - -### Step 5: Basic searching in Vim - -Imagine your team lead wants you to change a text string in a project. How can you do that quickly? You might want to search for the line using a certain keyword. - -Vim's search functionality can be very useful. Go into the Command Line mode by (1) pressing **Esc** key, then (2) pressing colon **:** ****key. We can search a keyword by entering : **/ **, where **< SEARCH_KEYWORD>** is the text string you want to find. Here we are searching for the keyword string "Hello." In the image below, the colon is missing but required. - -![Searching in Vim][19] - -However, a keyword can appear more than once, and this may not be the one you want. So, how do you navigate around to find the next match? You simply press the **n** key, which stands for _next_. Make sure that you aren't in Insert mode when you do this! - -### Bonus step: Use split mode in Vim - -That pretty much covers all the Vim basics. But, as a bonus, I want to show you a cool Vim feature called _split mode_. - -Get out of _HelloWorld.java_ and create a new file. In a terminal window, type **vim GoodBye.java** and hit **Enter** to create a new file named _GoodBye.java_. - -Enter any text you want; I decided to type "Goodbye." Save the file. (Remember you can use **:x!** or **:wq** in Command Line mode.) - -In Command Line mode, type **:split HelloWorld.java** , and see what happens. - -![Split mode in Vim][20] - -Wow! Look at that! The **split** command created horizontally divided windows with _HelloWorld.java_ above and _GoodBye.java_ below. How can you switch between the windows? Hold **Control** (on a Mac) or **CTRL** (on a PC) then hit **ww** (i.e., **w** twice in succession). - -As a final exercise, try to edit _GoodBye.java_ to match the screen below by copying and pasting from _HelloWorld.java_. - -![Modify GoodBye.java file in Split Mode][21] - -Save both files, and you are done! - -> **TIP 1:** If you want to arrange the files vertically, use the command **:vsplit ** (instead of **:split **, where **< FILE_NAME>** is the name of the file you want to open in Split mode. -> -> **TIP 2:** You can open more than two files by calling as many additional **split** or **vsplit** commands as you want. Try it and see how it looks. - -### Vim cheat sheet - -In this article, you learned how to use Vim just enough to get by for work or a project. But this is just the beginning of your journey to unlock Vim's powerful capabilities. Be sure to check out other great tutorials and tips on Opensource.com. - -To make things a little easier, I've summarized everything you've learned into [a handy cheat sheet][22]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/3/getting-started-vim - -作者:[Bryant Son (Red Hat, Community Moderator)][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/brson -[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://opensource.com/sites/default/files/uploads/1_xkcdcartoon.jpg (Real Programmers comic) -[3]: https://xkcd.com/378/ -[4]: https://kate-editor.org -[5]: https://www.nano-editor.org -[6]: https://www.vim.org -[7]: https://www.gnu.org/software/emacs -[8]: https://opensource.com/sites/default/files/uploads/2_createtestfolder.jpg (Create a folder) -[9]: https://opensource.com/sites/default/files/uploads/4_existingvim.jpg (Editing Vim) -[10]: https://opensource.com/sites/default/files/uploads/6_insertionmode.jpg (Vim insert mode) -[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[12]: https://opensource.com/sites/default/files/uploads/10_setnumberresult_0.jpg (Showing Line Numbers) -[13]: https://opensource.com/sites/default/files/uploads/12_jumpintoline3.jpg (Jump to line 3) -[14]: https://opensource.com/sites/default/files/uploads/14_gotolastcharacter.jpg (Go to the last character) -[15]: https://opensource.com/sites/default/files/uploads/15_deletinglines.jpg (Deleting A Line) -[16]: https://opensource.com/sites/default/files/uploads/16_undoingtheline.jpg (Undoing a change in Vim) -[17]: https://opensource.com/sites/default/files/uploads/17_highlighting.jpg (Highlighting text in Vim) -[18]: https://opensource.com/sites/default/files/uploads/19_pasting.jpg (Pasting in Vim) -[19]: https://opensource.com/sites/default/files/uploads/22_searchmode.jpg (Searching in Vim) -[20]: https://opensource.com/sites/default/files/uploads/26_copytonewfiles.jpg (Split mode in Vim) -[21]: https://opensource.com/sites/default/files/uploads/27_exercise.jpg (Modify GoodBye.java file in Split Mode) -[22]: https://opensource.com/downloads/cheat-sheet-vim diff --git a/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md b/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md new file mode 100644 index 0000000000..22f7df8876 --- /dev/null +++ b/sources/tech/20190325 How Open Source Is Accelerating NFV Transformation.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Open Source Is Accelerating NFV Transformation) +[#]: via: (https://www.linux.com/blog/2019/3/how-open-source-accelerating-nfv-transformation) +[#]: author: (Pam Baker https://www.linux.com/users/pambaker) + +How Open Source Is Accelerating NFV Transformation +====== + +![NFV][1] + +In anticipation of the upcoming Open Networking Summit, we talked with Thomas Nadeau, Technical Director NFV at Red Hat, about the role of open source in innovation for telecommunications service providers. + +[Creative Commons Zero][2] + +Red Hat is noted for making open source a culture and business model, not just a way of developing software, and its message of [open source as the path to innovation][3] resonates on many levels. + +In anticipation of the upcoming [Open Networking Summit][4], we talked with [Thomas Nadeau][5], Technical Director NFV at Red Hat, who gave a [keynote address][6] at last year’s event, to hear his thoughts regarding the role of open source in innovation for telecommunications service providers. + +One reason for open source’s broad acceptance in this industry, he said, was that some very successful projects have grown too large for any one company to manage, or single-handedly push their boundaries toward additional innovative breakthroughs. + +“There are projects now, like Kubernetes, that are too big for any one company to do. There's technology that we as an industry need to work on, because no one company can push it far enough alone,” said Nadeau. “Going forward, to solve these really hard problems, we need open source and the open source software development model.” + +Here are more insights he shared on how and where open source is making an innovative impact on telecommunications companies. + +**Linux.com: Why is open source central to innovation in general for telecommunications service providers?** + +**Nadeau:** The first reason is that the service providers can be in more control of their own destiny. There are some service providers that are more aggressive and involved in this than others. Second, open source frees service providers from having to wait for long periods for the features they need to be developed. + +And third, open source frees service providers from having to struggle with using and managing monolith systems when all they really wanted was a handful of features. Fortunately, network equipment providers are responding to this overkill problem. They're becoming much more flexible, more modular, and open source is the best means to achieve that. + +**Linux.com: In your ONS keynote presentation, you said open source levels the playing field for traditional carriers in competing with cloud-scale companies in creating digital services and revenue streams. Please explain how open source helps.** + +**Nadeau:** Kubernetes again. OpenStack is another one. These are tools that these businesses really need, not to just expand, but to exist in today's marketplace. Without open source in that virtualization space, you’re stuck with proprietary monoliths, no control over your future, and incredibly long waits to get the capabilities you need to compete. + +There are two parts in the NFV equation: the infrastructure and the applications. NFV is not just the underlying platforms, but this constant push and pull between the platforms and the applications that use the platforms. + +NFV is really virtualization of functions. It started off with monolithic virtual machines (VMs). Then came "disaggregated VMs" where individual functions, for a variety of reasons, were run in a more distributed way. To do so meant separating them, and this is where SDN came in, with the separation of the control plane from the data plane. Those concepts were driving changes in the underlying platforms too, which drove up the overhead substantially. That in turn drove interest in container environments as a potential solution, but it's still NFV. + +You can think of it as the latest iteration of SOA with composite applications. Kubernetes is the kind of SOA model that they had at Google, which dropped the worry about the complicated networking and storage underneath and simply allowed users to fire up applications that just worked. And for the enterprise application model, this works great. + +But not in the NFV case. In the NFV case, in the previous iteration of the platform at OpenStack, everybody enjoyed near one-for-one network performance. But when we move it over here to OpenShift, we're back to square one where you lose 80% of the performance because of the latest SOA model that they've implemented. And so now evolving the underlying platform rises in importance, and so the pendulum swing goes, but it's still NFV. Open source allows you to adapt to these changes and influences effectively and quickly. Thus innovations happen rapidly and logically, and so do their iterations. + +**Linux.com: Tell us about the underlying Linux in NFV, and why that combo is so powerful.** + +**Nadeau:** Linux is open source and it always has been in some of the purest senses of open source. The other reason is that it's the predominant choice for the underlying operating system. The reality is that all major networks and all of the top networking companies run Linux as the base operating system on all their high-performance platforms. Now it's all in a very flexible form factor. You can lay it on a Raspberry Pi, or you can lay it on a gigantic million-dollar router. It's secure, it's flexible, and scalable, so operators can really use it as a tool now. + +**Linux.com: Carriers are always working to redefine themselves. Indeed, many are actively seeking ways to move out of strictly defensive plays against disruptors, and onto offense where they ARE the disruptor. How can network function virtualization (NFV) help in either or both strategies?** + +**Nadeau:** Telstra and Bell Canada are good examples. They are using open source code in concert with the ecosystem of partners they have around that code which allows them to do things differently than they have in the past. There are two main things they do differently today. One is they design their own network. They design their own things in a lot of ways, whereas before they would possibly need to use a turnkey solution from a vendor that looked a lot, if not identical, to their competitors’ businesses. + +These telcos are taking a real “in-depth, roll up your sleeves” approach. ow that they understand what they're using at a much more intimate level, they can collaborate with the downstream distro providers or vendors. This goes back to the point that the ecosystem, which is analogous to partner programs that we have at Red Hat, is the glue that fills in gaps and rounds out the network solution that the telco envisions. + +_Learn more at[Open Networking Summit][4], happening April 3-5 at the San Jose McEnery Convention Center._ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2019/3/how-open-source-accelerating-nfv-transformation + +作者:[Pam Baker][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/pambaker +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/nfv-443852_1920.jpg?itok=uFbzmEPY (NFV) +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linuxfoundation.org/blog/2018/02/open-source-standards-team-red-hat-measures-open-source-success/ +[4]: https://events.linuxfoundation.org/events/open-networking-summit-north-america-2019/ +[5]: https://www.linkedin.com/in/tom-nadeau/ +[6]: https://onseu18.sched.com/event/Fmpr diff --git a/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md b/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md new file mode 100644 index 0000000000..52c7c925dd --- /dev/null +++ b/sources/tech/20190326 An inside look at an IIoT-powered smart factory.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An inside look at an IIoT-powered smart factory) +[#]: via: (https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +An inside look at an IIoT-powered smart factory +====== + +### Despite housing some 50 robots and 50 people, Tempo Automation’s gleaming connected factory relies on industrial IoT and looks more like a high-tech startup office than a manufacturing plant. + +![Tempo Automation][1] + +As someone who’s spent his whole career working in offices, not factories, I had very little idea what a modern “smart factory” powered by the industrial Internet of Things (IIoT) might look like. That’s why I was so interested in [Tempo Automation][2]’s new 42,000-square-foot facility in San Francisco’s trendy Design District. + +Frankly, I pictured the company’s facility, which uses IIoT to automatically configure, operate, and monitor the prototyping and low-volume production of printed circuit board assemblies (PCBAs), as a cacophony of robots and conveyor belts attended to by a grizzled band of grease-stained technicians. You know, a 21stcentury update of Charlie Chaplin’s 1936 classic *Modern Times *making equipment for customers in the aerospace, medtech, industrial automation, consumer electronics, and automotive industries. (The company just inked a [new contract with Lockheed Martin][3].) + +**[ Learn more about the[industrial Internet of Things][4]. | Get regularly scheduled insights by [signing up for Network World newsletters][5]. ]** + +Not exactly. As you can see from the below pictures, despite housing some 50 robots and 50 people, this gleaming “connected factory” looks more like a high-tech startup office, with just as many computers and few more hard-to-identify machines, including Solder Jet and Stencil Printers, zone reflow ovens, 3D X-ray devices and many more. + +![Tempo Automation office space][6] + +![Tempo Automation factory floor][7] + +## How Tempo Automation's 'smart factory' works + +On the front end, Tempo’s customers upload CAD files with their board designs and Bills of Materials (BOM) listing the required parts to be used. After performing feature extraction on the design and developing a virtual model of the finished product, the Tempo system, the platform (called Tempocom) creates a manufacturing plan and automatically programs the factory’s machines. Tempocom also creates work plans for the factory employees, uploading them to the networked IIoT mobile devicesthey all carry. Updated in real time based on design and process changes, this“digital traveler” tells workers where to go and what to work on next. + +While Tempocom is planning and organizing the internal work of production, the system is also connected to supplier databases, seeking and ordering the parts that will be used in assembly, optimizing for speed of delivery to the Tempo factory. + +## Connecting the digital thread + +“There could be up to 20 robots, 400 unique parts, and 25 people working on the factory floor to produce one order start to finish in a matter of hours,” explained [Shashank Samala][8], Tempo’s co-founder and vice president of product in an email. Tempo “employs IIoT to automatically configure, operate, and monitor” the entire process, coordinated by a “connected manufacturing system” that creates an “unbroken digital thread from design intent of the engineer captured on the website, to suppliers distributed across the country, to robots and people on the factory floor.” + +Rather than the machines on the floor functioning as “isolated islands of technology,” Samala added, Tempo Automation uses [Amazon Web Services (AWS) GovCloud][9] to network everything in a bi-directional feedback loop. + +“After customers upload their design to the Tempo platform, our software extracts the design features and then streams relevant data down to all the devices, processes, and robots on the factory floor,” he said. “This loop then works the other way: As the robots build the products, they collect data and feedback about the design during production. This data is then streamed back through the Tempo secure cloud architecture to the customer as a ‘Production Forensics’ report.” + +Samala claimed the system has “streamlined operations, improved collaboration, and simplified remote management and control.” + +## Traditional IoT, too + +Of course, the Tempo factory isn’t all fancy, cutting-edge IIoT implementations. According to Ryan Saul, vice president of manufacturing,the plant also includes an array of IoT sensors that track temperature, humidity, equipment status, job progress, reported defects, and so on to help engineers and executives understand how the facility is operating. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384378/an-inside-look-at-tempo-automations-iiot-powered-smart-factory.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-floor-100791923-large.jpg +[2]: http://www.tempoautomation.com/ +[3]: https://www.businesswire.com/news/home/20190325005097/en/Tempo-Automation-Announces-Contract-Lockheed-Martin +[4]: https://www.networkworld.com/article/3243928/internet-of-things/what-is-the-industrial-iot-and-why-the-stakes-are-so-high.html#nww-fsb +[5]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[6]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-2-100791921-large.jpg +[7]: https://images.idgesg.net/images/article/2019/03/tempo-automation-iiot-factory-100791922-large.jpg +[8]: https://www.linkedin.com/in/shashanksamala/ +[9]: https://aws.amazon.com/govcloud-us/ +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md b/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md new file mode 100644 index 0000000000..803b6a993d --- /dev/null +++ b/sources/tech/20190326 Changes in SD-WAN Purchase Drivers Show Maturity of the Technology.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Changes in SD-WAN Purchase Drivers Show Maturity of the Technology) +[#]: via: (https://www.networkworld.com/article/3384103/changes-in-sd-wan-purchase-drivers-show-maturity-of-the-technology.html#tk.rss_all) +[#]: author: (Cliff Grossner https://www.networkworld.com/author/Cliff-Grossner/) + +Changes in SD-WAN Purchase Drivers Show Maturity of the Technology +====== + +![istock][1] + +[SD-WANs][2] have been available now for the past five years, but adoption has been light compared to that of the overall WAN market. This should be no surprise, as the technology was immature, and customers were dipping their toes in the water first as a test. Recently, however, there are signs that the market is maturing, which also happens to coincide with an acceleration of the market. + +Evidence of the maturation of SD-WANs can be seen in the most recent IHS Markit _Campus LAN and WAN SDN Strategies and Leadership North American Enterprise Survey_. Exhibit 1 shows that the top drivers of SD-WAN deployments are the simplification of WAN provisioning, automation capabilities. and direct cloud connectivity—all of which require an architectural change. + +This is in stark contrast to the approach of early adopters looking for a reduction in opex and capex savings, doing so in the past by shifting to cheap broadband and low-cost branch hardware. The survey data finds that opex savings now ranks tied in fifth place among the purchase drivers of SD-WAN; and that reduced capex is last, indicating that cost savings no longer possess the same level of importance as with early adopters. + +The shift in purchase drivers indicates companies are looking for SD-WAN to provide more value than legacy WAN. + +With [SD-WAN][3], the “software defined” indicates that the control plane has been separated from the data plane, enabling the control plane to be abstracted away from the hardware and allowing centralized, distributed, and hybrid control architectures, working alongside the centralized management of those architectures. This provides many benefits, the biggest of which is to make WAN provisioning easier. + +![Exhibit 1: Simplification and automation are top drivers for SD-WAN.][4] + +With SD-WAN, most mainstream buyers now demand Zero Touch Provisioning, where the SD-WAN appliance automatically calls home when it attaches to the network and pulls its configuration down from a centralized location. Also, changes can be made through a centralized console and then immediately pushed out to every device. This can automate many of the mundane and repetitive tasks associated with running a network. + +Such a setup carries many benefits—the most important being that highly skilled network engineers can dedicate more time to innovation and less time to working on tasks associated with “keeping the lights on.” + +At present, most resources—time and money—associated with running the WAN are allocated to maintaining the status quo. In the cloud era, however, business leaders embracing digital transformation are looking to their IT organization to help drive innovation and leapfrog the competition. SD-WANs can modernize the network, and the technology will tip the IT resource scale back in favor of innovation. + +### Mainstream buyers set new expectations for SD-WAN + +With early adopters, technology innovation is key because adopters are generally tech-savvy buyers and are always looking to use the latest and greatest to gain an edge. With mainstream buyers, other concerns arise. Exhibit 2 from the IHS Markit survey shows that technological innovation now ranks tied in fourth place in what buyers look for from an SD-WAN provider. While innovation is still important, factors such as security, financial stability, and product service and reliability rank higher. And although businesses need a strong technical solution, it cannot be achieved at the expense of security, vendor stability, or quality without putting operations at risk. + +It’s not surprising, then, that security turned out to be the overwhelming top evaluation criterion, as SD-WANs enable businesses to implement local internet breakout and cloud on-ramp features. Overall, SD-WANs help make applications perform better, especially as enterprises deploy workloads in off-premises, cloud-service-provider-operated data centers as they build their hybrid and multi-clouds. + +Another security capability of SD-WANs is their ability to easily implement segmentation, which enables businesses to establish centrally defined and globally consistent security policies that isolate traffic. For example, a retailer could isolate point-of-sale systems from its guest Wi-Fi network. [SD-WAN vendors][5] can also establish partnerships with well-known security vendors that enable the SD-WAN software to be service chained into application traffic flows, in the process allowing mainstream buyers their choice of security technology. + +![Exhibit 2: SD-WAN buyers now want security and financially viable vendors.][6] + +### The bottom line + +The SD-WAN market is maturing, and the shift from early adopters to mainstream businesses will create a “rising tide” that will benefit all SD-WAN buyers in the WAN ecosystem. As a result, vendors will work to meet calls emphasizing greater simplicity and risk reduction, as well as bring about features that provide an integrated connectivity fabric for enterprise edge, hybrid, and multi-clouds. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384103/changes-in-sd-wan-purchase-drivers-show-maturity-of-the-technology.html#tk.rss_all + +作者:[Cliff Grossner][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/Cliff-Grossner/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/istock-998475736-100791932-large.jpg +[2]: https://www.silver-peak.com/sd-wan +[3]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[4]: https://images.idgesg.net/images/article/2019/03/chart-1_post-10-100791930-large.jpg +[5]: https://www.silver-peak.com/sd-wan/choosing-an-sd-wan-vendor +[6]: https://images.idgesg.net/images/article/2019/03/chart-2_post-10-100791931-large.jpg diff --git a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md index e3bd5f5e26..37c14fec39 100644 --- a/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md +++ b/sources/tech/20190326 How to use NetBSD on a Raspberry Pi.md @@ -5,7 +5,7 @@ [#]: url: ( ) [#]: subject: (How to use NetBSD on a Raspberry Pi) [#]: via: (https://opensource.com/article/19/3/netbsd-raspberry-pi) -[#]: author: (Seth Kenlon (Red Hat, Community Moderator) https://opensource.com/users/seth) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) How to use NetBSD on a Raspberry Pi ====== diff --git a/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md b/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md new file mode 100644 index 0000000000..babc54c0f7 --- /dev/null +++ b/sources/tech/20190326 Today-s Retailer is Turning to the Edge for CX.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Today’s Retailer is Turning to the Edge for CX) +[#]: via: (https://www.networkworld.com/article/3384202/today-s-retailer-is-turning-to-the-edge-for-cx.html#tk.rss_all) +[#]: author: (Cindy Waxer https://www.networkworld.com/author/Cindy-Waxer/) + +Today’s Retailer is Turning to the Edge for CX +====== + +### Despite the increasing popularity and convenience of ecommerce, 92% of purchases continue to be made off-line, according to the U.S. Census. + +![iStock][1] + +Despite the increasing popularity and convenience of ecommerce, 92% of purchases continue to be made off-line, according to the [U.S. Census][2]. That’s putting enormous pressure on retailers to meet new consumer expectations around real-time access to merchandise and order information. In fact, 85.3% of shoppers expect retailers to provide associates with handheld or fixed devices to check inventory and price within a store, a nearly 51% increase over 2017, according to a [survey from SOTI][3]. + +With an eye on transforming the customer experience of spending time in a store, retailers are investing aggressively in compute power located closer to the buyer, also known as [edge computing][4]. + +So what new and innovative technologies are edge environments supporting? Here’s where retail is headed with customer service and how edge computing will help them get there. + +**Face forward** : Facial recognition technology is on the rise in retail as brands search for new ways to engage customers. Take, CaliBurger, for example. The restaurant chain recently tested out self-ordering kiosks that use AI and facial-recognition technology to identify registered customers and pull up their loyalty accounts and order preferences. By automatically displaying a customer’s most popular purchases, the system aims to help patrons complete their orders in seconds flat for greater speed and convenience. + +**Customer experience on display** : Forget about traditional counter displays. Savvy retailers are experimenting with high-tech, in-store digital signage solutions to attract consumers and gather valuable data. For instance, Glass Media’s projection-based, end-to-end digital retail signage combines display technology, a cloud-based IoT platform, and data analytic capabilities. Through projection, the solution can influence customers at the point-of-decision. + +**Backroom access** : Tracking inventory manually requires substantial human resources. IoT-powered backroom technologies such as RFID, real-time point of sale (POS), and smart shelving systems promise to change that by improving the accuracy of inventory tracking throughout the supply chain. These automated solutions can track and reorder items automatically, eliminating the need for humans to take inventory and reducing the risk of product shortages. + +**Robots to the rescue** : Hoping to transform the branch experience, HSBC recently unveiled Pepper, a concierge robot whose job is to help customers with simple tasks, from answering commonly asked questions to directing them to available tellers. Pepper also acts as an online banking station where customers can log into their mobile banking account or access information about products. By putting Pepper on the payroll, HSBC hopes to reduce customer wait times and free up its “human” bankers. + +These innovative technologies provide retailers with unique opportunities to enhance customer experience, develop new revenue streams, and boost customer loyalty. But many of them require edge computing to work properly. Bandwidth-intensive content and vast volumes of data can lead to latency issues, outages, and other IT headaches. Fortunately, by placing computing power and storage capabilities directly on the edge of the network, edge computing can help retailers deliver the best customer experience possible. + +To find out more about how edge computing is transforming the customer experience in retail, visit [APC.com][5]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384202/today-s-retailer-is-turning-to-the-edge-for-cx.html#tk.rss_all + +作者:[Cindy Waxer][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/Cindy-Waxer/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/istock-508154656-100791924-large.jpg +[2]: https://ycharts.com/indicators/ecommerce_sales_as_percent_retail_sales +[3]: https://www.soti.net/resources/newsroom/2019/annual-connected-retailer-survey-new-soti-survey-reveals-us-consumers-prefer-speed-and-convenience-when-shopping-with-limited-human-interaction/ +[4]: https://www.hpe.com/us/en/servers/edgeline-iot-systems.html?pp=false&jumpid=ps_83cqske5um_aid-510380402&gclid=CjwKCAjw6djYBRB8EiwAoAF6oWwk-M6LWcfCbbZ331fXhEHShXGbLWoSwTIzue6mxQg4gDvYx59XZxoC_4oQAvD_BwE&gclsrc=aw.ds +[5]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md b/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md deleted file mode 100644 index 641679996c..0000000000 --- a/sources/tech/20190326 Using Square Brackets in Bash- Part 1.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using Square Brackets in Bash: Part 1) -[#]: via: (https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Using Square Brackets in Bash: Part 1 -====== - -![square brackets][1] - -This tutorial tackle square brackets and how they are used in different contexts at the command line. - -[Creative Commons Zero][2] - -After taking a look at [how curly braces (`{}`) work on the command line][3], now it’s time to tackle brackets (`[]`) and see how they are used in different contexts. - -### Globbing - -The first and easiest use of square brackets is in _globbing_. You have probably used globbing before without knowing it. Think of all the times you have listed files of a certain type, say, you wanted to list JPEGs, but not PNGs: - -``` -ls *.jpg -``` - -Using wildcards to get all the results that fit a certain pattern is precisely what we call globbing. - -In the example above, the asterisk means " _zero or more characters_ ". There is another globbing wildcard, `?`, which means " _exactly one character_ ", so, while - -``` -ls d*k* -``` - -will list files called _darkly_ and _ducky_ (and _dark_ and _duck_ \-- remember `*` can also be zero characters), - -``` -ls d*k? -``` - -will not list _darkly_ (or _dark_ or _duck_ ), but it will list _ducky_. - -Square brackets are used in globbing for sets of characters. To see what this means, make directory in which to carry out tests, `cd` into it and create a bunch of files like this: - -``` -touch file0{0..9}{0..9} -``` - -(If you don't know why that works, [take a look at the last installment that explains curly braces `{}`][3]). - -This will create files _file000_ , _file001_ , _file002_ , etc., through _file097_ , _file098_ and _file099_. - -Then, to list the files in the 70s and 80s, you can do this: - -``` -ls file0[78]? -``` - -To list _file022_ , _file027_ , _file028_ , _file052_ , _file057_ , _file058_ , _file092_ , _file097_ , and _file98_ you can do this: - -``` -ls file0[259][278] -``` - -Of course, you can use globbing (and square brackets for sets) for more than just `ls`. You can use globbing with any other tool for listing, removing, moving, or copying files, although the last two may require a bit of lateral thinking. - -Let's say you want to create duplicates of files _file010_ through _file029_ and call the copies _archive010_ , _archive011_ , _archive012_ , etc.. - -You can't do: - -``` -cp file0[12]? archive0[12]? -``` - -Because globbing is for matching against existing files and directories and the _archive..._ files don't exist yet. - -Doing this: - -``` -cp file0[12]? archive0[1..2][0..9] -``` - -won't work either, because `cp` doesn't let you copy many files to other many new files. Copying many files only works if you are copying them to a directory, so this: - -``` -mkdir archive - -cp file0[12]? archive -``` - -would work, but it would copy the files, using their same names, into a directory called _archive/_. This is not what you set out to do. - -However, if you look back at [the article on curly braces (`{}`)][3], you will remember how you can use `%` to lop off the end of a string contained in a variable. - -Of course, there is a way you can also lop of the beginning of string contained in a variable. Instead of `%`, you use `#`. - -For practice, you can try this: - -``` -myvar="Hello World" - -echo Goodbye Cruel ${myvar#Hello} -``` - -It prints " _Goodbye Cruel World_ " because `#Hello` gets rid of the _Hello_ part at the beginning of the string stored in `myvar`. - -You can use this feature alongside your globbing tools to make your _archive_ duplicates: - -``` -for i in file0[12]?;\ - -do\ - -cp $i archive${i#file};\ - -done -``` - -The first line tells the Bash interpreter that you want to loop through all the files that contain the string _file0_ followed by the digits _1_ or _2_ , and then one other character, which can be anything. The second line `do` indicates that what follows is the instruction or list of instructions you want the interpreter to loop through. - -Line 3 is where the actually copying happens, and you use the contents of the loop variable _`i`_ **twice: First, straight out, as the first parameter of the `cp` command, and then you add _archive_ to its contents, while at the same time cutting of _file_. So, if _`i`_ contains, say, _file019_... - -``` -"archive" + "file019" - "file" = "archive019" -``` - -the `cp` line is expanded to this: - -``` -cp file019 archive019 -``` - -Finally, notice how you can use the backslash `\` to split a chain of commands over several lines for clarity. - -In part two, we’ll look at more ways to use square brackets. Stay tuned. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2019/3/using-square-brackets-bash-part-1 - -作者:[Paul Brown][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/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/square-gabriele-diwald-475007-unsplash.jpg?itok=cKmysLfd (square brackets) -[2]: https://www.linux.com/LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO -[3]: https://www.linux.com/blog/learn/2019/2/all-about-curly-braces-bash diff --git a/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md b/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md new file mode 100644 index 0000000000..2a0dde5fb3 --- /dev/null +++ b/sources/tech/20190327 Cisco forms VC firm looking to weaponize fledgling technology companies.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco forms VC firm looking to weaponize fledgling technology companies) +[#]: via: (https://www.networkworld.com/article/3385039/cisco-forms-vc-firm-looking-to-weaponize-fledgling-technology-companies.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco forms VC firm looking to weaponize fledgling technology companies +====== + +### Decibel, an investment firm focused on early stage funding for enterprise-product startups, will back technologies related to Cisco's core interests. + +![BrianaJackson / Getty][1] + +Cisco this week stepped deeper into the venture capital world by announcing Decibel, an early-stage investment firm that will focus on bringing enterprise-oriented startups to market. + +Veteran VC groundbreaker and former general partner at New Enterprise Associates [Jon Sakoda][2] will lead Decibel. Sakoda had been with NEA since 2006 and focused on startup investments in software and Internet companies. + +**[ Now see[7 free network tools you must have][3]. ]** + +Of Decibel Sakoda said: “We want to invest in companies that are helping our customers use innovation as a weapon in the game to transform their respective industries.” + +“Decibel combines the speed, agility, and independent risk-taking traditionally found in the best VC firms, while offering differentiated access to the scale, entrepreneurial talent, and deep customer relationships found in one of the largest tech companies in the world,” [Sakoda said][4]. “This approach is an industry first and provides a unique way for entrepreneurs to get access to unparalleled resources at a time and stage when they need it most.” + +“As one of the most prolific strategic venture capitalists in the world, Cisco already has a view into future technologies shaping our markets through our rich portfolio of companies,” wrote Rob Salvagno, vice president of Corporate Development and Cisco Investments in a [blog about Decibel][5]. “But we realized we could do even more by engaging with the startup community earlier in its lifecycle.” + +Indeed Cisco already has an investment arm, Cisco Investments, that focuses on later stage startups, the company says. Cisco said this arm invests $200 to $300 million annually, and it will continue its charter of investing and partnering with best-in-class companies in core and adjacent markets. + +Cisco didn’t talk about how much money would be involved in Decibel, but according to a [CNBC report][6], Cisco is setting up Decibel as an independent firm with a separate pool of cash, an unusual model for corporate investors. The fund hasn’t closed yet, but a [Securities and Exchange Commission filing][7] from October indicated that Sakoda was setting out to [raise $500 million][8], CNBC wrote. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][9] ]** + +Decibel does plan to invest anywhere from $5M – 15M in each start up in their portfolio, Cisco says. + +“Cisco has a culture of leveraging both internal and external innovation – accelerating our rich internal development capabilities by our ability to also partner, invest and acquire, Salvagno said. + +He said the company recognizes that significant innovation happens outside of the walls of Cisco. Cisco has acquired more than 200 companies, accounting for more than one in eight Cisco employees have joined as a result. "We have a deep bench of acquired founders, many of which play leadership roles within the company today, which continues to reinforce this entrepreneurial spirit," Salvagno said. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385039/cisco-forms-vc-firm-looking-to-weaponize-fledgling-technology-companies.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/02/money_salary_magnet_flying-money_money-magnet-by-brianajackson-getty-100787974-large.jpg +[2]: https://twitter.com/jonsakoda +[3]: https://www.networkworld.com/article/2825879/7-free-open-source-network-monitoring-tools.html +[4]: https://www.decibel.vc/the-blast/announcingdecibel +[5]: https://blogs.cisco.com/news/cisco-fuels-innovation-engine-with-investment-in-new-early-stage-vc-fund +[6]: https://www.cnbc.com/2019/03/26/cisco-introduces-decibel-an-early-stage-venture-firm-with-jon-sakoda.html +[7]: https://www.sec.gov/Archives/edgar/data/1754260/000175426018000002/xslFormDX01/primary_doc.xml +[8]: https://www.cnbc.com/2018/10/08/cisco-lead-investor-jon-sakoda-catalyst-labs-500-million.html +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md b/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md new file mode 100644 index 0000000000..f7c49381f4 --- /dev/null +++ b/sources/tech/20190327 Identifying exceptional user experience (UX) in IoT platforms.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Identifying exceptional user experience (UX) in IoT platforms) +[#]: via: (https://www.networkworld.com/article/3384738/identifying-exceptional-user-experience-ux-in-iot-platforms.html#tk.rss_all) +[#]: author: (Steven Hilton https://www.networkworld.com/author/Steven-Hilton/) + +Identifying exceptional user experience (UX) in IoT platforms +====== + +### Examples of excellent IoT platform UX from the perspectives of 5 typical IoT platform personas. + +![Leo Wolfert / Getty Images][1] + +Enterprises are inundated with information about IoT platforms’ features and capabilities. But to find a long-lived IoT platform that minimizes ongoing development costs, enterprises must focus on exceptional user experience (UX) for 5 types of IoT platform users. + +Marketing and sales literature from IoT platform vendors is filled with information about IoT platform features. And no doubt, enterprises choosing to buy IoT platform services need to understand the actual capabilities of IoT platforms – preferably by [testing a variety of IoT platforms][2] – before making a purchase decision. + +However, it is a lot harder to gauge the quality of an IoT platform UX than itemizing an IoT platform’s features. Having excellent UX leads to lower platform deployment and management costs and higher customer satisfaction and retention. So enterprises should make UX one of their top criteria when selecting an IoT platform. + +[RELATED: Storage tank operator turns to IoT for energy savings][3] + +One of the ways to determine excellent IoT platform UX is to simulate the tasks conducted by typical IoT platform users. By completing these tasks, it becomes readily apparent when an IoT platform is exceptional or annoyingly bad. + +In this blog, I describe excellent IoT platform UX from the perspectives of five typical IoT platform users or personas. + +## Persona 1: platform administrator + +A platform administrator’s primary role is to configure, monitor, and maintain the functionality of an IoT platform. A platform administrator is typically an IT employee responsible for maintaining and configuring the various data management, device management, access control, external integration, and monitoring services that comprise an IoT platform. + +Typical platform administrator tasks include + + * configuration of the on-platform data visualization and data aggregation tools + * configuration of available device management functionality or execution of in-bulk device management tasks + * configuration and creation of on-platform complex event processing (CEP) workflows + * management and configuration of platform service orchestration + + + +Enterprises should pick IoT platforms with superlative access to on-platform configuration functionality with an emphasis on declarative interfaces for configuration management. Although many platform administrators are capable of working with RESTful API endpoints, good UX design should not require that platform administrators use third-party tools to automate basic functionality or execute bulk tasks. Some programmatic interfaces, such as SQL syntax for limiting monitoring views or dashboards for setting event processing trigger criteria, are acceptable and expected, although a fully declarative solution that maintains similar functionality is preferred. + +## Persona 2: platform operator + +A platform operator’s primary role is to leverage an IoT platform to execute common day-to-day business-centric operations and services. While the responsibilities of a platform operator will vary based on enterprise vertical and use case, all platform operators conduct business rather than IoT domain tasks. + +Typical platform operator tasks include + + * visualizing and aggregating on-platform data to view key business KPIs + * using device management functionality on a per-device basis + * creating, managing, and monitoring per-device and per-location event processing rules + * executing self-service administrative tasks, such as enrolling downstream operators + + + +Enterprises should pick IoT platforms centered on excellent ease-of-use for a business user. In general, the UX should be focused on providing information immediately required for the execution of day-to-day operational tasks while removing more complex functionality. These platforms should have easy access to well-defined and well-constrained operational functions or data visualization. An effective UX should enable easy creation and modification of data views, graphs, dashboards, and other visualizations by allowing operators to select devices using a declarative rather than SQL or other programmatic interfaces. + +## Persona 3: hardware and systems developer + +A hardware and systems developer’s primary role is the integration and configuration of IoT assets into an IoT platform. The hardware and systems developer possesses very specific, detailed knowledge about IoT hardware (e.g., specific multipoint control units, embedded platforms, or PLC/SCADA control systems), and leverages this knowledge to enable protocol and asset compatibility with northbound platform services. + +Typical hardware and systems developer tasks include + + * designing and implementing firmware for IoT assets based on either standardized IoT SDKs or platform-specific SDKs + * updating firmware or software packages over deployment lifecycles + * integrating manufacturer-specific protocols adapters into either IoT assets or the northbound platform + + + +Enterprises should pick IoT platforms that allow hardware and systems developers to most efficiently design and implement low-level device and protocol functionality. An effective developer experience provides well-documented and fully-featured SDKs supporting a variety of languages and device architectures to enable integration with various types of IoT hardware. + +## Persona 4: platform and backend developer + +A platform and backend developer’s primary role is to execute customer-specific application logic and integrations within an IoT deployment. Customer-specific logic may include on-platform or on-edge custom applications, such as those used for analytics, data aggregation and normalization, or any type of event processing workflow. In addition, a platform and backend developer is responsible for integrating the IoT platform with external databases, analytic solutions, or business systems such as MES, ERP, or CRM applications. + +Typical platform and backend developer tasks include + + * integrating streaming data from the IoT platform into external systems and applications + * configuring inbound and outbound platform actions and interactions with external systems + * configuring complex code-based event processing capabilities beyond the scope of a platform administrator’s knowledge or ability + * debugging low-level platform functionalities that require coding to detect or resolve + + + +Enterprises should pick excellent IoT platforms that provide access to well-documented and well-featured platform-level SDKs for application or service development. A best-in-class platform UX should provide real-time logging tools, debugging tools, and indexed and searchable access to all platform logs. Finally, a platform and backend developer is particularly dependent upon high-quality, platform-level documentation, especially for platform APIs. + +## Persona 5: user interface and experience (UI/UX) developer + +A UI/UX developer’s primary role is to design the various operator interfaces and monitoring views for an IoT platform. In more complex IoT deployments, various operator audiences will need to be addressed, including solution domain experts such as a factory manager; role-specific experts such as an equipment operator or factory technician; and business experts such as a supply-chain analyst or company executive. + +Typical UI/UX developer tasks include + + * building and maintaining customer-specific dashboards and monitoring views on either the IoT platform or edge devices + * designing, implementing, and maintaining various operator consoles for a variety of operator audiences and customer-specific use cases + * ensuring good user experience for customers over the lifetime of an IoT implementation + + + +Enterprises should pick IoT platforms that provide an exceptional variety and quality of UI/UX tools, such as dashboarding frameworks for on-platform monitoring solutions that are declaratively or programmatically customizable, as well as various widget and display blocks to help the developer rapidly implement customer-specific views. An IoT platform must also provide a UI/UX developer with appropriate debugging and logging tools for monitoring and operator console frameworks and platform APIs. Finally, a best-in-class platform should provide a sample dashboard, operator console, and on-edge monitoring implementation in order to enable the UI/UX developer to quickly become accustomed with platform paradigms and best practices. + +Enterprises should make UX one of their top criteria when selecting an IoT platform. Having excellent UX allows enterprises to minimize platform deployment and management costs. At the same time, excellent UX allows enterprises to more readily launch new solutions to the market thereby increasing customer satisfaction and retention. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][4]** + +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/3384738/identifying-exceptional-user-experience-ux-in-iot-platforms.html#tk.rss_all + +作者:[Steven Hilton][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/Steven-Hilton/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_by_leowolfert_gettyimages-689799380_2400x1600-100788464-large.jpg +[2]: https://www.machnation.com/2018/09/25/announcing-mit-e-2-0-hands-on-benchmarking-for-iot-cloud-edge-and-analytics-platforms/ +[3]: https://www.networkworld.com/article/3169384/internet-of-things/storage-tank-operator-turns-to-iot-for-energy-savings.html#tk.nww-fsb +[4]: /contributor-network/signup.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md b/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md new file mode 100644 index 0000000000..016c5151fb --- /dev/null +++ b/sources/tech/20190327 IoT roundup- Keeping an eye on energy use and Volkswagen teams with AWS.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (IoT roundup: Keeping an eye on energy use and Volkswagen teams with AWS) +[#]: via: (https://www.networkworld.com/article/3384697/iot-roundup-keeping-an-eye-on-energy-use-and-volkswagen-teams-with-aws.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +IoT roundup: Keeping an eye on energy use and Volkswagen teams with AWS +====== + +### This week's roundup features new tech from MIT, big news in the automotive sector and a handy new level of centralization from a smaller IoT-focused company. + +![Getty Images][1] + +Much of what’s exciting about IoT technology has to do with getting data from a huge variety of sources into one place so it can be mined for insight, but sensors used to gather that data are frequently legacy devices from the early days of industrial automation or cheap, lightweight, SoC-based gadgets without a lot of sophistication of their own. + +Researchers at MIT have devised a system that can gather a certain slice of data from unsophisticated devices that are grouped on the same electrical circuit without adding sensors to each device. + +**[ Check out our[corporate guide to addressing IoT security][2]. ]** + +The technology’s called non-intrusive load monitoring, and sits directly on a given building's, vehicle's or other piece of infrastructure’s electrical circuits, identifies devices based on their power usage, and sends alerts when there are irregularities. + +It seems likely to make IIoT-related waves once it’s out of testing and onto the market. + +NLIM was recently tested, said MIT’s news service, on a U.S. Coast Guard cutter based in Boston, where it was attached to the outside of an electrical wire “at a single point, without requiring any cutting or splicing of wires.” + +Two such connections allowed the scientists to monitor roughly 20 separate devices on an electrical circuit, and the system was able to detect an anomalous amount of energy use from a component of the ship’s diesel engines known as a jacket water heater. + +“[C]rewmembers were skeptical about the reading but went to check it anyway. The heaters are hidden under protective metal covers, but as soon as the cover was removed from the suspect device, smoke came pouring out, and severe corrosion and broken insulation were clearly revealed,” the MIT report stated. Two other important but slightly less critical faults were also detected by the system. + +It’s easy to see why NLIM could easily prove to be an attractive technology for IIoT use in the future. It sounds as though it’s very simple to install, can operate without any kind of Internet connection (though most implementers will probably want to connect it to a wider monitoring setup for a more holistic picture of their systems) and does all of its computational work locally. It can even be used for general energy audits. What, in short, is not to like? + +**Volkswagen teams up with Amazon** + +AWS has got a new flagship client for its growing IoT services in the form of the Volkswagen Group, which [announced][3] that AWS is going to design and build the Volkswagen Industrial Cloud, a floor-to-ceiling industrial IoT implementation aimed at improving uptime, flexibility, productivity and vehicle quality. + +Real-time data from all 122 of VW’s manufacturing plants around the world will be available to the system, everything from part tracking to comparative analysis of efficiency to even deeper forms of analytics will take place in the company’s “data lake,” as the announcement calls it. Oh, and machine learning is part of it, too. + +The German carmaker clearly believes that AWS’s technology can provide a lot of help to its operations across the board, [even in the wake of a partnership with Microsoft for Azure-based cloud services announced last year.][4] + +**IoT-in-a-box** + +IoT can be very complicated. While individual components of any given implementation are often quite simple, each implementation usually contains a host of technologies that have to work in close concert. That means a lot of orchestration work has to go into making this stuff work. + +Enter Digi International, which rolled out an IoT-in-a-box package called Digi Foundations earlier this month. The idea is to take a lot of the logistical legwork out of IoT implementations by integrating cloud-connection software and edge-computing capabilities into the company’s core industrial router business. Foundations, which is packaged as a software subscription that adds these capabilities and more to the company’s devices, also includes a built-in management layer, allowing for simplified configuration and monitoring. + +OK, so it’s not quite all-in-one, but it’s still an impressive level of integration, particularly from a company that many might not have heard of before. It’s also a potential bellwether for other smaller firms upping their technical sophistication in the IoT sector. + +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/3384697/iot-roundup-keeping-an-eye-on-energy-use-and-volkswagen-teams-with-aws.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/08/nw_iot-news_internet-of-things_smart-city_smart-home7-100768495-large.jpg +[2]: https://www.networkworld.com/article/3269165/internet-of-things/a-corporate-guide-to-addressing-iot-security-concerns.html +[3]: https://www.volkswagen-newsroom.com/en/press-releases/volkswagen-and-amazon-web-services-to-develop-industrial-cloud-4780 +[4]: https://www.volkswagenag.com/en/news/2018/09/volkswagen-and-microsoft-announce-strategic-partnership.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md b/sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md deleted file mode 100644 index 481428b14a..0000000000 --- a/sources/tech/20190327 Setting kernel command line arguments with Fedora 30.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Setting kernel command line arguments with Fedora 30) -[#]: via: (https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/) -[#]: author: (Laura Abbott https://fedoramagazine.org/makes-fedora-kernel/) - -Setting kernel command line arguments with Fedora 30 -====== - -![][1] - -Adding options to the kernel command line is a common task when debugging or experimenting with the kernel. The upcoming Fedora 30 release made a change to use Bootloader Spec ([BLS][2]). Depending on how you are used to modifying kernel command line options, your workflow may now change. Read on for more information. - -To determine if your system is running with BLS or the older layout, look in the file - -``` -/etc/default/grub -``` - -If you see - -``` -GRUB_ENABLE_BLSCFG=true -``` - -in there, you are running with the BLS setup and you may need to change how you set kernel command line arguments. - -If you only want to modify a single kernel entry (for example, to temporarily work around a display problem) you can use a grubby command - -``` -$ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --args="amdgpu.dc=0" -``` - -To remove a kernel argument, you can use the - -``` ---remove-args -``` -argument to grubby - -``` -$ grubby --update-kernel /boot/vmlinuz-5.0.1-300.fc30.x86_64 --remove-args="amdgpu.dc=0" -``` - -If there is an option that should be added to every kernel command line (for example, you always want to disable the use of the rdrand instruction for random number generation) you can run a grubby command: - -``` -$ grubby --update-kernel=ALL --args="nordrand" -``` - -This will update the command line of all kernel entries and save the option to the saved kernel command line for future entries. - -If you later want to remove the option from all kernels, you can again use - -``` ---remove-args -``` -with - -``` ---update-kernel=ALL -``` - -``` -$ grubby --update-kernel=ALL --remove-args="nordrand" -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/ - -作者:[Laura Abbott][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/makes-fedora-kernel/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/f30-kernel-1-816x345.jpg -[2]: https://fedoraproject.org/wiki/Changes/BootLoaderSpecByDefault diff --git a/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md b/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md new file mode 100644 index 0000000000..3dfb93eec7 --- /dev/null +++ b/sources/tech/20190328 As memory prices plummet, PCIe is poised to overtake SATA for SSDs.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (As memory prices plummet, PCIe is poised to overtake SATA for SSDs) +[#]: via: (https://www.networkworld.com/article/3384700/as-memory-prices-plummet-pcie-is-poised-to-overtake-sata-for-ssds.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +As memory prices plummet, PCIe is poised to overtake SATA for SSDs +====== + +### Taiwan vendors believe PCIe and SATA will achieve price and market share parity by years' end. + +![Intel SSD DC P6400 Series][1] + +A collapse in price for NAND flash memory and a shrinking gap between the prices of PCI Express-based and SATA-based [solid-state drives][2] (SSDs) means the shift to PCI Express SSDs will accelerate in 2019, with the newer, faster format replacing the old by years' end. + +According to the Taiwanese tech publication DigiTimes (the stories are now archived and unavailable without a subscription), falling NAND flash prices continue to drag down SSD prices, which will drive the adoption of SSDs in enterprise and data-center applications. This, in turn, will further drive the adoption of PCIe drives, which are a superior format to SATA. + +**[ Read also:[Backup vs. archive: Why it’s important to know the difference][3] ]** + +## SATA vs. PCI Express + +SATA was introduced in 2001 as a replacement for the IDE interface, which had a much larger cable and slower interface. But SATA is a legacy HDD connection and not fast enough for NAND flash memory. + +I used to review SSDs, and it was always the same when it came to benchmarking, with the drives scoring within a few milliseconds of each other despite the memory used. The SATA interface was the bottleneck. A SATA SSD is like a one-lane highway with no speed limit. + +PCIe is several times faster and has much more parallelism, so throughput is more suited to the NAND format. It comes in two physical formats: an [add-in card][4] that plugs into a PCIe slot and M.2, which is about the size of a [stick of gum][5] and sits on the motherboard. PCIe is most widely used in servers, while M.2 is in consumer devices. + +There used to be a significant price difference between PCIe and SATA drives with the same capacity, but they have come into parity thanks to Moore’s Law, said Jim Handy, principal analyst with Objective Analysis, who follows the memory market. + +“The controller used to be a big part of the price of an SSD. But complexity has not grown with transistor count. It can have a lot of transistors, and it doesn’t cost more. SATA got more complicated, but PCIe has not. PCIe is very close to the same price as SATA, and [the controller] was the only thing that justified the price diff between the two,” he said. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][6] ]** + +DigiTimes estimates that the price drop for NAND flash chips will cause global shipments of SSDs to surge 20 to 25 percent in 2019, and PCIe SSDs are expected to emerge as a new mainstream offering by the end of 2019 with a market share of 50 percent, matching SATA SSDs. + +## SSD and NAND memory prices already falling + +Market sources to DigiTimes said that unit price for 512GB PCIe SSD has fallen by 11 percent sequentially in the first quarter of 2019, while SATA SSDs have dropped 9 percent. They added that the current average unit price for 512GB SSDs is now equal to that of 256GB SSDs from one year ago, with prices continuing to drop. + +According to DRAMeXchange, NAND flash contract prices will continue falling but at a slower rate in the second quarter of 2019. Memory makers are cutting production to avoid losing any more profits. + +“We’re in a price collapse. For over a year I’ve been saying the destination for NAND is 8 cents per gigabyte, and some spot markets are 6 cents. It was 30 cents a year ago. Contract pricing is around 15 cents now, it had been 25 to 27 cents last year,” said Handy. + +A contract price is what it sounds like. A memory maker like Samsung or Micron signs a contract with a SSD maker like Toshiba or Kingston for X amount for Y cents per gigabyte. Spot prices are prices that take place at the end of a quarter (like now) where a vendor anxious to unload excessive inventory has a fire sale to a drive maker that needs it on short supply. + +DigiTimes’s contacts aren’t the only ones who foresee this. Handy was at an analyst event by Samsung a few months back where they presented their projection that PCIe SSD would outsell SATA by the end of this year, and not just in the enterprise but everywhere. + +**More about backup and recovery:** + + * [Backup vs. archive: Why it’s important to know the difference][3] + * [How to pick an off-site data-backup method][7] + * [Tape vs. disk storage: Why isn’t tape dead yet?][8] + * [The correct levels of backup save time, bandwidth, space][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384700/as-memory-prices-plummet-pcie-is-poised-to-overtake-sata-for-ssds.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/12/intel-ssd-p4600-series1-100782098-large.jpg +[2]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html +[3]: https://www.networkworld.com/article/3285652/storage/backup-vs-archive-why-its-important-to-know-the-difference.html +[4]: https://www.newegg.com/Product/Product.aspx?Item=N82E16820249107 +[5]: https://www.newegg.com/Product/Product.aspx?Item=20-156-199&cm_sp=SearchSuccess-_-INFOCARD-_-m.2+-_-20-156-199-_-2&Description=m.2+ +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[7]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[8]: https://www.networkworld.com/article/3315156/storage/tape-vs-disk-storage-why-isnt-tape-dead-yet.html +[9]: https://www.networkworld.com/article/3302804/storage/the-correct-levels-of-backup-save-time-bandwidth-space.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md b/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md new file mode 100644 index 0000000000..bae14a2f5c --- /dev/null +++ b/sources/tech/20190328 Can Better Task Stealing Make Linux Faster.md @@ -0,0 +1,133 @@ +[#]: 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 diff --git a/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md b/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md new file mode 100644 index 0000000000..1ae1222f6e --- /dev/null +++ b/sources/tech/20190328 Elizabeth Warren-s right-to-repair plan fails to consider data from IoT equipment.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Elizabeth Warren's right-to-repair plan fails to consider data from IoT equipment) +[#]: via: (https://www.networkworld.com/article/3385122/elizabeth-warrens-right-to-repair-plan-fails-to-consider-data-from-iot-equipment.html#tk.rss_all) +[#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) + +Elizabeth Warren's right-to-repair plan fails to consider data from IoT equipment +====== + +### Senator and presidential candidate Elizabeth Warren suggests national legislation focused on farm equipment. But that’s only a first step. The data collected by that equipment must also be considered. + +![Thinkstock][1] + +There’s a surprising battle being fought on America’s farms, between farmers and the companies that sell them tractors, combines, and other farm equipment. Surprisingly, the outcome of that war could have far-reaching implications for the internet of things (IoT) — and now Massachusetts senator and Democratic presidential candidate Elizabeth Warren has weighed in with a proposal that could shift the balance of power in this largely under-the-radar struggle. + +## Right to repair farm equipment + +Here’s the story: As part of a new plan to support family farms, Warren came out in support of a national right-to-repair law for farm equipment. That might not sound like a big deal, but it raises the stakes in a long-simmering fight between farmers and equipment makers over who really controls access to the equipment — and to the increasingly critical data gathered by the IoT capabilities built into it. + +**[ Also read:[Right-to-repair smartphone ruling loosens restrictions on industrial, farm IoT][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3] ]** + +[Warren’s proposal reportedly][4] calls for making all diagnostics tools and manuals freely available to the equipment owners, as well as independent repair shops — not just vendors and their authorized agents — and focuses solely on farm equipment. + +That’s a great start, and kudos to Warren for being by far the most prominent politician to weigh in on the issue. + +## Part of a much bigger IoT data issue + +But Warren's proposal merely scratches the surface of the much larger issue of who actually controls the equipment and devices that consumers and businesses buy. Even more important, it doesn’t address the critical data gathered by IoT sensors in everything ranging from smartphones, wearables, and smart-home devices to private and commercial vehicles and aircraft to industrial equipment. + +And as many farmers can tell you, this isn’t some academic argument. That data has real value — not to mention privacy implications. For farmers, it’s GPS-equipped smart sensors tracking everything — from temperature to moisture to soil acidity — that can determine the most efficient times to plant and harvest crops. For consumers, it might be data that affects their home or auto insurance rates, or even divorce cases. For manufacturers, it might cover everything from which equipment needs maintenance to potential issues with raw materials or finished products. + +The solution is simple: IoT users need consistent regulations that ensure free access to what is really their own data, and give them the option to share that data with the equipment vendors — if they so choose and on their own terms. + +At the very least, users need clear statements of the rules, so they know exactly what they’re getting — and not getting — when they buy IoT-enhanced devices and equipment. And if they’re being honest, most equipment vendors would likely admit that clear rules would benefit them as well by creating a level playing field, reducing potential liabilities and helping to avoid making customers unhappy. + +Sen. Warren made headlines earlier this month by proposing to ["break up" tech giants][5] such as Amazon, Apple, and Facebook. If she really wants to help technology buyers, prioritizing the right-to-repair and the associated right to own your own data seems like a more effective approach. + +**[ Now read this:[Big trouble down on the IoT farm][6] ]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385122/elizabeth-warrens-right-to-repair-plan-fails-to-consider-data-from-iot-equipment.html#tk.rss_all + +作者:[Fredric Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Fredric-Paul/ +[b]: https://github.com/lujun9972 +[1]: https://images.techhive.com/images/article/2017/03/ai_agriculture_primary-100715481-large.jpg +[2]: https://www.networkworld.com/article/3317696/the-recent-right-to-repair-smartphone-ruling-will-also-affect-farm-and-industrial-equipment.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://appleinsider.com/articles/19/03/27/presidential-candidate-elizabeth-warren-focusing-right-to-repair-on-farmers-not-tech +[5]: https://www.nytimes.com/2019/03/08/us/politics/elizabeth-warren-amazon.html +[6]: https://www.networkworld.com/article/3262631/big-trouble-down-on-the-iot-farm.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md b/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md new file mode 100644 index 0000000000..0400f4db04 --- /dev/null +++ b/sources/tech/20190328 Microsoft introduces Azure Stack for HCI.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Microsoft introduces Azure Stack for HCI) +[#]: via: (https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Microsoft introduces Azure Stack for HCI +====== + +### Azure Stack is great for your existing hardware, so Microsoft is covering the bases with a turnkey solution. + +![Thinkstock/Microsoft][1] + +Microsoft has introduced Azure Stack HCI Solutions, a new implementation of its on-premises Azure product specifically for [Hyper Converged Infrastructure][2] (HCI) hardware. + +[Azure Stack][3] is an on-premises version of its Azure cloud service. It gives companies a chance to migrate to an Azure environment within the confines of their own enterprise rather than onto Microsoft’s data centers. Once you have migrated your apps and infrastructure to Azure Stack, moving between your systems and Microsoft’s cloud service is easy. + +HCI is the latest trend in server hardware. It uses scale-out hardware systems and a full software-defined platform to handle [virtualization][4] and management. It’s designed to reduce the complexity of a deployment and on-going management, since everything ships fully integrated, hardware and software. + +**[ Read also:[12 most powerful hyperconverged infrasctructure vendors][5] | Get regularly scheduled insights: [Sign up for Network World newsletters][6] ]** + +It makes sense for Microsoft to take this step. Azure Stack was ideal for an existing enterprise. Now you can deploy a whole new hardware configuration setup to run Azure in-house, complete with Hyper-V-based software-defined compute, storage, and networking. + +The Windows Admin Center is the main management tool for Azure Stack HCI. It connects to other Azure tools, such as Azure Monitor, Azure Security Center, Azure Update Management, Azure Network Adapter, and Azure Site Recovery. + +“We are bringing our existing HCI technology into the Azure Stack family for customers to run virtualized applications on-premises with direct access to Azure management services such as backup and disaster recovery,” wrote Julia White, corporate vice president of Microsoft Azure, in a [blog post announcing Azure Stack HCI][7]. + +It’s not so much a new product launch as a rebranding. When Microsoft launched Server 2016, it introduced a version called Windows Server Software-Defined Data Center (SDDC), which was built on the Hyper-V hypervisor, and says so in a [FAQ][8] as part of the announcement. + +"Azure Stack HCI is the evolution of Windows Server Software-Defined (WSSD) solutions previously available from our hardware partners. We brought it into the Azure Stack family because we have started to offer new options to connect seamlessly with Azure for infrastructure management services,” the company said. + +Microsoft introduced Azure Stack in 2017, but it was not the first to offer an on-premises cloud option. That distinction goes to [OpenStack][9], a joint project between Rackspace and NASA built on open-source code. Amazon followed with its own product, called [Outposts][10]. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385078/microsoft-introduces-azure-stack-for-hci.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2017/08/5_microsoft-azure-100733132-large.jpg +[2]: https://www.networkworld.com/article/3207567/what-is-hyperconvergence.html +[3]: https://www.networkworld.com/article/3207748/microsoft-introduces-azure-stack-its-answer-to-openstack.html +[4]: https://www.networkworld.com/article/3234795/what-is-virtualization-definition-virtual-machine-hypervisor.html +[5]: https://www.networkworld.com/article/3112622/hardware/12-most-powerful-hyperconverged-infrastructure-vendors.htmll +[6]: https://www.networkworld.com/newsletters/signup.html +[7]: https://azure.microsoft.com/en-us/blog/enabling-customers-hybrid-strategy-with-new-microsoft-innovation/ +[8]: https://azure.microsoft.com/en-us/blog/announcing-azure-stack-hci-a-new-member-of-the-azure-stack-family/ +[9]: https://www.openstack.org/ +[10]: https://www.networkworld.com/article/3324043/aws-does-hybrid-cloud-with-on-prem-hardware-vmware-help.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md b/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md new file mode 100644 index 0000000000..ce38f54f79 --- /dev/null +++ b/sources/tech/20190328 Motorola taps freed-up wireless spectrum for enterprise LTE networks.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Motorola taps freed-up wireless spectrum for enterprise LTE networks) +[#]: via: (https://www.networkworld.com/article/3385117/motorola-taps-cbrs-spectrum-to-create-private-broadband-lmr-system.html#tk.rss_all) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Motorola taps freed-up wireless spectrum for enterprise LTE networks +====== + +### Citizens Broadband Radio Service (CBRS) is developing. Out of the gate, Motorola is creating a land mobile radio (LMR) system that includes enterprise-level, voice handheld devices and fast, private data networks. + +![Jiraroj Praditcharoenkul / Getty Images][1] + +In a move that could upend how workers access data in the enterprise, Motorola has announced a broadband product that it says will deliver data at double the capacity and four-times the range of Wi-Fi for end users. The handheld, walkie-talkie-like device, called Mototrbo Nitro, will, importantly, also include a voice channel. “Business-critical voice with private broadband data,” as [Motorola describes it on its website][2]. + +The company sees the product being implemented in traditional, moving-around, voice communications environments, such as factories and warehouses, that increasingly need data supplementation, too. A shop floor that has an electronically delivered repair manual, with included video demonstration, could be one example. Video could be two-way, even. + +**[ Also read:[Wi-Fi 6 is coming to a router near you][3] | Get regularly scheduled insights: [Sign up for Network World newsletters][4] ]** + +The product takes advantage of upcoming Citizens Broadband Radio Service (CBRS) spectrum. That’s a swath of radio bandwidth that’s being released by the Federal Communications Commission (FCC) in the 3.5GHz band. It’s a frequency chunk that is also expected to be used heavily for 5G. In this case, though, Motorola is creating a private LTE network for the enterprise. + +The CBRS band is the first time publicly available broadband spectrum has been available, [Motorola explains in a white paper][5] (pdf) — organizations don’t have to buy licenses, yet they can get access to useful spectrum: [A tiered sharing system, where auction winners will get priority access licenses, but others will have some access too is proposed][6] by the FCC. The non-prioritized open access could be used by any enterprise for whatever — internet of things (IoT) or private networks. + +## Motorola's pitch for using a private broadband network + +Why a private broadband network and not simply cell phones? One giveaway line is in Motorola’s promotional video: “Without sacrificing control,” it says. What it means is that the firm thinks there’s a market for companies who want to run entire business communications systems — data and voice — without involvement from possibly nosy Mobile Network Operator phone companies. [I’ve written before about how control over security is prompting large industrials to explore private networks][7] more. Motorola manages the network in this case, though, for the enterprise. + +Motorola also refers to potentially limited or intermittent onsite coverage and congestion for public, commercial, single-platform voice and data networks. That’s particularly the case in factories, [Motorola says in an ebook][8]. Heavy machinery containing radio-unfriendly metal can hinder Wi-Fi and cellular, it claims. Or that traditional Land Mobile Radios (LMRs), such as walkie-talkies and vehicle-mounted mobile radios, don’t handle data natively. In particular, it says that if you want to get into artificial intelligence (AI) and analytics, say, you need a more evolving voice and fast data communications setup. + +## Industrial IoT uses for Motorola's Nitro network + +Industrial IoT will be another beneficiary, Motorola says. It says its CBRS Nitro network could include instant notifications of equipment failures that traditional products can’t provide. It also suggests merging fixed security cameras with “photos and videos of broken machines and sending real-time video to an expert.” + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][9] ]** + +Motorola also suggests that by separating consumer Wi-Fi (as is offered in hospitality and transport verticals, for example) from business-critical systems, one reduces traffic congestion risks. + +The highly complicated CBRS band-sharing system is still not through its government testing. “However, we could deploy customer systems under an experimental license,” a Motorola representative told me. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385117/motorola-taps-cbrs-spectrum-to-create-private-broadband-lmr-system.html#tk.rss_all + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/industry_4-0_industrial_iot_smart_factory_automation_robotic_arm_gear_engineer_tablet_by_jiraroj_praditcharoenkul_gettyimages-1091790364_2400x1600-100788459-large.jpg +[2]: https://www.motorolasolutions.com/en_us/products/two-way-radios/mototrbo/nitro.html +[3]: https://www.networkworld.com/article/3311921/mobile-wireless/wi-fi-6-is-coming-to-a-router-near-you.html +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: https://www.motorolasolutions.com/content/dam/msi/docs/products/mototrbo/nitro/cbrs-white-paper.pdf +[6]: https://www.networkworld.com/article/3300339/private-lte-using-new-spectrum-approaching-market-readiness.html +[7]: https://www.networkworld.com/article/3319176/private-5g-networks-are-coming.html +[8]: https://img04.en25.com/Web/MotorolaSolutionsInc/%7B293ce809-fde0-4619-8507-2b42076215c3%7D_radio_evolution_eBook_Nitro_03.13.19_MS_V3.pdf?elqTrackId=850d56c6d53f4013afa2290a66d6251f&elqaid=2025&elqat=2 +[9]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md b/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md new file mode 100644 index 0000000000..f62317ae54 --- /dev/null +++ b/sources/tech/20190328 Robots in Retail are Real- and so is Edge Computing.md @@ -0,0 +1,48 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Robots in Retail are Real… and so is Edge Computing) +[#]: via: (https://www.networkworld.com/article/3385046/robots-in-retail-are-real-and-so-is-edge-computing.html#tk.rss_all) +[#]: author: (Wendy Torell https://www.networkworld.com/author/Wendy-Torell/) + +Robots in Retail are Real… and so is Edge Computing +====== + +### I’ve seen plenty of articles touting the promise of edge computing technologies like AI and robotics in retail brick & mortar, but it wasn’t until this past weekend that I had my first encounter with an actual robot in a retail store. + +![Getty][1] + +I’ve seen plenty of articles touting the promise of [edge computing][2] technologies like AI and robotics in retail brick & mortar, but it wasn’t until this past weekend that I had my first encounter with an actual robot in a retail store. I was doing my usual weekly grocery shopping at my local Stop & Shop, and who comes strolling down the aisle, but…. Marty… the autonomous robot. He was friendly looking with his big googly eyes and was wearing a sign that explained he was there for safety, and that he was monitoring the aisles to report spills, debris, and other hazards to employees to improve my shopping experience. He caught the attention of most of the shoppers. + +At the National Retail Federation conference in NY that I attended in January, this was a topic of one of the [panel sessions][3]. It all makes sense… a positive customer experience is critical to retail success. But employee-to-customer (human to human) interaction has also been proven important. That’s where Marty comes in… to free up resources spent on tedious, time consuming tasks so that personnel can spend more time directly helping customers. + +**Use cases for robots in stores** + +Robotics have been utilized by retailers in manufacturing floors, and in distribution warehouses to improve productivity and optimize business processes along the supply chain. But it is only more recently that we’re seeing them make their way into the retail store front, where they are in contact with the customers. Alerting to hazards in the aisles is just one of many use-cases for the robots. They can also be used to scan and re-stock shelves, or as general information sources and greeters upon entering the store to guide your shopping experience. But how does a retailer justify the investment in this type of technology? Determining your ROI isn’t as cut and dry as in a warehouse environment, for example, where costs are directly tied to number of staff, time to complete tasks, etc… I guess time will tell for the retailers that are giving it a go. + +**What does it mean for the IT equipment on-premise ([micro data center][4])** + +Robotics are one of the many ways retail stores are being digitized. Video analytics is another big one, being used to analyze facial expressions for customer satisfaction, obtain customer demographics as input to product development, or ensure queue lines don’t get too long. My colleague, Patrick Donovan, wrote a detailed [blog post][5] about our trip to NRF and the impact on the physical infrastructure in the stores. In a nutshell, the equipment on-premise is becoming more mission critical, more integrated to business applications in the cloud, more tied to positive customer-experiences… and with that comes the need for more secure, more available, more manageable edge. But this is easier said than done in an environment that generally has no IT staff on-premise, and with hundreds or potentially thousands of stores spread out geographically. So how do we address this? + +We answer this question in a white paper that Patrick and I are currently writing titled “An Integrated Ecosystem to Solve Edge Computing Infrastructure Challenges”. Here’s a hint, (1) an integrated ecosystem of partners, and (2) an integrated micro data center that emerges from the ecosystem. I’ll be sure to comment on this blog with the link when the white paper becomes publicly available! In the meantime, explore our [edge computing][2] landing page to learn more. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385046/robots-in-retail-are-real-and-so-is-edge-computing.html#tk.rss_all + +作者:[Wendy Torell][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/Wendy-Torell/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/03/gettyimages-828488368-1060x445-100792228-large.jpg +[2]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp +[3]: https://stores.org/2019/01/15/why-is-there-a-robot-in-my-store/ +[4]: https://www.apc.com/us/en/solutions/business-solutions/micro-data-centers.jsp +[5]: https://blog.apc.com/2019/02/06/4-thoughts-edge-computing-infrastructure-retail-sector/ diff --git a/sources/tech/20190329 How to submit a bug report with Bugzilla.md b/sources/tech/20190329 How to submit a bug report with Bugzilla.md new file mode 100644 index 0000000000..ee778410e7 --- /dev/null +++ b/sources/tech/20190329 How to submit a bug report with Bugzilla.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to submit a bug report with Bugzilla) +[#]: via: (https://opensource.com/article/19/3/bug-reporting) +[#]: author: (David Both https://opensource.com/users/dboth) + +How to submit a bug report with Bugzilla +====== + +Submitting bug reports is an easy way to give back and it helps everyone. + +![][1] + +I spend a lot of time doing research for my books and [Opensource.com][2] articles. Sometimes this leads me to discover bugs in the software I use, including Fedora and the Linux kernel. As a long-time Linux user and sysadmin, I have benefited greatly from GNU/Linux, and I like to give back. I am not a C language programmer, so I don't create fixes and submit them with bug reports, as some people do. But a way I can return some value to the Linux community is by reporting bugs. + +Product maintainers use a lot of tools to let their users search for existing bugs and report new ones. Bugzilla is a popular tool, and I use the Red Hat [Bugzilla][3] website to report Fedora-related bugs because I primarily use Fedora on the systems I'm responsible for. It's an easy process, but it may seem daunting if you have never done it before. So let's start with the basics. + +### Start with a search + +Even though it's tempting, never assume that seemingly anomalous behavior is the result of a bug. I always start with a search of relevant websites, such as the [Fedora wiki][4], the [CentOS wiki][5], and the documentation for the distro I'm using. I also try to check the various distro listservs. + +If it appears that no one has encountered this problem before (or if they have, they haven't reported it as a bug), I go to the Red Hat Bugzilla site and begin searching for a bug report that might come close to matching the symptoms I encountered. + +You can search the Red Hat Bugzilla site without an account. Go to the Bugzilla site and click on the [Advanced Search tab][6]. + +![Searching for a bug][7] + +For example, if you want to search for bug reports related to Fedora's Rescue mode kernel, enter the following data in the Advanced Search form. + +Field | Logic | Data or Selection +---|---|--- +Summary | Contains the string | Rescue mode kernel +Classification | | Fedora +Product | | Fedora +Component | | grub2 +Status | | New + Assigned + +Then press **Search**. This returns a list of one bug with the ID 1654337 (which happens to be a bug I reported). + +![Bug report list][8] + +Click on the ID to view my bug report details. I entered as much relevant data as possible in the top section of the report. In the comments, I described the problem and included supporting files, other relevant comments (such as the fact that the problem occurred on multiple motherboards), and the steps to reproduce the problem. + +![Bug report details][9] + +The more information you can provide here that pertains to the bug, such as symptoms, the hardware and software environments (if they are applicable), other software that was running at the time, kernel and distro release levels, and so on, the easier it will be to determine where to assign your bug. In this case, I originally chose the kernel component, but it was quickly changed to the GRUB2 component because the problem occurred before the kernel loaded. + +### How to submit a bug report + +The Red Hat [Bugzilla][3] website requires an account to submit new bugs or comment on old ones. It is easy to sign up. On Bugzilla's main page, click **Open a New Account** and fill in the requested information. After you verify your email address, you can fill in the rest of the information to create your account. + +_**Advisory:**_ _Bugzilla is a working website that people count on for support. I strongly suggest not creating an account unless you intend to submit bug reports or comment on existing bugs._ + +To demonstrate how to submit a bug report, I'll use a fictional example of creating a bug against the Xfce4-terminal emulator in Fedora. _Please do not do this unless you have a real bug to report._ + +Log into your account and click on **New** in the menu bar or the **File a Bug** button. You'll need to select a classification for the bug to continue the process. This will narrow down some of the choices on the next page. + +The following image shows how I filled out the required fields (and a couple of others that are not required). + +![Reporting a bug][10] + +When you type a short problem description in the **Summary** field, Bugzilla displays a list of other bugs that might match yours. If one matches, click **Add Me to the CC List** to receive emails when changes are made to the bug. + +If none match, fill in the information requested in the **Description** field. Add as much information as you can, including error messages and screen captures that illustrate the problem. Be sure to describe the exact steps needed to reproduce the problem and how reproducible it is: does it fail every time, every second, third, fourth, random time, or whatever. If it happened only once, it's very unlikely anyone will be able to reproduce the problem you observed. + +When you finish adding as much information as you can, press **Submit Bug**. + +### Be kind + +Bug reporting websites are not for asking questions—they are for searching and reporting bugs. That means you must have performed some work on your own to conclude that there really is a bug. There are many wikis, listservs, and Q&A websites that are appropriate for asking questions. Use sites like Bugzilla to search for existing bug reports on the problem you have found. + +Be sure you submit your bugs on the correct bug reporting website. For example, only submit bugs about Red Hat products on the Red Hat Bugzilla, and submit bugs about LibreOffice by following [LibreOffice's instructions][11]. + +Reporting bugs is not difficult, and it is an important way to participate. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/bug-reporting + +作者:[David Both (Community Moderator)][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/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug-insect-butterfly-diversity-inclusion-2.png?itok=TcC9eews +[2]: http://Opensource.com +[3]: https://bugzilla.redhat.com/ +[4]: https://fedoraproject.org/wiki/ +[5]: https://wiki.centos.org/ +[6]: https://bugzilla.redhat.com/query.cgi?format=advanced +[7]: https://opensource.com/sites/default/files/uploads/bugreporting-1.png (Searching for a bug) +[8]: https://opensource.com/sites/default/files/uploads/bugreporting-2.png (Bug report list) +[9]: https://opensource.com/sites/default/files/uploads/bugreporting-4.png (Bug report details) +[10]: https://opensource.com/sites/default/files/uploads/bugreporting-3.png (Reporting a bug) +[11]: https://wiki.documentfoundation.org/QA/BugReport diff --git a/sources/tech/20190329 Russia demands access to VPN providers- servers.md b/sources/tech/20190329 Russia demands access to VPN providers- servers.md new file mode 100644 index 0000000000..0c950eb04f --- /dev/null +++ b/sources/tech/20190329 Russia demands access to VPN providers- servers.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Russia demands access to VPN providers’ servers) +[#]: via: (https://www.networkworld.com/article/3385050/russia-demands-access-to-vpn-providers-servers.html#tk.rss_all) +[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/) + +Russia demands access to VPN providers’ servers +====== + +### 10 VPN service providers have been ordered to link their servers in Russia to the state censorship agency by April 26 + +![Getty Images][1] + +The Russian censorship agency Roskomnadzor has ordered 10 [VPN][2] service providers to link their servers in Russia to its network in order to stop users within the country from reaching banned sites. + +If they fail to comply, their services will be blocked, according to a machine translation of the order. + +[RELATED: Best VPN routers for small business][3] + +The 10 VPN providers are ExpressVPN, HideMyAss!, Hola VPN, IPVanish, Kaspersky Secure Connection, KeepSolid, NordVPN, OpenVPN, TorGuard, and VyprVPN. + +In response at least five of the 10 – Express VPN, IPVanish, KeepSolid, NordVPN, TorGuard and – say they are tearing down their servers in Russia but continuing to offer their services to Russian customers if they can reach the providers’ servers located outside of Russia. A sixth provider, Kaspersky Labs, which is based in Moscow, says it will comply with the order. The other four could not be reached for this article. + +IPVanish characterized the order as another phase of “Russia’s censorship agenda” dating back to 2017 when the government enacted a law forbidding the use of VPNs to access blocked Web sites. + +“Up until recently, however, they had done little to enforce such rules,” IPVanish [says in its blog][4]. “These new demands mark a significant escalation.” + +The reactions of those not complying are similar. TorGuard says it has taken steps to remove all its physical servers from Russia. It is also cutting off its business with data centers in the region + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][5] ]** + +“We would like to be clear that this removal of servers was a voluntary decision by TorGuard management and no equipment seizure occurred,” [TorGuard says in its blog][6]. “We do not store any logs so even if servers were compromised it would be impossible for customer’s data to be exposed.” + +TorGuard says it is deploying more servers in adjacent countries to protect fast download speeds for customers in the region. + +IPVanish says it has faced similar demands from Russia before and responded similarly. In 2016, a new Russian law required online service providers to store customers’ private data for a year. “In response, [we removed all physical server presence in Russia][7], while still offering Russians encrypted connections via servers outside of Russian borders,” the company says. “That decision was made in accordance with our strict zero-logs policy.” + +KeepSolid says it had no servers in Russia, but it will not comply with the order to link with Roskomnadzor's network. KeepSolid says it will [draw on its experience dealing with the Great Firewall of China][8] to fight the Russian censorship attempt. "Our team developed a special [KeepSolid Wise protocol][9] which is designed for use in countries where the use of VPN is blocked," a spokesperson for the company said in an email statement. + +NordVPN says it’s shutting down all its Russian servers, and all of them will be shredded as of April 1. [The company says in a blog][10] that some of its customers who connected to its Russian servers without use of the NordVPN application will have to reconfigure their devices to insure their security. Those customers using the app won’t have to do anything differently because the option to connect to Russia via the app has been removed. + +ExpressVPN is also not complying with the order. "As a matter of principle, ExpressVPN will never cooperate with efforts to censor the internet by any country," said the company's vice presidentn Harold Li in an email, but he said that blocking traffic will be ineffective. "We epect that Russian internet users will still be able to find means of accessing the sites and services they want, albeit perhaps with some additional effort." + +Kaspersky Labs says it will comply with the Russian order and responded to emailed questions about its reaction with this written response: + +“Kaspersky Lab is aware of the new requirements from Russian regulators for VPN providers operating in the country. These requirements oblige VPN providers to restrict access to a number of websites that were listed and prohibited by the Russian Government in the country’s territory. As a responsible company, Kaspersky Lab complies with the laws of all the countries where it operates, including Russia. At the same time, the new requirements don’t affect the main purpose of Kaspersky Secure Connection which protects user privacy and ensures confidentiality and protection against data interception, for example, when using open Wi-Fi networks, making online payments at cafes, airports or hotels. Additionally, the new requirements are relevant to VPN use only in Russian territory and do not concern users in other countries.” + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385050/russia-demands-access-to-vpn-providers-servers.html#tk.rss_all + +作者:[Tim Greene][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/Tim-Greene/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/ipsecurity-protocols-network-security-vpn-100775457-large.jpg +[2]: https://www.networkworld.com/article/3268744/understanding-virtual-private-networks-and-why-vpns-are-important-to-sd-wan.html +[3]: http://www.networkworld.com/article/3002228/router/best-vpn-routers-for-small-business.html#tk.nww-fsb +[4]: https://nordvpn.com/blog/nordvpn-servers-roskomnadzor-russia/ +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[6]: https://torguard.net/blog/why-torguard-has-removed-all-russian-servers/ +[7]: https://blog.ipvanish.com/ipvanish-removes-russian-vpn-servers-from-moscow/ +[8]: https://www.vpnunlimitedapp.com/blog/what-roskomnadzor-demands-from-vpns/ +[9]: https://www.vpnunlimitedapp.com/blog/keepsolid-wise-a-smart-solution-to-get-total-online-freedom/ +[10]: /cms/article/blog%20https:/nordvpn.com/blog/nordvpn-servers-roskomnadzor-russia/ +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190329 ShadowReader- Serverless load tests for replaying production traffic.md b/sources/tech/20190329 ShadowReader- Serverless load tests for replaying production traffic.md new file mode 100644 index 0000000000..3d7f7eaf0c --- /dev/null +++ b/sources/tech/20190329 ShadowReader- Serverless load tests for replaying production traffic.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ShadowReader: Serverless load tests for replaying production traffic) +[#]: via: (https://opensource.com/article/19/3/shadowreader-serverless) +[#]: author: (Yuki Sawa https://opensource.com/users/yukisawa1/users/yongsanchez) + +ShadowReader: Serverless load tests for replaying production traffic +====== +This open source tool recreates serverless production conditions to +pinpoint causes of memory leaks and other errors that aren't visible in +the QA environment. +![Traffic lights at night][1] + +While load testing has become more accessible, configuring load tests that faithfully re-create production conditions can be difficult. A good load test must use a set of URLs that are representative of production traffic and achieve request rates that mimic real users. Even performing distributed load tests requires the upkeep of a fleet of servers. + +[ShadowReader][2] aims to solve these problems. It gathers URLs and request rates straight from production logs and replays them using AWS Lambda. Being serverless, it is more cost-efficient and performant than traditional distributed load tests; in practice, it has scaled beyond 50,000 requests per minute. + +At Edmunds, we have been able to utilize these capabilities to solve problems, such as Node.js memory leaks that were happening only in production, by recreating the same conditions in our QA environment. We're also using it daily to generate load for pre-production canary deployments. + +The memory leak problem we faced in our Node.js application confounded our engineering team; as it was only occurring in our production environment; we could not reproduce it in QA until we introduced ShadowReader to replay production traffic into QA. + +### The incident + +On Christmas Eve 2017, we suffered an incident where there was a jump in response time across the board with error rates tripling and impacting many users of our website. + +![Christmas Eve 2017 incident][3] + +![Christmas Eve 2017 incident][4] + +Monitoring during the incident helped identify and resolve the issue quickly, but we still needed to understand the root cause. + +At Edmunds, we leverage a robust continuous delivery (CD) pipeline that releases new updates to production multiple times a day. We also dynamically scale up our applications to accommodate peak traffic and scale down to save costs. Unfortunately, this had the side effect of masking a memory leak. + +In our investigation, we saw that the memory leak had existed for weeks, since early December. Memory usage would climb to 60%, along with a slow increase in 99th percentile response time. + +Between our CD pipeline and autoscaling events, long-running containers were frequently being shut down and replaced by newer ones. This inadvertently masked the memory leak until December, when we decided to stop releasing software to ensure stability during the holidays. + +![Slow increase in 99th percentile response time][5] + +### Our CD pipeline + +At a glance, Edmunds' CD pipeline looks like this: + + 1. Unit test + 2. Build a Docker image for the application + 3. Integration test + 4. Load test/performance test + 5. Canary release + + + +The solution is fully automated and requires no manual cutover. The final step is a canary deployment directly into the live website, allowing us to release multiple times a day. + +For our load testing, we leveraged custom tooling built on top of JMeter. It takes random samples of production URLs and can simulate various percentages of traffic. Unfortunately, however, our load tests were not able to reproduce the memory leak in any of our pre-production environments. + +### Solving the memory leak + +When looking at the memory patterns in QA, we noticed there was a very healthy pattern. Our initial hypothesis was that our JMeter load testing in QA was unable to simulate production traffic in a way that allows us to predict how our applications will perform. + +While the load test takes samples from production URLs, it can't precisely simulate the URLs customers use and the exact frequency of calls (i.e., the burst rate). + +Our first step was to re-create the problem in QA. We used a new tool called ShadowReader, a project that evolved out of our hackathons. While many projects we considered were product-focused, this was the only operations-centric one. It is a load-testing tool that runs on AWS Lambda and can replay production traffic and usage patterns against our QA environment. + +The results it returned were immediate: + +![QA results in ShadowReader][6] + +Knowing that we could re-create the problem in QA, we took the additional step to point ShadowReader to our local environment, as this allowed us to trigger Node.js heap dumps. After analyzing the contents of the dumps, it was obvious the memory leak was coming from two excessively large objects containing only strings. At the time the snapshot dumped, these objects contained 373MB and 63MB of strings! + +![Heap dumps show source of memory leak][7] + +We found that both objects were temporary lookup caches containing metadata to be used on the client side. Neither of these caches was ever intended to be persisted on the server side. The user's browser cached only its own metadata, but on the server side, it cached the metadata for all users. This is why we were unable to reproduce the leak with synthetic testing. Synthetic tests always resulted in the same fixed set of metadata in the server-side caches. The leak surfaced only when we had a sufficient amount of unique metadata being generated from a variety of users. + +Once we identified the problem, we were able to remove the large caches that we observed in the heap dumps. We've since instrumented the application to start collecting metrics that can help detect issues like this faster. + +![Collecting metrics][8] + +After making the fix in QA, we saw that the memory usage was constant and the leak was plugged. + +![Graph showing memory leak fixed][9] + +### What is ShadowReader? + +ShadowReader is a serverless load-testing framework powered by AWS Lambda and S3 to replay production traffic. It mimics real user traffic by replaying URLs from production at the same rate as the live website. We are happy to announce that after months of internal usage, we have released it as open source! + +#### Features + + * ShadowReader mimics real user traffic by replaying user requests (URLs). It can also replay certain headers, such as True-Client-IP and User-Agent, along with the URL. + + + * It is more efficient cost- and performance-wise than traditional distributed load tests that run on a fleet of servers. Managing a fleet of servers for distributed load testing can cost $1,000 or more per month; with a serverless stack, it can be reduced to $100 per month by provisioning compute resources on demand. + + + * We've scaled it up to 50,000 requests per minute, but it should be able to handle more than 100,000 reqs/min. + + + * New load tests can be spun up and stopped instantly, unlike traditional load-testing tools, which can take many minutes to generate the test plan and distribute the test data to the load-testing servers. + + + * It can ramp traffic up or down by a percentage value to function as a more traditional load test. + + + * Its plugin system enables you to switch out plugins to change its behavior. For instance, you can switch from past replay (i.e., replays past requests) to live replay (i.e., replays requests as they come in). + + + * Currently, it can replay logs from the [Application Load Balancer][10] and [Classic Load Balancer][11] Elastic Load Balancers (ELBs), and support for other load balancers is coming soon. + + + +### How it works + +ShadowReader is composed of four different Lambdas: a Parser, an Orchestrator, a Master, and a Worker. + +![ShadowReader architecture][12] + +When a user visits a website, a load balancer (in this case, an ELB) typically routes the request. As the ELB routes the request, it will log the event and ship it to S3. + +Next, ShadowReader triggers a Parser Lambda every minute via a CloudWatch event, which parses the latest access (ELB) logs on S3 for that minute, then ships the parsed URLs into another S3 bucket. + +On the other side of the system, ShadowReader also triggers an Orchestrator lambda every minute. This Lambda holds the configurations and state of the system. + +The Orchestrator then invokes a Master Lambda function. From the Orchestrator, the Master receives information on which time slice to replay and downloads the respective data from the S3 bucket of parsed URLs (deposited there by the Parser). + +The Master Lambda divides the load-test URLs into smaller batches, then invokes and passes each batch into a Worker Lambda. If 800 requests must be sent out, then eight Worker Lambdas will be invoked, each one handling 100 URLs. + +Finally, the Worker receives the URLs passed from the Master and starts load-testing the chosen test environment. + +### The bigger picture + +The challenge of reproducibility in load testing serverless infrastructure becomes increasingly important as we move from steady-state application sizing to on-demand models. While ShadowReader is designed and used with Edmunds' infrastructure in mind, any application leveraging ELBs can take full advantage of it. Soon, it will have support to replay the traffic of any service that generates traffic logs. + +As the project moves forward, we would love to see it evolve to be compatible with next-generation serverless runtimes such as Knative. We also hope to see other open source communities build similar toolchains for their infrastructure as serverless becomes more prevalent. + +### Getting started + +If you would like to test drive ShadowReader, check out the [GitHub repo][2]. The README contains how-to guides and a batteries-included [demo][13] that will deploy all the necessary resources to try out live replay in your AWS account. + +We would love to hear what you think and welcome contributions. See the [contributing guide][14] to get started! + +* * * + +_This article is based on "[How we fixed a Node.js memory leak by using ShadowReader to replay production traffic into QA][15]," published on the_ _Edmunds Tech Blog_ _with the help of Carlos Macasaet, Sharath Gowda, and Joey Davis._ _Yuki_ _Sawa_ _also presented this_ as* [ShadowReader—Serverless load tests for replaying production traffic][16] at ([SCaLE 17x][17]) March 7-10 in Pasadena, Calif.* + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/3/shadowreader-serverless + +作者:[Yuki Sawa][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/yukisawa1/users/yongsanchez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/traffic-light-go.png?itok=nC_851ys (Traffic lights at night) +[2]: https://github.com/edmunds/shadowreader +[3]: https://opensource.com/sites/default/files/uploads/shadowreader_incident1_0.png (Christmas Eve 2017 incident) +[4]: https://opensource.com/sites/default/files/uploads/shadowreader_incident2.png (Christmas Eve 2017 incident) +[5]: https://opensource.com/sites/default/files/uploads/shadowreader_99thpercentile.png (Slow increase in 99th percentile response time) +[6]: https://opensource.com/sites/default/files/uploads/shadowreader_qa.png (QA results in ShadowReader) +[7]: https://opensource.com/sites/default/files/uploads/shadowreader_heapdumps.png (Heap dumps show source of memory leak) +[8]: https://opensource.com/sites/default/files/uploads/shadowreader_code.png (Collecting metrics) +[9]: https://opensource.com/sites/default/files/uploads/shadowreader_leakplugged.png (Graph showing memory leak fixed) +[10]: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html +[11]: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html +[12]: https://opensource.com/sites/default/files/uploads/shadowreader_architecture.png (ShadowReader architecture) +[13]: https://github.com/edmunds/shadowreader#live-replay +[14]: https://github.com/edmunds/shadowreader/blob/master/CONTRIBUTING.md +[15]: https://technology.edmunds.com/2018/08/25/Investigating-a-Memory-Leak-and-Introducing-ShadowReader/ +[16]: https://www.socallinuxexpo.org/scale/17x/speakers/yuki-sawa +[17]: https://www.socallinuxexpo.org/ diff --git a/sources/tech/20190401 Build and host a website with Git.md b/sources/tech/20190401 Build and host a website with Git.md new file mode 100644 index 0000000000..32a07d3490 --- /dev/null +++ b/sources/tech/20190401 Build and host a website with Git.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build and host a website with Git) +[#]: via: (https://opensource.com/article/19/4/building-hosting-website-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Build and host a website with Git +====== +Publishing your own website is easy if you let Git help you out. Learn +how in the first article in our series about little-known Git uses. +![web development and design, desktop and browser][1] + +[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. + +Creating a website used to be both sublimely simple and a form of black magic all at once. Back in the old days of Web 1.0 (that's not what anyone actually called it), you could just open up any website, view its source code, and reverse engineer the HTML—with all its inline styling and table-based layout—and you felt like a programmer after an afternoon or two. But there was still the matter of getting the page you created on the internet, which meant dealing with servers and FTP and webroot directories and file permissions. While the modern web has become far more complex since then, self-publication can be just as easy (or easier!) if you let Git help you out. + +### Create a website with Hugo + +[Hugo][3] is an open source static site generator. Static sites are what the web used to be built on (if you go back far enough, it was _all_ the web was). There are several advantages to static sites: they're relatively easy to write because you don't have to code them, they're relatively secure because there's no code executed on the pages, and they can be quite fast because there's no processing aside from transferring whatever you have on the page. + +Hugo isn't the only static site generator out there. [Grav][4], [Pico][5], [Jekyll][6], [Podwrite][7], and many others provide an easy way to create a full-featured website with minimal maintenance. Hugo happens to be one with GitLab integration built in, which means you can generate and host your website with a free GitLab account. + +Hugo has some pretty big fans, too. For instance, if you've ever gone to the Let's Encrypt website, then you've used a site built with Hugo. + +![Let's Encrypt website][8] + +#### Install Hugo + +Hugo is cross-platform, and you can find installation instructions for MacOS, Windows, Linux, OpenBSD, and FreeBSD in [Hugo's getting started resources][9]. + +If you're on Linux or BSD, it's easiest to install Hugo from a software repository or ports tree. The exact command varies depending on what your distribution provides, but on Fedora you would enter: + +``` +$ sudo dnf install hugo +``` + +Confirm you have installed it correctly by opening a terminal and typing: + +``` +$ hugo help +``` + +This prints all the options available for the **hugo** command. If you don't see that, you may have installed Hugo incorrectly or need to [add the command to your path][10]. + +#### Create your site + +To build a Hugo site, you must have a specific directory structure, which Hugo will generate for you by entering: + +``` +$ hugo new site mysite +``` + +You now have a directory called **mysite** , and it contains the default directories you need to build a Hugo website. + +Git is your interface to get your site on the internet, so change directory to your new **mysite** folder and initialize it as a Git repository: + +``` +$ cd mysite +$ git init . +``` + +Hugo is pretty Git-friendly, so you can even use Git to install a theme for your site. Unless you plan on developing the theme you're installing, you can use the **\--depth** option to clone the latest state of the theme's source: + +``` +$ git clone --depth 1 \ + +themes/mero +``` + + +Now create some content for your site: + +``` +$ hugo new posts/hello.md +``` + +Use your favorite text editor to edit the **hello.md** file in the **content/posts** directory. Hugo accepts Markdown files and converts them to themed HTML files at publication, so your content must be in [Markdown format][11]. + +If you want to include images in your post, create a folder called **images** in the **static** directory. Place your images into this folder and reference them in your markup using the absolute path starting with **/images**. For example: + +``` +![A picture of a thing](/images/thing.jpeg) +``` + +#### Choose a theme + +You can find more themes at [themes.gohugo.io][12], but it's best to stay with a basic theme while testing. The canonical Hugo test theme is [Ananke][13]. Some themes have complex dependencies, and others don't render pages the way you might expect without complex configuration. The Mero theme used in this example comes bundled with a detailed **config.toml** configuration file, but (for the sake of simplicity) I'll provide just the basics here. Open the file called **config.toml** in a text editor and add three configuration parameters: + +``` + +languageCode = "en-us" +title = "My website on the web" +theme = "mero" + +[params] + author = "Seth Kenlon" + description = "My hugo demo" +``` + +#### Preview your site + +You don't have to put anything on the internet until you're ready to publish it. While you work, you can preview your site by launching the local-only web server that ships with Hugo. + +``` +$ hugo server --buildDrafts --disableFastRender +``` + +Open a web browser and navigate to **** to see your work in progress. + +### Publish with Git to GitLab + +To publish and host your site on GitLab, create a repository for the contents of your site. + +To create a repository in GitLab, click on the **New Project** button in your GitLab Projects page. Create an empty repository called **yourGitLabUsername.gitlab.io** , replacing **yourGitLabUsername** with your GitLab user name or group name. You must use this scheme as the name of your project. If you want to add a custom domain later, you can. + +Do not include a license or a README file (because you've started a project locally, adding these now would make pushing your data to GitLab more complex, and you can always add them later). + +Once you've created the empty repository on GitLab, add it as the remote location for the local copy of your Hugo site, which is already a Git repository: + +``` +$ git remote add origin git@gitlab.com:skenlon/mysite.git +``` + +Create a GitLab site configuration file called **.gitlab-ci.yml** and enter these options: + +``` +image: monachus/hugo + +variables: + GIT_SUBMODULE_STRATEGY: recursive + +pages: + script: + - hugo + artifacts: + paths: + - public + only: + - master +``` + +The **image** parameter defines a containerized image that will serve your site. The other parameters are instructions telling GitLab's servers what actions to execute when you push new code to your remote repository. For more information on GitLab's CI/CD (Continuous Integration and Delivery) options, see the [CI/CD section of GitLab's docs][14]. + +#### Set the excludes + +Your Git repository is configured, the commands to build your site on GitLab's servers are set, and your site ready to publish. For your first Git commit, you must take a few extra precautions so you're not version-controlling files you don't intend to version-control. + +First, add the **/public** directory that Hugo creates when building your site to your **.gitignore** file. You don't need to manage the finished site in Git; all you need to track are your source Hugo files. + +``` +$ echo "/public" >> .gitignore +``` + +You can't maintain a Git repository within a Git repository without creating a Git submodule. For the sake of keeping this simple, move the embedded **.git** directory so that the theme is just a theme. + +Note that you _must_ add your theme files to your Git repository so GitLab will have access to the theme. Without committing your theme files, your site cannot successfully build. + +``` +$ mv themes/mero/.git ~/.local/share/Trash/files/ +``` + +Alternately, use a **trash** command such as [Trashy][15]: + +``` +$ trash themes/mero/.git +``` + +Now you can add all the contents of your local project directory to Git and push it to GitLab: + +``` +$ git add . +$ git commit -m 'hugo init' +$ git push -u origin HEAD +``` + +### Go live with GitLab + +Once your code has been pushed to GitLab, take a look at your project page. An icon indicates GitLab is processing your build. It might take several minutes the first time you push your code, so be patient. However, don't be _too_ patient, because the icon doesn't always update reliably. + +![GitLab processing your build][16] + +While you're waiting for GitLab to assemble your site, go to your project settings and find the **Pages** panel. Once your site is ready, its URL will be provided for you. The URL is **yourGitLabUsername.gitlab.io/yourProjectName**. Navigate to that address to view the fruits of your labor. + +![Previewing Hugo site][17] + +If your site fails to assemble correctly, GitLab provides insight into the CI/CD pipeline logs. Review the error message for an indication of what went wrong. + +### Git and the web + +Hugo (or Jekyll or similar tools) is just one way to leverage Git as your web publishing tool. With server-side Git hooks, you can design your own Git-to-web pipeline with minimal scripting. With the community edition of GitLab, you can self-host your own GitLab instance or you can use an alternative like [Gitolite][18] or [Gitea][19] and use this article as inspiration for a custom solution. Have fun! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/building-hosting-website-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh (web development and design, desktop and browser) +[2]: https://git-scm.com/ +[3]: http://gohugo.io +[4]: http://getgrav.org +[5]: http://picocms.org/ +[6]: https://jekyllrb.com +[7]: http://slackermedia.info/podwrite/ +[8]: https://opensource.com/sites/default/files/uploads/letsencrypt-site.jpg (Let's Encrypt website) +[9]: https://gohugo.io/getting-started/installing +[10]: https://opensource.com/article/17/6/set-path-linux +[11]: https://commonmark.org/help/ +[12]: https://themes.gohugo.io/ +[13]: https://themes.gohugo.io/gohugo-theme-ananke/ +[14]: https://docs.gitlab.com/ee/ci/#overview +[15]: http://slackermedia.info/trashy +[16]: https://opensource.com/sites/default/files/uploads/hugo-gitlab-cicd.jpg (GitLab processing your build) +[17]: https://opensource.com/sites/default/files/uploads/hugo-demo-site.jpg (Previewing Hugo site) +[18]: http://gitolite.com +[19]: http://gitea.io diff --git a/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md b/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md new file mode 100644 index 0000000000..777108f639 --- /dev/null +++ b/sources/tech/20190401 Meta Networks builds user security into its Network-as-a-Service.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Meta Networks builds user security into its Network-as-a-Service) +[#]: via: (https://www.networkworld.com/article/3385531/meta-networks-builds-user-security-into-its-network-as-a-service.html#tk.rss_all) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Meta Networks builds user security into its Network-as-a-Service +====== + +### Meta Networks has a unique approach to the security of its Network-as-a-Service. A tight security perimeter is built around every user and the specific resources each person needs to access. + +![MF3d / Getty Images][1] + +Network-as-a-Service (NaaS) is growing in popularity and availability for those organizations that don’t want to host their own LAN or WAN, or that want to complement or replace their traditional network with something far easier to manage. + +With NaaS, a service provider creates a multi-tenant wide area network comprised of geographically dispersed points of presence (PoPs) connected via high-speed Tier 1 carrier links that create the network backbone. The PoPs peer with cloud services to facilitate customer access to cloud applications such as SaaS offerings, as well as to infrastructure services from the likes of Amazon, Google and Microsoft. User organizations connect to the network from whatever facilities they have — data centers, branch offices, or even individual client devices — typically via SD-WAN appliances and/or VPNs. + +Numerous service providers now offer Network-as-a-Service. As the network backbone and the PoPs become more of a commodity, the providers are distinguishing themselves on other value-added services, such as integrated security or WAN optimization. + +**[ Also read:[What to consider when deploying a next generation firewall][2] | Get regularly scheduled insights: [Sign up for Network World newsletters][3]. ]** + +Ever since its launch about a year ago, [Meta Networks][4] has staked security as its primary value-add. What’s different about the Meta NaaS is the philosophy that the network is built around users, not around specific sites or offices. Meta Networks does this by building a software-defined perimeter (SDP) for each user, giving workers micro-segmented access to only the applications and network resources they need. The vendor was a little ahead of its time with SDP, but the market is starting to catch up. Companies are beginning to show interest in SDP as a VPN replacement or VPN alternative. + +Meta NaaS has a zero-trust architecture where each user is bound by an SDP. Each user has a unique, fixed identity no matter from where they connect to this network. The SDP security framework allows one-to-one network connections that are dynamically created on demand between the user and the specific resources they need to access. Everything else on the NaaS is invisible to the user. No access is possible unless it is explicitly granted, and it’s continuously verified at the packet level. This model effectively provides dynamically provisioned secure network segmentation. + +## SDP tightly controls access to specific resources + +This approach works very well when a company wants to securely connect employees, contractors, and external partners to specific resources on the network. For example, one of Meta Networks’ customers is Via Transportation, a New York-based company that has a ride-sharing platform. The company operates its own ride-sharing services in various cities in North America and Europe, and it licenses its technology to other transit systems around the world. + +Via’s operations are completely cloud-native, and so it has no legacy-style site-based WAN to connect its 400-plus employees and contractors to their cloud-based applications. Via’s partners, primarily transportation operators in different cities and countries, also need controlled access to specific portions of Via’s software platform to manage rideshares. Giving each group of users access to the applications they need — and _only_ to the ones they specifically need – was a challenge using a VPN. Using the Meta NaaS instead gives Via more granular control over who has what access. + +**[[Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][5] ]** + +Via’s employees with managed devices connect to the Meta NaaS using client software on the device, and they are authenticated using Okta and a certificate. Contractors and customers with unmanaged devices use a browser-based access solution from Meta that doesn’t require installation or setup. New users can be on-boarded quickly and assigned granular access policies based on their role. Integration with Okta provides information that facilitates identity-based access policies. Once users connect to the network, they can see only the applications and network resources that their policy allows; everything else is invisible to them under the SDP architecture. + +For Via, there are several benefits to the Meta NaaS approach. First and foremost, the company doesn’t have to own or operate its own WAN infrastructure. Everything is a managed service located in the cloud — the same business model that Via itself espouses. Next, this solution scales easily to support the company’s growth. Meta’s security integrates with Via’s existing identity management system, so identities and access policies can be centrally managed. And finally, the software-defined perimeter hides resources from unauthorized users, creating security by obscurity. + +## Tightening security even further + +Meta Networks further tightens the security around the user by doing device posture checks — “NAC lite,” if you will. A customer can define the criteria that devices have to meet before they are allowed to connect to the NaaS. For example, the check could be whether a security certificate is installed, if a registry key is set to a specific value, or if anti-virus software is installed and running. It’s one more way to enforce company policies on network access. + +When end users use the browser-based method to connect to the Meta NaaS, all activity is recorded in a rich log so that everything can be audited, but also to set alerts and look for anomalies. This data can be exported to a SIEM if desired, but Meta has its own notification and alert system for security incidents. + +Meta Networks recently implemented some new features around management, including smart groups and support for the System for Cross-Domain Identity Management (SCIM) protocol. The smart groups feature provides the means to add an extra notation or tag to elements such as devices, services, network subnets or segments, and basically everything that’s in the system. These tags can then be applied to policy. For example, a customer could label some of their services as a production, staging, or development environment. Then a policy could be implemented to say that only sales people can access the production environment. Smart groups are just one more way to get even more granular about policy. + +The SCIM support makes on-boarding new users simple. SCIM is a protocol that is used to synchronize and provision users and identities from a third-party identity provider such as Okta, Azure AD, or OneLogin. A customer can use SCIM to provision all the users from the IdP into the Meta system, synchronize in real time the groups and attributes, and then use that information to build the access policies inside Meta NaaS. + +These and other security features fit into Meta Networks’ vision that the security perimeter goes with you no matter where you are, and the perimeter includes everything that was formerly delivered through the data center. It is delivered through the cloud to your client device with always-on security. It’s a broad approach to SDP and a unique approach to NaaS. + +**Reviews: 4 free, open-source network monitoring tools** + + * [Icinga: Enterprise-grade, open-source network-monitoring that scales][6] + * [Nagios Core: Network-monitoring software with lots of plugins, steep learning curve][7] + * [Observium open-source network monitoring tool: Won’t run on Windows but has a great user interface][8] + * [Zabbix delivers effective no-frills network monitoring][9] + + + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3385531/meta-networks-builds-user-security-into-its-network-as-a-service.html#tk.rss_all + +作者:[Linda Musthaler][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/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/10/firewall_network-security_lock_padlock_cyber-security-100776989-large.jpg +[2]: https://www.networkworld.com/article/3236448/lan-wan/what-to-consider-when-deploying-a-next-generation-firewall.html +[3]: https://www.networkworld.com/newsletters/signup.html +[4]: https://www.metanetworks.com/ +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr +[6]: https://www.networkworld.com/article/3273439/review-icinga-enterprise-grade-open-source-network-monitoring-that-scales.html?nsdr=true#nww-fsb +[7]: https://www.networkworld.com/article/3304307/nagios-core-monitoring-software-lots-of-plugins-steep-learning-curve.html +[8]: https://www.networkworld.com/article/3269279/review-observium-open-source-network-monitoring-won-t-run-on-windows-but-has-a-great-user-interface.html?nsdr=true#nww-fsb +[9]: https://www.networkworld.com/article/3304253/zabbix-delivers-effective-no-frills-network-monitoring.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md b/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md new file mode 100644 index 0000000000..8177390648 --- /dev/null +++ b/sources/tech/20190401 Top Ten Reasons to Think Outside the Router -2- Simplify and Consolidate the WAN Edge.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Ten Reasons to Think Outside the Router #2: Simplify and Consolidate the WAN Edge) +[#]: via: (https://www.networkworld.com/article/3384928/top-ten-reasons-to-think-outside-the-router-2-simplify-and-consolidate-the-wan-edge.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Top Ten Reasons to Think Outside the Router #2: Simplify and Consolidate the WAN Edge +====== + +![istock][1] + +We’re now near reaching the end of our homage to the iconic David Letterman Top Ten List segment from his former Late Show, as [Silver Peak][2] counts down the *Top Ten Reasons to Think Outside the Router. *Click for the [#3][3], [#4][4], [#5][5], [#6][6], [#7][7], [#8][8], [#9][9] and [#10][10] reasons to retire traditional branch routers. + +_The #2 reason it’s time to retire branch routers: conventional router-centric WAN architectures are rigid and complex to manage!_ + +### **Challenges of conventional WAN edge architecture** + +A conventional WAN edge architecture consists of a disparate array of devices, including routers, firewalls, WAN optimization appliances, wireless controllers and so on. This architecture was born in the era when applications were hosted exclusively in the data center. With this model, deploying new applications or provisioning new policies or making policy changes has become an arduous and time-consuming task. Configuration, deployment and management requires specialized on-premise IT expertise to manually program and configure each device with its own management interface, often using an arcane CLI. This process has hit the wall in the cloud era proving too slow, complex, error-prone, costly and inefficient. + +As cloud-first enterprises increasingly migrate applications and infrastructure to the cloud, the traditional WAN architecture is no longer efficient. IT is now faced with a new set of challenges when it comes to connecting users securely and directly to the applications that run their businesses: + + * How do you manage and consistently apply QoS and security policies across the distributed enterprise? + * How do you intelligently automate traffic steering across multiple WAN transport services based on application type and unique requirements? + * How do you deliver the highest quality of experiences to users when running applications over broadband, especially voice and video? + * How do you quickly respond to continuously changing business requirements? + + + +These are just some of the new challenges facing IT teams in the cloud era. To be successful, enterprises will need to shift toward a business-first networking model where top-down business intent drives how the network behaves. And they would be well served to deploy a business-driven unified [SD-WAN][11] edge platform to transform their networks from a business constraint to a business accelerant. + +### **Shifting toward a business-driven WAN edge platform** + +A business-driven WAN edge platform is designed to enable enterprises to realize the full transformation promise of the cloud. It is a model where top-down business intent is the driver, not bottoms-up technology constraints. It’s outcome oriented, utilizing automation, artificial intelligence (AI) and machine learning to get smarter every day. Through this continuous adaptation, and the ability to improve the performance of underlying transport and applications, it delivers the highest quality of experience to end users. This is in stark contrast to the router-centric model where application policies must be shoe-horned to fit within the constraints of the network. A business-driven, top-down approach continuously stays in compliance with business intent and centrally defined security policies. + +### **A unified platform for simplifying and consolidating the WAN Edge** + +Achieving a business-driven architecture requires a unified platform, designed from the ground up as one system, uniting [SD-WAN][12], [firewall][13], [segmentation][14], [routing][15], [WAN optimization][16], application visibility and control in a single-platform. Furthermore, it requires [centralized orchestration][17] with complete observability of the entire wide area network through a single pane of glass. + +The use case “[Simplifying WAN Architecture][18]” describes in detail key capabilities of the Silver Peak [Unity EdgeConnect™][19] SD-WAN edge platform. It illustrates how EdgeConnect enables enterprises to simplify branch office WAN edge infrastructure and streamline deployment, configuration and ongoing management. + +![][20] + +### **Business and IT outcomes of a business-driven SD-WAN** + + * Accelerates deployment, leveraging consistent hardware, software, cloud delivery models + * Saves up to 40 percent on hardware, software, installation, management and maintenance costs when replacing traditional routers + * Protects existing investment in security through simplified service chaining with our broadest ecosystem partners: [Check Point][21], [Forcepoint][22], [McAfee][23], [OPAQ][24], [Palo Alto Networks][25], [Symantec][26] and [Zscaler][27]. + * Reduces foot print by 75 percent as it unifies network functions into a single platform + * Saves more than 50 percent on WAN optimization costs by selectively applying it when and where is needed on an application-by-application basis + * Accelerates time-to-resolution of application or network performance bottlenecks from days to minutes with simple, visual application and WAN analytics + + + +Calculate your [ROI][28] today and learn why the time is now to [think outside the router][29] and deploy the business-driven Silver Peak EdgeConnect SD-WAN edge platform! + +![][30] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384928/top-ten-reasons-to-think-outside-the-router-2-simplify-and-consolidate-the-wan-edge.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/silverpeak_main-100792490-large.jpg +[2]: https://www.silver-peak.com/why-silver-peak +[3]: http://blog.silver-peak.com/think-outside-the-router-reason-3-mpls-contract-renewal +[4]: http://blog.silver-peak.com/top-ten-reasons-to-think-outside-the-router-4-broadband-is-used-only-for-failover +[5]: http://blog.silver-peak.com/think-outside-the-router-reason-5-manual-cli-based-configuration-and-management +[6]: http://blog.silver-peak.com/https-blog-silver-peak-com-think-outside-the-router-reason-6 +[7]: http://blog.silver-peak.com/think-outside-the-router-reason-7-exorbitant-router-support-and-maintenance-costs +[8]: http://blog.silver-peak.com/think-outside-the-router-reason-8-garbled-voip-pixelated-video +[9]: http://blog.silver-peak.com/think-outside-router-reason-9-sub-par-saas-performance +[10]: http://blog.silver-peak.com/think-outside-router-reason-10-its-getting-cloudy +[11]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[12]: https://www.silver-peak.com/sd-wan +[13]: https://www.silver-peak.com/products/unity-edge-connect/orchestrated-security-policies +[14]: https://www.silver-peak.com/resource-center/centrally-orchestrated-end-end-segmentation +[15]: https://www.silver-peak.com/products/unity-edge-connect/bgp-routing +[16]: https://www.silver-peak.com/products/unity-boost +[17]: https://www.silver-peak.com/products/unity-orchestrator +[18]: https://www.silver-peak.com/use-cases/simplifying-wan-architecture +[19]: https://www.silver-peak.com/products/unity-edge-connect +[20]: https://images.idgesg.net/images/article/2019/04/sp_linkthrough-copy-100792505-large.jpg +[21]: https://www.silver-peak.com/resource-center/check-point-silver-peak-securing-internet-sd-wan +[22]: https://www.silver-peak.com/company/tech-partners/forcepoint +[23]: https://www.silver-peak.com/company/tech-partners/mcafee +[24]: https://www.silver-peak.com/company/tech-partners/opaq-networks +[25]: https://www.silver-peak.com/resource-center/palo-alto-networks-and-silver-peak +[26]: https://www.silver-peak.com/company/tech-partners/symantec +[27]: https://www.silver-peak.com/resource-center/zscaler-and-silver-peak-solution-brief +[28]: https://www.silver-peak.com/sd-wan-interactive-roi-calculator +[29]: https://www.silver-peak.com/think-outside-router +[30]: https://images.idgesg.net/images/article/2019/04/roi-100792506-large.jpg diff --git a/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md b/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md new file mode 100644 index 0000000000..38cbc70e94 --- /dev/null +++ b/sources/tech/20190402 3 Essentials for Achieving Resiliency at the Edge.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Essentials for Achieving Resiliency at the Edge) +[#]: via: (https://www.networkworld.com/article/3386438/3-essentials-for-achieving-resiliency-at-the-edge.html#tk.rss_all) +[#]: author: (Anne Taylor https://www.networkworld.com/author/Anne-Taylor/) + +3 Essentials for Achieving Resiliency at the Edge +====== + +### Edge computing requires different thinking and management to ensure the always-on availability that users have come to demand. + +![iStock][1] + +> “The IT industry has done a good job of making robust data centers that are highly manageable, highly secure, with redundant systems,” [says Kevin Brown][2], SVP Innovation and CTO for Schneider Electric’s Secure Power Division. + +However, he continues, companies then connect these data centers to messy edge closets and server rooms, which over time have become “micro mission-critical data centers” in their own right — making system availability vital. If not designed and managed correctly, the situation can be disastrous if users cannot connect to business-critical applications. + +To avoid unacceptable downtime, companies should incorporate three essential ingredients into their edge computing deployments: remote management, physical security, and rapid deployments. + +**Remote management** + +Depending on the company’s size, staff could be managing several — or many multiple — edge sites. Not only is this time consuming and costly, it’s also complex, especially if protocols differ from site to site. + +While some organizations might deploy traditional remote monitoring technology to manage these sites, it’s important to note these tools: don’t provide real-time status updates; are largely reactionary rather than proactive; and are sometimes limited in terms of data output. + +Coupled with the need to overcome these limitations, the economics for managing edge sites necessitate that organizations consider a digital, or cloud-based, solution. In addition to cost savings, these platforms provide: + + * Simplification in monitoring across edge sites + * Real-time visibility, right down to any device on the network + * Predictive analytics, including data-driven intelligence and recommendations to ensure proactive service delivery + + + +**Physical security** + +Small, local edge computing sites are often situated within larger corporate or wide-open spaces, sometimes in highly accessible, shared offices and public areas. And sometimes they’re set up on-the-fly for a time-sensitive project. + +However, when there is no dedicated location and open racks are unsecured, the risks of malicious and accidental incidents escalate. + +To prevent unauthorized access to IT equipment at edge computing sites, proper physical security is critical and requires: + + * Physical space monitoring, with environmental sensors for temperature and humidity + * Access control, with biometric sensors as an option + * Audio and video surveillance and monitoring with recording + * If possible, install IT equipment within a secure enclosure + + + +**Rapid deployments** + +The [benefits of edge computing][3] are significant, especially the ability to bring bandwidth-intensive computing closer to the user, which leads to faster speed to market and greater productivity. + +Create a holistic plan that will enable the company to quickly deploy edge sites, while ensuring resiliency and reliability. That means having a standardized, repeatable process including: + + * Pre-configured, integrated equipment that combines server, storage, networking, and software in a single enclosure — a prefabricated micro data center, if you will + * Designs that specify supporting racks, UPSs, PDUs, cable management, airflow practices, and cooling systems + + + +These best practices as well as a balanced, systematic approach to edge computing deployments will ensure the always-on availability that today’s employees and users have come to expect. + +Learn how to enable resiliency within your edge computing deployment at [APC.com][4]. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386438/3-essentials-for-achieving-resiliency-at-the-edge.html#tk.rss_all + +作者:[Anne Taylor][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/Anne-Taylor/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-900882382-100792635-large.jpg +[2]: https://www.youtube.com/watch?v=IfsCTFSH6Jc +[3]: https://www.networkworld.com/article/3342455/how-edge-computing-will-bring-business-to-the-next-level.html +[4]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp diff --git a/sources/tech/20190402 Automate password resets with PWM.md b/sources/tech/20190402 Automate password resets with PWM.md new file mode 100644 index 0000000000..0bc7012c21 --- /dev/null +++ b/sources/tech/20190402 Automate password resets with PWM.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate password resets with PWM) +[#]: via: (https://opensource.com/article/19/4/automate-password-resets-pwm) +[#]: author: (James Mawson https://opensource.com/users/dxmjames) + +Automate password resets with PWM +====== +PWM puts responsibility for password resets in users' hands, freeing IT +for more pressing tasks. +![Password][1] + +One of the things that can be "death by a thousand cuts" for any IT team's sanity and patience is constantly being asked to reset passwords. + +The best way we've found to handle this is to ditch your hashing algorithms and store your passwords in plaintext so that your users can retrieve them at any time. + +Ha! I am, of course, kidding. That's a terrible idea. + +When your users forget their passwords, you'll still need to reset them. But is there a way to break free from the monotonous, repetitive task of doing it manually? + +### PWM puts password resets in users' hands + +[PWM][2] is an open source ([GPLv2][3]) [JavaServer Pages][4] application that provides a webpage where users can submit their own password resets. If certain conditions are met—which you can configure—PWM will send a password reset instruction to whichever directory service you've connected it to. + +![PWM password reset screen][5] + +One thing that's great about PWM is it's very easy to add it to an existing network. If you're largely happy with what you've already built—just sick of processing password requests manually—you can just throw PWM into the mix. + +PWM works with any implementation of [LDAP][6] and written to run on [Apache Tomcat][7]. Once you get it up and running, you can administer it through a browser-based dashboard. + +### Why PWM is better than Microsoft SSPR + +As much as our team prefers open source, we still have to deal with Windows networks. Of course, Microsoft has its own password-reset tool, called Self Service Password Reset (SSPR). But I prefer PWM, and not just because of a general preference for open source. I believe PWM is better for my use case for the following reasons: + + * **SSPR has a very complex licensing system**. You need different products depending on what servers you're running and whose metal they're running on. This is a constraint on your flexibility and a whole extra pain in the neck when it's time to move to new architecture. For [the busy admin who wants to go home on time][8], it's extra bureaucracy to get the purchase approved. PWM just works on what it's configured to work on at no cost. + + * **PWM is not just for Windows**. It works with any kind of LDAP server. So, it's one less part you need to worry about if you ever stop using Windows for a certain role. It also means that, once you've gotten the hang of it, you have something in your bag of tricks that you can use in many different environments. + + * **PWM is easy to install**. If you know how to install Linux as a virtual machine—and, let's face it, if you're running a network, you probably do—then you're already most of the way there. + + + + +PWM can run on Windows, but we prefer to include it in a Windows network by running it on a Linux virtual machine, [for example, Ubuntu Server 16.04][9]. + +### Risks and rewards of automation + +Password resets are an attack vector, so be thoughtful about where and how you use PWM. Automating your password resets can mean an attacker is potentially just one unencrypted email connection away from resetting a password. + +To some extent, automating your password resets trades a bit of security for some convenience. So maybe this isn't the right way to handle C-suite user accounts that approve large payments. + +On the other hand, manual resets are not 100% secure either—they can be gamed with targeted attacks like spear phishing and social engineering. It's much easier to fall for these scams if your team gets frequent reset requests and is sick of dealing with them. You may benefit from automating the bulk of lower-risk requests so you can focus on protecting the higher-risk accounts manually; this is possible given the time you can save using PWM. + +Some of the risks associated with shifting resets to users can be mitigated with PWM's built-in features, such as insisting users verify their password reset request by email or SMS. You can also make PWM accessible only on the intranet. + +![PWM configuration options][10] + +PWM doesn't store any passwords, so that's one less headache. It does, however, store answers to users' secret questions in a MySQL database that can be configured to be stored locally or on a separate server, depending on your preference. + +There are a ton of ways to make PWM look and feel like a polished part of your team's infrastructure. With a little bit of CSS know-how, you can customize the user interface for your business' branding. There are also more options for implementation than you can shake a stick at. + +### Wrapping up + +PWM is a great open source project, it's actively developed, and it has a helpful online community. It's a great alternative to Microsoft's Azure SSPR solution for small to midsized businesses that have to keep a tight grip on the purse strings, and it slots in neatly to any existing Active Directory infrastructure. It also saves IT's time by outsourcing this mundane task to users. + +I advise every network admin to dive in and have a look at the cool stuff PWM offers. Check out the [getting started resources][11] and reach out to the community if you have any questions. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/automate-password-resets-pwm + +作者:[James Mawson][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/dxmjames +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password) +[2]: https://github.com/pwm-project/pwm +[3]: https://github.com/pwm-project/pwm/blob/master/LICENSE +[4]: https://www.oracle.com/technetwork/java/index-jsp-138231.html +[5]: https://opensource.com/sites/default/files/uploads/pwm_password-reset.png (PWM password reset screen) +[6]: https://opensource.com/business/14/5/top-4-open-source-ldap-implementations +[7]: http://tomcat.apache.org/ +[8]: https://opensource.com/article/18/7/tools-admin +[9]: https://blog.dxmtechsupport.com.au/adding-pwm-password-reset-tool-to-windows-network/ +[10]: https://opensource.com/sites/default/files/uploads/pwm-configuration.png (PWM configuration options) +[11]: https://github.com/pwm-project/pwm#links diff --git a/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md b/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md new file mode 100644 index 0000000000..686a2be6a4 --- /dev/null +++ b/sources/tech/20190402 Intel-s Agilex FPGA family targets data-intensive workloads.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel's Agilex FPGA family targets data-intensive workloads) +[#]: via: (https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html#tk.rss_all) +[#]: author: (Marc Ferranti https://www.networkworld.com) + +Intel's Agilex FPGA family targets data-intensive workloads +====== +Agilex processors are the first Intel FPGAs to use 10nm manufacturing, achieving a performance boost for AI, financial and IoT workloads +![Intel][1] + +After teasing out details about the technology for a year and half under the code name Falcon Mesa, Intel has unveiled the Agilex family of FPGAs, aimed at data-center and network applications that are processing increasing amounts of data for AI, financial, database and IoT workloads. + +The Agilex family, expected to start appearing in devices in the third quarter, is part of a new wave of more easily programmable FPGAs that is beginning to take an increasingly central place in computing as data centers are called on to handle an explosion of data. + +**Learn about edge networking** + + * [How edge networking and IoT will reshape data centers][2] + * [Edge computing best practices][3] + * [How edge computing can help secure the IoT][4] + + + +FPGAs, or field programmable gate arrays, are built around around a matrix of configurable logic blocks (CLBs) linked via programmable interconnects that can be programmed after manufacturing – and even reprogrammed after being deployed in devices – to run algorithms written for specific workloads. They can thus be more efficient on a performance-per-watt basis than general-purpose CPUs, even while driving higher performance. + +### Accelerated computing takes center stage + +CPUs can be packaged with FPGAs, offloading specific tasks to them and enhancing overall data-center and network efficiency. The concept, known as accelerated computing, is increasingly viewed by data-center and network managers as a cost-efficient way to handle increasing data and network traffic. + +"This data is creating what I call an innovation race across from the edge to the network to the cloud," said Dan McNamara, general manager of the Programmable Solutions Group (PSG) at Intel. "We believe that we’re in the largest adoption phase for FPGAs in our history." + +The Agilex family is the first line of FPGAs developed from the ground up in the wake of [Intel’s $16.7 billion 2015 acquisition of Altera.][5] It's the first FPGA line to be made with Intel's 10nm manufacturing process, which adds billions of transistors to the FPGAs compared to earlier generations. Along with Intel's second-generation HyperFlex architecture, it helps give Agilex 40 percent higher performance than the company's current high-end FPGA family, the Stratix 10 line, Intel says. + +HyperFlex architecture includes additional registers – places on a processor that temporarily hold data – called Hyper-Registers, located everywhere throughout the core fabric to enhance bandwidth as well as area and power efficiency. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][6] ]** + +### Memory coherency is key + +Agilex FPGAs are also the first processors to support [Compute Express Link (CXL), a high-speed interconnect][7] designed to maintain memory coherency among CPUs like Intel's second-generation Xeon Scalable processors and purpose-built accelerators like FPGAs and GPUs. It ensures that different processors don't clash when trying to write to the same memory space, essentially allowing CPUs and accelerators to share memory. + +"By having this CXL bus you can actually write applications that will use all the real memory so what that does is it simplifies the programming model in large memory workloads," said Patrick Moorhead, founder and principal at Moor Insights & Strategy. + +The ability to integrate FPGAs, other accelerators and CPUs is key to Intel's accelerated computing strategy for the data center. Intel calls it "any to any" integration. + +### 'Any-to-any' integration is crucial for the data center + +The Agilex family uses embedded multi-die interconnect bridge (EMIB) packaging technology to integrate, for example, Xeon Scalable CPUs or ASICs – special-function processors that are not reprogammable – alongside FPGA fabric. Intel last year bought eASIC, a maker of structured ASICs, which the company describes as an intermediary technology between FPGAs and ASICs. The idea is to deliver products that offer a mix of functionality to achieve optimal cost and performance efficiency for data-intensive workloads. + +Intel underscored the importance of processor integration for the data center by unveiling Agilex on Tuesday at its Data Centric Innovation Day in San Francisco, when it also discussed plans for its second generation Xeon Scalable line. + +Traditionally, FPGAs were mainly used in embedded devices, communications equipment and in hyperscale data centers, and not sold directly to enterprises. But several products based on Intel Stratix 10 and Arria 10 FPGAs are now being sold to enterprises, including in Dell EMC and Fujitsu off-the-shelf servers. + +Making FPGAs easier to program is key to making them more mainstream. "What's really, really important is the software story," said Intel's McNamara. "None of this really matters if we can't generate more users and make it easier to program FPGA's." + +Intel's Quartus Prime design tool will be available for Agilex hardware developers but the real breakthrough for FPGA software development will be Intel's OneAPI concept, announced in December. + +"OneAPI is is an effort by Intel to be able to have programmers write to OneAPI and OneAPI determines the best piece of silicon to run it on," Moorhead said. "I lovingly refer to it as the magic API; this is the big play I always thought Intel was gonna be working on ever since it bought Altera. The first thing I expect to happen are the big enterprise developers like SAP and Oracle to write to Agilex, then smaller ISVs, then custom enterprise applications." + +![][8] + +Intel plans three different product lines in the Agilex family – from low to high end, the F-, I- and M-series – aimed at different applications and processing requirements. The Agilex family, depending on the series, supports PCIe (peripheral component interconnect express) Gen 5, and different types of memory including DDR5 RAM, HBM (high-bandwidth memory) and Optane DC persistent memory. It will offer up to 112G bps transceiver data rates and a greater mix of arithmetic precision for AI, including bfloat16 number format. + +In addition to accelerating server-based workloads like AI, genomics, financial and database applications, FPGAs play an important part in networking. Their cost-per-watt efficiency makes them suitable for edge networks, IoT devices as well as deep packet inspection. In addition, they can be used in 5G base stations; as 5G standards evolve, they can be reprogrammed. Once 5G standards are hardened, the "any to any" integration will allow processing to be offloaded to special-purpose ASICs for ultimate cost efficiency. + +### Agilex will compete with Xylinx's ACAPs + +Agilex will likely vie with Xylinx's upcoming [Versal product family][9], due out in devices in the second half of the year. Xylinx competed for years with Altera in the FPGA market, and with Versal has introduced what it says is [a new product category, the Adaptive Compute Acceleration Platform (ACAP)][10]. Versal ACAPs will be made using TSMC's 7nm manufacturing process technology, though because Intel achieves high transistor density, the number of transistors offered by Agilex and Versal chips will likely be equivalent, noted Moorhead. + +Though Agilex and Versal differ in details, the essential pitch is similar: the programmable processors offer a wider variety of programming options than prior generations of FPGA, work with CPUs to accelerate data-intensive workloads, and offer memory coherence. Rather than CXL, though, the Versal family uses the cache coherent interconnect for accelerators (CCIX) interconnect fabric. + +Neither Intel or Xylinx for the moment have announced OEM support for Agilex or Versal products that will be sold to the enterprise, but that should change as the year progresses. + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html#tk.rss_all + +作者:[Marc Ferranti][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 +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/agilex-100792596-large.jpg +[2]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[3]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[4]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[5]: https://www.networkworld.com/article/2903454/intel-could-strengthen-its-server-product-stack-with-altera.html +[6]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[7]: https://www.networkworld.com/article/3359254/data-center-giants-announce-new-high-speed-interconnect.html +[8]: https://images.idgesg.net/images/article/2019/04/agilex-family-100792597-large.jpg +[9]: https://www.xilinx.com/news/press/2018/xilinx-unveils-versal-the-first-in-a-new-category-of-platforms-delivering-rapid-innovation-with-software-programmability-and-scalable-ai-inference.html +[10]: https://www.networkworld.com/article/3263436/fpga-maker-xilinx-aims-range-of-software-programmable-chips-at-data-centers.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190402 Manage your daily schedule with Git.md b/sources/tech/20190402 Manage your daily schedule with Git.md new file mode 100644 index 0000000000..8f5d7d89bb --- /dev/null +++ b/sources/tech/20190402 Manage your daily schedule with Git.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage your daily schedule with Git) +[#]: via: (https://opensource.com/article/19/4/calendar-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Manage your daily schedule with Git +====== +Treat time like source code and maintain your calendar with the help of +Git. +![website design image][1] + +[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. Today, we'll look at using Git to keep track of your calendar. + +### Keep track of your schedule with Git + +What if time itself was but source code that could be managed and version controlled? While proving or disproving such a theory is probably beyond the scope of this article, it happens that you can treat time like source code and manage your daily schedule with the help of Git. + +The reigning champion for calendaring is the [CalDAV][3] protocol, which drives popular open source calendaring applications like [NextCloud][4] as well as popular closed source ones. There's nothing wrong with CalDAV (commenters, take heed). But it's not for everyone, and besides there's nothing less inspiring than a mono-culture. + +Because I have no interest in becoming invested in largely GUI-dependent CalDAV clients (although if you're looking for a good terminal CalDAV viewer, see [khal][5]), I started investigating text-based alternatives. Text-based calendaring has all the usual benefits of working in [plaintext][6]. It's lightweight, it's highly portable, and as long as it's structured, it's easy to parse and beautify (whatever _beauty_ means to you). + +And best of all, it's exactly what Git was designed to manage. + +### Org mode not in a scary way + +If you don't impose structure on your plaintext, it quickly falls into a pandemonium of off-the-cuff thoughts and devil-may-care notation. Luckily, a markup syntax exists for calendaring, and it's contained in the venerable productivity Emacs mode, [Org mode][7] (which, admit it, you've been meaning to start using anyway). + +The amazing thing about Org mode that many people don't realize is [you don't need to know or even use Emacs][8] to take advantage of conventions established by Org mode. You get a lot of great features if you _do_ use Emacs, but if Emacs intimidates you, then you can implement a Git-based Org-mode calendaring system without so much as installing Emacs. + +The only part of Org mode that you need to know is its syntax. Org-mode syntax is low-maintenance and fairly intuitive. The biggest difference in calendaring with Org mode instead of a GUI calendaring app is the workflow: instead of going to a calendar and finding the day you want to schedule a task, you create a list of tasks and then assign each one a day and time. + +Lists in Org mode use asterisks (*) as bullets. Here's my gaming task list: **** + +``` +* Gaming +** Build Stardrifter character +** Read Stardrifter rules +** Stardrifter playtest + +** Blue Planet @ Mike's + +** Run Rappan Athuk +*** Purchase hard copy +*** Skim Rappan Athuk +*** Build Rappan Athuk maps in maptool +*** Sort Rappan Athuk tokens +``` + +If you're familiar with [CommonMark][9] or Markdown, you'll notice that instead of using whitespace to create a subtask, Org mode favors the more explicit use of additional bullets. Whatever your background with lists, this is an intuitive and easy way to build a list, and it obviously is not inherently tied to Emacs (although using Emacs provides you with shortcuts so you can rearrange your list quickly). + +To turn your list into scheduled tasks or events in a calendar, go back through and add the keywords **SCHEDULED** and, optionally, **:CATEGORY:**. + +``` +* Gaming +:CATEGORY: Game +** Build Stardrifter character +SCHEDULED: <2019-03-22 18:00-19:00> +** Read Stardrifter rules +SCHEDULED: <2019-03-22 19:00-21:00> +** Stardrifter playtest +SCHEDULED: <2019-03-25 0900-1300> +** Blue Planet @ Mike's +SCHEDULED: <2019-03-18 18:00-23:00 +1w> + +and so on... +``` + +The **SCHEDULED** keyword marks the entry as an event that you expect to be notified about and the optional **:CATEGORY:** keyword is an arbitrary tagging system for your own use (and in Emacs, you can color-code entries according to category). + +For a repeating event, you can use notation such as **+1w** to create a weekly event or **+2w** for a fortnightly event, and so on. + +All the fancy markup available for Org mode is [documented][10], so don't hesitate to find more tricks to help it fit your needs. + +### Put it into Git + +Without Git, your Org-mode appointments are just a file on your local machine. It's the 21st century, though, so you at least need your calendar on your mobile phone, if not on all of your personal computers. You can use Git to publish your calendar for yourself and others. + +First, create a directory for your **.org** files. I store mine in **~/cal**. + +``` +$ mkdir ~/cal +``` + +Change into your directory and make it a Git repository: + +``` +$ cd cal +$ git init +``` + +Move your **.org** file to your local Git repo. In practice, I maintain one **.org** file per category. + +``` +$ mv ~/*.org ~/cal +$ ls +Game.org Meal.org Seth.org Work.org +``` + +Stage and commit your files: + +``` +$ git add *.org +$ git commit -m 'cal init' +``` + +### Create a Git remote + +To make your calendar available from anywhere, you must have a Git repository on the internet. Your calendar is plaintext, so any Git repository will do. You can put your calendar on [GitLab][11] or any other public Git hosting service (even proprietary ones), and as long as your host allows it, you can even mark the repository as private. If you don't want to post your calendar to a server you don't control, it's easy to host a Git repository yourself, either using a bare repository for a single user or using a frontend service like [Gitolite][12] or [Gitea][13]. + +In the interest of simplicity, I'll assume a self-hosted bare Git repository. You can create a bare remote repository on any server you have SSH access to with one Git command: +``` +$ ssh -p 22122 [seth@example.com][14] +[remote]$ mkdir cal.git +[remote]$ cd cal.git +[remote]$ git init --bare +[remote]$ exit +``` + +This bare repository can serve as your calendar's home on the internet. + +Set it as the remote source for your local (on your computer, not your server) Git repository: + +``` +$ git remote add origin seth@example.com:/home/seth/cal.git +``` + +And then push your calendar data to the server: + +``` +$ git push -u origin HEAD +``` + +With your calendar in a Git repository, it's available to you on any device running Git. That means you can make updates and changes to your schedule and push your changes upstream so it updates everywhere. + +I use this method to keep my calendar in sync between my work laptop and my home workstation. Since I use Emacs every day for most of the day, being able to view and edit my calendar in Emacs is a major convenience. The same is true for most people with a mobile device, so the next step is to set up an Org-mode calendaring system on a mobile. + +### Mobile Git + +Since your calendar data is in plaintext, strictly speaking, you can "use" it on any device that can read a text file. That's part of the beauty of this system; you're never without, at the very least, your raw data. But to integrate your calendar on a mobile device the way you'd expect a modern calendar to work, you need two components: a mobile Git client and a mobile Org-mode viewer. + +#### Git client for mobile + +[MGit][15] is a good Git client for Android. There are Git clients for iOS, as well. + +Once you've installed MGit (or a similar Git client), you must clone your calendar repository so your phone has a copy. To access your server from your mobile device, you must set up an SSH key for authentication. MGit can generate and store a key for you, which you must add to your server's **~/.ssh/authorized_keys** file or to your SSH keys in the settings of your hosted Git account. + +You must do this manually. MGit does not have an interface to log into your server or hosted Git account. If you do not do this, your mobile device cannot access your server to access your calendar data. + +I did it by copying the key file I generated in MGit to my laptop over [KDE Connect][16] (but you can do the same over Bluetooth, or with an SD card reader, or a USB cable, depending on your preferred method of accessing data on your phone). I copied the key (a file called **calkey** to my server with this command: + +``` +$ cat calkey | ssh seth@example.com "cat >> /home/seth/.ssh/authorized_keys" +``` + +You may have a different way of doing it, but if you ever set your server up for passwordless login, this is exactly the same process. If you're using a hosted Git service like GitLab, you must copy and paste the contents of your key file into your user account's SSH Key panel. + +![Adding key file data to GitLab][17] + +Once that's done, your mobile device can authorize to your server, but it still needs to know where to go to find your calendar data. Different apps may use different notation, but MGit uses plain old Git-over-SSH. That means if you're using a non-standard SSH port, you must specify the SSH port to use: + +``` +$ git clone ssh://seth@example.com:22122//home/seth/git/cal.git +``` + +![Specifying SSH port in MGit][18] + +If you use a different app, it may use a different syntax that allows you to provide a port in a special field or drop the **ssh://** prefix. Refer to the app documentation if you experience issues. + +Clone the repository to your phone. + +![Cloned repositories][19] + +Few Git apps are set to automatically update the repository. There are a few apps you can use to automate pulls, or you can set up Git hooks to push updates from your server—but I won't get into that here. For now, after you make an update to your calendar, be sure to pull new changes manually in MGit (or if you change events on your phone, push the changes to your server). + +![MGit push/pull settings][20] + +#### Mobile calendar + +There are a few different apps that provide frontends for Org mode on a mobile device. [Orgzly][21] is a great open source Android app that provides an interface for Org mode's greatest features, from the Agenda mode to the TODO lists. Install and launch it. + +From the Main menu, choose Setting Sync Repositories and select the directory containing your calendar files (i.e., the Git repository you cloned from your server). + +Give Orgzly a moment to import the data, then use Orgzly's [hamburger][22] menu to select the Agenda view. + +![Orgzly's agenda view][23] + +In Orgzly's Settings Reminders menu, you can choose which event types trigger a notification on your phone. You can get notifications for **SCHEDULED** tasks, **DEADLINE** tasks, or anything with an event time assigned to it. If you use your phone as your taskmaster, you'll never miss an event with Org mode and Orgzly. + +![Orgzly notification][24] + +Orgzly isn't just a parser. You can edit and update events, and even mark events **DONE**. + +![Orgzly to-do list][25] + +### Designed for and by you + +The important thing to understand about using Org mode and Git is that both applications are highly flexible, and it's expected that you'll customize how and what they do so they will adapt to your needs. If something in this article is an affront to how you organize your life or manage your weekly schedule, but you like other parts of what this proposal offers, then throw out the part you don't like. You can use Org mode in Emacs if you want, or you can just use it as calendar markup. You can set your phone to pull Git data right off your computer at the end of the day instead of a server on the internet, or you can configure your computer to sync calendars whenever your phone is plugged in, or you can manage it daily as you load up your phone with all the stuff you need for the workday. It's up to you, and that's the most significant thing about Git, about Org mode, and about open source. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/calendar-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/web-design-monitor-website.png?itok=yUK7_qR0 (website design image) +[2]: https://git-scm.com/ +[3]: https://tools.ietf.org/html/rfc4791 +[4]: http://nextcloud.com +[5]: https://github.com/pimutils/khal +[6]: https://plaintextproject.online/ +[7]: https://orgmode.org +[8]: https://opensource.com/article/19/1/productivity-tool-org-mode +[9]: https://commonmark.org/ +[10]: https://orgmode.org/manual/ +[11]: http://gitlab.com +[12]: http://gitolite.com/gitolite/index.html +[13]: https://gitea.io/en-us/ +[14]: mailto:seth@example.com +[15]: https://f-droid.org/en/packages/com.manichord.mgit +[16]: https://community.kde.org/KDEConnect +[17]: https://opensource.com/sites/default/files/uploads/gitlab-add-key.jpg (Adding key file data to GitLab) +[18]: https://opensource.com/sites/default/files/uploads/mgit-0.jpg (Specifying SSH port in MGit) +[19]: https://opensource.com/sites/default/files/uploads/mgit-1.jpg (Cloned repositories) +[20]: https://opensource.com/sites/default/files/uploads/mgit-2.jpg (MGit push/pull settings) +[21]: https://f-droid.org/en/packages/com.orgzly/ +[22]: https://en.wikipedia.org/wiki/Hamburger_button +[23]: https://opensource.com/sites/default/files/uploads/orgzly-agenda.jpg (Orgzly's agenda view) +[24]: https://opensource.com/sites/default/files/uploads/orgzly-cal-notify.jpg (Orgzly notification) +[25]: https://opensource.com/sites/default/files/uploads/orgzly-cal-todo.jpg (Orgzly to-do list) diff --git a/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md b/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md new file mode 100644 index 0000000000..29a73998d7 --- /dev/null +++ b/sources/tech/20190402 When Wi-Fi is mission-critical, a mixed-channel architecture is the best option.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (When Wi-Fi is mission-critical, a mixed-channel architecture is the best option) +[#]: via: (https://www.networkworld.com/article/3386376/when-wi-fi-is-mission-critical-a-mixed-channel-architecture-is-the-best-option.html#tk.rss_all) +[#]: author: (Zeus Kerravala https://www.networkworld.com/author/Zeus-Kerravala/) + +When Wi-Fi is mission-critical, a mixed-channel architecture is the best option +====== + +### Multi-channel is the norm for Wi-Fi today, but it’s not always the best choice. Single-channel and hybrid APs offer compelling alternatives when reliable Wi-Fi is a must. + +![Getty Images][1] + +I’ve worked with a number of companies that have implemented digital projects only to see them fail. The ideation was correct, the implementation was sound, and the market opportunity was there. The weak link? The Wi-Fi network. + +For example, a large hospital wanted to improve clinician response times to patient alarms by having telemetry information sent to mobile devices. Without the system, the only way a nurse would know about a patient alarm is from an audible alert. And with all the background noise, it’s often tough to discern where noises are coming from. The problem was the Wi-Fi network in the hospital had not been upgraded in years and caused messages to be significantly delayed in their delivery, often taking four to five minutes to deliver. The long delivery times caused a lack of confidence in the system, so many clinicians stopped using it and went back to manual alerting. As a result, the project was considered a failure. + +I’ve seen similar examples in manufacturing, K-12 education, entertainment, and other industries. Businesses are competing on the basis of customer experience, and that’s driven from the ever-expanding, ubiquitous wireless edge. Great Wi-Fi doesn’t necessarily mean market leadership, but bad Wi-Fi will have a negative impact on customers and employees. And in today’s competitive climate, that’s a recipe for disaster. + +**[ Read also:[Wi-Fi site-survey tips: How to avoid interference, dead spots][2] ]** + +## Wi-Fi performance historically inconsistent + +The problem with Wi-Fi is that it’s inherently flaky. I’m sure everyone reading this has experienced the typical flaws with failed downloads, dropped connections, inconsistent performance, and lengthy wait times to connect to public hot spots. + +Picture sitting in a conference prior to a keynote address and being able to tweet, send email, browse the web, and do other things with no problem. Then the keynote speaker comes on stage and the entire audiences start snapping pics, uploading those pictures, and streaming things – and the Wi-Fi stops working. I find this to be the norm more than the exception, underscoring the need for [no-compromise Wi-Fi][3]. + +The question for network professionals is how to get to a place where the Wi-Fi is rock solid 100% of the time. Some say that just beefing up the existing network will do that, and it might, but in some cases, the type of Wi-Fi might not be appropriate. + +The most commonly deployed type of Wi-Fi is multi-channel, also known as micro-cell, where each client connects to the access point (AP) using a radio channel. A high-quality experience is based on two things: good signal strength and minimal interference. Several things can cause interference, such as APs being too close, layout issues, or interference from other equipment. To minimize interference, businesses invest a significant amount of time and money in [site surveys to plan the optimal channel map][2], but even with that’s done well, Wi-Fi glitches can still happen. + +**[[Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][4] ]** + +## Multi-channel Wi-Fi not always the best choice + +For many carpeted offices, multi-channel Wi-Fi is likely to be solid, but there are some environments where external circumstances will impact performance. A good example of this is a multi-tenant building in which there are multiple Wi-Fi networks transmitting on the same channel and interfering with one another. Another example is a hospital where there are many campus workers moving between APs. The client will also try to connect to the best AP, causing the client to continually disconnect and reconnect resulting in dropped sessions. Then there are environments such as schools, airports, and conference facilities where there is a high number of transient devices and multi-channel can struggle to keep up. + +## Single channel Wi-Fi offers better reliability but with a performance hit + +What’s a network manager to do? Is inconsistent Wi-Fi just a fait accompli? Multi-channel is the norm, but it isn’t designed for dynamic physical environments or those where reliable connectivity is a must. + +Several years ago an alternative architecture was proposed that would solve these problems. As the name suggests, “single channel” Wi-Fi uses a single radio channel for all APs in the network. Think of this as being a single Wi-Fi fabric that operates on one channel. With this architecture, the placement of APs is irrelevant because they all utilize the same channel, so they won’t interfere with one another. This has an obvious simplicity advantage, such as if coverage is poor, there’s no reason to do another expensive site survey. Instead, just drop in APs where they are needed. + +One of the disadvantages of single-channel is that aggregate network throughput was lower than multi-channel because only one channel can be used. This might be fine in environments where reliability trumps performance, but many organizations want both. + +## Hybrid APs offer the best of both worlds + +There has been recent innovation from the manufacturers of single-channel systems that mix channel architectures, creating a “best of both worlds” deployment that offers the throughput of multi-channel with the reliability of single-channel. For example, Allied Telesis offers Hybrid APs that can operate in multi-channel and single-channel mode simultaneously. That means some web clients can be assigned to the multi-channel to have maximum throughput, while others can use single-channel for seamless roaming experience. + +A practical use-case of such a mix might be a logistics facility where the office staff uses multi-channel, but the fork-lift operators use single-channel for continuous connectivity as they move throughout the warehouse. + +Wi-Fi was once a network of convenience, but now it is perhaps the most mission-critical of all networks. A traditional multi-channel system might work, but due diligence should be done to see how it functions under a heavy load. IT leaders need to understand how important Wi-Fi is to digital transformation initiatives and do the proper testing to ensure it’s not the weak link in the infrastructure chain and choose the best technology for today’s environment. + +**Reviews: 4 free, open-source network monitoring tools:** + + * [Icinga: Enterprise-grade, open-source network-monitoring that scales][5] + * [Nagios Core: Network-monitoring software with lots of plugins, steep learning curve][6] + * [Observium open-source network monitoring tool: Won’t run on Windows but has a great user interface][7] + * [Zabbix delivers effective no-frills network monitoring][8] + + + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386376/when-wi-fi-is-mission-critical-a-mixed-channel-architecture-is-the-best-option.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/09/tablet_graph_wifi_analytics-100771638-large.jpg +[2]: https://www.networkworld.com/article/3315269/wi-fi-site-survey-tips-how-to-avoid-interference-dead-spots.html +[3]: https://www.alliedtelesis.com/blog/no-compromise-wi-fi +[4]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture +[5]: https://www.networkworld.com/article/3273439/review-icinga-enterprise-grade-open-source-network-monitoring-that-scales.html?nsdr=true#nww-fsb +[6]: https://www.networkworld.com/article/3304307/nagios-core-monitoring-software-lots-of-plugins-steep-learning-curve.html +[7]: https://www.networkworld.com/article/3269279/review-observium-open-source-network-monitoring-won-t-run-on-windows-but-has-a-great-user-interface.html?nsdr=true#nww-fsb +[8]: https://www.networkworld.com/article/3304253/zabbix-delivers-effective-no-frills-network-monitoring.html +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190402 Zero-trust- microsegmentation networking.md b/sources/tech/20190402 Zero-trust- microsegmentation networking.md new file mode 100644 index 0000000000..864bd8eea4 --- /dev/null +++ b/sources/tech/20190402 Zero-trust- microsegmentation networking.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zero-trust: microsegmentation networking) +[#]: via: (https://www.networkworld.com/article/3384748/zero-trust-microsegmentation-networking.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Zero-trust: microsegmentation networking +====== + +### Microsegmentation gives administrators the control to set granular policies in order to protect the application environment. + +![Aaron Burson \(CC0\)][1] + +The transformation to the digital age has introduced significant changes to the cloud and data center environments. This has compelled the organizations to innovate more quickly than ever before. This, however, brings with it both – the advantages and disadvantages. + +The network and security need to keep up with this rapid pace of change. If you cannot match with the speed of the [digital age,][2] then ultimately bad actors will become a hazard. Therefore, the organizations must move to a [zero-trust environment][3]: default deny, with least privilege access. In today’s evolving digital world this is the primary key to success. + +Ideally, a comprehensive solution must provide protection across all platforms including legacy servers, VMs, services in public clouds, on-premise, off-premise, hosted, managed or self-managed. We are going to stay hybrid for a long time, therefore we need to equip our architecture with [zero-trust][4]. + +**[ Don’t miss[customer reviews of top remote access tools][5] and see [the most powerful IoT companies][6] . | Get daily insights by [signing up for Network World newsletters][7]. ]** + +We need to have the ability to support all of these hybrid environments that can analyze at a process, flow data, and infrastructure level. As a matter of fact, there is never just one element to analyze within a network in order to create an effective security posture. + +To adequately secure such an environment requires a solution with key components: such as appropriate visibility, microsegmentation, and breach detection. Let's learn more about one of these primary elements: zero-trust microsegmentation networking. + +There are a variety of microsegmentation vendors, all with competing platforms. We have, for example, SDN-based, container-centric, network-based appliance be it physical or virtual, and container-centric to name just a few. + +## What is microsegmentation? + +Microsegmentation is the ability to put a wrapper around the access control for each component of an application. The traditional days are gone where we can just impose a block on source/destination/port numbers or higher up in the stack with protocols, such as HTTP or HTTPS. + +As the communication patterns become more complex, thereby isolating the communication flows between entities, hence following the microsegmentation principles has become a necessity. + +## Why is microsegmentation important? + +Microsegmentation gives administrators the control to set granular policies in order to protect the application environment. It defines the rules and policies as to how an application can communicate within its tier. The policies are granular (a lot more granular than what we had before), which restrict the communication to hosts that are only allowed to communicate. + +Eventually, this reduces the available attack surface and completely locks down the ability for the bad actors to move laterally within the application infrastructure. Why? Because it governs the application’s activity at a granular level, thereby improving the entire security posture. The traditional zone-based networking no longer cuts it in today’s [digital world][8]. + +## General networking + +Let's start with the basics. We all know that with security, you are only as strong as your weakest link. As a result, enterprises have begun to further segment networks into microsegments. Some call them nanosegments. + +But first, let’s recap on what we actually started within the initial stage- nothing! We had IP addresses that were used for connectivity but unfortunately, they have no built-in authentication mechanism. Why? Because it wasn't a requirement back then. + +Network connectivity based on network routing protocols was primarily used for sharing resources. A printer, 30 years ago, could cost the same as a house, so connectivity and the sharing of resources were important. The authentication of the communication endpoints was not considered significant. + +## Broadcast domains + +As networks grew in size, virtual LANs (VLANs) were introduced to divide the broadcast domains and improve network performance. A broadcast domain is a logical division of a computer network. All nodes can reach each other by sending a broadcast at the data link layer. When the broadcast domain swells, the network performance takes a hit. + +Over time the role of the VLAN grew to be used as a security tool but it was never meant to be in that space. VLANs were used to improve performance, not to isolate the resources. The problem with VLANs is that there is no intra VLAN filtering. They have a very broad level of access and trust. If bad actors gain access to one segment in the zone, they should not be allowed to try and compromise another device within that zone, but with VLANs, this is a strong possibility. + +Hence, VLAN offers the bad actor a pretty large attack surface to play with and move across laterally without inspection. Lateral movements are really hard to detect with traditional architectures. + +Therefore, enterprises were forced to switch to microsegmentation. Microsegmentation further segments networks within the zone. On the contrary, the whole area of virtualization complicates the segmentation process. A virtualized server may only have a single physical network port but it supports numerous logical networks where services and applications reside across multiple security zones. + +Thus, microsegmentation needs to work at both; the physical network layer as well as within the virtualized networking layer. As you are aware, there has been a change in the traffic pattern. The good thing about microsegmentation is that it controls both; the “north & south” and also the “east & west” movement of traffic, further isolating the size of broadcast domains. + +## Microsegmentation – a multi-stage process + +Implementing microsegmentation is a multi-stage process. There are certain prerequisites that must be followed before the implementation. Firstly, you need to fully understand the communication patterns, map the flows and all the application dependencies. + +Once this is done, it's only then you can enable microsegmentation in a platform-agnostic manner across all the environments. Segmenting your network appropriately creates a dark network until the administrator turns on the lights. Authentication is performed first and then access is granted to the communicating entities operating with zero-trust with least privilege access. + +Once you are connecting the entities, they need to run through a number of technologies in order to be fully connected. There is not a once-off check with microsegmentation. It’s rather a continuous process to make sure that both entities are doing what they are supposed to do. + +This ensures that everyone is doing what they are entitled to do. You want to reduce the unnecessary cross-talk to an absolute minimum and only allow communication that is a complete necessity. + +## How do you implement microsegmentation? + +Firstly, you need strong visibility not just at the traffic flow level but also at the process and data contextual level. Without granular application visibility, it's impossible to map and fully understand what is normal traffic flow and irregular application communication patterns. + +Visibility cannot be mapped out manually, as there could be hundreds of workloads. Therefore, an automatic approach must be taken. Manual mapping is more prone to errors and is inefficient. The visibility also needs to be in real-time. A static snapshot of the application architecture, even if it's down to a process level, will not tell you anything about the behaviors that are sanctioned or unsanctioned. + +You also need to make sure that you, not under-segmenting, similar to what we had in the old days. Primarily, microsegmentation must manage communication workflows all the way up to Layer 7 of the Open Systems Interconnection (OSI) layer. Layer 4 microsegmentation only focuses on the Transport layer. If you are only segmenting the network at Layer 4 then you are widening your attack surface, thereby opening the network to be compromised. + +Segmenting right up to the application layer means you are locking down the lateral movements, open ports, and protocols. It enables you to restrict access to the source and destination process rather than source and destination port numbers. + +## Security issues with hybrid cloud + +Since the [network perimeter][9] has been removed, therefore, it has become difficult to bolt the traditional security tools. Traditionally, we could position a static perimeter around the network infrastructure. However, this is not an available option today as we have a mixture of containerized applications, for example, a legacy database server. We have legacy communicating to the containerized land. + +Hybrid enables organizations to use different types of cloud architects to include the on-premise and new technologies, such as containers. We are going to have a hybrid cloud in coming times which will change the way we think about networking. Hybrid forces the organizations to rethink about the network architectures. + +When you attach the microsegment policies around the workload itself, then the policies will go with the workload. Then it would not matter if the entity moves to the on-premise or to the cloud. If the workload auto scales up and down or horizontally, the policy needs to go with the workload. Even if you go deeper than the workload, into the process level, you can set even more granular controls for microsegmentation. + +## Identity + +However, this is the point where identity becomes a challenge. If things are scaling and becoming dynamic, you can’t tie policies to the IP addresses. Rather than using IP addresses as the base for microsegmentation, policies are based on the logical (not physical) attributes. + +With microsegmentation, the workload identity is based on logical attributes, such as the multi-factor authentication (MFA), transport layer security (TLS) certificate, the application service, or the use of a logical label associated with the workload. + +These are what are known as logical attributes. Ultimately the policies map to the IP addresses but these are set by using the logical attributes, not the physical ones. As we progress in this technological era, the IP address is less relevant now. Named data networking is one of the perfect examples. + +Other identity methods for microsegmentation are TLS certificates. If the traffic is encrypted with a different TLS certificate or from an invalid source, it automatically gets dropped, even if it comes from the right location. It will get blocked as it does not have the right identity. + +You can even extend that further and look inside the actual payload. If an entity is trying to do a hypertext transfer protocol (HTTP) post to a record and if it tries to perform any other operation, it will get blocked. + +## Policy enforcement + +Practically, all of these policies can be implemented and enforced in different places throughout the network. However, if you enforce in only one place, that point in the network can become compromised and become an entry door to the bad actor. You can, for example, enforce in 10 different network points, even if you subvert in 2 of them the other 8 will still protect you. + +Zero-trust microsegmentation ensures that you can enforce in different points throughout the network and also with different mechanics. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][10]** + +Join the Network World communities on [Facebook][11] and [LinkedIn][12] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3384748/zero-trust-microsegmentation-networking.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/07/hive-structured_windows_architecture_connections_connectivity_network_lincoln_park_pavilion_chicago_by_aaron_burson_cc0_via_unsplash_1200x800-100765880-large.jpg +[2]: https://youtu.be/AnMQH_noNDo +[3]: https://network-insight.net/2018/10/zero-trust-networking-ztn-want-ghosted/ +[4]: https://network-insight.net/2018/09/embrace-zero-trust-networking/ +[5]: https://www.networkworld.com/article/3262145/lan-wan/customer-reviews-top-remote-access-tools.html#nww-fsb +[6]: https://www.networkworld.com/article/2287045/internet-of-things/wireless-153629-10-most-powerful-internet-of-things-companies.html#nww-fsb +[7]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[8]: https://network-insight.net/2017/10/internet-things-iot-dissolving-cloud/ +[9]: https://network-insight.net/2018/09/software-defined-perimeter-zero-trust/ +[10]: /contributor-network/signup.html +[11]: https://www.facebook.com/NetworkWorld/ +[12]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md b/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md new file mode 100644 index 0000000000..826cd9d413 --- /dev/null +++ b/sources/tech/20190403 Intel unveils an epic response to AMD-s server push.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel unveils an epic response to AMD’s server push) +[#]: via: (https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel unveils an epic response to AMD’s server push +====== + +### Intel introduced more than 50 new Xeon Scalable Processors for servers that cover a variety of workloads. + +![Intel][1] + +Intel on Tuesday introduced its second-generation Xeon Scalable Processors for servers, developed under the codename Cascade Lake, and it’s clear AMD has lit a fire under a once complacent company. + +These new Xeon SP processors max out at 28 cores and 56 threads, a bit shy of AMD’s Epyc server processors with 32 cores and 64 threads, but independent benchmarks are still to come, which may show Intel having a lead at single core performance. + +And for absolute overkill, there is the Xeon SP Platinum 9200 Series, which sports 56 cores and 112 threads. It will also require up to 400W of power, more than twice what the high-end Xeons usually consume. + +**[ Now read:[What is quantum computing (and why enterprises should care)][2] ]** + +The new processors were unveiled at a big event at Intel’s headquarters in Santa Clara, California, and live-streamed on the web. [Newly minted CEO][3] Bob Swan kicked off the event, saying the new processors were the “first truly data-centric portfolio for our customers.” + +“For the last several years, we have embarked on a journey to transform from a PC-centric company to a data-centric computing company and build the silicon processors with our partners to help our customers prosper and grow in an increasingly data-centric world,” he added. + +He also said the move to a data-centric world isn’t just CPUs, but a suite of accelerant technologies, including the [Agilex FPGA processors][4], Optane memory, and more. + +This launch is the largest Xeon launch in the company’s history, with more than 50 processor designs across the Xeon 8200 and 9200 lines. While something like that can lead to confusion, many of these are specific to certain workloads instead of general-purpose processors. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][5] ]** + +Cascade Lake chips are the replacement for the previous Skylake platform, and the mainstream Cascade Lake chips have the same architecture as the Purley motherboard used by Skylake. Like the current Xeon Scalable processors, they have up to 28 cores with up to 38.5 MB of L3 cache, but speeds and feeds have been bumped up. + +The Cascade Lake generation supports the new UPI (Ultra Path Interface) high-speed interconnect, up to six memory channels, AVX-512 support, and up to 48 PCIe lanes. Memory capacity has been doubled, from 768GB to 1.5TB of memory per socket. They work in the same socket as Purley motherboards and are built on a 14nm manufacturing process. + +Some of the new Xeons, however, can access up to 4.5TB of memory per processor: 1.5TB of memory and 3TB of Optane memory, the new persistent memory that sits between DRAM and NAND flash memory and acts as a massive cache for both. + +## Built-in fixes for Meltdown and Spectre vulnerabilities + +Most important, though, is that these new Xeons have built-in fixes for the Meltdown and Spectre vulnerabilities. There are existing fixes for the exploits, but they have the effect of reducing performance, which varies based on workload. Intel showed a slide at the event that shows the company is using a combination of firmware and software mitigation. + +New features also include Intel Deep Learning Boost (DL Boost), a technology developed to accelerate vector computing that Intel said makes this the first CPU with built-in inference acceleration for AI workloads. It works with the AVX-512 extension, which should make it ideal for machine learning scenarios. + +Most of the new Xeons are available now, except for the 9200 Platinum, which is coming in the next few months. Many Intel partners – Dell, Cray, Cisco, Supermicro – all have new products, with Supermicro launching more than 100 new products built around Cascade Lake. + +## Intel also rolls out Xeon D-1600 series processors + +In addition to its hot rod Xeons, Intel also rolled out the Xeon D-1600 series processors, a low power variant based on a completely different architecture. Xeon D-1600 series processors are designed for space and/or power constrained environments, such as edge network devices and base stations. + +Along with the new Xeons and FPGA chips, Intel also announced the Intel Ethernet 800 series adapter, which supports 25, 50 and 100 Gigabit transfer speeds. + +Thank you, AMD. This is what competition looks like. + +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/3386142/intel-unveils-an-epic-response-to-amds-server-push.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/intel-xeon-family-1-100792811-large.jpg +[2]: https://www.networkworld.com/article/3275367/what-s-quantum-computing-and-why-enterprises-need-to-care.html +[3]: https://www.networkworld.com/article/3336921/intel-promotes-swan-to-ceo-bumps-off-itanium-and-eyes-mellanox.html +[4]: https://www.networkworld.com/article/3386158/intels-agilex-fpga-family-targets-data-intensive-workloads.html +[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md b/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md new file mode 100644 index 0000000000..72d566a7d0 --- /dev/null +++ b/sources/tech/20190403 Top Ten Reasons to Think Outside the Router -1- It-s Time for a Router Refresh.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Ten Reasons to Think Outside the Router #1: It’s Time for a Router Refresh) +[#]: via: (https://www.networkworld.com/article/3386116/top-ten-reasons-to-think-outside-the-router-1-it-s-time-for-a-router-refresh.html#tk.rss_all) +[#]: author: (Rami Rammaha https://www.networkworld.com/author/Rami-Rammaha/) + +Top Ten Reasons to Think Outside the Router #1: It’s Time for a Router Refresh +====== + +![istock][1] + +We’re now at the end of our homage to the iconic David Letterman Top Ten List segment from his former Late Show, as [Silver Peak][2] counts down the _Top Ten Reasons to Think Outside the Router._ Click for the [#2][3], [#3][4], [#4][5], [#5][6], [#6][7], [#7][8], [#8][9], [#9][10] and [#10][11] reasons to retire traditional branch routers. + +_**The #1 reason it’s time to retire conventional routers at the branch: your branch routers are coming due for a refresh – the perfect time to evaluate new options.**_ + +Your WAN architecture is due for a branch router refresh! You’re under immense pressure to advance your organization’s digital transformation initiatives and deliver a high quality of experience to your users and customers. Your applications – at least SaaS apps – are all cloud-based. You know you need to move more quickly to keep pace with changing business requirements to realize the transformational promise of the cloud. And, you’re dealing with shifting traffic patterns and an insatiable appetite for more bandwidth at branch sites to support your users and applications. Finally, you know your IT budget for networking isn’t going to increase. + +_So, what’s next?_ You really only have three options when it comes to refreshing your WAN. You can continue to try and stretch your conventional router-centric model. You can choose a basic [SD-WAN][12] model that may or may not be good enough. Or you can take a new approach and deploy a business-driven SD-WAN edge platform. + +### **The pitfalls of a router-centric model** + +![][13] + +The router-centric approach worked well when enterprise applications were hosted in the data center; before the advent of the cloud. All traffic was routed directly from branch offices to the data center. With the emergence of the cloud, businesses were forced to conform to the constraints of the network when deploying new applications or making network changes. This is a bottoms-up device centric approach in which the network becomes a bottleneck to the business. + +A router-centric approach requires manual device-by-device configuration that results in endless hours of manual programming, making it extremely difficult for network administrators to scale without experiencing major challenges in configuration, outages and troubleshooting. Any changes that arise when deploying a new application or changing a QoS or security policy, once again requires manually programming every router at every branch across the network. Re-programming is time consuming and requires utilizing a complex, cumbersome CLI, further adding to the inefficiencies of the model. In short, the router-centric WAN has hit the wall. + +### **Basic SD-WAN, a step in the right direction** + +![][14] + +In this model, businesses realize the benefit of foundational features, but this model falls short of the goal of a fully automated, business-driven network. A basic SD-WAN approach is unable to provide what the business really needs, including the ability to deliver the best Quality of Experience for users. + +Some of the basic SD-WAN features include the ability to use multiple forms of transport, path selection, centralized management, zero-touch provisioning and encrypted VPN overlays. However, a basic SD-WAN lacks in many areas: + + * Limited end-to-end orchestration of WAN edge network functions + * Rudimentary path selection with traffic steering limited to pre-defined rules + * Long fail-over times in response to WAN transport outages + * Inability to use links when they experience brownouts due to link congestion or packet loss + * Fixed application definitions and manually scripted ACLs to control traffic steering across the internet + + + +### **The solution: shift to a business-first networking model** + +![][15] + +In this model, the network enables the business. The WAN is transformed into a business accelerant that is fully automated and continuous, giving every application the resources it truly needs while delivering 10x the bandwidth for the same budget – ultimately achieving the highest quality of experience to users and IT alike. With a business-first networking model, the network functions (SD-WAN, firewall, segmentation, routing, WAN optimization and application visibility and control) are unified in a single platform and are centrally orchestrated and managed. Top-down business intent is the driver, enabling businesses to unlock the full transformational promise of the cloud. + +The business-driven [Silver Peak® EdgeConnect™ SD-WAN][16] edge platform was built for the cloud, enabling enterprises to liberate their applications from the constraints of existing WAN approaches. EdgeConnect offers the following advanced capabilities: + +1\. Automates traffic steering and security policy enforcement based on business intent instead of TCP/IP addresses, delivering the highest Quality of Experience for users + +2\. Actively embraces broadband to increase application performance and availability while lowering costs + +3\. Securely and directly connect branch users to SaaS and IaaS cloud services + +4\. Increases operational efficiency while increasing business agility and time-to-market via centralized orchestration + +Silver Peak has more than 1,000 enterprise customer deployments across a range of vertical industries. Bentley Systems, [Nuffield Health][17] and [Solis Mammography][18] have all realized tangible business outcomes from their EdgeConnect deployments. + +![][19] + +Learn why the time is now to [think outside the router][20]! + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3386116/top-ten-reasons-to-think-outside-the-router-1-it-s-time-for-a-router-refresh.html#tk.rss_all + +作者:[Rami Rammaha][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/Rami-Rammaha/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/istock-478729482-100792542-large.jpg +[2]: https://www.silver-peak.com/why-silver-peak +[3]: http://blog.silver-peak.com/think-outside-the-router-reason-2-simplify-and-consolidate-the-wan-edge +[4]: http://blog.silver-peak.com/think-outside-the-router-reason-3-mpls-contract-renewal +[5]: http://blog.silver-peak.com/top-ten-reasons-to-think-outside-the-router-4-broadband-is-used-only-for-failover +[6]: http://blog.silver-peak.com/think-outside-the-router-reason-5-manual-cli-based-configuration-and-management +[7]: http://blog.silver-peak.com/https-blog-silver-peak-com-think-outside-the-router-reason-6 +[8]: http://blog.silver-peak.com/think-outside-the-router-reason-7-exorbitant-router-support-and-maintenance-costs +[9]: http://blog.silver-peak.com/think-outside-the-router-reason-8-garbled-voip-pixelated-video +[10]: http://blog.silver-peak.com/think-outside-router-reason-9-sub-par-saas-performance +[11]: http://blog.silver-peak.com/think-outside-router-reason-10-its-getting-cloudy +[12]: https://www.silver-peak.com/sd-wan/sd-wan-explained +[13]: https://images.idgesg.net/images/article/2019/04/1_router-centric-vs-business-first-100792538-medium.jpg +[14]: https://images.idgesg.net/images/article/2019/04/2_basic-sd-wan-vs-business-first-100792539-medium.jpg +[15]: https://images.idgesg.net/images/article/2019/04/3_bus-first-networking-model-100792540-large.jpg +[16]: https://www.silver-peak.com/products/unity-edge-connect +[17]: https://www.silver-peak.com/resource-center/nuffield-health-deploys-uk-wide-sd-wan-silver-peak +[18]: https://www.silver-peak.com/resource-center/national-leader-mammography-services-accelerates-access-life-critical-scans +[19]: https://images.idgesg.net/images/article/2019/04/4_real-world-business-outcomes-100792541-large.jpg +[20]: https://www.silver-peak.com/think-outside-router diff --git a/sources/tech/20190403 Use Git as the backend for chat.md b/sources/tech/20190403 Use Git as the backend for chat.md new file mode 100644 index 0000000000..e564bbc6e7 --- /dev/null +++ b/sources/tech/20190403 Use Git as the backend for chat.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Git as the backend for chat) +[#]: via: (https://opensource.com/article/19/4/git-based-chat) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Use Git as the backend for chat +====== +GIC is a prototype chat application that showcases a novel way to use Git. +![Team communication, chat][1] + +[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. Today, we'll look at GIC, a Git-based chat application + +### Meet GIC + +While the authors of Git probably expected frontends to be created for Git, they undoubtedly never expected Git would become the backend for, say, a chat client. Yet, that's exactly what developer Ephi Gabay did with his experimental proof-of-concept [GIC][3]: a chat client written in [Node.js][4] using Git as its backend database. + +GIC is by no means intended for production use. It's purely a programming exercise, but it's one that demonstrates the flexibility of open source technology. What's astonishing is that the client consists of just 300 lines of code, excluding the Node libraries and Git itself. And that's one of the best things about the chat client and about open source; the ability to build upon existing work. Seeing is believing, so you should give GIC a look for yourself. + +### Get set up + +GIC uses Git as its engine, so you need an empty Git repository to serve as its chatroom and logger. The repository can be hosted anywhere, as long as you and anyone who needs access to the chat service has access to it. For instance, you can set up a Git repository on a free Git hosting service like GitLab and grant chat users contributor access to the Git repository. (They must be able to make commits to the repository, because each chat message is a literal commit.) + +If you're hosting it yourself, create a centrally located bare repository. Each user in the chat must have an account on the server where the bare repository is located. You can create accounts specific to Git with Git hosting software like [Gitolite][5] or [Gitea][6], or you can give them individual user accounts on your server, possibly using **git-shell** to restrict their access to Git. + +Performance is best on a self-hosted instance. Whether you host your own or you use a hosting service, the Git repository you create must have an active branch, or GIC won't be able to make commits as users chat because there is no Git HEAD. The easiest way to ensure that a branch is initialized and active is to commit a README or license file upon creation. If you don't do that, you can create and commit one after the fact: + +``` +$ echo "chat logs" > README +$ git add README +$ git commit -m 'just creating a HEAD ref' +$ git push -u origin HEAD +``` + +### Install GIC + +Since GIC is based on Git and written in Node.js, you must first install Git, Node.js, and the Node package manager, npm (which should be bundled with Node). The command to install these differs depending on your Linux or BSD distribution, but here's an example command on Fedora: + +``` +$ sudo dnf install git nodejs +``` + +If you're not running Linux or BSD, follow the installation instructions on [git-scm.com][7] and [nodejs.org][8]. + +There's no install process, as such, for GIC. Each user (Alice and Bob, in this example) must clone the repository to their hard drive: + +``` +$ git cone https://github.com/ephigabay/GIC GIC +``` + +Change directory into the GIC directory and install the Node.js dependencies with **npm** : + +``` +$ cd GIC +$ npm install +``` + +Wait for the Node modules to download and install. + +### Configure GIC + +The only configuration GIC requires is the location of your Git chat repository. Edit the **config.js** file: + +``` +module.exports = { +gitRepo: '[seth@example.com][9]:/home/gitchat/chatdemo.git', +messageCheckInterval: 500, +branchesCheckInterval: 5000 +}; +``` + + +Test your connection to the Git repository before trying GIC, just to make sure your configuration is sane: + +``` +$ git clone --quiet seth@example.com:/home/gitchat/chatdemo.git > /dev/null +``` + +Assuming you receive no errors, you're ready to start chatting. + +### Chat with Git + +From within the GIC directory, start the chat client: + +``` +$ npm start +``` + +When the client first launches, it must clone the chat repository. Since it's nearly an empty repository, it won't take long. Type your message and press Enter to send a message. + +![GIC][10] + +A Git-based chat client. What will they think of next? + +As the greeting message says, a branch in Git serves as a chatroom or channel in GIC. There's no way to create a new branch from within the GIC UI, but if you create one in another terminal session or in a web UI, it shows up immediately in GIC. It wouldn't take much to patch some IRC-style commands into GIC. + +After chatting for a while, take a look at your Git repository. Since the chat happens in Git, the repository itself is also a chat log: + +``` +$ git log --pretty=format:"%p %cn %s" +4387984 Seth Kenlon Hey Chani, did you submit a talk for All Things Open this year? +36369bb Chani No I didn't get a chance. Did you? +[...] +``` + +### Exit GIC + +Not since Vim has there been an application as difficult to stop as GIC. You see, there is no way to stop GIC. It will continue to run until it is killed. When you're ready to stop GIC, open another terminal tab or window and issue this command: + +``` +$ kill `pgrep npm` +``` + +GIC is a novelty. It's a great example of how an open source ecosystem encourages and enables creativity and exploration and challenges us to look at applications from different angles. Try GIC out. Maybe it will give you ideas. At the very least, it's a great excuse to spend an afternoon with Git. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/git-based-chat + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://git-scm.com/ +[3]: https://github.com/ephigabay/GIC +[4]: https://nodejs.org/en/ +[5]: http://gitolite.com +[6]: http://gitea.io +[7]: http://git-scm.com +[8]: http://nodejs.org +[9]: mailto:seth@example.com +[10]: https://opensource.com/sites/default/files/uploads/gic.jpg (GIC) diff --git a/sources/tech/20190404 9 features developers should know about Selenium IDE.md b/sources/tech/20190404 9 features developers should know about Selenium IDE.md new file mode 100644 index 0000000000..b099da68e2 --- /dev/null +++ b/sources/tech/20190404 9 features developers should know about Selenium IDE.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 features developers should know about Selenium IDE) +[#]: via: (https://opensource.com/article/19/4/features-selenium-ide) +[#]: author: (Al Sargent https://opensource.com/users/alsargent) + +9 features developers should know about Selenium IDE +====== +The new Selenium IDE brings the benefits of functional test automation +to many IT professionals—and to frontend developers specifically. +![magnifying glass on computer screen][1] + +There has long been a stigma associated with using record-and-playback tools for testing rather than scripted QA automation tools like [Selenium Webdriver][2], [Cypress][3], and [WebdriverIO][4]. + +Record-and-playbook tools are perceived to suffer from many issues, including a lack of cross-browser support, no way to run scripts in parallel or from CI build scripts, poor support for responsive web apps, and no way to quickly diagnose frontend bugs. + +Needless to say, it's been somewhat of a rough road for these tools, and after Selenium IDE [went end-of-life][5] in 2017, many thought the road for record and playback would end altogether. + +Well, it turns out this perception was wrong. Not long after the Selenium IDE project was discontinued, my colleagues at [Applitools approached the Selenium open source community][6] to see how they could help. + +Since then, much of Selenium IDE's code has been revamped. The code is now freely available on GitHub under an Apache 2.0 license, managed by the Selenium community, and supported by [two full-time engineers][7], one of whom literally wrote the book on [Selenium testing][8]. + +![Selenium IDE's GitHub repository][9] + +The new Selenium IDE brings the benefits of functional test automation to many IT professionals—and to frontend developers specifically. Here are nine things developers should know about the new Selenium IDE. + +### 1\. Selenium IDE is now cross-browser + +When the record-and-playback tool first came out in 2006, Firefox was the shiny new browser it hitched its wagon to, and it remained that way for a decade. No more! Selenium IDE is now available as a [Google Chrome Extension][10] and [Firefox Add-on][11]. + +Even better, Selenium IDE can run its tests on Selenium WebDriver servers by using Selenium IDE's new command-line test runner, [SIDE Runner][12]. SIDE Runner blends elements of Selenium IDE and Selenium Webdriver. It takes a Selenium IDE script, saved as a [**.side** file][13], and runs it using browser drivers such as [ChromeDriver][14], [EdgeDriver][15], Firefox's [Geckodriver][16], [IEDriver][17], and [SafariDriver][18]. + +SIDE Runner and the other drivers above are available as [straightforward npm installs][12]. Here's what it looks like in action. + +![SIDE Runner][19] + +### 2\. No more brittle functional tests + +For years, brittle tests have been an issue for functional tests—whether you record them or code them by hand. Now that developers are releasing new features more frequently, their user interface (UI) code is constantly changing as well. When a UI changes, object locators often change, too. + +Selenium IDE fixes that by capturing multiple object locators when you record your script. During playback, if Selenium IDE can't find one locator, it tries each of the other locators until it finds one that works. Your test will fail only if none of the locators work. This doesn't guarantee scripts will always play back, but it does insulate scripts against numerous changes. As you can see below, Selenium IDE captures linkText, an xPath expression, and CSS-based locators. + +![Selenium IDE captures linkText, an xPath expression, and CSS-based locators][20] + +### 3\. Conditional logic to handle UI features + +When testing web apps, scripts have to handle intermittent UI elements that can randomly appear in your app. These come in the form of cookie notices, popups for special offers, quote requests, newsletter subscriptions, paywall notifications, adblocker requests, and more. + +Conditional logic is a great way to handle these intermittent UI features. Developers can easily insert conditional logic—also called control flow—into Selenium IDE scripts. [Here are details][21] and how it looks. + +![Selenium IDE's Conditional logic][22] + +### 4\. Support for embedded code + +As broad as the new [Selenium IDE API][23] is, it doesn't do everything. For this reason, Selenium IDE has **[**execute** **script**][24]** and **[execute async script][25]** commands that let your script call a JavaScript snippet. + +This provides developers with a tremendous amount of flexibility to take advantage of JavaScript's flexibility and wide range of libraries. To use it, click on the test step where you want JavaScript to run, choose **Insert New Command** , and enter **execute script** or **execute async script** in the command field, as shown below. + +![Selenium IDE's command line][26] + +### 5\. Selenium IDE runs from CI build scripts + +Because SIDE Runner is called from the command line, you can easily fit it into CI build scripts, so long as the CI server can call **selenium-ide-runner** and upload the **.side** file (the test script) as a build artifact. For example, here's how to upload an input file in [Jenkins][27], [Travis][28], and [CircleCI][29]. + +This means Selenium IDE can be better integrated into the software development technology stack. In addition, the scripts created by less-technical QA team members—including business analysts—can run with every build. This helps better align QA with the developer so fewer bugs escape into production. + +### 6\. Support for third-party plugins + +Imagine companies building plugins to have Selenium IDE do all kinds of things, like uploading scripts to a functional testing cloud, a load testing cloud, or a production application monitoring service. + +Plenty of companies have integrated Selenium Webdriver into their offerings, and I bet the same will happen with Selenium IDE. You can also [build your own Selenium IDE plugin][30]. + +### 7\. Visual UI testing + +Speaking of new plugins, Applitools introduced a new Selenium IDE plugin to add artificial intelligence-powered visual validations to the equation. Available through the [Chrome][31] and [Firefox][32] stores via a three-second install, just plug in the Applitools API key and go. + +Visual checkpoints are a great way to ensure a UI renders correctly. Rather than a bunch of assert statements on all the UI elements—which would be a pain to maintain—one visual checkpoint checks all your page elements. + +Best of all, visual AI looks at a web app the same way a human does, ignoring minor differences. This means fewer fake bugs to frustrate a development team. + +### 8\. Visually test responsive web apps + +When testing the visual layout of [responsive web apps][33], it's best to do it on a wide range of screen sizes (also called viewports) to ensure nothing appears out of whack. It's all too easy for responsive web bugs to creep in, and when they do, the problems can range from merely cosmetic to business stopping. + +When you use visual UI testing for Selenium IDE, you can visually test your webpages on the Applitools [Visual Grid][34], which has more than 100 combinations of browsers, emulated devices, and viewport sizes. + +Once tests run on the Visual Grid, developers can easily check the test results on all the various combinations. + +![Selenium IDE's Visual Grid][35] + +### 9\. Responsive web bugs have nowhere to hide + +Selenium IDE can help pinpoint the cause of frontend bugs. Every Selenium IDE script that's run with the Visual Grid can be analyzed with Applitools' [Root Cause Analysis][36]. It's no longer enough to find a bug—developers also need to fix it. + +When a visual bug is discovered, it can be clicked on and just the relevant (not all) Document Object Model (DOM) and CSS differences will be displayed. + +![Finding visual bugs][37] + +In summary, much like many emerging technologies in software development, Selenium IDE is part of a larger trend of making life easier and simpler for technical professionals and enabling them to spend more time and effort on creating code for even faster feedback. + +* * * + +_This article is based on[16 reasons why to use Selenium IDE in 2019 (and 2 why not)][38] originally published on the Applitools blog._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/features-selenium-ide + +作者:[Al Sargent][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/alsargent +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0 (magnifying glass on computer screen) +[2]: https://www.seleniumhq.org/projects/webdriver/ +[3]: https://www.cypress.io/ +[4]: https://webdriver.io/ +[5]: https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/ +[6]: https://seleniumhq.wordpress.com/2018/08/06/selenium-ide-tng/ +[7]: https://github.com/SeleniumHQ/selenium-ide/graphs/contributors +[8]: http://davehaeffner.com/ +[9]: https://opensource.com/sites/default/files/uploads/selenium_ide_github_graphic_1.png (Selenium IDE's GitHub repository) +[10]: https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd +[11]: https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/ +[12]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/ +[13]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/command-line-runner/#launching-the-runner +[14]: http://chromedriver.chromium.org/ +[15]: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ +[16]: https://github.com/mozilla/geckodriver +[17]: https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver +[18]: https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari +[19]: https://opensource.com/sites/default/files/uploads/selenium_ide_side_runner_2.png (SIDE Runner) +[20]: https://opensource.com/sites/default/files/uploads/selenium_ide_linktext_3.png (Selenium IDE captures linkText, an xPath expression, and CSS-based locators) +[21]: https://www.seleniumhq.org/selenium-ide/docs/en/introduction/control-flow/ +[22]: https://opensource.com/sites/default/files/uploads/selenium_ide_conditional_logic_4.png (Selenium IDE's Conditional logic) +[23]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/ +[24]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-script +[25]: https://www.seleniumhq.org/selenium-ide/docs/en/api/commands/#execute-async-script +[26]: https://opensource.com/sites/default/files/uploads/selenium_ide_command_line_5.png (Selenium IDE's command line) +[27]: https://stackoverflow.com/questions/27491789/how-to-upload-a-generic-file-into-a-jenkins-job +[28]: https://docs.travis-ci.com/user/uploading-artifacts/ +[29]: https://circleci.com/docs/2.0/artifacts/ +[30]: https://www.seleniumhq.org/selenium-ide/docs/en/plugins/plugins-getting-started/ +[31]: https://chrome.google.com/webstore/detail/applitools-for-selenium-i/fbnkflkahhlmhdgkddaafgnnokifobik +[32]: https://addons.mozilla.org/en-GB/firefox/addon/applitools-for-selenium-ide/ +[33]: https://en.wikipedia.org/wiki/Responsive_web_design +[34]: https://applitools.com/visualgrid +[35]: https://opensource.com/sites/default/files/uploads/selenium_ide_visual_grid_6.png (Selenium IDE's Visual Grid) +[36]: https://applitools.com/root-cause-analysis +[37]: https://opensource.com/sites/default/files/uploads/seleniumice_rootcauseanalysis_7.png (Finding visual bugs) +[38]: https://applitools.com/blog/why-selenium-ide-2019 diff --git a/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md b/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md new file mode 100644 index 0000000000..b2f8a59ab4 --- /dev/null +++ b/sources/tech/20190404 Edge Computing is Key to Meeting Digital Transformation Demands - and Partnerships Can Help Deliver Them.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Edge Computing is Key to Meeting Digital Transformation Demands – and Partnerships Can Help Deliver Them) +[#]: via: (https://www.networkworld.com/article/3387140/edge-computing-is-key-to-meeting-digital-transformation-demands-and-partnerships-can-help-deliver-t.html#tk.rss_all) +[#]: author: (Rob McKernan https://www.networkworld.com/author/Rob-McKernan/) + +Edge Computing is Key to Meeting Digital Transformation Demands – and Partnerships Can Help Deliver Them +====== + +### Organizations in virtually every vertical industry are undergoing a digital transformation in an attempt to take advantage of edge computing technology + +![Getty Images][1] + +Organizations in virtually every vertical industry are undergoing a digital transformation in an attempt to take advantage of [edge computing][2] technology to make their businesses more efficient, innovative and profitable. In the process, they’re coming face to face with challenges ranging from time to market to reliability of IT infrastructure. + +It’s a complex problem, especially when you consider the scope of what digital transformation entails. “Digital transformation is not simply a list of IT projects, it involves completely rethinking how an organization uses technology to pursue new revenue streams, products, services, and business models,” as the [research firm IDC says][3]. + +Companies will be spending more than $650 billion per year on digital transformation efforts by 2024, a CAGR of more than 18.5% from 2018, according to the research firm [Market Research Engine][4]. + +The drivers behind all that spending include Internet of Things (IoT) technology, which involves collecting data from machines and sensors covering every aspect of the organization. That is contributing to Big Data – the treasure trove of data that companies mine to find the keys to efficiency, opportunity and more. Artificial intelligence and machine learning are crucial to that effort, helping companies make sense of the mountains of data they’re creating and consuming, and to find opportunities. + +**Requirements for Edge Computing** + +All of these trends are creating the need for more and more compute power and data storage. And much of it needs to be close to the source of the data, and to those employees who are working with it. In other words, it’s driving the need for companies to build edge data centers or edge computing sites. + +Physically, these edge computing sites bear little resemblance to large, centralized data centers, but they have many of the same requirements in terms of performance, reliability, efficiency and security. Given they are typically in locations with few if any IT personnel, the data centers must have a high degree of automation and remote management capabilities. And to meet business requirements, they must be built quickly. + +**Answering the Call at the Edge** + +These are complex requirements, but if companies are to meet time-to-market goals and deal with the lack of IT personnel at the edge, they demand simple solutions. + +One solution is integration. We’re seeing this already in the IT space, with vendors delivering hyper-converged infrastructure that combines servers, storage, networking and software that is tightly integrated and delivered in a single enclosure. This saves IT groups valuable time in terms of procuring and configuring equipment and makes it far easier to manage over the long term. + +Now we’re seeing the same strategy applied to edge data centers. Prefabricated, modular data centers are an ideal solution for delivering edge data center capacity quickly and reliably. All the required infrastructure – power, cooling, racks, UPSs – can be configured and installed in a factory and delivered as a single, modular unit to the data center site (or multiple modules, depending on requirements). + +Given they’re built in a factory under controlled conditions, modular data centers are more reliable over the long haul. They can be configured with management software built-in, enabling remote management capabilities and a high degree of automation. And they can be delivered in weeks or months, not years – and in whatever size is required, including small “micro” data centers. + +Few companies, however, have all the components required to deliver a complete, functional data center, not to mention the expertise required to install and configure it. So, it takes effective partnerships to deliver complete edge data center solutions. + +**Tech Data Partnership Delivers at the Edge ** + +APC by Schneider Electric has a long history of partnering to deliver complete solutions that address customer needs. Of the thousands of partnerships it has established over the years, the [25-year partnership][5] with [Tech Data][6] is particularly relevant for the digital transformation era. + +Tech Data is a $36.8 billion, Fortune 100 company that has established itself as the world’s leading end-to-end IT distributor. Power and physical infrastructure specialists from Tech Data team up with their counterparts from APC to deliver innovative solutions, including modular and [micro data centers][7]. Many of these solutions are pre-certified by major alliance partners, including IBM, HPE, Cisco, Nutanix, Dell EMC and others. + +To learn more, [access the full story][8] that explains how the Tech Data and APC partnership helps deliver [Certainty in a Connected World][9] and effective edge computing solutions that meet today’s time to market requirements. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387140/edge-computing-is-key-to-meeting-digital-transformation-demands-and-partnerships-can-help-deliver-t.html#tk.rss_all + +作者:[Rob McKernan][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/Rob-McKernan/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/04/gettyimages-494323751-942x445-100792905-large.jpg +[2]: https://www.apc.com/us/en/solutions/business-solutions/edge-computing.jsp +[3]: https://www.idc.com/getdoc.jsp?containerId=US43985717 +[4]: https://www.marketresearchengine.com/digital-transformation-market +[5]: https://www.apc.com/us/en/partners-alliances/partners/tech-data-and-apc-partnership-drives-edge-computing-success/full-resource.jsp +[6]: https://www.techdata.com/ +[7]: https://www.apc.com/us/en/solutions/business-solutions/micro-data-centers.jsp +[8]: https://www.apc.com/us/en/partners-alliances/partners/tech-data-and-apc-partnership-drives-edge-computing-success/index.jsp +[9]: https://www.apc.com/us/en/who-we-are/certainty-in-a-connected-world.jsp diff --git a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md new file mode 100644 index 0000000000..3ec4b4600e --- /dev/null +++ b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel formally launches Optane for data center memory caching) +[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Intel formally launches Optane for data center memory caching +====== + +### Intel formally launched the Optane persistent memory product line, which includes 3D Xpoint memory technology. The Intel-only solution is meant to sit between DRAM and NAND and to speed up performance. + +![Intel][1] + +As part of its [massive data center event][2] on Tuesday, Intel formally launched the Optane persistent memory product line. It had been out for a while, but the current generation of Xeon server processors could not fully utilize it. The new Xeon 8200 and 9200 lines take full advantage of it. + +And since Optane is an Intel product (co-developed with Micron), that means AMD and Arm server processors are out of luck. + +As I have [stated in the past][3], Optane DC Persistent Memory uses 3D Xpoint memory technology that Intel developed with Micron Technology. 3D Xpoint is a non-volatile memory type that is much faster than solid-state drives (SSD), almost at the speed of DRAM, but it has the persistence of NAND flash. + +**[ Read also:[Why NVMe? Users weigh benefits of NVMe-accelerated flash storage][4] and [IDC’s top 10 data center predictions][5] | Get regularly scheduled insights [Sign up for Network World newsletters][6] ]** + +The first 3D Xpoint products were SSDs called Intel’s ["ruler,"][7] because they were designed in a long, thin format similar to the shape of a ruler. They were designed that way to fit in 1u server carriages. As part of Tuesday’s announcement, Intel introduced the new Intel SSD D5-P4326 'Ruler' SSD, using four-cell or QLC 3D NAND memory, with up to 1PB of storage in a 1U design. + +Optane DC Persistent Memory will be available in DIMM capacities of 128GB on up to 512GB initially. That’s two to four times what you can get with DRAM, said Navin Shenoy, executive vice president and general manager of Intel’s Data Center Group, who keynoted the event. + +“We expect system capacity in a server system to scale to 4.5 terabytes per socket or 36 TB in an 8-socket system. That’s three times larger than what we were able to do with the first-generation of Xeon Scalable,” he said. + +## Intel Optane memory uses and speed + +Optane runs in two different modes: Memory Mode and App Direct Mode. Memory mode is what I have been describing to you, where Optane memory exists “above” the DRAM and acts as a cache. In App Direct mode, the DRAM and Optane DC Persistent Memory are pooled together to maximize the total capacity. Not every workload is ideal for this kind of configuration, so it should be used in applications that are not latency-sensitive. The primary use case for Optane, as Intel is promoting it, is Memory Mode. + +**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** + +When 3D Xpoint was initially announced a few years back, Intel claimed it was 1,000 times faster than NAND, with 1000 times the endurance, and 10 times the density potential of DRAM. Well that was a little exaggerated, but it does have some intriguing elements. + +Optane memory, when used in 256B contiguous 4 cacheline, can achieve read speeds of 8.3GB/sec and write speeds of 3.0GB/sec. Compare that with the read/write speed of 500 or so MB/sec for a SATA SSD, and you can see the performance gain. Optane, remember, is feeding memory, so it caches frequently accessed SSD content. + +This is the key takeaware of Optane DC. It will keep very large data sets very close to memory, and hence the CPU, with low latency while at the same time minimizing the need to access the slower storage subsystem, whether it’s SSD or HDD. It now offers the possibility of putting multiple terabytes of data very close to the CPU for much faster access. + +## One challenge with Optane memory + +The only real challenge is that Optane goes into DIMM slots, which is where memory goes. Now some motherboards come with as many as 16 DIMM slots per CPU socket, but that’s still board real estate that the customer and OEM provider will need to balance out: Optane vs. memory. There are some Optane drives in PCI Express format, which alleviate the memory crowding on the motherboard. + +3D Xpoint also offers higher endurance than traditional NAND flash memory due to the way it writes data. Intel promises a five-year warranty with its Optane, while a lot of SSDs offer only three years. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg +[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html +[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html +[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html +[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md b/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md new file mode 100644 index 0000000000..f5915aebe7 --- /dev/null +++ b/sources/tech/20190404 Why blockchain (might be) coming to an IoT implementation near you.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why blockchain (might be) coming to an IoT implementation near you) +[#]: via: (https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html#tk.rss_all) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Why blockchain (might be) coming to an IoT implementation near you +====== + +![MF3D / Getty Images][1] + +Companies have found that IoT partners well with a host of other popular enterprise computing technologies of late, and blockchain – the innovative system of distributed trust most famous for underpinning cryptocurrencies – is no exception. Yet while the two phenomena can be complementary in certain circumstances, those expecting an explosion of blockchain-enabled IoT technologies probably shouldn’t hold their breath. + +Blockchain technology can be counter-intuitive to understand at a basic level, but it’s probably best thought of as a sort of distributed ledger keeping track of various transactions. Every “block” on the chain contains transactional records or other data to be secured against tampering, and is linked to the previous one by a cryptographic hash, which means that any tampering with the block will invalidate that connection. The nodes – which can be largely anything with a CPU in it – communicate via a decentralized, peer-to-peer network to share data and ensure the validity of the data in the chain. + +**[ Also see[What is edge computing?][2] and [How edge networking and IoT will reshape data centers][3].]** + +The system works because all the blocks have to agree with each other on the specifics of the data that they’re safeguarding, according to Nir Kshetri, a professor of management at the University of North Carolina – Greensboro. If someone attempts to alter a previous transaction on a given node, the rest of the data on the network pushes back. “The old record of the data is still there,” said Kshetri. + +That’s a powerful security technique – absent a bad actor successfully controlling all of the nodes on a given blockchain (the [famous “51% attack][4]”), the data protected by that blockchain can’t be falsified or otherwise fiddled with. So it should be no surprise that the use of blockchain is an attractive option to companies in some corners of the IoT world. + +Part of the reason for that, over and above the bare fact of blockchain’s ability to securely distribute trusted information across a network, is its place in the technology stack, according to Jay Fallah, CTO and co-founder of NXMLabs, an IoT security startup. + +“Blockchain stands at a very interesting intersection. Computing has accelerated in the last 15 years [in terms of] storage, CPU, etc, but networking hasn’t changed that much until recently,” he said. “[Blockchain]’s not a network technology, it’s not a data technology, it’s both.” + +### Blockchain and IoT** + +** + +Where blockchain makes sense as a part of the IoT world depends on who you speak to and what they are selling, but the closest thing to a general summation may have come from Allison Clift-Jenning, CEO of enterprise blockchain vendor Filament. + +“Anywhere where you've got people who are kind of wanting to trust each other, and have very archaic ways of doing it, that is usually a good place to start with use cases,” she said. + +One example, culled directly from Filament’s own customer base, is used car sales. Filament’s working with “a major Detroit automaker” to create a trusted-vehicle history platform, based on a device that plugs into the diagnostic port of a used car, pulls information from there, and writes that data to a blockchain. Just like that, there’s an immutable record of a used car’s history, including whether its airbags have ever been deployed, whether it’s been flooded, and so on. No unscrupulous used car lot or duplicitous former owner could change the data, and even unplugging the device would mean that there’s a suspicious blank period in the records. + +Most of present-day blockchain IoT implementation is about trust and the validation of data, according to Elvira Wallis, senior vice president and global head of IoT at SAP. + +“Most of the use cases that we have come across are in the realm of tracking and tracing items,” she said, giving the example of a farm-to-fork tracking system for high-end foodstuffs, using blockchain nodes mounted on crates and trucks, allowing for the creation of an un-fudgeable record of an item’s passage through transport infrastructure. (e.g., how long has this steak been refrigerated at such-and-such a temperature, how far has it traveled today, and so on.) + +### **Is using blockchain with IoT a good idea?** + +Different vendors sell different blockchain-based products for different use cases, which use different implementations of blockchain technology, some of which don’t bear much resemblance to the classic, linear, mined-transaction blockchain used in cryptocurrency. + +That means it’s a capability that you’d buy from a vendor for a specific use case, at this point. Few client organizations have the in-house expertise to implement a blockchain security system, according to 451 Research senior analyst Csilla Zsigri. + +The idea with any intelligent application of blockchain technology is to play to its strengths, she said, creating a trusted platform for critical information. + +“That’s where I see it really adding value, just in adding a layer of trust and validation,” said Zsigri. + +Yet while the basic idea of blockchain-enabled IoT applications is fairly well understood, it’s not applicable to every IoT use case, experts agree. Applying blockchain to non-transactional systems – although there are exceptions, including NXM Labs’ blockchain-based configuration product for IoT devices – isn’t usually the right move. + +If there isn’t a need to share data between two different parties – as opposed to simply moving data from sensor to back-end – blockchain doesn’t generally make sense, since it doesn’t really do anything for the key value-add present in most IoT implementations today: data analysis. + +“We’re still in kind of the early dial-up era of blockchain today,” said Clift-Jennings. “It’s slower than a typical database, it often isn't even readable, it often doesn't have a query engine tied to it. You don't really get privacy, by nature of it.” + +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/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html#tk.rss_all + +作者:[Jon Gold][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/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2019/02/chains_binary_data_blockchain_security_by_mf3d_gettyimages-941175690_2400x1600-100788434-large.jpg +[2]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[3]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[4]: https://bitcoinist.com/51-percent-attack-hackers-steals-18-million-bitcoin-gold-btg-tokens/ +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190405 5 open source tools for teaching young children to read.md b/sources/tech/20190405 5 open source tools for teaching young children to read.md new file mode 100644 index 0000000000..c3a1fe82c8 --- /dev/null +++ b/sources/tech/20190405 5 open source tools for teaching young children to read.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source tools for teaching young children to read) +[#]: via: (https://opensource.com/article/19/4/early-literacy-tools) +[#]: author: (Laura B. Janusek https://opensource.com/users/lbjanusek) + +5 open source tools for teaching young children to read +====== +Early literacy apps give kids a foundation in letter recognition, +alphabet sequencing, word finding, and more. +![][1] + +Anyone who sees a child using a tablet or smartphone observes their seemingly innate ability to scroll through apps and swipe through screens, flexing those "digital native" muscles. According to [Common Sense Media][2], the percentage of US households in which 0- to 8-year-olds have access to a smartphone has grown from 52% in 2011 to 98% in 2017. While the debates around age guidelines and screen time surge, it's hard to deny that children are developing familiarity and skills with technology at an unprecedented rate. + +This rise in early technical literacy may be astonishing, but what about _traditional_ literacy, the good old-fashioned ability to read? What does the intersection of early literacy development and early tech use look like? Let's explore some open source tools for early learners that may help develop both of these critical skill sets. + +### Balancing risks and rewards + +But first, a disclaimer: Guidelines for technology use, especially for young children, are [constantly changing][3]. Organizations like the American Academy of Pediatrics, Common Sense Media, Zero to Three, and PBS Kids are continually conducting research and publishing recommendations. One position that all of these and other organizations can agree on is that plopping a child in front of a screen with unmonitored content for an unlimited set of time is highly inadvisable. + +Even setting kids up with educational content or tools for extended periods of time may have risks. And on the flip side, research on the benefits of education technologies is often limited or unavailable. In short, there are many cases in which we don't know for certain if educational technology use at a young age is beneficial, detrimental, or simply neutral. + +But if screen time is available to your child or student, it's logical to infer that educational resources would be preferable over simpler pop-the-bubble or slice-the-fruit games or platforms that could house inappropriate content or online predators. While we may not be able to prove that education apps will make a child's test scores soar, we can at least take comfort in their generally being safer and more age-appropriate than the internet at large. + +That said, if you're open to exploring early-education technologies, there are many reasons to look to open source options. Open source technologies are not only free but open to collaborative improvement. In many cases, they are created by developers who are educators or parents themselves, and they're a great way to avoid in-app purchases, advertisements, and paid upgrades. Open source programs can often be downloaded and installed on your device and accessed without an internet connection. Plus, the idea of [open source in education][4] is a growing trend, and there are countless resources to [learn more][5] about the concept. + +But for now, let's check out some open source tools for early literacy in action! + +### Childsplay + +![Childsplay screenshot][6] + +Let's start simple. [Childsplay][7], licensed under the GPLv2, is the most basic of the resources on this list. It's a compilation of just over a dozen educational games for young learners, four of which are specific to letter recognition, including memory games and an activity where the learner identifies a spoken letter. + +### eduActiv8 + +![eduActiv8 screenshot][8] + +[eduActiv8][9] started in 2011 as a personal project for the developer's son, "whose thirst for learning and knowledge inspired the creation of this educational program." It includes activities for building basic math and early literacy skills, including a variety of spelling, matching, and listening activities. Games include filling in missing letters in the alphabet, unscrambling letters to form a word, matching words to images, and completing mazes by connecting letters in the correct order. eduActiv8 was written in [Python][10] and is available under the GPLv3. + +### GCompris + +![GCompris screenshot][11] + +[GCompris][12] is an open source behemoth (licensed under the GPLv3) of early educational activities. A French software engineer started it in 2000, and it now includes over 130 educational games in nearly 20 languages. Tailored for learners under age 10, it includes activities for letter recognition and drawing, alphabet sequencing, vocabulary building, and games like hangman to identify missing letters in words, plus activities for learning braille. It also includes games in math and music, plus classics from tic-tac-toe to chess. + +### Feed the Monster + +![Feed the Monster screenshot][13] + +The quality of the playful "monster" graphics in [Feed the Monster][14] definitely sets it apart from the others on this list, plus it supports nearly 40 languages! The app includes activities for sorting letters to form words, memory games to match words to images, and letter-tracing writing activities. The app is developed by Curious Learning, which states: "We create, localize, distribute, and optimize open source mobile software so every child can learn to read." While Feed the Monster's offerings are geared toward early readers, Curious Mind's roadmap suggests it's headed towards a more robust personalized literacy platform growing on a foundation of research with MIT, Tufts, and Georgia State University. + +### Syntax Untangler + +![Syntax Untangler screenshot][15] + +[Syntax Untangler][16] is the outlier of this group. Developed by a technologist at the University of Wisconsin–Madison under the GPLv2, the application is "particularly designed for training language learners to recognize and parse linguistic features." Examples show the software being used for foreign language learning, but anyone can use it to create language identification games, including games for early literacy activities like letter recognition. It could also be applied to later literacy skills, like identifying parts of speech in complex sentences or literary techniques in poetry or fiction. + +### Wrapping up + +Access to [literary environments][17] has been shown to impact literacy and attitudes towards reading. Why not strive to create a digital literary environment for our kids by filling our devices with educational technologies, just like our shelves are filled with books? + +Now it's your turn! What open source literacy tools have you used? Comment below to share. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/early-literacy-tools + +作者:[Laura B. Janusek][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/lbjanusek +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_kid_education.png?itok=3lRp6gFa +[2]: https://www.commonsensemedia.org/research/the-common-sense-census-media-use-by-kids-age-zero-to-eight-2017?action +[3]: https://www.businessinsider.com/smartphone-use-young-kids-toddlers-limits-science-2018-3 +[4]: /article/18/1/best-open-education +[5]: https://opensource.com/resources/open-source-education +[6]: https://opensource.com/sites/default/files/uploads/cp_flashcards.gif (Childsplay screenshot) +[7]: http://www.childsplay.mobi/ +[8]: https://opensource.com/sites/default/files/uploads/eduactiv8.jpg (eduActiv8 screenshot) +[9]: https://www.eduactiv8.org/ +[10]: /article/17/11/5-approaches-learning-python +[11]: https://opensource.com/sites/default/files/uploads/gcompris2.png (GCompris screenshot) +[12]: https://gcompris.net/index-en.html +[13]: https://opensource.com/sites/default/files/uploads/feedthemonster.png (Feed the Monster screenshot) +[14]: https://www.curiouslearning.org/ +[15]: https://opensource.com/sites/default/files/uploads/syntaxuntangler.png (Syntax Untangler screenshot) +[16]: https://courses.dcs.wisc.edu/untangler/ +[17]: http://www.jstor.org/stable/41386459 diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md new file mode 100644 index 0000000000..13f95b8287 --- /dev/null +++ b/sources/tech/20190405 File sharing with Git.md @@ -0,0 +1,234 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (File sharing with Git) +[#]: via: (https://opensource.com/article/19/4/file-sharing-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +File sharing with Git +====== +SparkleShare is an open source, Git-based, Dropbox-style file sharing +application. Learn more in our series about little-known uses of Git. +![][1] + +[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. Today, we'll look at SparkleShare, which uses Git as the backbone for file sharing. + +### Git for file sharing + +One of the nice things about Git is that it's inherently distributed. It's built to share. Even if you're sharing a repository just with other computers on your own network, Git brings transparency to the act of getting files from a shared location. + +As interfaces go, Git is pretty simple. It varies from user to user, but the common incantation when sitting down to get some work done is just **git pull** or maybe the slightly more complex **git pull && git checkout -b my-branch**. Still, for some people, the idea of _entering a command_ into their computer at all is confusing or bothersome. Computers are meant to make life easy, and computers are good at repetitious tasks, and so there are easier ways to share files with Git. + +### SparkleShare + +The [SparkleShare][3] project is a cross-platform, open source, Dropbox-style file sharing application based on Git. It automates all Git commands, triggering the add, commit, push, and pull processes with the simple act of dragging-and-dropping a file into a specially designated SparkleShare directory. Because it is based on Git, you get fast, diff-based pushes and pulls, and you inherit all the benefits of Git version control and backend infrastructure (like Git hooks). It can be entirely self-hosted, or you can use it with Git hosting services like [GitLab][4], GitHub, Bitbucket, and others. Furthermore, because it's basically just a frontend to Git, you can access your SparkleShare files on devices that may not have a SparkleShare client but do have Git clients. + +Just as you get all the benefits of Git, you also get all the usual Git restrictions: It's impractical to use SparkleShare to store hundreds of photos and music and videos because Git is designed and optimized for text. Git certainly has the capability to store large files of binary data but it is designed to track history, so once a file is added to it, it's nearly impossible to completely remove it. This somewhat limits the usefulness of SparkleShare for some people, but it makes it ideal for many workflows, including [calendaring][5]. + +#### Installing SparkleShare + +SparkleShare is cross-platform, with installers for Windows and Mac available from its [website][6]. For Linux, there's a [Flatpak][7] in your software installer, or you can run these commands in a terminal: + + +``` +$ sudo flatpak remote-add flathub +$ sudo flatpak install flathub org.sparkleshare.SparkleShare +``` + +### Creating a Git repository + +SparkleShare isn't software-as-a-service (SaaS). You run SparkleShare on your computer to communicate with a Git repository—SparkleShare doesn't store your data. If you don't have a Git repository to sync a folder with yet, you must create one before launching SparkleShare. You have three options: hosted Git, self-hosted Git, or self-hosted SparkleShare. + +#### Git hosting + +SparkleShare can use any Git repository you can access for storage, so if you have or create an account with GitLab or any other hosting service, it can become the backend for your SparkleShare. For example, the open source [Notabug.org][8] service is a Git hosting service like GitHub and GitLab, but unique enough to prove SparkleShare's flexibility. Creating a new repository differs from host to host depending on the user interface, but all of the major ones follow the same general model. + +First, locate the button in your hosting service to create a new project or repository and click on it to begin. Then step through the repository creation process, providing a name for your repository, privacy level (repositories often default to being public), and whether or not to initialize the repository with a README file. Whether you need a README or not, enable an initial README file. Starting a repository with a file isn't strictly necessary, but it forces the Git host to instantiate a **master** branch in the repository, which helps ensure that frontend applications like SparkleShare have a branch to commit and push to. It's also useful for you to see a file, even if it's an almost empty README file, to confirm that you have connected. + +![Creating a Git repository][9] + +Once you've created a repository, obtain the URL it uses for SSH clones. You can get this URL the same way anyone gets any URL for a Git project: navigate to the page of the repository and look for the **Clone** button or field. + +![Cloning a URL on GitHub][10] + +Cloning a GitHub URL. + +![Cloning a URL on GitLab][11] + +Cloning a GitLab URL. + +This is the address SparkleShare uses to reach your data, so make note of it. Your Git repository is now configured. + +#### Self-hosted Git + +You can use SparkleShare to access a Git repository on any computer you have access to. No special setup is required, aside from a bare Git repository. However, if you want to give access to your Git repository to anyone else, then you should run a Git manager like [Gitolite][12] or SparkleShare's own Dazzle server to help you manage SSH keys and accounts. At the very least, create a user specific to Git so that users with access to your Git repository don't also automatically gain access to the rest of your server. + +Log into your server as the Git user (or yourself, if you're very good at managing user and group permissions) and create a repository: + + +``` +$ mkdir ~/sparkly.git +$ cd ~/sparkly.git +$ git init --bare . +``` + +Your Git repository is now configured. + +#### Dazzle + +SparkleShare's developers provide a Git management system called [Dazzle][13] to help you self-host Git repositories. + +On your server, download the Dazzle application to some location in your path: + + +``` +$ curl \ +\--output ~/bin/dazzle +$ chmod +x ~/bin/dazzle +``` + +Dazzle sets up a user specific to Git and SparkleShare and also implements access rights based on keys generated by the SparkleShare application. For now, just set up a project: + + +``` +`$ dazzle create sparkly` +``` + +Your server is now configured as a SparkleShare host. + +### Configuring SparkleShare + +When you launch SparkleShare for the first time, you are prompted to configure what server you want SparkleShare to use for storage. This process may feel like a first-run setup wizard, but it's actually the usual process for setting up a new shared location within SparkleShare. Unlike many shared drive applications, with SparkleShare you can have several locations configured at once. The first shared location you configure isn't any more significant than any shared location you may set up later, and you're not signing up with SparkleShare or any other service. You're just pointing SparkleShare at a Git repository so that it knows what to keep your first SparkleShare folder in sync with. + +On the first screen, identify yourself by whatever means you want on record in the Git commits that SparkleShare makes on your behalf. You can use anything, even fake information that resolves to nothing. It's purely for the commit messages, which you may never even see if you have no interest in reviewing the Git backend processes. + +The next screen prompts you to choose your hosting type. If you are using GitLab, GitHub, Planio, or Bitbucket, then select the appropriate one. For anything else, select **Own server**. + +![Choosing a Sparkleshare host][14] + +At the bottom of this screen, you must enter the SSH clone URL. If you're self-hosting, the address is something like **** and the remote path is the absolute path to the Git repository you created for this purpose. + +Based on my self-hosted examples above, the address to my imaginary server is **** (the **:22122** indicates a nonstandard SSH port) and the remote path is **/home/git/sparkly.git**. + +If I use my Notabug.org account instead, the address from the example above is **[git@notabug.org][15]** and the path is **seth/sparkly.git**. + +SparkleShare will fail the first time it attempts to connect to the host because you have not yet copied the SparkleShare client ID (an SSH key specific to the SparkleShare application) to the Git host. This is expected, so don't cancel the process. Leave the SparkleShare setup window open and obtain the client ID from the SparkleShare icon in your system tray. Then copy the client ID to your clipboard so you can add it to your Git host. + +![Getting the client ID from Sparkleshare][16] + +#### Adding your client ID to a hosted Git account + +Minor UI differences aside, adding an SSH key (which is all the client ID is) is basically the same process on any hosting service. In your Git host's web dashboard, navigate to your user settings and find the **SSH Keys** category. Click the **Add New Key** button (or similar) and paste the contents of your SparkleShare client ID. + +![Adding an SSH key][17] + +Save the key. If you want someone else, such as collaborators or family members, to be able to access this same repository, they must provide you with their SparkleShare client ID so you can add it to your account. + +#### Adding your client ID to a self-hosted Git account + +A SparkleShare client ID is just an SSH key, so copy and paste it into your Git user's **~/.ssh/authorized_keys** file. + +#### Adding your client ID with Dazzle + +If you are using Dazzle to manage your SparkleShare projects, add a client ID with this command: + + +``` +`$ dazzle link` +``` + +When Dazzle prompts you for the ID, paste in the client ID found in the SparkleShare menu. + +### Using SparkleShare + +Once you've added your client ID to your Git host, click the **Retry** button in the SparkleShare window to finish setup. When it's finished cloning your repository, you can close the SparkleShare setup window, and you'll find a new **SparkleShare** folder in your home directory. If you set up a Git repository with a hosting service and chose to include a README or license file, you can see them in your SparkleShare directory. + +![Sparkleshare file manager][18] + +Otherwise, there are some hidden directories, which you can see by revealing hidden directories in your file manager. + +![Showing hidden files in GNOME][19] + +You use SparkleShare the same way you use any directory on your computer: you put files into it. Anytime a file or directory is placed into a SparkleShare folder, it's copied in the background to your Git repository. + +#### Excluding certain files + +Since Git is designed to remember _everything_ , you may want to exclude specific file types from ever being recorded. There are a few reasons to manage excluded files. By defining files that are off limits for SparkleShare, you can avoid accidental copying of large files. You can also design a scheme for yourself that enables you to store files that logically belong together (MIDI files with their **.flac** exports, for instance) in one directory, but manually back up the large files yourself while letting SparkleShare back up the text-based files. + +If you can't see hidden files in your system's file manager, then reveal them. Navigate to your SparkleShare folder, then to the directory representing your repository, locate a file called **.gitignore** , and open it in a text editor. You can enter file extensions or file names, one per line, into **.gitignore** , and any file matching what you list will be (as the file name suggests) ignored. + + +``` +Thumbs.db +$RECYCLE.BIN/ +.DS_Store +._* +.fseventsd +.Spotlight-V100 +.Trashes +.directory +.Trash-* +*.wav +*.ogg +*.flac +*.mp3 +*.m4a +*.opus +*.jpg +*.png +*.mp4 +*.mov +*.mkv +*.avi +*.pdf +*.djvu +*.epub +*.od{s,t} +*.cbz +``` + +You know the types of files you encounter most often, so concentrate on the ones most likely to sneak their way into your SparkleShare directory. If you want to exercise a little overkill, you can find good collections of **.gitignore** files on Notabug.org and also on the internet at large. + +With those entries in your **.gitignore** file, you can place large files that you don't want sent to your Git host in your SparkleShare directory, and SparkleShare will ignore them entirely. Of course, that means it's up to you to make sure they get onto a backup or distributed to your SparkleShare collaborators through some other means. + +### Automation + +[Automation][20] is part of the silent agreement we have with computers: they do the repetitious, boring stuff that we humans either aren't very good at doing or aren't very good at remembering. SparkleShare is a nice, simple way to automate the routine distribution of data. It isn't right for every Git repository, by any means. It doesn't have an interface for advanced Git functions; it doesn't have a pause button or a manual override. And that's OK because its scope is intentionally limited. SparkleShare does what SparkleShare sets out to do, it does it well, and it's one Git repository you won't have to think about. + +If you have a use for that kind of steady, invisible automation, give SparkleShare a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/file-sharing-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://git-scm.com/ +[3]: http://www.sparkleshare.org/ +[4]: http://gitlab.com +[5]: https://opensource.com/article/19/4/calendar-git +[6]: http://sparkleshare.org +[7]: /business/16/8/flatpak +[8]: http://notabug.org +[9]: https://opensource.com/sites/default/files/uploads/git-new-repo.jpg (Creating a Git repository) +[10]: https://opensource.com/sites/default/files/uploads/github-clone-url.jpg (Cloning a URL on GitHub) +[11]: https://opensource.com/sites/default/files/uploads/gitlab-clone-url.jpg (Cloning a URL on GitLab) +[12]: http://gitolite.org +[13]: https://github.com/hbons/Dazzle +[14]: https://opensource.com/sites/default/files/uploads/sparkleshare-host.jpg (Choosing a Sparkleshare host) +[15]: mailto:git@notabug.org +[16]: https://opensource.com/sites/default/files/uploads/sparkleshare-clientid.jpg (Getting the client ID from Sparkleshare) +[17]: https://opensource.com/sites/default/files/uploads/git-ssh-key.jpg (Adding an SSH key) +[18]: https://opensource.com/sites/default/files/uploads/sparkleshare-file-manager.jpg (Sparkleshare file manager) +[19]: https://opensource.com/sites/default/files/uploads/gnome-show-hidden-files.jpg (Showing hidden files in GNOME) +[20]: /downloads/ansible-quickstart diff --git a/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md b/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md new file mode 100644 index 0000000000..6ee1633f9d --- /dev/null +++ b/sources/tech/20190405 How to Authenticate a Linux Desktop to Your OpenLDAP Server.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Authenticate a Linux Desktop to Your OpenLDAP Server) +[#]: via: (https://www.linux.com/blog/how-authenticate-linux-desktop-your-openldap-server) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +How to Authenticate a Linux Desktop to Your OpenLDAP Server +====== + +![][1] + +[Creative Commons Zero][2] + +In this final part of our three-part series, we reach the conclusion everyone has been waiting for. The ultimate goal of using LDAP (in many cases) is enabling desktop authentication. With this setup, admins are better able to manage and control user accounts and logins. After all, Active Directory admins shouldn’t have all the fun, right? + +WIth OpenLDAP, you can manage your users on a centralized directory server and connect the authentication of every Linux desktop on your network to that server. And since you already have [OpenLDAP][3] and the [LDAP Authentication Manager][4] setup and running, the hard work is out of the way. At this point, there is just a few quick steps to enabling those Linux desktops to authentication with that server. + +I’m going to walk you through this process, using the Ubuntu Desktop 18.04 to demonstrate. If your desktop distribution is different, you’ll only have to modify the installation steps, as the configurations should be similar. + +**What You’ll Need** + +Obviously you’ll need the OpenLDAP server up and running. You’ll also need user accounts created on the LDAP directory tree, and a user account on the client machines with sudo privileges. With those pieces out of the way, let’s get those desktops authenticating. + +**Installation** + +The first thing we must do is install the necessary client software. This will be done on all the desktop machines that require authentication with the LDAP server. Open a terminal window on one of the desktop machines and issue the following command: + +``` +sudo apt-get install libnss-ldap libpam-ldap ldap-utils nscd -y +``` + +During the installation, you will be asked to enter the LDAP server URI ( **Figure 1** ). + +![][5] + +Figure 1: Configuring the LDAP server URI for the client. + +[Used with permission][6] + +The LDAP URI is the address of the OpenLDAP server, in the form ldap://SERVER_IP (Where SERVER_IP is the IP address of the OpenLDAP server). Type that address, tab to OK, and press Enter on your keyboard. + +In the next window ( **Figure 2)** , you are required to enter the Distinguished Name of the OpenLDAP server. This will be in the form dc=example,dc=com. + +![][7] + +Figure 2: Configuring the DN of your OpenLDAP server. + +[Used with permission][6] + +If you’re unsure of what your OpenLDAP DN is, log into the LDAP Account Manager, click Tree View, and you’ll see the DN listed in the left pane ( **Figure 3** ). + +![][8] + +Figure 3: Locating your OpenLDAP DN with LAM. + +[Used with permission][6] + +The next few configuration windows, will require the following information: + + * Specify LDAP version (select 3) + + * Make local root Database admin (select Yes) + + * Does the LDAP database require login (select No) + + * Specify LDAP admin account suffice (this will be in the form cn=admin,dc=example,dc=com) + + * Specify password for LDAP admin account (this will be the password for the LDAP admin user) + + + + +Once you’ve answered the above questions, the installation of the necessary bits is complete. + +**Configuring the LDAP Client** + +Now it’s time to configure the client to authenticate against the OpenLDAP server. This is not nearly as hard as you might think. + +First, we must configure nsswitch. Open the configuration file with the command: + +``` +sudo nano /etc/nsswitch.conf +``` + +In that file, add ldap at the end of the following line: + +``` +passwd: compat systemd + +group: compat systemd + +shadow: files +``` + +These configuration entries should now look like: + +``` +passwd: compat systemd ldap +group: compat systemd ldap +shadow: files ldap +``` + +At the end of this section, add the following line: + +``` +gshadow files +``` + +The entire section should now look like: + +``` +passwd: compat systemd ldap + +group: compat systemd ldap + +shadow: files ldap + +gshadow files +``` + +Save and close that file. + +Now we need to configure PAM for LDAP authentication. Issue the command: + +``` +sudo nano /etc/pam.d/common-password +``` + +Remove use_authtok from the following line: + +``` +password [success=1 user_unknown=ignore default=die] pam_ldap.so use_authtok try_first_pass +``` + +Save and close that file. + +There’s one more PAM configuration to take care of. Issue the command: + +``` +sudo nano /etc/pam.d/common-session +``` + +At the end of that file, add the following: + +``` +session optional pam_mkhomedir.so skel=/etc/skel umask=077 +``` + +The above line will create the default home directory (upon first login), on the Linux desktop, for any LDAP user that doesn’t have a local account on the machine. Save and close that file. + +**Logging In** + +Reboot the client machine. When the login is presented, attempt to log in with a user on your OpenLDAP server. The user account should authenticate and present you with a desktop. You are good to go. + +Make sure to configure every single Linux desktop on your network in the same fashion, so they too can authenticate against the OpenLDAP directory tree. By doing this, any user in the tree will be able to log into any configured Linux desktop machine on your network. + +You now have an OpenLDAP server running, with the LDAP Account Manager installed for easy account management, and your Linux clients authenticating against that LDAP server. + +And that, my friends, is all there is to it. + +We’re done. + +Keep using Linux. + +It’s been an honor. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/how-authenticate-linux-desktop-your-openldap-server + +作者:[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.linux.com/sites/lcom/files/styles/rendered_file/public/cyber-3400789_1280_0.jpg?itok=YiinDnTw +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.linux.com/blog/2019/3/how-install-openldap-ubuntu-server-1804 +[4]: https://www.linux.com/blog/learn/2019/3/how-install-ldap-account-manager-ubuntu-server-1804 +[5]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_1.jpg?itok=DgYT8iY1 +[6]: /LICENSES/CATEGORY/USED-PERMISSION +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_2.jpg?itok=CXITs7_J +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ldapauth_3.jpg?itok=HmhiYj7J diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md new file mode 100644 index 0000000000..2d7749a465 --- /dev/null +++ b/sources/tech/20190406 Run a server with Git.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run a server with Git) +[#]: via: (https://opensource.com/article/19/4/server-administration-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) + +Run a server with Git +====== +Thanks to Gitolite, you can manage a Git server with Git. Learn how in +our series about little-known Git uses. +![computer servers processing data][1] + +As I've tried to demonstrate in this series leading up to Git's 14th anniversary on April 7, [Git][2] can do a wide range of things beyond tracking source code. Believe it or not, Git can even manage your Git server, so you can, more or less, run a Git server with Git itself. + +Of course, this involves a lot of components beyond everyday Git, not the least of which is [Gitolite][3], the backend application managing the fiddly bits that you configure using Git. The great thing about Gitolite is that, because it uses Git as its frontend interface, it's easy to integrate Git server administration within the rest of your Git-based workflow. Gitolite provides precise control over who can access specific repositories on your server and what permissions they have. You can manage that sort of thing yourself with the usual Linux system tools, but it takes a lot of work if you have more than just one or two repos across a half-dozen users. + +Gitolite's developers have done the hard work to make it easy for you to provide many users with access to your Git server without giving them access to your entire environment—and you can do it all with Git. + +What Gitolite is _not_ is a GUI admin and user panel. That sort of experience is available with the excellent [Gitea][4] project, but this article focuses on the simple elegance and comforting familiarity of Gitolite. + +### Install Gitolite + +Assuming your Git server runs Linux, you can install Gitolite with your package manager ( **yum** on CentOS and RHEL, **apt** on Debian and Ubuntu, **zypper** on OpenSUSE, and so on). For example, on RHEL: + + +``` +`$ sudo yum install gitolite3` +``` + +Many repositories still have older versions of Gitolite for legacy support, but the current version is version 3. + +You must have passwordless SSH access to your server. You can use a password to log in if you prefer, but Gitolite relies on SSH keys, so you must configure the option to log in with keys. If you don't know how to configure a server for passwordless SSH access, go learn how to do that first (the [Setting up SSH key authentication][5] section of Steve Ovens's Ansible article explains it well). It's an essential part of secure server administration—as well as of running Gitolite. + +### Configure a Git user + +Without Gitolite, if a person requests access to a Git repository you host on a server, you have to provide that person with a user account. Git provides a special shell, the **git-shell** , which is an ultra-specific shell that performs only Git tasks. This lets you have users who can access your server only through the filter of a very limited shell environment. + +That solution works, but it usually means a user gains access to all repositories on your server unless you have a very good schema for group permissions and maintain those permissions strictly whenever a new repository is created. It also requires a lot of manual configuration at the system level, an area usually reserved for a specific tier of sysadmins and not necessarily the person usually in charge of Git repositories. + +Gitolite sidesteps this issue entirely by designating one username for every person who needs access to any repository. By default, the username is **git** , and because Gitolite's documentation assumes that's what is used, it's a good default to keep when you're learning the tool. It's also a well-known convention for anyone who's ever used GitLab or GitHub or any other Git hosting service. + +Gitolite calls this user the _hosting user_. Create an account on your server to act as the hosting user (I'll stick with **git** because that's the convention): + + +``` +` $ sudo adduser --create-home git` +``` + +For you to control the **git** user account, it must have a valid public SSH key that belongs to you. You should already have this set up, so **cp** your public key ( _not your private key_ ) to the **git** user's home directory: + + +``` +$ sudo cp ~/.ssh/id_ed25519.pub /home/git/ +$ sudo chown git:git /home/git/id_ed25519.pub +``` + +If your public key doesn't end with the extension **.pub** , Gitolite will not use it, so rename the file accordingly. Change to that user account to run Gitolite's setup: + + +``` +$ sudo su - git +$ gitolite setup --pubkey id_ed25519.pub +``` + +After the setup script runs, the **git** home's user directory will have a **repositories** directory, which (for now) contains the files **git-admin.git** and **testing.git**. That's all the setup the server requires, so log out. + +### Use Gitolite + +Managing Gitolite is a matter of editing text files in a Git repository, specifically **gitolite-admin.git**. You won't SSH into your server for Git administration, and Gitolite encourages you not to try. The repositories you and your users store on the Gitolite server are _bare_ repositories, so it's best to stay out of them. + + +``` +$ git clone [git@example.com][6]:gitolite-admin.git gitolite-admin.git +$ cd gitolite-admin.git +$ ls -1 +conf +keydir +``` + +The **conf** directory in this repository contains a file called **gitolite.conf**. Open it in a text editor or use **cat** to view its contents: + + +``` +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all +``` + +You may have an idea of what this configuration file does: **gitolite-admin** represents this repository, and the owner of the **id_ed25519** key has read, write, and Git administrative privileges. In other words, rather than mapping users to normal local Unix users (because all your users log in using the **git** hosting user identity), Gitolite maps users to SSH keys listed in the **keydir** directory. + +The **testing.git** repository gives full permissions to everyone with access to the server using special group notation. + +#### Add users + +If you want to add a user called **alice** to your Git server, the person Alice must send you her public SSH key. Gitolite uses whatever is to the left of the **.pub** extension as the identifier for your Git users. Rather than using the default key name values, give keys a name indicative of the key owner. If a user has more than one key (e.g., one for her laptop, one for her desktop), you can use subdirectories to avoid file name collisions. For instance, the key Alice uses from her laptop might come to you as the default **id_rsa.pub** , so rename it **alice.pub** or similar (or let the users name the key according to their local user accounts on their computers), and place it into the **gitolite-admin.git/keydir/work/laptop/** directory. If she sends you another key from her desktop, name it **alice.pub** (the same as the previous one) and add it to **keydir/work/desktop/**. Another key might go into **keydir/home/desktop/** , and so on. Gitolite recursively searches **keydir** for a **.pub** file matching a repository "user" and treats any match as the same identity. + +When you add keys to the **keydir** directory, you must commit them back to your server. This is such an easy thing to forget that there's a real argument here for using an automated Git application like [**Sparkleshare**][7] so any change is committed back to your Gitolite admin immediately. The first time you forget to commit and push—and waste three hours of your time and your user's time troubleshooting—you'll see that Gitolite is the perfect justification for using Sparkleshare. + + +``` +$ git add keydir +$ git commit -m 'added alice-laptop-0.pub' +$ git push origin HEAD +``` + +Alice, by default, gains access to the **testing.git** directory so she can test connectivity and functionality with that. + +#### Set permissions + +As with users, directory permissions and groups are abstracted away from the normal Unix tools you might be used to (or find information about online). Permissions to projects are granted in the **gitolite.conf** file in **gitolite-admin.git/conf** directory. There are four levels of permissions: + + * **R** allows read-only. A user with **R** permissions on a repository may clone it, and that's all. + * **RW** allows a user to perform a fast-forward push of a branch, create new branches, and create new tags. More or less, this one feels like a "normal" Git repository to most users. + * **RW+** allows Git actions that are potentially destructive. A user can perform normal fast-forward pushes, as well as rewind pushes, do rebases, and delete branches and tags. This may or may not be something you want to grant to all contributors on a project. + * **-** explicitly denies access to a repository. This is essentially the same as a user not being listed in the repository's configuration. + + + +Create a new repository or modify an existing repository's permissions by adjusting **gitolite.conf**. For instance, to give Alice permissions to administrate a new repository called **widgets.git** : + + +``` +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo widgets +RW+ = alice +``` + +Now Alice—and Alice alone—can clone the repo: + + +``` +[alice]$ git clone [git@example.com][6]:widgets.git +Cloning into 'widgets'... +warning: You appear to have cloned an empty repository. +``` + +On her initial push, Alice must use the **-u** option to send her branch to the empty repository (as she would have to do with any Git host). + +To make user management easier, you can define groups of repositories: + + +``` +@qtrepo = widgets +@qtrepo = games + +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo @qtrepo +RW+ = alice +``` + +Just as you can create group repositories, you can group users. One user group exists by default: **@all**. As you might expect, it includes all users, without exception. You can create your own: + + +``` +@qtrepo = widgets +@qtrepo = games + +@developers = alice bob + +repo gitolite-admin +RW+ = id_ed22519 + +repo testing +RW+ = @all + +repo @qtrepo +RW+ = @developers +``` + +As with adding or modifying key files, any change to the **gitolite.conf** file must be committed and pushed to take effect. + +### Create a repository + +By default, Gitolite assumes repository creation happens from the top down. For instance, a project manager with access to the Git server creates a project repository and, through the Gitolite administration repo, adds developers. + +In practice, you might prefer to grant users permission to create repositories. Gitolite calls these "wild repos" (I'm not sure whether that's commentary on how the repos come into being or a reference to the wildcard characters required by the configuration file to let it happen). Here's an example: + + +``` +@managers = alice bob + +repo foo/CREATOR/[a-z]..* +C = @managers +RW+ = CREATOR +RW = WRITERS +R = READERS +``` + +The first line defines a group of users: the group is called **@managers** and contains users **alice** and **bob**. The next line sets up a wildcard allowing repositories that do not yet exist to be created in a directory called **foo** followed by a subdirectory named for the user creating the repo. For example: + + +``` +[alice]$ git clone [git@example.com][6]:foo/alice/cool-app.git +Cloning into cool-app'... +Initialized empty Git repository in /home/git/repositories/foo/alice/cool-app.git +warning: You appear to have cloned an empty repository. +``` + +There are some mechanisms for the creator of a wild repo to define who can read and write to their repository, but they're limited in scope. For the most part, Gitolite assumes that a specific set of users governs project permission. One solution is to grant all users access to **gitolite-admin** using a Git hook to require manager approval to merge changes into the master branch. + +### Learn more + +Gitolite has many more features than what this introductory article covers, so try it out. The [documentation][8] is excellent, and once you read through it, you can customize your Gitolite server to provide your users whatever level of control you are comfortable with. Gitolite is a low-maintenance, simple system that you can install, set up, and then more or less forget about. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/server-administration-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) +[2]: https://git-scm.com/ +[3]: http://gitolite.com +[4]: http://gitea.io +[5]: Setting%20up%20SSH%20key%20authentication +[6]: mailto:git@example.com +[7]: https://opensource.com/article/19/4/file-sharing-git +[8]: http://gitolite.com/gitolite/quick_install.html diff --git a/sources/tech/20190407 Manage multimedia files with Git.md b/sources/tech/20190407 Manage multimedia files with Git.md new file mode 100644 index 0000000000..340c356aa9 --- /dev/null +++ b/sources/tech/20190407 Manage multimedia files with Git.md @@ -0,0 +1,247 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage multimedia files with Git) +[#]: via: (https://opensource.com/article/19/4/manage-multimedia-files-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Manage multimedia files with Git +====== +Learn how to use Git to track large multimedia files in your projects in +the final article in our series on little-known uses of Git. +![video editing dashboard][1] + +Git is very specifically designed for source code version control, so it's rarely embraced by projects and industries that don't primarily work in plaintext. However, the advantages of an asynchronous workflow are appealing, especially in the ever-growing number of industries that combine serious computing with seriously artistic ventures, including web design, visual effects, video games, publishing, currency design (yes, that's a real industry), education… the list goes on and on. + +In this series leading up to Git's 14th anniversary, we've shared six little-known ways to use Git. In this final article, we'll look at software that brings the advantages of Git to managing multimedia files. + +### The problem with managing multimedia files with Git + +It seems to be common knowledge that Git doesn't work well with non-text files, but it never hurts to challenge assumptions. Here's an example of copying a photo file using Git: + + +``` +$ du -hs +108K . +$ cp ~/photos/dandelion.tif . +$ git add dandelion.tif +$ git commit -m 'added a photo' +[master (root-commit) fa6caa7] two photos +1 file changed, 0 insertions(+), 0 deletions(-) +create mode 100644 dandelion.tif +$ du -hs +1.8M . +``` + +Nothing unusual so far; adding a 1.8MB photo to a directory results in a directory 1.8MB in size. So, let's try removing the file: + + +``` +$ git rm dandelion.tif +$ git commit -m 'deleted a photo' +$ du -hs +828K . +``` + +You can see the problem here: Removing a large file after it's been committed increases a repository's size roughly eight times its original, barren state (from 108K to 828K). You can perform tests to get a better average, but this simple demonstration is consistent with my experience. The cost of committing files that aren't text-based is minimal at first, but the longer a project stays active, the more changes people make to static content, and the more those fractions start to add up. When a Git repository becomes very large, the major cost is usually speed. The time to perform pulls and pushes goes from being how long it takes to take a sip of coffee to how long it takes to wonder if your computer got kicked off the network. + +The reason static content causes Git to grow in size is that formats based on text allow Git to pull out just the parts that have changed. Raster images and music files make as much sense to Git as they would to you if you looked at the binary data contained in a .png or .wav file. So Git just takes all the data and makes a new copy of it, even if only one pixel changes from one photo to the next. + +### Git-portal + +In practice, many multimedia projects don't need or want to track the media's history. The media part of a project tends to have a different lifecycle than the text or code part of a project. Media assets generally progress in one direction: a picture starts as a pencil sketch, proceeds toward its destination as a digital painting, and, even if the text is rolled back to an earlier version, the art continues its forward progress. It's rare for media to be bound to a specific version of a project. The exceptions are usually graphics that reflect datasets—usually tables or graphs or charts—that can be done in text-based formats such as SVG. + +So, on many projects that involve both media and text (whether it's narrative prose or code), Git is an acceptable solution to file management, as long as there's a playground outside the version control cycle for artists to play in. + +![Graphic showing relationship between art assets and Git][2] + +A simple way to enable that is [Git-portal][3], a Bash script armed with Git hooks that moves your asset files to a directory outside Git's purview and replaces them with symlinks. Git commits the symlinks (sometimes called aliases or shortcuts), which are trivially small, so all you commit are your text files and whatever symlinks represent your media assets. Because the replacement files are symlinks, your project continues to function as expected because your local machine follows the symlinks to their "real" counterparts. Git-portal maintains a project's directory structure when it swaps out a file with a symlink, so it's easy to reverse the process, should you decide that Git-portal isn't right for your project or you need to build a version of your project without symlinks (for distribution, for instance). + +Git-portal also allows remote synchronization of assets over rsync, so you can set up a remote storage location as a centralized source of authority. + +Git-portal is ideal for multimedia projects, including video game and tabletop game design, virtual reality projects with big 3D model renders and textures, [books][4] with graphics and .odt exports, collaborative [blog websites][5], music projects, and much more. It's not uncommon for an artist to perform versioning in their application—in the form of layers (in the graphics world) and tracks (in the music world)—so Git adds nothing to multimedia project files themselves. The power of Git is leveraged for other parts of artistic projects (prose and narrative, project management, subtitle files, credits, marketing copy, documentation, and so on), and the power of structured remote backups is leveraged by the artists. + +#### Install Git-portal + +There are RPM packages for Git-portal located at , which you can download and install. + +Alternately, you can install Git-portal manually from its home on GitLab. It's just a Bash script and some Git hooks (which are also Bash scripts), but it requires a quick build process so that it knows where to install itself: + + +``` +$ git clone git-portal.clone +$ cd git-portal.clone +$ ./configure +$ make +$ sudo make install +``` + +#### Use Git-portal + +Git-portal is used alongside Git. This means, as with all large-file extensions to Git, there are some added steps to remember. But you only need Git-portal when dealing with your media assets, so it's pretty easy to remember unless you've acclimated yourself to treating large files the same as text files (which is rare for Git users). There's one setup step you must do to use Git-portal in a project: + + +``` +$ mkdir bigproject.git +$ cd !$ +$ git init +$ git-portal init +``` + +Git-portal's **init** function creates a **_portal** directory in your Git repository and adds it to your .gitignore file. + +Using Git-portal in a daily routine integrates smoothly with Git. A good example is a MIDI-based music project: the project files produced by the music workstation are text-based, but the MIDI files are binary data: + + +``` +$ ls -1 +_portal +song.1.qtr +song.qtr +song-Track_1-1.mid +song-Track_1-3.mid +song-Track_2-1.mid +$ git add song*qtr +$ git-portal song-Track*mid +$ git add song-Track*mid +``` + +If you look into the **_portal** directory, you'll find the original MIDI files. The files in their place are symlinks to **_portal** , which keeps the music workstation working as expected: + + +``` +$ ls -lG +[...] _portal/ +[...] song.1.qtr +[...] song.qtr +[...] song-Track_1-1.mid -> _portal/song-Track_1-1.mid* +[...] song-Track_1-3.mid -> _portal/song-Track_1-3.mid* +[...] song-Track_2-1.mid -> _portal/song-Track_2-1.mid* +``` + +As with Git, you can also add a directory of files: + + +``` +$ cp -r ~/synth-presets/yoshimi . +$ git-portal add yoshimi +Directories cannot go through the portal. Sending files instead. +$ ls -lG _portal/yoshimi +[...] yoshimi.stat -> ../_portal/yoshimi/yoshimi.stat* +``` + +Removal works as expected, but when removing something in **_portal** , you should use **git-portal rm** instead of **git rm**. Using Git-portal ensures that the file is removed from **_portal** : + + +``` +$ ls +_portal/ song.qtr song-Track_1-3.mid@ yoshimi/ +song.1.qtr song-Track_1-1.mid@ song-Track_2-1.mid@ +$ git-portal rm song-Track_1-3.mid +rm 'song-Track_1-3.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +``` + +If you forget to use Git-portal, then you have to remove the portal file manually: + + +``` +$ git-portal rm song-Track_1-1.mid +rm 'song-Track_1-1.mid' +$ ls _portal/ +song-Track_1-1.mid* song-Track_2-1.mid* yoshimi/ +$ trash _portal/song-Track_1-1.mid +``` + +Git-portal's only other function is to list all current symlinks and find any that may have become broken, which can sometimes happen if files move around in a project directory: + + +``` +$ mkdir foo +$ mv yoshimi foo +$ git-portal status +bigproject.git/song-Track_2-1.mid: symbolic link to _portal/song-Track_2-1.mid +bigproject.git/foo/yoshimi/yoshimi.stat: broken symbolic link to ../_portal/yoshimi/yoshimi.stat +``` + +If you're using Git-portal for a personal project and maintaining your own backups, this is technically all you need to know about Git-portal. If you want to add in collaborators or you want Git-portal to manage backups the way (more or less) Git does, you can a remote. + +#### Add Git-portal remotes + +Adding a remote location for Git-portal is done through Git's existing remote function. Git-portal implements Git hooks, scripts hidden in your repository's .git directory, to look at your remotes for any that begin with **_portal**. If it finds one, it attempts to **rsync** to the remote location and synchronize files. Git-portal performs this action anytime you do a Git push or a Git merge (or pull, which is really just a fetch and an automatic merge). + +If you've only cloned Git repositories, then you may never have added a remote yourself. It's a standard Git procedure: + + +``` +$ git remote add origin [git@gitdawg.com][6]:seth/bigproject.git +$ git remote -v +origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) +origin [git@gitdawg.com][6]:seth/bigproject.git (push) +``` + +The name **origin** is a popular convention for your main Git repository, so it makes sense to use it for your Git data. Your Git-portal data, however, is stored separately, so you must create a second remote to tell Git-portal where to push to and pull from. Depending on your Git host, you may need a separate server because gigabytes of media assets are unlikely to be accepted by a Git host with limited space. Or maybe you're on a server that permits you to access only your Git repository and not external storage directories: + + +``` +$ git remote add _portal [seth@example.com][7]:/home/seth/git/bigproject_portal +$ git remote -v +origin [git@gitdawg.com][6]:seth/bigproject.git (fetch) +origin [git@gitdawg.com][6]:seth/bigproject.git (push) +_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (fetch) +_portal [seth@example.com][7]:/home/seth/git/bigproject_portal (push) +``` + +You may not want to give all of your users individual accounts on your server, and you don't have to. To provide access to the server hosting a repository's large file assets, you can run a Git frontend like **[Gitolite][8]** , or you can use **rrsync** (i.e., restricted rsync). + +Now you can push your Git data to your remote Git repository and your Git-portal data to your remote portal: + + +``` +$ git push origin HEAD +master destination detected +Syncing _portal content... +sending incremental file list +sent 9,305 bytes received 18 bytes 1,695.09 bytes/sec +total size is 60,358,015 speedup is 6,474.10 +Syncing _portal content to example.com:/home/seth/git/bigproject_portal +``` + +If you have Git-portal installed and a **_portal** remote configured, your **_portal** directory will be synchronized, getting new content from the server and sending fresh content with every push. While you don't have to do a Git commit and push to sync with the server (a user could just use rsync directly), I find it useful to require commits for artistic changes. It integrates artists and their digital assets into the rest of the workflow, and it provides useful metadata about project progress and velocity. + +### Other options + +If Git-portal is too simple for you, there are other options for managing large files with Git. [Git Large File Storage][9] (LFS) is a fork of a defunct project called git-media and is maintained and supported by GitHub. It requires special commands (like **git lfs track** to protect large files from being tracked by Git) and requires the user to manage a .gitattributes file to update which files in the repository are tracked by LFS. It supports _only_ HTTP and HTTPS remotes for large files, so your LFS server must be configured so users can authenticate over HTTP rather than SSH or rsync. + +A more flexible option than LFS is [git-annex][10], which you can learn more about in my article about [managing binary blobs in Git][11] (ignore the parts about the deprecated git-media, as its former flexibility doesn't apply to its successor, Git LFS). Git-annex is a flexible and elegant solution with a detailed system for adding, removing, and moving large files within a repository. Because it's flexible and powerful, there are lots of new commands and rules to learn, so take a look at its [documentation][12]. + +If, however, your needs are simple and you like a solution that utilizes existing technology to do simple and obvious tasks, Git-portal might be the tool for the job. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/manage-multimedia-files-git + +作者:[Seth Kenlon (Red Hat, Community Moderator)][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/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/sites/default/files/uploads/git-velocity.jpg (Graphic showing relationship between art assets and Git) +[3]: http://gitlab.com/slackermedia/git-portal.git +[4]: https://www.apress.com/gp/book/9781484241691 +[5]: http://mixedsignals.ml +[6]: mailto:git@gitdawg.com +[7]: mailto:seth@example.com +[8]: https://opensource.com/article/19/4/file-sharing-git +[9]: https://git-lfs.github.com/ +[10]: https://git-annex.branchable.com/ +[11]: https://opensource.com/life/16/8/how-manage-binary-blobs-git-part-7 +[12]: https://git-annex.branchable.com/walkthrough/ diff --git a/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md b/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md new file mode 100644 index 0000000000..10e073a029 --- /dev/null +++ b/sources/tech/20190407 What it means to be Cloud-Native approach - the CNCF way.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What it means to be Cloud-Native approach — the CNCF way) +[#]: via: (https://medium.com/@sonujose993/what-it-means-to-be-cloud-native-approach-the-cncf-way-9e8ab99d4923) +[#]: author: (Sonu Jose https://medium.com/@sonujose993) + +What it means to be Cloud-Native approach — the CNCF way +====== + +![](https://cdn-images-1.medium.com/max/2400/0*YknjM7T_Pxwz9deR) + +While discussing on Digital Transformation and modern application development Cloud-Native is a term which frequently comes in. But what does it actually means to be cloud-native? This blog is all about giving a good understanding of the cloud-native approach and the ways to achieve it in the CNCF way. + +Michael Dell once said that “the cloud isn’t a place, it’s a way of doing IT”. He was right, and the same can be said of cloud-native. + +Cloud-native is an approach to building and running applications that exploit the advantages of the cloud computing delivery model. Cloud-native is about how applications are created and deployed, not where. … It’s appropriate for both public and private clouds. + +Cloud native architectures take full advantage of on-demand delivery, global deployment, elasticity, and higher-level services. They enable huge improvements in developer productivity, business agility, scalability, availability, utilization, and cost savings. + +### CNCF (Cloud native computing foundation) + +Google has been using containers for many years and they led the Kubernetes project which is a leading container orchestration platform. But alone they can’t really change the broad perspective in the industry around modern applications. So there was a huge need for industry leaders to come together and solve the major problems facing the modern approach. In order to achieve this broader vision, Google donated kubernetes to the Cloud Native foundation and this lead to the birth of CNCF in 2015. + +![](https://cdn-images-1.medium.com/max/1200/1*S1V9R_C_rjLVlH3M8dyF-g.png) + +Cloud Native computing foundation is created in the Linux foundation for building and managing platforms and solutions for modern application development. It really is a home for amazing projects that enable modern application development. CNCF defines cloud-native as “scalable applications” running in “modern dynamic environments” that use technologies such as containers, microservices, and declarative APIs. Kubernetes is the world’s most popular container-orchestration platform and the first CNCF project. + +### The approach… + +CNCF created a trail map to better understand the concept of Cloud native approach. In this article, we will be discussed based on this landscape. The newer version is available at https://landscape.cncf.io/ + +The Cloud Native Trail Map is CNCF’s recommended path through the cloud-native landscape. This doesn’t define a specific path with which we can approach digital transformation rather there are many possible paths you can follow to align with this concept based on your business scenario. This is just a trail to simplify the journey to cloud-native. + + +Let's start discussing the steps defined in this trail map. + +### 1. CONTAINERIZATION + +![][1] + +You can’t do cloud-native without containerizing your application. It doesn’t matter what size the application is any type of application will do. **A container is a standard unit of software that packages up the code and all its dependencies** so the application runs quickly and reliably from one computing environment to another. Docker is the most preferred platform for containerization. A **Docker container** image is a lightweight, standalone, executable package of software that includes everything needed to run an application. + +### 2. CI/CD + +![][2] + +Setup Continuous Integration/Continuous Delivery (CI/CD) so that changes to your source code automatically result in a new container being built, tested, and deployed to staging and eventually, perhaps, to production. Next thing we need to setup is automated rollouts, rollbacks as well as testing. There are a lot of platforms for CI/CD: **Jenkins, VSTS, Azure DevOps** , TeamCity, JFRog, Spinnaker, etc.. + +### 3. ORCHESTRATION + +![][3] + +Container orchestration is all about managing the lifecycles of containers, especially in large, dynamic environments. Software teams use container orchestration to control and automate many tasks. **Kubernetes** is the market-leading orchestration solution. There are other orchestrators like Docker swarm, Mesos, etc.. **Helm Charts** help you define, install, and upgrade even the most complex Kubernetes application. + +### 4. OBSERVABILITY & ANALYSIS + +Kubernetes provides no native storage solution for log data, but you can integrate many existing logging solutions into your Kubernetes cluster. Kubernetes provides detailed information about an application’s resource usage at each of these levels. This information allows you to evaluate your application’s performance and where bottlenecks can be removed to improve overall performance. + +![][4] + +Pick solutions for monitoring, logging, and tracing. Consider CNCF projects Prometheus for monitoring, Fluentd for logging and Jaeger for TracingFor tracing, look for an OpenTracing-compatible implementation like Jaeger. + +### 5. SERVICE MESH + +As its name says it’s all about connecting services, the **discovery of services** , **health checking, routing** and it is used to **monitoring ingress** from the internet. A service mesh also often has more complex operational requirements, like A/B testing, canary rollouts, rate limiting, access control, and end-to-end authentication. + +![][5] + +**Istio** provides behavioral insights and operational control over the service mesh as a whole, offering a complete solution to satisfy the diverse requirements of microservice applications. **CoreDNS** is a fast and flexible tool that is useful for service discovery. **Envoy** and **Linkerd** each enable service mesh architectures. + +### 6. NETWORKING AND POLICY + +It is really important to enable more flexible networking layers. To enable more flexible networking, use a CNI compliant network project like Calico, Flannel, or Weave Net. Open Policy Agent (OPA) is a general purpose policy engine with uses ranging from authorization and admission control to data filtering + +### 7. DISTRIBUTED DATABASE + +A distributed database is a database in which not all storage devices are attached to a common processor. It may be stored in multiple computers, located in the same physical location; or may be dispersed over a network of interconnected computers. + +![][6] + +When you need more resiliency and scalability than you can get from a single database, **Vitess** is a good option for running MySQL at scale through sharding. Rook is a storage orchestrator that integrates a diverse set of storage solutions into Kubernetes. Serving as the “brain” of Kubernetes, etcd provides a reliable way to store data across a cluster of machine + +### 8. MESSAGING + +When you need higher performance than JSON-REST, consider using gRPC or NATS. gRPC is a universal RPC framework. NATS is a multi-modal messaging system that includes request/reply, pub/sub and load balanced queues. It is also applicable and take care of much newer and use cases like IoT. + +### 9. CONTAINER REGISTRY & RUNTIMES + +Container Registry is a single place for your team to manage Docker images, perform vulnerability analysis, and decide who can access what with fine-grained access control. There are many container registries available in market docker hub, Azure Container registry, Harbor, Nexus registry, Amazon Elastic Container Registry and way more… + +![][7] + +Container runtime **containerd** is available as a daemon for Linux and Windows. It manages the complete container lifecycle of its host system, from image transfer and storage to container execution and supervision to low-level storage to network attachments and beyond. + +### 10. SOFTWARE DISTRIBUTION + +If you need to do secure software distribution, evaluate Notary, implementation of The Update Framework (TUF). + +TUF provide a framework (a set of libraries, file formats, and utilities) that can be used to secure new and existing software update systems. The framework should enable applications to be secure from all known attacks on the software update process. It is not concerned with exposing information about what software is being updated (and thus what software the client may be running) or the contents of updates. + +-------------------------------------------------------------------------------- + +via: https://medium.com/@sonujose993/what-it-means-to-be-cloud-native-approach-the-cncf-way-9e8ab99d4923 + +作者:[Sonu Jose][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://medium.com/@sonujose993 +[b]: https://github.com/lujun9972 +[1]: https://cdn-images-1.medium.com/max/1200/1*glD7bNJG3SlO0_xNmSGPcQ.png +[2]: https://cdn-images-1.medium.com/max/1600/1*qOno8YNzmwimlaL9j2fSbA.png +[3]: https://cdn-images-1.medium.com/max/1200/1*fw8YJnfF32dWsX_beQpWOw.png +[4]: https://cdn-images-1.medium.com/max/1600/1*sbjPYNq76s9lR7D_FK4ltg.png +[5]: https://cdn-images-1.medium.com/max/1600/1*kUFBuGfjZSS-n-32CCjtwQ.png +[6]: https://cdn-images-1.medium.com/max/1600/1*4OGiB3HHQZBFsALjaRb9pA.jpeg +[7]: https://cdn-images-1.medium.com/max/1600/1*VMCJN41mGZs4p2lQHD0nDw.png diff --git a/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md new file mode 100644 index 0000000000..2110c17606 --- /dev/null +++ b/sources/tech/20190408 A beginner-s guide to building DevOps pipelines with open source tools.md @@ -0,0 +1,352 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A beginner's guide to building DevOps pipelines with open source tools) +[#]: via: (https://opensource.com/article/19/4/devops-pipeline) +[#]: author: (Bryant Son https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter) + +A beginner's guide to building DevOps pipelines with open source tools +====== +If you're new to DevOps, check out this five-step process for building +your first pipeline. +![Shaking hands, networking][1] + +DevOps has become the default answer to fixing software development processes that are slow, siloed, or otherwise dysfunctional. But that doesn't mean very much when you're new to DevOps and aren't sure where to begin. This article explores what a DevOps pipeline is and offers a five-step process to create one. While this tutorial is not comprehensive, it should give you a foundation to start on and expand later. But first, a story. + +### My DevOps journey + +I used to work for the cloud team at Citi Group, developing an Infrastructure-as-a-Service (IaaS) web application to manage Citi's cloud infrastructure, but I was always interested in figuring out ways to make the development pipeline more efficient and bring positive cultural change to the development team. I found my answer in a book recommended by Greg Lavender, who was the CTO of Citi's cloud architecture and infrastructure engineering, called _[The Phoenix Project][2]_. The book reads like a novel while it explains DevOps principles. + +A table at the back of the book shows how often different companies deploy to the release environment: + +Company | Deployment Frequency +---|--- +Amazon | 23,000 per day +Google | 5,500 per day +Netflix | 500 per day +Facebook | 1 per day +Twitter | 3 per week +Typical enterprise | 1 every 9 months + +How are the frequency rates of Amazon, Google, and Netflix even possible? It's because these companies have figured out how to make a nearly perfect DevOps pipeline. + +This definitely wasn't the case before we implemented DevOps at Citi. Back then, my team had different staged environments, but deployments to the development server were very manual. All developers had access to just one development server based on IBM WebSphere Application Server Community Edition. The problem was the server went down whenever multiple users simultaneously tried to make deployments, so the developers had to let each other know whenever they were about to make a deployment, which was quite a pain. In addition, there were problems with low code test coverages, cumbersome manual deployment processes, and no way to track code deployments with a defined task or a user story. + +I realized something had to be done, and I found a colleague who felt the same way. We decided to collaborate to build an initial DevOps pipeline—he set up a virtual machine and a Tomcat application server while I worked on Jenkins, integrating with Atlassian Jira and BitBucket, and code testing coverages. This side project was hugely successful: we almost fully automated the development pipeline, we achieved nearly 100% uptime on our development server, we could track and improve code testing coverage, and the Git branch could be associated with the deployment and Jira task. And most of the tools we used to construct our DevOps pipeline were open source. + +I now realize how rudimentary our DevOps pipeline was, as we didn't take advantage of advanced configurations like Jenkins files or Ansible. However, this simple process worked well, maybe due to the [Pareto][3] principle (also known as the 80/20 rule). + +### A brief introduction to DevOps and the CI/CD pipeline + +If you ask several people, "What is DevOps? you'll probably get several different answers. DevOps, like agile, has evolved to encompass many different disciplines, but most people will agree on a few things: DevOps is a software development practice or a software development lifecycle (SDLC) and its central tenet is cultural change, where developers and non-developers all breathe in an environment where formerly manual things are automated; everyone does what they are best at; the number of deployments per period increases; throughput increases; and flexibility improves. + +While having the right software tools is not the only thing you need to achieve a DevOps environment, some tools are necessary. A key one is continuous integration and continuous deployment (CI/CD). This pipeline is where the environments have different stages (e.g., DEV, INT, TST, QA, UAT, STG, PROD), manual things are automated, and developers can achieve high-quality code, flexibility, and numerous deployments. + +This article describes a five-step approach to creating a DevOps pipeline, like the one in the following diagram, using open source tools. + +![Complete DevOps pipeline][4] + +Without further ado, let's get started. + +### Step 1: CI/CD framework + +The first thing you need is a CI/CD tool. Jenkins, an open source, Java-based CI/CD tool based on the MIT License, is the tool that popularized the DevOps movement and has become the de facto standard. + +So, what is Jenkins? Imagine it as some sort of a magical universal remote control that can talk to many many different services and tools and orchestrate them. On its own, a CI/CD tool like Jenkins is useless, but it becomes more powerful as it plugs into different tools and services. + +Jenkins is just one of many open source CI/CD tools that you can leverage to build a DevOps pipeline. + +Name | License +---|--- +[Jenkins][5] | Creative Commons and MIT +[Travis CI][6] | MIT +[CruiseControl][7] | BSD +[Buildbot][8] | GPL +[Apache Gump][9] | Apache 2.0 +[Cabie][10] | GNU + +Here's what a DevOps process looks like with a CI/CD tool. + +![CI/CD tool][11] + +You have a CI/CD tool running in your localhost, but there is not much you can do at the moment. Let's follow the next step of DevOps journey. + +### Step 2: Source control management + +The best (and probably the easiest) way to verify that your CI/CD tool can perform some magic is by integrating with a source control management (SCM) tool. Why do you need source control? Suppose you are developing an application. Whenever you build an application, you are programming—whether you are using Java, Python, C++, Go, Ruby, JavaScript, or any of the gazillion programming languages out there. The programming codes you write are called source codes. In the beginning, especially when you are working alone, it's probably OK to put everything in your local directory. But when the project gets bigger and you invite others to collaborate, you need a way to avoid merge conflicts while effectively sharing the code modifications. You also need a way to recover a previous version—and the process of making a backup and copying-and-pasting gets old. You (and your teammates) want something better. + +This is where SCM becomes almost a necessity. A SCM tool helps by storing your code in repositories, versioning your code, and coordinating among project members. + +Although there are many SCM tools out there, Git is the standard and rightly so. I highly recommend using Git, but there are other open source options if you prefer. + +Name | License +---|--- +[Git][12] | GPLv2 & LGPL v2.1 +[Subversion][13] | Apache 2.0 +[Concurrent Versions System][14] (CVS) | GNU +[Vesta][15] | LGPL +[Mercurial][16] | GNU GPL v2+ + +Here's what the DevOps pipeline looks like with the addition of SCM. + +![Source control management][17] + +The CI/CD tool can automate the tasks of checking in and checking out source code and collaborating across members. Not bad? But how can you make this into a working application so billions of people can use and appreciate it? + +### Step 3: Build automation tool + +Excellent! You can check out the code and commit your changes to the source control, and you can invite your friends to collaborate on the source control development. But you haven't yet built an application. To make it a web application, it has to be compiled and put into a deployable package format or run as an executable. (Note that an interpreted programming language like JavaScript or PHP doesn't need to be compiled.) + +Enter the build automation tool. No matter which build tool you decide to use, all build automation tools have a shared goal: to build the source code into some desired format and to automate the task of cleaning, compiling, testing, and deploying to a certain location. The build tools will differ depending on your programming language, but here are some common open source options to consider. + +Name | License | Programming Language +---|---|--- +[Maven][18] | Apache 2.0 | Java +[Ant][19] | Apache 2.0 | Java +[Gradle][20] | Apache 2.0 | Java +[Bazel][21] | Apache 2.0 | Java +[Make][22] | GNU | N/A +[Grunt][23] | MIT | JavaScript +[Gulp][24] | MIT | JavaScript +[Buildr][25] | Apache | Ruby +[Rake][26] | MIT | Ruby +[A-A-P][27] | GNU | Python +[SCons][28] | MIT | Python +[BitBake][29] | GPLv2 | Python +[Cake][30] | MIT | C# +[ASDF][31] | Expat (MIT) | LISP +[Cabal][32] | BSD | Haskell + +Awesome! You can put your build automation tool configuration files into your source control management and let your CI/CD tool build it. + +![Build automation tool][33] + +Everything is good, right? But where can you deploy it? + +### Step 4: Web application server + +So far, you have a packaged file that might be executable or deployable. For any application to be truly useful, it has to provide some kind of a service or an interface, but you need a vessel to host your application. + +For a web application, a web application server is that vessel. An application server offers an environment where the programming logic inside the deployable package can be detected, render the interface, and offer the web services by opening sockets to the outside world. You need an HTTP server as well as some other environment (like a virtual machine) to install your application server. For now, let's assume you will learn about this along the way (although I will discuss containers below). + +There are a number of open source web application servers available. + +Name | License | Programming Language +---|---|--- +[Tomcat][34] | Apache 2.0 | Java +[Jetty][35] | Apache 2.0 | Java +[WildFly][36] | GNU Lesser Public | Java +[GlassFish][37] | CDDL & GNU Less Public | Java +[Django][38] | 3-Clause BSD | Python +[Tornado][39] | Apache 2.0 | Python +[Gunicorn][40] | MIT | Python +[Python Paste][41] | MIT | Python +[Rails][42] | MIT | Ruby +[Node.js][43] | MIT | Javascript + +Now the DevOps pipeline is almost usable. Good job! + +![Web application server][44] + +Although it's possible to stop here and integrate further on your own, code quality is an important thing for an application developer to be concerned about. + +### Step 5: Code testing coverage + +Implementing code test pieces can be another cumbersome requirement, but developers need to catch any errors in an application early on and improve the code quality to ensure end users are satisfied. Luckily, there are many open source tools available to test your code and suggest ways to improve its quality. Even better, most CI/CD tools can plug into these tools and automate the process. + +There are two parts to code testing: _code testing frameworks_ that help write and run the tests, and _code quality suggestion tools_ that help improve code quality. + +#### Code test frameworks + +Name | License | Programming Language +---|---|--- +[JUnit][45] | Eclipse Public License | Java +[EasyMock][46] | Apache | Java +[Mockito][47] | MIT | Java +[PowerMock][48] | Apache 2.0 | Java +[Pytest][49] | MIT | Python +[Hypothesis][50] | Mozilla | Python +[Tox][51] | MIT | Python + +#### Code quality suggestion tools + +Name | License | Programming Language +---|---|--- +[Cobertura][52] | GNU | Java +[CodeCover][53] | Eclipse Public (EPL) | Java +[Coverage.py][54] | Apache 2.0 | Python +[Emma][55] | Common Public License | Java +[JaCoCo][56] | Eclipse Public License | Java +[Hypothesis][50] | Mozilla | Python +[Tox][51] | MIT | Python +[Jasmine][57] | MIT | JavaScript +[Karma][58] | MIT | JavaScript +[Mocha][59] | MIT | JavaScript +[Jest][60] | MIT | JavaScript + +Note that most of the tools and frameworks mentioned above are written for Java, Python, and JavaScript, since C++ and C# are proprietary programming languages (although GCC is open source). + +Now that you've implemented code testing coverage tools, your DevOps pipeline should resemble the DevOps pipeline diagram shown at the beginning of this tutorial. + +### Optional steps + +#### Containers + +As I mentioned above, you can host your application server on a virtual machine or a server, but containers are a popular solution. + +[What are][61] [containers][61]? The short explanation is that a VM needs the huge footprint of an operating system, which overwhelms the application size, while a container just needs a few libraries and configurations to run the application. There are clearly still important uses for a VM, but a container is a lightweight solution for hosting an application, including an application server. + +Although there are other options for containers, Docker and Kubernetes are the most popular. + +Name | License +---|--- +[Docker][62] | Apache 2.0 +[Kubernetes][63] | Apache 2.0 + +To learn more, check out these other [Opensource.com][64] articles about Docker and Kubernetes: + + * [What Is Docker?][65] + * [An introduction to Docker][66] + * [What is Kubernetes?][67] + * [From 0 to Kubernetes][68] + + + +#### Middleware automation tools + +Our DevOps pipeline mostly focused on collaboratively building and deploying an application, but there are many other things you can do with DevOps tools. One of them is leveraging Infrastructure as Code (IaC) tools, which are also known as middleware automation tools. These tools help automate the installation, management, and other tasks for middleware software. For example, an automation tool can pull applications, like a web application server, database, and monitoring tool, with the right configurations and deploy them to the application server. + +Here are several open source middleware automation tools to consider: + +Name | License +---|--- +[Ansible][69] | GNU Public +[SaltStack][70] | Apache 2.0 +[Chef][71] | Apache 2.0 +[Puppet][72] | Apache or GPL + +For more on middleware automation tools, check out these other [Opensource.com][64] articles: + + * [A quickstart guide to Ansible][73] + * [Automating deployment strategies with Ansible][74] + * [Top 5 configuration management tools][75] + + + +### Where can you go from here? + +This is just the tip of the iceberg for what a complete DevOps pipeline can look like. Start with a CI/CD tool and explore what else you can automate to make your team's job easier. Also, look into [open source communication tools][76] that can help your team work better together. + +For more insight, here are some very good introductory articles about DevOps: + + * [What is DevOps][77] + * [5 things to master to be a DevOps engineer][78] + * [DevOps is for everyone][79] + * [Getting started with predictive analytics in DevOps][80] + + + +Integrating DevOps with open source agile tools is also a good idea: + + * [What is agile?][81] + * [4 steps to becoming an awesome agile developer][82] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/devops-pipeline + +作者:[Bryant Son (Red Hat, Community Moderator)][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/brson/users/milindsingh/users/milindsingh/users/dscripter +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/network_team_career_hand.png?itok=_ztl2lk_ (Shaking hands, networking) +[2]: https://www.amazon.com/dp/B078Y98RG8/ +[3]: https://en.wikipedia.org/wiki/Pareto_principle +[4]: https://opensource.com/sites/default/files/uploads/1_finaldevopspipeline.jpg (Complete DevOps pipeline) +[5]: https://github.com/jenkinsci/jenkins +[6]: https://github.com/travis-ci/travis-ci +[7]: http://cruisecontrol.sourceforge.net +[8]: https://github.com/buildbot/buildbot +[9]: https://gump.apache.org +[10]: http://cabie.tigris.org +[11]: https://opensource.com/sites/default/files/uploads/2_runningjenkins.jpg (CI/CD tool) +[12]: https://git-scm.com +[13]: https://subversion.apache.org +[14]: http://savannah.nongnu.org/projects/cvs +[15]: http://www.vestasys.org +[16]: https://www.mercurial-scm.org +[17]: https://opensource.com/sites/default/files/uploads/3_sourcecontrolmanagement.jpg (Source control management) +[18]: https://maven.apache.org +[19]: https://ant.apache.org +[20]: https://gradle.org/ +[21]: https://bazel.build +[22]: https://www.gnu.org/software/make +[23]: https://gruntjs.com +[24]: https://gulpjs.com +[25]: http://buildr.apache.org +[26]: https://github.com/ruby/rake +[27]: http://www.a-a-p.org +[28]: https://www.scons.org +[29]: https://www.yoctoproject.org/software-item/bitbake +[30]: https://github.com/cake-build/cake +[31]: https://common-lisp.net/project/asdf +[32]: https://www.haskell.org/cabal +[33]: https://opensource.com/sites/default/files/uploads/4_buildtools.jpg (Build automation tool) +[34]: https://tomcat.apache.org +[35]: https://www.eclipse.org/jetty/ +[36]: http://wildfly.org +[37]: https://javaee.github.io/glassfish +[38]: https://www.djangoproject.com/ +[39]: http://www.tornadoweb.org/en/stable +[40]: https://gunicorn.org +[41]: https://github.com/cdent/paste +[42]: https://rubyonrails.org +[43]: https://nodejs.org/en +[44]: https://opensource.com/sites/default/files/uploads/5_applicationserver.jpg (Web application server) +[45]: https://junit.org/junit5 +[46]: http://easymock.org +[47]: https://site.mockito.org +[48]: https://github.com/powermock/powermock +[49]: https://docs.pytest.org +[50]: https://hypothesis.works +[51]: https://github.com/tox-dev/tox +[52]: http://cobertura.github.io/cobertura +[53]: http://codecover.org/ +[54]: https://github.com/nedbat/coveragepy +[55]: http://emma.sourceforge.net +[56]: https://github.com/jacoco/jacoco +[57]: https://jasmine.github.io +[58]: https://github.com/karma-runner/karma +[59]: https://github.com/mochajs/mocha +[60]: https://jestjs.io +[61]: /resources/what-are-linux-containers +[62]: https://www.docker.com +[63]: https://kubernetes.io +[64]: http://Opensource.com +[65]: https://opensource.com/resources/what-docker +[66]: https://opensource.com/business/15/1/introduction-docker +[67]: https://opensource.com/resources/what-is-kubernetes +[68]: https://opensource.com/article/17/11/kubernetes-lightning-talk +[69]: https://www.ansible.com +[70]: https://www.saltstack.com +[71]: https://www.chef.io +[72]: https://puppet.com +[73]: https://opensource.com/article/19/2/quickstart-guide-ansible +[74]: https://opensource.com/article/19/1/automating-deployment-strategies-ansible +[75]: https://opensource.com/article/18/12/configuration-management-tools +[76]: https://opensource.com/alternatives/slack +[77]: https://opensource.com/resources/devops +[78]: https://opensource.com/article/19/2/master-devops-engineer +[79]: https://opensource.com/article/18/11/how-non-engineer-got-devops +[80]: https://opensource.com/article/19/1/getting-started-predictive-analytics-devops +[81]: https://opensource.com/article/18/10/what-agile +[82]: https://opensource.com/article/19/2/steps-agile-developer diff --git a/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md b/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md new file mode 100644 index 0000000000..4ec5b372e0 --- /dev/null +++ b/sources/tech/20190408 Beyond SD-WAN- VMware-s vision for the network edge.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Beyond SD-WAN: VMware’s vision for the network edge) +[#]: via: (https://www.networkworld.com/article/3387641/beyond-sd-wan-vmwares-vision-for-the-network-edge.html#tk.rss_all) +[#]: author: (Linda Musthaler https://www.networkworld.com/author/Linda-Musthaler/) + +Beyond SD-WAN: VMware’s vision for the network edge +====== +Under the ownership of VMware, the VeloCloud Business Unit is greatly expanding its vision of what an SD-WAN should be. VMware calls the strategy “the network edge.” +![istock][1] + +VeloCloud is now a Business Unit within VMware since being acquired in December 2017. The two companies have had sufficient time to integrate their operations and fit their technologies together to build a cohesive offering. In January, Neal Weinberg provided [an overview of where VMware is headed with its reinvention][2]. Now let’s look at it from the VeloCloud [SD-WAN][3] perspective. + +I recently talked to Sanjay Uppal, vice president and general manager of the VeloCloud Business Unit. He shared with me where VeloCloud is heading, adding that it’s all possible because of the complementary products that VMware brings to VeloCloud’s table. + +**[ Read also:[Edge computing is the place to address a host of IoT security concerns][4] ]** + +It all starts with this architecture chart that shows the VMware vision for the network edge. + +![][5] + +The left side of the chart shows that in the branch office, you can put an edge device that can be either a VeloCloud hardware appliance or VeloCloud software running on some third-party hardware. Then the right side of the chart shows where the workloads are — the traditional data center, the public cloud, and SaaS applications. You can put one or more edge devices there and then you have the classic hub-and-spoke model with the VeloCloud SD-WAN on running on top. + +In the middle of the diagram are the gateways, which are a differentiator and a unique benefit of VeloCloud. + +“If you have applications in the public cloud or SaaS, then you can use our gateways instead of spinning up individual edges at each of the applications,” Uppal said. “Those gateways really perform a multi-tenanted edge function. So, instead of locating an individual edge at every termination point at the cloud, you basically go from an edge in the branch to a gateway in the cloud, and then from that gateway you go to your final destination. We've engineered it so that the gateways are close to where the end applications are — typically within five milliseconds.” + +Going back to the architecture diagram, there are two clouds in the middle of the chart. The left-hand cloud is the over-the-top (OTT) service run by VeloCloud. It uses 800 gateways deployed over 30 points of presence (PoPs) around the world. The right-hand cloud is the telco cloud, which deploys gateways as network-based services. VeloCloud has several telco partners that take the same VeloCloud gateways and deploy them in their cloud. + +“Between a telco service, a cloud service, and hub and spoke on premise, we essentially have covered all the bases in terms of how enterprises would want to consume software-defined WAN. This flexibility is part of the reason why we've been successful in this market,” Uppal said. + +Where is VeloCloud going with this strategy? Again, looking at the architecture chart, the “vision” pieces are labeled 1 through 5. Let’s look at each of those areas. + +### Edge compute + +Starting with number 1 on the left-hand side of the diagram, there is the expansion from the edge itself going deeper into the branch by crossing over a LAN or a Wi-Fi boundary to get to where the individual users and IoT “things” are. This approach uses the same VeloCloud platform to spin up [compute at the edge][6], which can be either a container or a virtual machine (VM). + +“Of course, VMwareis very strong in compute in the data center. Our CEO recently articulated the VMware edge story, which is compute edge and device edge. When you combine it with the network edge, which is VeloCloud, then you have a full edge solution,” Uppal explained. “So, this first piece that you see is our foray into getting deeper into the branch all the way up to the individual users and things and combining compute functions on to the VeloCloud solution. There's been a lot of talk about edge compute and we do know that the pendulum is swinging back, but one of the major challenges is how to manage it all. VMware has strong technology in the data center space that we are bringing to bear out there at the edge.” + +### 5G underlay intelligence + +The next piece, number 2 on the diagram, is [5G][7]. At the Mobile World Congress, VMware and AT&T announced they are bringing SD-WAN out running on 5G. The idea here is that 5G should give you a low-latency connection and you get on-demand control, so you can tell 5G on the fly that you want this type of connection. Once that is done, the right network slices would be put in place and then you can get a connection according to the specifications that you asked for. + +“We as VeloCloud would measure the underlay continuously. It's like a speed test on steroids. We would measure bandwidth, packet loss, jitter and latency continuously with low overhead because we piggyback on real user traffic. And then on the basis of that measurement, we would steer the traffic one way or another,” Uppal said. “For example, your real-time voice is important, so let's pick the best performing network at that instant of time, which might change in the next instant, so that's why we have to make that decision on a per-packet basis.” + +Uppal continued, “What 5G allows us to do is to look at that underlay as not just being one underlay, but it could be several different underlays, and it's programmable so you could ask it for a type of underlay. That is actually pretty revolutionary — that we would run an overlay with the intelligence of SD-WAN counting on the underlay intelligence of 5G. + +“We are working pretty closely with our partner AT&T in this space. We are talking about the business aspect of 5G being used as a transport mechanism for enterprise data, rather than consumer phones having 5G on them. This is available from AT&T today in a handful of cities. So as 5G becomes more ubiquitous, you'll begin to see it deployed more and more. Then we will do an Ethernet or Wi-Fi handoff to the hotspot, and from then on, we'll jump onto the 5G network for the SD-WAN. Then the next phase of that will be 5G natively on our devices, which is what we are working on today.” + +### Gateway federation + +The third part of the vision is gateway federation, some of which is available today. The left-hand cloud in the diagram, which is the OTT service, should be able to interoperate gateway to gateway with the cloud on the right-hand side, which is the network-based service. For example, if you have a telco cloud of gateways but those gateways don't reach out into areas where the telco doesn’t have a presence, then you can reuse VeloCloud gateways that are sitting in other locations. A gateway would federate with another gateway, so it would extend the telco’s network beyond the facilities that they own. That's the first step of gateway federation, which is available from VeloCloud today. + +Uppal said the next step is a telco-to telco-federation. “There's a lot of interest from folks in the industry on how to get that federation done. We're working with the Metro Ethernet Forum (MEF) on that,” he said. + +### SD-WAN as a platform + +The next piece of the vision is SD-WAN as a platform. VeloCloud already incorporates security services into its SD-WAN platform in the form of [virtual network functions][8] (VNFs) from Palo Alto, Check Point Software, and other partners. Deploying a service as a VNF eliminates having separate hardware on the network. Now the company is starting to bring more services onto its platform. + +“Analytics is the area we are bringing in next,” Uppal said. “We partnered with SevOne and Plixer so that they can take analytics that we are providing, correlate them with other analytics that they have and then come up with inferences on whether things worked correctly or not, or to check for anomalous behavior.” + +Two additional areas that VeloCloud is working on are unified communications as a service (UCaaS) and universal customer premises equipment (uCPE). + +“We announced that we are working with RingCentral in the UCaaS space, and with ADVA and Telco Systems for uCPE. We have our own uCPE offering today but with a limited number of VNFs, so ADVA and Telco Systems will help us expand those capabilities,” Uppal explained. “With SD-WAN becoming a platform for on-premise deployments, you can virtualize functions and manage them from the same place, whether they're VNF-type of functions or compute-type of functions. This is an important direction that we are moving towards.” + +### Hybrid and multi-cloud integration + +The final piece of the strategy is hybrid and multi-cloud integration. Since its inception, VeloCloud has had gateways to facilitate access to specific applications running in the cloud. These gateways provide a secure end-to-end connection and an ROI advantage. + +Recognizing that workloads have expanded to multi-cloud and hybrid cloud, VeloCloud is broadening this approach utilizing VMware’s relationships with Microsoft, Amazon, and Google and offerings on Azure, Amazon Web Services, and Google Cloud, respectively. From a networking standpoint, you can get the same consistency of access using VeloCloud because you can decide from the gateway whichever direction you want to go. That direction will be chosen — and services added — based on your business policy. + +“We think this is the next hurdle in terms of deployment of SD-WAN, and once that is solved, people are going to deploy a lot more for hybrid and multi-cloud,” said Uppal. “We want to be the first ones out of the gate to get that done.” + +Uppal further said, “These five areas are where we see our SD-WAN headed, and we call this a network edge because it's beyond just the traditional SD-WAN functions. It includes edge computing, SD-WAN becoming a broader platform, integrating with hybrid multi cloud — these are all aspects of features that go way beyond just the narrower definition of SD-WAN.” + +**More about edge networking:** + + * [How edge networking and IoT will reshape data centers][9] + * [Edge computing best practices][10] + * [How edge computing can help secure the IoT][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/3387641/beyond-sd-wan-vmwares-vision-for-the-network-edge.html#tk.rss_all + +作者:[Linda Musthaler][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/Linda-Musthaler/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/01/istock-864405678-100747484-large.jpg +[2]: https://www.networkworld.com/article/3340259/vmware-s-transformation-takes-hold.html +[3]: https://www.networkworld.com/article/3031279/sd-wan-what-it-is-and-why-you-ll-use-it-one-day.html +[4]: https://www.networkworld.com/article/3307859/edge-computing-helps-a-lot-of-iot-security-problems-by-getting-it-involved.html +[5]: https://images.idgesg.net/images/article/2019/04/vmware-vision-for-network-edge-100793086-large.jpg +[6]: https://www.networkworld.com/article/3224893/what-is-edge-computing-and-how-it-s-changing-the-network.html +[7]: https://www.networkworld.com/article/3203489/what-is-5g-how-is-it-better-than-4g.html +[8]: https://www.networkworld.com/article/3206709/what-s-the-difference-between-sdn-and-nfv.html +[9]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[10]: https://www.networkworld.com/article/3331978/lan-wan/edge-computing-best-practices.html +[11]: https://www.networkworld.com/article/3331905/internet-of-things/how-edge-computing-can-help-secure-the-iot.html +[12]: https://www.facebook.com/NetworkWorld/ +[13]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md b/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md new file mode 100644 index 0000000000..b0e1948ff4 --- /dev/null +++ b/sources/tech/20190408 InitRAMFS, Dracut, and the Dracut Emergency Shell.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (InitRAMFS, Dracut, and the Dracut Emergency Shell) +[#]: via: (https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +InitRAMFS, Dracut, and the Dracut Emergency Shell +====== + +![][1] + +The [Linux startup process][2] goes through several stages before reaching the final [graphical or multi-user target][3]. The initramfs stage occurs just before the root file system is mounted. Dracut is a tool that is used to manage the initramfs. The dracut emergency shell is an interactive mode that can be initiated while the initramfs is loaded. + +This article will show how to use the dracut command to modify the initramfs. Some basic troubleshooting commands that can be run from the dracut emergency shell will also be demonstrated. + +### The InitRAMFS + +[Initramfs][4] stands for Initial Random-Access Memory File System. On modern Linux systems, it is typically stored in a file under the /boot directory. The kernel version for which it was built will be included in the file name. A new initramfs is generated every time a new kernel is installed. + +![A Linux Boot Directory][5] + +By default, Fedora keeps the previous two versions of the kernel and its associated initramfs. This default can be changed by modifying the value of the _installonly_limit_ setting the /etc/dnf/dnf.conf file. + +You can use the _lsinitrd_ command to list the contents of your initramfs archive: + +![The LsInitRD Command][6] + +The above screenshot shows that my initramfs archive contains the _nouveau_ GPU driver. The _modinfo_ command tells me that the nouveau driver supports several models of NVIDIA video cards. The _lspci_ command shows that there is an NVIDIA GeForce video card in my computer’s PCI slot. There are also several basic Unix commands included in the archive such as _cat_ and _cp_. + +By default, the initramfs archive only includes the drivers that are needed for your specific computer. This allows the archive to be smaller and decreases the time that it takes for your computer to boot. + +### The Dracut Command + +The _dracut_ command can be used to modify the contents of your initramfs. For example, if you are going to move your hard drive to a new computer, you might want to temporarily include all drivers in the initramfs to be sure that the operating system can load on the new computer. To do so, you would run the following command: + +``` +# dracut --force --no-hostonly +``` + +The _force_ parameter tells dracut that it is OK to overwrite the existing initramfs archive. The _no-hostonly_ parameter overrides the default behavior of including only drivers that are germane to the currently-running computer and causes dracut to instead include all drivers in the initramfs. + +By default dracut operates on the initramfs for the currently-running kernel. You can use the _uname_ command to display which version of the Linux kernel you are currently running: + +``` +$ uname -r +5.0.5-200.fc29.x86_64 +``` + +Once you have your hard drive installed and running in your new computer, you can re-run the dracut command to regenerate the initramfs with only the drivers that are needed for the new computer: + +``` +# dracut --force +``` + +There are also parameters to add arbitrary drivers, dracut modules, and files to the initramfs archive. You can also create configuration files for dracut and save them under the /etc/dracut.conf.d directory so that your customizations will be automatically applied to all new initramfs archives that are generated when new kernels are installed. As always, check the man page for the details that are specific to the version of dracut you have installed on your computer: + +``` +$ man dracut +``` + +### The Dracut Emergency Shell + +![The Dracut Emergency Shell][7] + +Sometimes something goes wrong during the initramfs stage of your computer’s boot process. When this happens, you will see “Entering emergency mode” printed to the screen followed by a shell prompt. This gives you a chance to try and fix things up manually and continue the boot process. + +As a somewhat contrived example, let’s suppose that I accidentally deleted an important kernel parameter in my boot loader configuration: + +``` +# sed -i 's/ rd.lvm.lv=fedora\/root / /' /boot/grub2/grub.cfg +``` + +The next time I reboot my computer, it will seem to hang for several minutes while it is trying to find the root partition and eventually give up and drop to an emergency shell. + +From the emergency shell, I can enter _journalctl_ and then use the **Space** key to page down though the startup logs. Near the end of the log I see a warning that reads “/dev/mapper/fedora-root does not exist”. I can then use the _ls_ command to find out what does exist: + +``` +# ls /dev/mapper +control fedora-swap +``` + +Hmm, the fedora-root LVM volume appears to be missing. Let’s see what I can find with the lvm command: + +``` +# lvm lvscan +ACTIVE '/dev/fedora/swap' [3.85 GiB] inherit +inactive '/dev/fedora/home' [22.85 GiB] inherit +inactive '/dev/fedora/root' [46.80 GiB] inherit +``` + +Ah ha! There’s my root partition. It’s just inactive. All I need to do is activate it and exit the emergency shell to continue the boot process: + +``` +# lvm lvchange -a y fedora/root +# exit +``` + +![The Fedora Login Screen][8] + +The above example only demonstrates the basic concept. You can check the [troubleshooting section][9] of the [dracut guide][10] for a few more examples. + +It is possible to access the dracut emergency shell manually by adding the _rd.break_ parameter to your kernel command line. This can be useful if you need to access your files before any system services have been started. + +Check the _dracut.kernel_ man page for details about what kernel options your version of dracut supports: + +``` +$ man dracut.kernel +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/dracut-816x345.png +[2]: https://en.wikipedia.org/wiki/Linux_startup_process +[3]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-targets +[4]: https://en.wikipedia.org/wiki/Initial_ramdisk +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/boot.jpg +[6]: https://fedoramagazine.org/wp-content/uploads/2019/04/lsinitrd.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2019/04/dracut-shell.jpg +[8]: https://fedoramagazine.org/wp-content/uploads/2019/04/fedora-login-1024x768.jpg +[9]: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html#_troubleshooting +[10]: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html diff --git a/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md b/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md new file mode 100644 index 0000000000..ca0d81d89a --- /dev/null +++ b/sources/tech/20190408 Linux Server Hardening Using Idempotency with Ansible- Part 1.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 1) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-1) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 1 +====== + +![][1] + +[Creative Commons Zero][2] + +I think it’s safe to say that the need to frequently update the packages on our machines has been firmly drilled into us. To ensure the use of latest features and also keep security bugs to a minimum, skilled engineers and even desktop users are well-versed in the need to update their software. + +Hardware, software and SaaS (Software as a Service) vendors have also firmly embedded the word “firewall” into our vocabulary for both domestic and industrial uses to protect our computers. In my experience, however, even within potentially more sensitive commercial environments, few engineers actively tweak the operating system (OS) they’re working on, to any great extent at least, to bolster security. + +Standard fare on Linux systems, for example, might mean looking at configuring a larger swap file to cope with your hungry application’s demands. Or, maybe adding a separate volume to your server for extra disk space, specifying a more performant CPU at launch time, installing a few of your favorite DevOps tools, or chucking a couple of certificates onto the filesystem for each new server you build. This isn’t quite the same thing. + +### Improve your Security Posture + +What I am specifically referring to is a mixture of compliance and security, I suppose. In short, there’s a surprisingly large number of areas in which a default OS can improve its security posture. We can agree that tweaking certain aspects of an OS are a little riskier than others. Consider your network stack, for example. Imagine that, completely out of the blue, your server’s networking suddenly does something unexpected and causes you troubleshooting headaches or even some downtime. This might happen because a new application or updated package suddenly expects routing to behave in a less-common way or needs a specific protocol enabled to function correctly. + +However, there are many changes that you can make to your servers without suffering any sleepless nights. The version and flavor of an OS helps determine which changes and to what extent you might want to comfortably make. Most importantly though what’s good for the goose is rarely good for the gander. In other words every single server estate has different, both broad and subtle, requirements which makes each use case unique. And, don’t forget that a database server also has very different needs to a web server so you can have a number of differing needs even within one small cluster of servers. + +Over the last few years I’ve introduced these hardening and compliance tweaks more than a handful of times across varying server estates in my DevSecOps roles. The OSs have included: Debian, Red Hat Enterprise Linux (RHEL) and their respective derivatives (including what I suspect will be the increasingly popular RHEL derivative, Amazon Linux). There have been times that, admittedly including a multitude of relatively tiny tweaks, the number of changes to a standard server build was into the hundreds. It all depended on the time permitted for the work, the appetite for any risks and the generic or specific nature of the OS tweaks. + +In this article, we’ll discuss the theory around something called idempotency which, in hand with an automation tool such as Ansible, can provide the ongoing improvements to your server estate’s security posture. For good measure we’ll also look at a number of Ansible playbook examples and additionally refer to online resources so that you can introduce idempotency to a server estate near you. + +### Say What? + +In simple terms the word “idempotent” just means returning something back to how it was prior to a change. It can also mean that lots of things you wanted to be the same, for consistency, are exactly the same, too. + +Picture that in action for a moment on a server estate; we’ll use AWS (Amazon Web Services) as our example. You create a new server image (Amazon Machine Images == AMIs) precisely how you want it with compliance and hardening introduced, custom packages, the removal of unwanted packages, SSH keys, user accounts etc and then spin up twenty servers using that AMI. + +You know for certain that all the servers, at least at the time that they are launched, are absolutely identical. Trust me when I say that this is a “good thing” ™. The lack of what’s known as “config drift” means that if one package on a server needs updated for security reasons then all the servers need that package updated too. Or if there’s a typo in a config file that’s breaking an application then it affects all servers equally. There’s less administrative overhead, less security risk and greater levels of predictability in terms of achieving better uptime. + +What about config drift from a security perspective? As you’ve guessed it’s definitely not welcome. That’s because engineers making manual changes to a “base OS build” can only lead to heartache and stress. The predictability of how a system is working suffers greatly as a result and servers running unique config become less reliable. These server systems are known as “snowflakes” as they’re unique but far less beautiful than actual snow. + +Equally an attacker might have managed to breach one aspect, component or service on a server but not all of its facets. By rewriting our base config again and again we’re able to, with 100% certainty (if it’s set up correctly), predict exactly what a server will look like and therefore how it will perform. Using various tools you can also trigger alarms if changes are detected to request that a pair of human eyes have a look to see if it’s a serious issue and then adjust the base config if needed. + +To make our machines idempotent we might overwrite our config changes every 20 or 30 minutes, for example. When it comes to running servers, that in essence, is what is meant by idempotency. + +### Central Station + +My mechanism of choice for repeatedly writing config across a large number of servers is running Ansible playbooks. It’s relatively easy to implement and removes the all-too-painful additional logic required when using shell scripts. Of the popular configuration management tools I’ve seen in action is Puppet, used successfully on a large government estate in an idempotent manner, but I prefer Ansible due to its more logical syntax (to my mind at least) and its readily available documentation. + +Before we look at some simple Ansible examples of hardening an OS with idempotency in mind we should explore how to trigger our Ansible playbooks. + +This is a larger area for debate than you might first imagine. Say, for example, you have nicely segmented server estate with production servers being carefully locked away from development servers, sitting behind a production-grade firewall. Consider the other servers on the estate, belonging to staging (pre-production) or other development environments, intentionally having different access permissions for security reasons. + +If you’re going to run a centralized server that has superuser permissions (which are required to make privileged changes to your core system files) then that server will need to have high-level access permissions potentially across your entire server estate. It must therefore be guarded very closely. + +You will also want to test your playbooks against development environments (in plural) to test their efficacy which means you’ll probably need two all-powerful centralised Ansible servers, one for production and one for the multiple development environments. + +The actual approach of how to achieve other logistical issues is up for debate and I’ve heard it discussed a few times. Bear in mind that Ansible runs using plain, old SSH keys (a feature that something other configuration management tools have started to copy over time) but ideally you want a mechanism for keeping non-privileged keys on your centralised servers so you’re not logging in as the “root” user across the estate every twenty minutes or thirty minutes. + +From a network perspective I like the idea of having firewalling in place to enforce one-way traffic only into the environment that you’re affecting. This protects your centralised host so that a compromised server can’t attack that main Ansible host easily and then as a result gain access to precious SSH keys in order to damage the whole estate. + +Speaking of which, are servers actually needed for a task like this? What about using AWS Lambda () to execute your playbooks? A serverless approach stills needs to be secured carefully but unquestionably helps to limit the attack surface and also potentially reduces administrative responsibilities. + +I suspect how this all-powerful server is architected and deployed is always going to be contentious and there will never be a one-size-fits-all approach but instead a unique, bespoke solution will be required for every server estate. + +### How Now, Brown Cow + +It’s important to think about how often you run your Ansible and also how to prepare for your first execution of the playbook. Let’s get the frequency of execution out of the way first as it’s the easiest to change in the future. + +My preference would be three times an hour or instead every thirty minutes. If we include enough detail in our configuration then our playbooks might prevent an attacker gaining a foothold on a system as the original configuration overwrites any altered config. Twenty minutes seems more appropriate to my mind. + +Again, this is an aspect you need to have a think about. You might be dumping small config databases locally onto a filesystem every sixty minutes for example and that scheduled job might add an extra little bit of undesirable load to your server meaning you have to schedule around it. + +Next time, we’ll take a look at some specific changes that can be made to various systems. + +_Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website:[https://www.devsecops.cc][3]_ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-1 + +作者:[Chris Binnie][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/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/geometric-1732847_1280.jpg?itok=YRux0Tua +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.devsecops.cc/ diff --git a/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md b/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md new file mode 100644 index 0000000000..9844c3d3bf --- /dev/null +++ b/sources/tech/20190408 Performance-Based Routing (PBR) - The gold rush for SD-WAN.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Performance-Based Routing (PBR) – The gold rush for SD-WAN) +[#]: via: (https://www.networkworld.com/article/3387152/performance-based-routing-pbr-the-gold-rush-for-sd-wan.html#tk.rss_all) +[#]: author: (Matt Conran https://www.networkworld.com/author/Matt-Conran/) + +Performance-Based Routing (PBR) – The gold rush for SD-WAN +====== +The inefficiency factor in the case of traditional routing is one of the main reasons why SD-WAN is really taking off. +![Getty Images][1] + +BGP (Border Gateway Protocol) is considered the glue of the internet. If we view through the lens of farsightedness, however, there’s a question that still remains unanswered for the future. Will BGP have the ability to route on the best path versus the shortest path? + +There are vendors offering performance-based solutions for BGP-based networks. They have adopted various practices, such as, sending out pings to monitor the network and then modifying the BGP attributes, such as the AS prepending to make BGP do the performance-based routing (PBR). However, this falls short in a number of ways. + +The problem with BGP is that it's not capacity or performance aware and therefore its decisions can sink the application’s performance. The attributes that BGP relies upon for path selection are, for example, AS-Path length and multi-exit discriminators (MEDs), which do not always correlate with the network’s performance. + +[The time of 5G is almost here][2] + +Also, BGP changes paths only in reaction to changes in the policy or the set of available routes. It traditionally permits the use of only one path to reach a destination. Hence, traditional routing falls short as it doesn't always look for the best path which may not be the shortest path. + +### Blackout and brownouts + +As a matter of fact, we live in a world where we have more brownouts than blackouts. However, BGP was originally designed to detect only the blackouts i.e. the events wherein a link fails to reroute the traffic to another link. In a world where brownouts can last from 10 milliseconds to 10 seconds, you ought to be able to detect the failure in sub-seconds and re-route to a better path. + +This triggered my curiosity to dig out some of the real yet significant reasons why [SD-WAN][3] was introduced. We all know it saves cost and does many other things but were the inefficiencies in routing one of the main reasons? I decided to sit down with [Sorell][4] to discuss the need for policy-based routing (PBR). + +### SD-WAN is taking off + +The inefficiency factor in the case of traditional routing is one of the main reasons why SD-WAN is really taking off. SD-WAN vendors are adding proprietary mechanisms to their routing in order to select the best path, not the shortest path. + +Originally, we didn't have real-time traffic, such as, voice and video, which is latency and jitter sensitive. Besides, we also assumed that all links were equal. But in today's world, we witness more of a mix and match, for example, 100Gig and slower long-term evolution (LTE) links. The assumption that the shortest path is the best no longer holds true. + +### Introduction of new protocols + +To overcome the drawbacks of traditional routing, we have had the onset of new protocols, such as, [IPv6 segment routing][5] and named data networking along with specific SD-WAN vendor mechanisms that improve routing. + +For optimum routing, effective packet steering is a must. And SD-WAN overlays provide this by utilizing encapsulation which could be a combination of GRE, UDP, Ethernet, MPLS, [VxLAN][6] and IPsec. IPv6 segment routing implements a stack of segments (IPv6 address list) inserted in every packet and the named data networking can be distributed with routing protocols. + +Another critical requirement is the hop-by-hop payload encryption. You should be able to encrypt payloads for sessions that do not have transport layer encryption. Re-encrypting data can be expensive; it fragments the packets and further complicates the networks. Therefore, avoiding double encryption is also a must. + +The SD-WAN overlays furnish an all or nothing approach with [IPsec][7]. IPv6 segment routing requires application layer security that is provided by [IPsec][8] and named data network can offer since it’s object-based. + +### The various SD-WAN solutions + +The above are some of the new protocols available and some of the technologies that the SD-WAN vendors offer. Different vendors will have different mechanisms to implement PBR. Different vendors term PBR with different names, such as, “application-aware routing.” + +SD-WAN vendors are using many factors to influence the routing decision. They are not just making routing decisions on the number of hops or links the way traditional routing does by default. They monitor how the link is performing and do not just evaluate if the link is up or down. + +They are using a variety of mechanisms to perform PBR. For example, some are adding timestamps to every packet. Whereas, others are adding sequence numbers to the packets over and above what you would get in a transmission control protocol (TCP) sequence number. + +Another option is the use of the domain name system (DNS) and [transport layer security][9] (TLS) certificates to automatically identify the application and then based on the identity of the application; they have default classes for it. However, others use timestamps by adding a proprietary label. This is the same as adding a sequence number to the packets, but the sequence number is at Layer 3 instead of Layer 4. + +I can tie all my applications and sequence numbers and then use the network time protocol (NTP) to identify latency, jitter and dropped packets. Running NTP on both ends enables the identification of end-to-end vs hop-by-hop performance. + +Some vendors use an internet control message protocol (ICMP) or bidirectional forwarding detection (BFD). Hence, instead of adding a label to every packet which can introduce overhead, they are doing a sampling for every quarter or half a second. + +Realistically, it is yet to be determined which technology is the best to use, but what is consistent is that these mechanisms are examining elements, such as, the latency, dropped packets and jitter on the links. Essentially, different vendors are using different technologies to choose the best path, but the end result is still the same. + +With these approaches, one can, for example, identify a WebEx session and since a WebEx session has voice and video, can create that session as a high-priority session. All packets associated with the WebEx sessions get placed in a high-value queue. + +The rules are set to say, “I want my WebEx session to go over the multiprotocol label switching (MPLS) link instead of a slow LTE link.” Hence, if your MPLS link faces latency or jitter problems, it automatically reroutes the flow to a better alternate path. + +### Problems with TCP + +One critical problem that surfaces today due to the transmission control protocol (TCP) and adaptive codex is called waves. Let’s say you have 30 file transfers across a link, now to carry out the file transfers, the TCP window size will grow to a point where the link gets maxed out. The router will start to drop packets, followed by the reduced TCP window size. As a result, the bandwidth shrinks and at times when not dropping packets the window size increases. This hits the threshold and eventually, the packets start getting dropped again. + +This can be a continuous process, happening again and again. With all these waves obstructing the efficiency, we need products, like wide area network (WAN) optimizations to manage multiple TCP flows. Why? Because only TCP is aware of the flow that it controls, the single flow. It is not the networking aware of other flows moving across the path. Primarily, the TCP window size is only aware of one single file transfer. + +### Problems with adaptive codex + +Adaptive codex will use upward of 6 megabytes of the video if the link is clean but as soon as it starts to drop packets, the adaptive codex will send more packets for forwarding error-control in the codex. Therefore, it makes the problem even worse before it backs off to change the frame rate and resolution. + +Adaptive codex is the opposite of fixed codex that will always send out a fixed packet size. Adaptive codex is the standard used in WebRTC and can vary the jitter, buffer size and the frequency of packets based on the network conditions. + +Adaptive codex works better off Internet connections that have higher loss and jitter rate than, for example, more stable links, such as MPLS. This is the reason why real-time voice and the video does not use TCP because if the packet gets dropped, there is no point in sending a new packet. Logically, having the additional headers of TCP does not buy you anything. + +QUIC, on the other hand, can take a single flow and run it across multiple network-flows. This helps the video applications in rebuffering and improves throughput. In addition, it helps in boosting the response for bandwidth-intensive applications. + +### The introduction of new technologies + +With the introduction of [edge computing][10], augmented reality (AR), virtual reality (VR), real-time driving applications, [IoT sensors][11] on critical systems and other hypersensitive latency applications, PBR becomes a necessity. + +With AR you want the computing to be accomplished between 5 to 10 milliseconds of the endpoint. In the world of brownouts and path congestion, you need to pick a better path much more quickly. Also, service providers (SP) are rolling out 5G networks and announcing the use of different routing protocols that are being used as PBR. So the future looks bright for PBR. + +As voice and video, edge and virtual reality gain more existence in the market, PBR will become more popular. Even Facebook and Google are putting PBR inside their internal networks. Over time it will have a role in all the networks, specifically, the Internet Exchange points, both private and public. + +### Internet exchange points + +Back in the early 90s, there were only 4 internet exchange points in the US and 9 across the world overall. Now we have more than 3,000 where different providers have come together, and they exchange Internet traffic. + +When BGP was first rolled out in the mid-‘90s, because the internet exchange points were located far apart, the concept of shortest path held true more than today, where you have an internet that is highly distributed. + +The internet architecture will get changed as different service providers move to software-defined networking and update the routing protocols that they use. As far as the foreseeable future is concerned, however, the core internet exchanges will still use BGP. + +**This article is published as part of the IDG Contributor Network.[Want to Join?][12]** + +Join the Network World communities on [Facebook][13] and [LinkedIn][14] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387152/performance-based-routing-pbr-the-gold-rush-for-sd-wan.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/10/smart-city_iot_digital-transformation_networking_wireless_city-scape_skyline-100777499-large.jpg +[2]: https://www.networkworld.com/article/3354477/mobile-world-congress-the-time-of-5g-is-almost-here.html +[3]: https://network-insight.net/2017/08/sd-wan-networks-scalpel/ +[4]: https://techvisionresearch.com/ +[5]: https://network-insight.net/2015/07/segment-routing-introduction/ +[6]: https://youtu.be/5XtkCSfRy3c +[7]: https://network-insight.net/2015/01/design-guide-ipsec-fault-tolerance/ +[8]: https://network-insight.net/2015/01/ipsec-virtual-private-network-vpn-overview/ +[9]: https://network-insight.net/2015/10/back-to-basics-ssl-security/ +[10]: https://youtu.be/5mbPiKd_TFc +[11]: https://network-insight.net/2016/11/internet-of-things-iot-networking/ +[12]: /contributor-network/signup.html +[13]: https://www.facebook.com/NetworkWorld/ +[14]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190409 AI Ops- Let the data talk.md b/sources/tech/20190409 AI Ops- Let the data talk.md new file mode 100644 index 0000000000..2b3d57ef17 --- /dev/null +++ b/sources/tech/20190409 AI Ops- Let the data talk.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (AI Ops: Let the data talk) +[#]: via: (https://www.networkworld.com/article/3388217/ai-ops-let-the-data-talk.html#tk.rss_all) +[#]: author: (Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena ) + +AI Ops: Let the data talk +====== +The catalysts and ROI of AI-powered network analytics for automated operations were the focus of discussion for service providers at the recent FutureNet conference in London. Blue Planet’s Marie Fiala details the conversation. +![metamorworks][1] + +![Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena][2] + +_The catalysts and ROI of AI-powered network analytics for automated operations were the focus of discussion for service providers at the recent FutureNet conference in London. Blue Planet’s Marie Fiala details the conversation._ + +Do we need perfect data? Or is ‘good enough’ data good enough? Certainly, there is a need to find a pragmatic approach or else one could get stalled in analysis-paralysis. Is closed-loop automation the end goal? Or is human-guided open loop automation desired? If the quality of data defines the quality of the process, then for closed-loop automation of critical business processes, one needs near-perfect data. Is that achievable? + +These issues were discussed and debated at the recent FutureNet conference in London, where the show focused on solving network operators’ toughest challenges. Industry presenters and panelists stayed true to the themes of AI and automation, all touting the necessity of these interlinked software technologies, yet there were varied opinions on approaches. Network and service providers such as BT, Colt, Deutsche Telekom, KPN, Orange, Telecom Italia, Telefonica, Telenor, Telia, Telus, Turk Telkom, and Vodafone weighed in on the discussion. + +**Catalysts for AI-powered analytics** + +On one point, most service providers were in agreement: there is a need to identify a specific business use case with measurable ROI, as an initial validation point when introducing AI-powered analytics into operations. + +Host operator, Vodafone, positioned 5G as the catalyst. With the advent of 5G technology supporting 100x connections, 10Gbps super-bandwidth, and ultra-low <10ms latency, the volume, velocity and variety of data is exploding. It’s a virtuous cycle – 5G technologies generate a plethora of data, and conversely, a 5G network requires data-driven automation to function accurately and optimally (how else can virtualized network functions be managed in real-time?). + +![5G as catalyst for digitalisation][3] + +Another operator stated that the ‘AI gateway for telecom’ is the customer experience domain, citing how agents can use analytics to better serve the customer base. For another operator, capacity planning is the killer use case: first leverage AI to understand what’s going on in your network, then use predictive AI for planning so that you can make smarter investment decisions. Another point of view was that service assurance is the area where the most benefits from AI will be realized. There was even mention of ‘AI as a business’ by enabling the creation of new services, such as home assistants. At the broadest level, it was noted that AI allows network operators to remain relevant in the eyes of customers. + +**The human side of AI and automation** + +When it comes to implementation, the significant human impact of AI and automation was not overlooked. Across the board, service providers acknowledged that a new skillset is needed in network operations centers. Network engineers have to upskill to become data scientists and DevOps developers in order to best leverage the new AI-driven software tools. + +Furthermore, it is a challenge to recruit specialist AI experts, especially since web-scale providers are also vying for the same talent. On the flip side of the dire need for new skills, there is also a shortage of qualified experts in legacy technologies. Operators need automated, zero-touch management before the workforce retires! + +![FutureNet panelists discuss how automated AI can be leveraged as a competitive differentiator][4] + +**The ROI of AI** + +In many cases, the approach to AI has been a technology-driven ‘Field of Dreams’: build it and they will come. A strategic decision was made to hire experts, build data lakes, collect data, and then the business case that yielded positive returns was discovered. In other cases, the business use case came first. But no matter what the approach, the ROI was significant. + +These positive results are spurring determination for continued research to uncover ever more areas where AI can deliver tangible benefits. This is however no easy task – one operator highlighted that data collection takes 80% of the effort, with the remaining 20% spent on development of algorithms. For AI to really proliferate throughout all aspects of operations, that trend needs to be reversed. It needs to be relatively easy and quick to collect massive amounts of heterogeneous data, aggregate it, and correlate it. This would allow investment to be overwhelmingly applied to the development of predictive and prescriptive analytics tailored to specific use cases, and to enacting intelligent closed-loop automation. Only then will data be able to truly talk – and tell us what we haven’t even thought of yet. + +[Discover Intelligent Automation at Blue Planet][5] + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388217/ai-ops-let-the-data-talk.html#tk.rss_all + +作者:[Marie Fiala, Director of Portfolio Marketing for Blue Planet at Ciena][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://images.idgesg.net/images/article/2019/04/istock-957627892-100793278-large.jpg +[2]: https://images.idgesg.net/images/article/2019/04/marla-100793273-small.jpg +[3]: https://images.idgesg.net/images/article/2019/04/ciena-post-5-image-1-100793275-large.jpg +[4]: https://images.idgesg.net/images/article/2019/04/ciena-post-5-image-2-100793276-large.jpg +[5]: https://www.blueplanet.com/resources/Intelligent-Automation-Driving-Digital-Automation-for-Service-Providers.html?utm_campaign=X1058319&utm_source=NWW&utm_term=BPVision&utm_medium=newsletter diff --git a/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md b/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md new file mode 100644 index 0000000000..7ed701ec14 --- /dev/null +++ b/sources/tech/20190409 Juniper opens SD-WAN service for the cloud.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Juniper opens SD-WAN service for the cloud) +[#]: via: (https://www.networkworld.com/article/3388030/juniper-opens-sd-wan-service-for-the-cloud.html#tk.rss_all) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Juniper opens SD-WAN service for the cloud +====== +Juniper rolls out its Contrail SD-WAN cloud offering. +![Thinkstock][1] + +Juniper has taken the wraps off a cloud-based SD-WAN service it says will ease the management and bolster the security of wired and wireless-connected branch office networks. + +The Contrail SD-WAN cloud offering expands on the company’s existing on-premise ([SRX][2]-based) and virtual ([NFX][3]-based) SD-WAN offerings to include greater expansion possibilities – up to 10,000 spoke-attached sites and support for more variants of passive redundant hybrid WAN links – and topologies such as hub and spoke, partial, and dynamic full mesh, Juniper stated. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][4] + * [How to pick an off-site data-backup method][5] + * [SD-Branch: What it is and why you’ll need it][6] + * [What are the options for security SD-WAN?][7] + + + +The service brings with it Juniper’s Contrail Service Orchestration package, which secures, automates, and runs the service life cycle across [NFX Series][3] Network Services Platforms, [EX Series][8] Ethernet Switches, [SRX Series][2] next-generation firewalls, and [MX Series][9] 5G Universal Routing Platforms. Ultimately it lets customers manage and set up SD-WANs all from a single portal. + +The package is also a service orchestrator for the [vSRX][10] Virtual Firewall and [vMX][11] Virtual Router, available in public cloud marketplaces such as Amazon Web Services (AWS) and Microsoft Azure, Juniper said. The SD-WAN offering also includes integration with cloud security provider ZScaler. + +Contrail Service Orchestration offers organizations visibility across SD-WAN, as well as branch wired and now wireless infrastructure. Monitoring and intelligent analytics offer real-time insight into network operations, allowing administrators to preempt looming threats and degradations, as well as pinpoint issues for faster recovery. + +The new service also includes support for Juniper’s [recently acquired][12] Mist Systems wireless technology, which lets the service access and manage Mist’s wireless access points, allowing customers to meld wireless and wired networks. + +Juniper recently closed the agreement to buy innovative wireless-gear-maker Mist for $405 million. Mist touts itself as having developed an artificial-intelligence-based wireless platform that makes Wi-Fi more predictable, reliable, and measurable. + +With Contrail, administrators can control a growing mix of legacy and modern scale-out architectures while automating their operational workflows using software that provides smarter, easier-to-use automation, orchestration and infrastructure visibility, wrote Juniper CTO [Bikash Koley][13] in a [blog about the SD-WAN announcement][14]. + +“Management complexity and policy enforcement are traditional network administrator fears, while both data and network security are growing in importance for organizations of all sizes,” Koley stated. ** **“Cloud-delivered SD-WAN removes the complexity of software operations, arguably the most difficult part of Software Defined Networking.” + +Analysts said the Juniper announcement could help the company compete in a super-competitive, rapidly evolving SD-WAN world. + +“The announcement is more a ‘me too’ than a particular technological breakthrough,” said Lee Doyle, principal analyst with Doyle Research. “The Mist integration is what’s interesting here, and that could help them, but there are 15 to 20 other vendors that have the same technology, bigger partners, and bigger sales channels than Juniper does.” + +Indeed the SD-WAN arena is a crowded one with Cisco, VMware, Silver Peak, Riverbed, Aryaka, Nokia, and Versa among the players. + +The cloud-based Contrail SD-WAN offering is available as an annual or multi-year subscription. + +Join the Network World communities on [Facebook][15] and [LinkedIn][16] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3388030/juniper-opens-sd-wan-service-for-the-cloud.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2018/01/cloud_network_blockchain_bitcoin_storage-100745950-large.jpg +[2]: https://www.juniper.net/us/en/products-services/security/srx-series/ +[3]: https://www.juniper.net/us/en/products-services/sdn/nfx-series/ +[4]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[5]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[6]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[7]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[8]: https://www.juniper.net/us/en/products-services/switching/ex-series/ +[9]: https://www.juniper.net/us/en/products-services/routing/mx-series/ +[10]: https://www.juniper.net/us/en/products-services/security/srx-series/vsrx/ +[11]: https://www.juniper.net/us/en/products-services/routing/mx-series/vmx/ +[12]: https://www.networkworld.com/article/3353042/juniper-grabs-mist-for-wireless-ai-cloud-service-delivery-technology.html +[13]: https://www.networkworld.com/article/3324374/juniper-cto-talks-cloud-intent-computing-revolution-high-speed-networking-and-open-source-growth.html?nsdr=true +[14]: https://forums.juniper.net/t5/Engineering-Simplicity/Cloud-Delivered-Branch-Simplicity-Now-Surpasses-SD-WAN/ba-p/461188 +[15]: https://www.facebook.com/NetworkWorld/ +[16]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md b/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md new file mode 100644 index 0000000000..2bb20bc8a0 --- /dev/null +++ b/sources/tech/20190409 UP Shell Script - Quickly Navigate To A Specific Parent Directory In Linux.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux) +[#]: via: (https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +UP Shell Script – Quickly Navigate To A Specific Parent Directory In Linux +====== + +Recently we had written an article about **[bd command][1]** , which help us to **[quickly go back to the specific parent directory][1]**. + +Even, the [up shell script][2] allow us to perform the same but has different approach so, we would like to explore it. + +This will allow us to quickly navigate to a specific parent directory with mentioning the directory name. + +Instead we can give the directory number. I mean to say that number of times you’d have to go back. + +Stop typing `cd ../../..` endlessly and navigate easily to a specific parent directory by using up shell script. + +It support tab completion so, it’s become more convenient. + +The `up.sh` registers the up function and some completion functions via your `.bashrc` or `.zshrc` file. + +It was completely written using shell script and it’s support zsh and fish shell as well. + +We had written an article about **[autocd][3]**. It’s a builtin shell variable that helps us to **[navigate to inside a directory without cd command][3]**. + +### How To Install up Linux? + +It’s not based on the distribution and you have to install it based on your shell. + +Simple run the following command to enable up script on `bash` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc +``` + +Run the following command to take the changes to effect. + +``` +$ source ~/.bashrc +``` + +Simple run the following command to enable up script on `zsh` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc +``` + +Run the following command to take the changes to effect. + +``` +$ source ~/.zshrc +``` + +Simple run the following command to enable up script on `fish` shell. + +``` +$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish + +$ source ~/.config/up/up.fish +``` + +### How To Use This In Linux? + +We have successfully installed and configured the up script on system. It’s time to test it. + +I’m going to take the below directory path for this testing. + +Run the `pwd` command or `dirs` command to know your current location. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ pwd +or +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ dirs + +/usr/share/icons/Adwaita/256x256/apps +``` + +How to up one level? Quickly go back to one directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go one directory up `256x256` directory quickly then simple type the following command. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up + +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256$ pwd +/usr/share/icons/Adwaita/256x256 +``` + +How to up multiple levels? Quickly go back to multiple directory. I’m currently in `/usr/share/icons/Adwaita/256x256/apps` and if i want to go to `share` directory quickly then simple type the following command. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up 4 + +daygeek@Ubuntu18:/usr/share$ pwd +/usr/share +``` + +How to up by full name? Quickly go back to the given directory instead of number. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up icons + +daygeek@Ubuntu18:/usr/share/icons$ pwd +/usr/share/icons +``` + +How to up by partial name? Quickly go back to the given directory instead of number. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up Ad + +daygeek@Ubuntu18:/usr/share/icons/Adwaita$ pwd +/usr/share/icons/Adwaita +``` + +As i told in the beginning of the article, it supports tab completion. + +``` +daygeek@Ubuntu18:/usr/share/icons/Adwaita/256x256/apps$ up +256x256/ Adwaita/ icons/ share/ usr/ +``` + +This tutorial allows you to quickly go back to a specific parent directory but there is no option to move forward quickly. + +We have another solution for this, will come up with new solution shortly. Please stay tune with us. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/up-shell-script-quickly-go-back-to-a-specific-parent-directory-in-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/bd-quickly-go-back-to-a-specific-parent-directory-in-linux/ +[2]: https://github.com/shannonmoeller/up +[3]: https://www.2daygeek.com/navigate-switch-directory-without-using-cd-command-in-linux/ diff --git a/sources/tech/20190409 What it takes to become a blockchain developer.md b/sources/tech/20190409 What it takes to become a blockchain developer.md new file mode 100644 index 0000000000..668824b99a --- /dev/null +++ b/sources/tech/20190409 What it takes to become a blockchain developer.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What it takes to become a blockchain developer) +[#]: via: (https://opensource.com/article/19/4/blockchain-career-developer) +[#]: author: (Joseph Mugo https://opensource.com/users/mugo) + +What it takes to become a blockchain developer +====== +If you’ve been considering a career in blockchain development, the time +to get your foot in the door is now. Here's how to get started. +![][1] + +The past decade has been an interesting time for the development of decentralized technologies. Before 2009, the progress was slow and without any clear direction until Satoshi Nakamoto created and deployed Bitcoin. That brought blockchain, the record-keeping technology behind Bitcoin, into the limelight. + +Since then, we've seen blockchain revolutionize various concepts that we used to take for granted, such as monitoring supply chains, [creating digital identities,][2] [tracking jewelry][3], and [managing shipping systems.][4] Companies such as IBM and Samsung are at the forefront of blockchain as the underlying infrastructure for the next wave of tech innovation. There is no doubt that blockchain's role will grow in the years to come. + +Thus, it's no surprise that there's a high demand for blockchain developers. LinkedIn put "blockchain developers" at the top of its 2018 [emerging jobs report][5] with an expected 33-fold growth. The freelancing site Upwork also released a report showing that blockchain was one of the [fastest growing skills][6] out of more than 5,000 in its index. + +Describing the internet in 2003, [Jeff Bezos said][7], "we are at the 1908 Hurley washing machine stage." The same can be said about blockchain today. The industry is busy building its foundation. If you've been considering a career as a blockchain developer, the time to get your foot in the door is now. + +However, you may not know where to start. It can be frustrating to go through countless blog posts and white papers or messy Slack channels when trying to find your footing. This article is a report on what I learned when contemplating whether I should become a blockchain developer. I'll approach it from the basics, with resources for each topic you need to master to be industry-ready. + +### Technical fundamentals + +Although you're won't be expected to build a blockchain from scratch, you need to be skilled enough to handle the duties of blockchain development. A bachelor's degree in computer science or information security is required. You also need to have some fundamentals in data structures, cryptography, and networking and distributed systems. + +#### Data structures + +The complexity of blockchain requires a solid understanding of data structures. At the core, a distributed ledger is like a network of replicated databases, only it stores information in blocks rather than tables. The blocks are also cryptographically secured to ensure their integrity every time a block is added. + +For this reason, you have to know how common data structures, such as binary search trees, hash maps, graphs, and linked lists, work. It's even better if you can build them from scratch. + +This [GitHub repository][8] contains all information newbies need to learn data structures and algorithms. Common languages such as Python, Java, Scala, C, C-Sharp, and C++ are featured. + +#### Cryptography + +Cryptography is the foundation of blockchain; it is what makes cryptocurrencies work. The Bitcoin blockchain employs public-key cryptography to create digital signatures and hash functions. You might be discouraged if you don't have a strong math background, but Stanford offers [a free course][9] that's perfect for newbies. You'll learn about authenticated encryption, message integrity, and block ciphers. + +You should also study [RSA][10], which doesn't require a strong background in mathematics, and look at [ECDSA][11] (elliptic curve cryptography). + +And don't forget [cryptographic hash functions][12]. They are the equations that enable most forms of encryptions on the internet. They keep payments secure on e-commerce sites and are the core mechanism behind the HTTPS protocol. There's extensive use of cryptographic hash functions in blockchain. + +#### Networking and distributed systems + +Build a good foundation in understanding how distributed ledgers work. Also understand how peer-to-peer networks work, which translates to a good foundation in computer networks, from networking topologies to routing. + +In blockchain, the processing power is harnessed from connected computers. For seamless recording and interchange of information between these devices, you need to understand about [Byzantine fault-tolerant consensus][13], which is a key security feature in blockchain. You don't need to know everything; an understanding of how distributed systems work is good enough. + +Stanford has a free, self-paced [course on computer networking][14] if you need to start from scratch. You can also consult this list of [awesome material on distributed systems][15]. + +### Cryptonomics + +We've covered some of the most important technical bits. It's time to talk about the economics of this industry. Although cryptocurrencies don't have central banks to monitor the money supply or keep crypto companies in check, it's essential to understand the economic structures woven around them. + +You'll need to understand game theory, the ideal mathematical framework for modeling scenarios in which conflicts of interest exist among involved parties. Take a look at Michael Karnjanaprakorn's [Beginner's Guide to Game Theory][16]. It's lucid and well explained. + +You also need to understand what affects currency valuation and the various monetary policies that affect cryptocurrencies. Here are some books you can refer to: + + * _[The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology][17]_ by William Mougayar + * _[Blockchain: Blueprint for the New Economy][18]_ by Melanie Swan + * _[Blockchain: The Blockchain For Beginners Guide to Blockchain Technology and Leveraging Blockchain Programming][19]_ by Josh Thompsons + + + +Depending on how skilled you are, you won't need to go through all those materials. But once you're done, you'll understand the fundamentals of blockchain. Then you can dive into the good stuff. + +### Smart contracts + +A [smart contract][20] is a program that runs on the blockchain once a transaction is complete to enhance blockchain's capabilities. + +Unlike traditional judicial systems, smart contracts are enforced automatically and impartially. There are also no middlemen, so you don't need a lawyer to oversee a transaction. + +As smart contracts get more complex, they become harder to secure. You need to be aware of every possible way a smart contract can be executed and ensure that it does what is expected. At the moment, not many developers can properly optimize and audit smart contracts. + +### Decentralized applications + +Decentralized applications (DApps) are software built on blockchains. As a blockchain developer, there are several platforms where you can build a DApp. Here are some of them: + +#### Ethereum + +Ethereum is Vitalik Buterin's brainchild. It went live in 2015 and is one of the most popular development platforms. Ether is the cryptocurrency that fuels the Ethereum. + +It has its own language called Solidity, which is similar to C++ and JavaScript. If you've got any experience with either, you'll pick it up easily. + +One thing that makes Solidity unique is that it is smart-contract oriented. + +#### NEO + +Originally known as Antshares, NEO was founded by Erik Zhang and Da Hongfei in 2014. It became NEO in 2017. Unlike Ethereum, it's not limited to one language. You can use different programming languages to build your DApps on NEO, including C# and Java. Experienced users can easily start building DApps on NEO. It's focused on providing platforms for future digital businesses. + +Consider NEO if you have applications that will need to process lots of transactions per second. However, it works closely with the Chinese government and follows Chinese business regulations. + +#### EOS + +EOS blockchain aims to be a decentralized operating system that can support industrial-scale applications. It's basically like Ethereum, but with faster transaction speeds and more scalable. + +#### Hyperledger + +Hyperledger is an open source collaborative platform that was created to develop cross-industry blockchain technologies. The Linux Foundation hosts Hyperledger as a hub for open industrial blockchain development. + +### Learning resources + +Here are some courses and other resources that'll help make you an industry-ready blockchain developer. + + * The University of Buffalo and The State University of New York have a [blockchain specialization course][21] that also teaches smart contracts. You can complete it in two months if you put in 10 hours per week. You'll learn about designing and implementing smart contracts and various methods for developing decentralized applications on blockchain. + * [DApps for Beginners][22] offers tutorials and other information to get you started on creating decentralized apps on the Ethereum blockchain. You'll need to know JavaScript, and knowledge of C++ is an added advantage. + * IBM also offers [Blockchain for Developers][23], where you'll work with IBM's private blockchain and build smart contracts using the [Hyperledger Fabric][24]. + * For $3,500 you can enroll in MIT's online [Blockchain Technologies: Business Innovation and Application][25] program, which examines blockchain from an economic perspective. You need deep pockets for this one; it's meant for executives who want to know how blockchain can be used in their organizations. + * If you're willing to commit 10 hours per week, Udacity's [Blockchain Developer Nanodegree][26] can prepare you to become an industry-ready blockchain developer in six months. Before enrolling, you should have some experience in object-oriented programming. You should also have developed the frontend and backend of a web application with JavaScript. And you're required to have used a remote API to create and consume data. You'll work with Bitcoin and Ethereum protocols to build projects for real-world applications. + * If you need to shore up your foundations, you may be interested in the Open Source Society University's wildly popular and [free computer science curriculum][27]. + * You can read a variety of articles about [blockchain in open source][28] on [Opensource.com][29]. + + + +### Types of blockchain development + +What does a blockchain developer really do? It doesn't involve building a blockchain from scratch. Depending on the organization you work for, here are some of the categories that blockchain developers fall under. + +#### Backend developers + +In this case, the developer is responsible for: + + * Designing and developing APIs for blockchain integration + * Doing performance testing and deployment + * Gathering requirements and working side-by-side with other developers and designers to design software + * Providing technical support + + + +#### Blockchain-specific + +Blockchain developers and project managers fall under this category. Their main roles include: + + * Developing and maintaining decentralized applications + * Supervising and planning blockchain projects + * Advising companies on how to structure initial coin offerings (ICOs) + * Understanding what a company needs and creating apps that address those needs + * For project managers, organizing training for employees + + + +#### Smart-contract engineers + +This type of developer is required to know a smart-contract language like Solidity, Python, or Go. Their main roles include: + + * Auditing and developing smart contracts + * Meeting with users and buyers + * Understanding business flow and security to ensure there are no loopholes in smart contracts + * Doing end-to-end business process testing + + + +### The state of the industry + +There's a wide base of knowledge to help you become a blockchain developer. If you're interested in joining the field, it's an opportunity for you to make a difference by pioneering the next wave of tech innovations. It pays very well and is in high demand. There's also a wide community you can join to help you gain entry as an actual developer, including [Ethereum Stack Exchange][30] and meetup events around the world. + +The banking sector, the insurance industry, governments, and retail industries are some of the sectors where blockchain developers can work. If you're willing to work for it, being a blockchain developer is an excellent career choice. Currently, the need outpaces available talent by far. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/blockchain-career-developer + +作者:[Joseph Mugo][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/mugo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_UnspokenBlockers_1110_A.png?itok=x8A9mqVA +[2]: https://www.fool.com/investing/2018/02/16/this-is-really-happening-microsoft-is-developing-b.aspx +[3]: https://www.engadget.com/2018/04/26/ibm-blockchain-jewelry-provenance/ +[4]: https://www.engadget.com/2018/04/16/samsung-blockchain-based-global-shipping-system/ +[5]: https://economicgraph.linkedin.com/research/linkedin-2018-emerging-jobs-report +[6]: https://www.upwork.com/blog/2018/05/fastest-growing-skills-upwork-q1-2018/ +[7]: https://www.wsj.com/articles/SB104690855395981400 +[8]: https://github.com/TheAlgorithms +[9]: https://www.coursera.org/learn/crypto +[10]: https://en.wikipedia.org/wiki/RSA_(cryptosystem) +[11]: https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm +[12]: https://komodoplatform.com/cryptographic-hash-function/ +[13]: https://en.wikipedia.org/wiki/Byzantine_fault +[14]: https://lagunita.stanford.edu/courses/Engineering/Networking-SP/SelfPaced/about +[15]: https://github.com/theanalyst/awesome-distributed-systems +[16]: https://hackernoon.com/beginners-guide-to-game-theory-31e3e6adcec9 +[17]: https://www.amazon.com/dp/B01EIGP8HG/ +[18]: https://www.amazon.com/Blockchain-Blueprint-Economy-Melanie-Swan/dp/1491920491 +[19]: https://www.amazon.com/Blockchain-Beginners-Technology-Leveraging-Programming-ebook/dp/B0711RN8KJ +[20]: https://lifeinpaces.com/2019/03/04/ethereum-smart-contracts-how-do-they-work/ +[21]: https://www.coursera.org/specializations/blockchain?aid=true +[22]: https://dappsforbeginners.wordpress.com/ +[23]: https://developer.ibm.com/tutorials/cl-ibm-blockchain-101-quick-start-guide-for-developers-bluemix-trs/#start +[24]: https://www.hyperledger.org/projects/fabric +[25]: https://executive.mit.edu/openenrollment/program/blockchain-technologies-business-innovation-and-application-self-paced-online/#.XJSk-CgzbRY +[26]: https://www.udacity.com/course/blockchain-developer-nanodegree--nd1309 +[27]: https://github.com/ossu/computer-science +[28]: https://opensource.com/tags/blockchain +[29]: http://Opensource.com +[30]: https://ethereum.stackexchange.com/ diff --git a/sources/tech/20190409 Working with variables on Linux.md b/sources/tech/20190409 Working with variables on Linux.md new file mode 100644 index 0000000000..da4fec5ea9 --- /dev/null +++ b/sources/tech/20190409 Working with variables on Linux.md @@ -0,0 +1,267 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with variables on Linux) +[#]: via: (https://www.networkworld.com/article/3387154/working-with-variables-on-linux.html#tk.rss_all) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Working with variables on Linux +====== +Variables often look like $var, but they also look like $1, $*, $? and $$. Let's take a look at what all these $ values can tell you. +![Mike Lawrence \(CC BY 2.0\)][1] + +A lot of important values are stored on Linux systems in what we call “variables,” but there are actually several types of variables and some interesting commands that can help you work with them. In a previous post, we looked at [environment variables][2] and where they are defined. In this post, we're going to look at variables that are used on the command line and within scripts. + +### User variables + +While it's quite easy to set up a variable on the command line, there are a few interesting tricks. To set up a variable, all you need to do is something like this: + +``` +$ myvar=11 +$ myvar2="eleven" +``` + +To display the values, you simply do this: + +``` +$ echo $myvar +11 +$ echo $myvar2 +eleven +``` + +You can also work with your variables. For example, to increment a numeric variable, you could use any of these commands: + +``` +$ myvar=$((myvar+1)) +$ echo $myvar +12 +$ ((myvar=myvar+1)) +$ echo $myvar +13 +$ ((myvar+=1)) +$ echo $myvar +14 +$ ((myvar++)) +$ echo $myvar +15 +$ let "myvar=myvar+1" +$ echo $myvar +16 +$ let "myvar+=1" +$ echo $myvar +17 +$ let "myvar++" +$ echo $myvar +18 +``` + +With some of these, you can add more than 1 to a variable's value. For example: + +``` +$ myvar0=0 +$ ((myvar0++)) +$ echo $myvar0 +1 +$ ((myvar0+=10)) +$ echo $myvar0 +11 +``` + +With all these choices, you'll probably find at least one that is easy to remember and convenient to use. + +You can also _unset_ a variable — basically undefining it. + +``` +$ unset myvar +$ echo $myvar +``` + +Another interesting option is that you can set up a variable and make it **read-only**. In other words, once set to read-only, its value cannot be changed (at least not without some very tricky command line wizardry). That means you can't unset it either. + +``` +$ readonly myvar3=1 +$ echo $myvar3 +1 +$ ((myvar3++)) +-bash: myvar3: readonly variable +$ unset myvar3 +-bash: unset: myvar3: cannot unset: readonly variable +``` + +You can use any of those setting and incrementing options for assigning and manipulating variables within scripts, but there are also some very useful _internal variables_ for working within scripts. Note that you can't reassign their values or increment them. + +### Internal variables + +There are quite a few variables that can be used within scripts to evaluate arguments and display information about the script itself. + + * $1, $2, $3 etc. represent the first, second, third, etc. arguments to the script. + * $# represents the number of arguments. + * $* represents the string of arguments. + * $0 represents the name of the script itself. + * $? represents the return code of the previously run command (0=success). + * $$ shows the process ID for the script. + * $PPID shows the process ID for your shell (the parent process for the script). + + + +Some of these variables also work on the command line but show related information: + + * $0 shows the name of the shell you're using (e.g., -bash). + * $$ shows the process ID for your shell. + * $PPID shows the process ID for your shell's parent process (for me, this is sshd). + + + +If we throw all of these variables into a script just to see the results, we might do this: + +``` +#!/bin/bash + +echo $0 +echo $1 +echo $2 +echo $# +echo $* +echo $? +echo $$ +echo $PPID +``` + +When we call this script, we'll see something like this: + +``` +$ tryme one two three +/home/shs/bin/tryme <== script name +one <== first argument +two <== second argument +3 <== number of arguments +one two three <== all arguments +0 <== return code from previous echo command +10410 <== script's process ID +10109 <== parent process's ID +``` + +If we check the process ID of the shell once the script is done running, we can see that it matches the PPID displayed within the script: + +``` +$ echo $$ +10109 <== shell's process ID +``` + +Of course, we're more likely to use these variables in considerably more useful ways than simply displaying their values. Let's check out some ways we might do this. + +Checking to see if arguments have been provided: + +``` +if [ $# == 0 ]; then + echo "$0 filename" + exit 1 +fi +``` + +Checking to see if a particular process is running: + +``` +ps -ef | grep apache2 > /dev/null +if [ $? != 0 ]; then + echo Apache is not running + exit +fi +``` + +Verifying that a file exists before trying to access it: + +``` +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +fi + +if [ ! -f $2 ]; then + echo "Error: File $2 not found" + exit 2 +else + head -$1 $2 +fi +``` + +And in this little script, we check if the correct number of arguments have been provided, if the first argument is numeric, and if the second argument is an existing file. + +``` +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +fi + +if [[ $1 != [0-9]* ]]; then + echo "Error: $1 is not numeric" + exit 2 +fi + +if [ ! -f $2 ]; then + echo "Error: File $2 not found" + exit 3 +else + echo top of file + head -$1 $2 +fi +``` + +### Renaming variables + +When writing a complicated script, it's often useful to assign names to the script's arguments rather than continuing to refer to them as $1, $2, and so on. By the 35th line, someone reading your script might have forgotten what $2 represents. It will be a lot easier on that person if you assign an important parameter's value to $filename or $numlines. + +``` +#!/bin/bash + +if [ $# -lt 2 ]; then + echo "Usage: $0 lines filename" + exit 1 +else + numlines=$1 + filename=$2 +fi + +if [[ $numlines != [0-9]* ]]; then + echo "Error: $numlines is not numeric" + exit 2 +fi + +if [ ! -f $ filename]; then + echo "Error: File $filename not found" + exit 3 +else + echo top of file + head -$numlines $filename +fi +``` + +Of course, this example script does nothing more than run the head command to show the top X lines in a file, but it is meant to show how internal parameters can be used within scripts to help ensure the script runs well or fails with at least some clarity. + +**[ Watch Sandra Henry-Stocker's Two-Minute Linux Tips[to learn how to master a host of Linux commands][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/3387154/working-with-variables-on-linux.html#tk.rss_all + +作者:[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://images.idgesg.net/images/article/2019/04/variable-key-keyboard-100793080-large.jpg +[2]: https://www.networkworld.com/article/3385516/how-to-manage-your-linux-environment.html +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md b/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md new file mode 100644 index 0000000000..48edeaec20 --- /dev/null +++ b/sources/tech/20190409 topgrade - Upgrade-Update Everything In Single Command On Linux.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (topgrade – Upgrade/Update Everything In Single Command On Linux?) +[#]: via: (https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +topgrade – Upgrade/Update Everything In Single Command On Linux? +====== + +As a Linux administrator, you have to keep your system up-to-date to get ride out from some unexpected issues. + +We have to keep the system with latest patches as part of best practices. + +To do so, you need to perform the patching activity at least once in a month. + +Most of the time you have to reboot the server after patching to activate the latest kernel. + +It’s good to reboot the server at least 90-120 days once that will fix some outstanding issue which we already having. + +If you have a single system then we can directly login to the system and do perform the patching that is not a big deal. + +Even, if you have few of servers with the same flavor then you can perform the patching with help of shell script. + +If you have high number of servers then i would advise you to go with any of the parallel utility, which will help us to perform the patching in parallel. + +It will save a lot’s of time compared with shell script as this go with sequential order. + +how to patch all togeter if you have servers with multiple flavors? What will be the solution ? + +I recently came to know the utility called `topgrade` that can fulfill your requirement. + +Also, your distribution package manager doesn’t upgrade the packages which was installed with other package managers such as pip, npm, snap, etc,. but topgrade can fix this issue as well. + +### What Is topgrade? + +[topgrade][1] is a new tool that will upgrade all the installed packages on your system to latest available version by detecting and running the appropriate package managers. + +### How To Install topgrade In Linux? + +There is no separate package manager for distributions wise. Hence, you need to install topgrade with help of cargo package manager. + +The topgrade is available in AUR. So, use one of the **[AUR helper][2]** to install it on Arch-based systems. I prefer to go with **[Yay helper][3]** program. + +``` +$ yay -S topgrade +``` + +Once you have installed the **[cargo package manager][4]** , use the following command to install it. + +``` +$ cargo install topgrade +``` + +Once topgrade is initiated, it will perform the following tasks one by one. + + * Try to self-upgrade if any updated is available for topgrade. + * Arch: Run yay or fall back to pacman + * CentOS/RHEL: Run yum upgrade + * Fedora: Run dnf upgrade + * Debian/Ubuntu: Run apt update && apt dist-upgrade + * openSUSE: Run zypper refresh && zypper dist-upgrade + * Upgrade Vim/Neovim packages. + * Run npm update -g if NPM is installed + * Upgrade Atom packages + * Linux: Update Flatpak packages + * Linux: Update snap packages + * Linux: Run fwupdmgr to show firmware upgrade. + * Finally it will run needrestart to bounce all the services. + + + +Now, we have successfully installed `topgrade` so, run the topgrade alone to upgrade everything on your system. I have tested the utility on Ubuntu 18.04 LTS and the results are below. + +``` +$ topgrade + +―― System update ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +[sudo] password for daygeek: +Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease +Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] +Get:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] +Get:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] +. +Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [45.2 kB] +Get:17 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,460 B] +Fetched 1,565 kB in 13s (117 kB/s) +Reading package lists... Done +Building dependency tree +Reading state information... Done +119 packages can be upgraded. Run 'apt list --upgradable' to see them. +Reading package lists... Done +Building dependency tree +Reading state information... Done +Calculating upgrade... Done +The following packages were automatically installed and are no longer required: + libopts25 linux-headers-4.15.0-45 linux-headers-4.15.0-45-generic linux-image-4.15.0-45-generic + linux-modules-4.15.0-29-generic linux-modules-4.15.0-45-generic linux-modules-extra-4.15.0-45-generic sntp +Use 'sudo apt autoremove' to remove them. +The following packages will be upgraded: + apport apport-gtk apt apt-utils cups cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-ipp-utils + cups-ppdc cups-server-common distro-info-data fwupdate fwupdate-signed gir1.2-dbusmenu-glib-0.4 gir1.2-gtk-3.0 + gir1.2-packagekitglib-1.0 gir1.2-snapd-1 gnome-settings-daemon gnome-settings-daemon-schemas grub-common grub-pc + python3-httplib2 python3-problem-report samba-libs systemd systemd-sysv ubuntu-drivers-common udev ufw + unattended-upgrades xdg-desktop-portal xdg-desktop-portal-gtk +119 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Need to get 38.5 MB of archives. +After this operation, 475 kB of additional disk space will be used. +Do you want to continue? [Y/n] +. +. +Setting up grub-pc (2.02-2ubuntu8.13) ... +Installing for i386-pc platform. +Installation finished. No error reported. +Sourcing file `/etc/default/grub' +Generating grub configuration file ... +Found memtest86+ image: /boot/memtest86+.elf +Found memtest86+ image: /boot/memtest86+.bin +done +Setting up mesa-vdpau-drivers:amd64 (18.2.8-0ubuntu0~18.04.2) ... +Updating PPD files for cups ... +Setting up apport-gtk (2.20.9-0ubuntu7.6) ... +Setting up pulseaudio-module-bluetooth (1:11.1-1ubuntu7.2) ... +Processing triggers for libc-bin (2.27-3ubuntu1) ... +Processing triggers for initramfs-tools (0.130ubuntu3.7) ... +update-initramfs: Generating /boot/initrd.img-4.15.0-47-generic +``` + +It will run the self-updates once the distribution official packages update done. + +``` +―― rustup ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +info: checking for self-updates +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: checking for self-updates + + stable-x86_64-unknown-linux-gnu unchanged - rustc 1.33.0 (2aa4c46cf 2019-02-28) +``` + +Then it will try to update the packages that has installed with other package managers. + +``` +―― Flatpak User Packages ―――――――――――――――――――――――――――――――――――――――――――――――――――――――― +Looking for updates... +Looking for updates... +Updating in system: +org.gnome.Platform/x86_64/3.30 flathub 862e6b8ec2b5 +org.gnome.Platform.Locale/x86_64/3.30 flathub 5e66e981ae00 +org.freedesktop.Platform.html5-codecs/x86_64/18.08 flathub 282fd2c4ef33 +com.github.muriloventuroso.easyssh/x86_64/stable flathub c6bc3a3e72fb + new permissions: ssh-auth +com.github.muriloventuroso.easyssh.Locale/x86_64/stable flathub b705864b8d78 +Updating: org.gnome.Platform/x86_64/3.30 from flathub +[####################] 16 delta parts, 10 loose fetched; 65539 KiB transferred in 63 seconds +Error: Failed to update org.gnome.Platform/x86_64/3.30: Flatpak system operation Deploy not allowed for user + +Skipping org.gnome.Platform.Locale/x86_64/3.30 due to previous error + +Skipping org.freedesktop.Platform.html5-codecs/x86_64/18.08 due to previous error +Updating: com.github.muriloventuroso.easyssh/x86_64/stable from flathub +[####################] 2 delta parts, 3 loose fetched; 1532 KiB transferred in 5 seconds +Error: Failed to update com.github.muriloventuroso.easyssh/x86_64/stable: Flatpak system operation Deploy not allowed for user + +Skipping com.github.muriloventuroso.easyssh.Locale/x86_64/stable due to previous error +error: There were one or more errors + +Retry? [y/N] +``` + +Then it will run the firmwre upgrade. + +``` +―― Firmware upgrades ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +Fetching metadata https://cdn.fwupd.org/downloads/firmware.xml.gz +Downloading… [***************************************] +Fetching signature https://cdn.fwupd.org/downloads/firmware.xml.gz.asc +``` + +Finally, it shows the summary about the patching has done. + +``` +―― Summary ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― +System update: OK +rustup: OK +Flatpak User Packages: FAILED +Firmware upgrade: OK +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/topgrade-upgrade-update-everything-in-single-command-on-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/r-darwish/topgrade +[2]: https://www.2daygeek.com/category/aur-helper/ +[3]: https://www.2daygeek.com/install-yay-yet-another-yogurt-aur-helper-on-arch-linux/ +[4]: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ diff --git a/sources/tech/20190410 How to enable serverless computing in Kubernetes.md b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md new file mode 100644 index 0000000000..75e5a5868d --- /dev/null +++ b/sources/tech/20190410 How to enable serverless computing in Kubernetes.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to enable serverless computing in Kubernetes) +[#]: via: (https://opensource.com/article/19/4/enabling-serverless-kubernetes) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh/users/daniel-oh) + +How to enable serverless computing in Kubernetes +====== +Knative is a faster, easier way to develop serverless applications on +Kubernetes platforms. +![Kubernetes][1] + +In the first two articles in this series about using serverless on an open source platform, I described [how to get started with serverless platforms][2] and [how to write functions][3] in popular languages and build components using containers on Apache OpenWhisk. + +Here in the third article, I'll walk you through enabling serverless in your [Kubernetes][4] environment. Kubernetes is the most popular platform to manage serverless workloads and microservice application containers and uses a finely grained deployment model to process workloads more quickly and easily. + +Keep in mind that serverless not only helps you reduce infrastructure management while utilizing a consumption model for actual service use but also provides many capabilities of what the cloud platform serves. There are many serverless or FaaS (Function as a Service) platforms, but Kuberenetes is the first-class citizen for building a serverless platform because there are more than [13 serverless or FaaS open source projects][5] based on Kubernetes. + +However, Kubernetes won't allow you to build, serve, and manage app containers for your serverless workloads in a native way. For example, if you want to build a [CI/CD pipeline][6] on Kubernetes to build, test, and deploy cloud-native apps from source code, you need to use your own release management tool and integrate it with Kubernetes. + +Likewise, it's difficult to use Kubernetes in combination with serverless computing unless you use an independent serverless or FaaS platform built on Kubernetes, such as [Apache OpenWhisk][7], [Riff][8], or [Kubeless][9]. More importantly, the Kubernetes environment is still difficult for developers to learn the features of how it deals with serverless workloads from cloud-native apps. + +### Knative + +[Knative][10] was born for developers to create serverless experiences natively without depending on extra serverless or FaaS frameworks and many custom tools. Knative has three primary components—[Build][11], [Serving][12], and [Eventing][13]—for addressing common patterns and best practices for developing serverless applications on Kubernetes platforms. + +To learn more, let's go through the usual development process for using Knative to increase productivity and solve Kubernetes' difficulties from the developer's point of view. + +**Step 1:** Generate your cloud-native application from scratch using [Spring Initializr][14] or [Thorntail Project Generator][15]. Begin implementing your business logic using the [12-factor app methodology][16], and you might also do assembly testing to see if the function works correctly in many local testing tools. + +![Spring Initializr screenshot][17] | ![Thorntail Project Generator screenshot][18] +---|--- + +**Step 2:** Build container images from your source code repositories via the Knative Build component. You can define multiple steps, such as installing dependencies, running integration testing, and pushing container images to your secured image registry for using existing Kubernetes primitives. More importantly, Knative Build makes developers' daily work easier and simpler—"boring but difficult." Here's an example of the Build YAML: + + +``` +apiVersion: build.knative.dev/v1alpha1 +kind: Build +metadata: +name: docker-build +spec: +serviceAccountName: build-bot +source: +git: +revision: master +url: +steps: +\- args: +\- --context=/workspace/java/springboot +\- --dockerfile=/workspace/java/springboot/Dockerfile +\- --destination=docker.io/demo/event-greeter:0.0.1 +env: +\- name: DOCKER_CONFIG +value: /builder/home/.docker +image: gcr.io/kaniko-project/executor +name: docker-push +``` + +**Step 3:** Deploy and serve your container applications as serverless workloads via the Knative Serving component. This step shows the beauty of Knative in terms of automatically scaling up your serverless containers on Kubernetes then scaling them down to zero if there is no request to the containers for a specific period (e.g., two minutes). More importantly, [Istio][19] will automatically address ingress and egress networking traffic of serverless workloads in multiple, secure ways. Here's an example of the Serving YAML: + + +``` +apiVersion: serving.knative.dev/v1alpha1 +kind: Service +metadata: +name: greeter +spec: +runLatest: +configuration: +revisionTemplate: +spec: +container: +image: dev.local/rhdevelopers/greeter:0.0.1 +``` + +**Step 4:** Bind running serverless containers to a variety of eventing platforms, such as SaaS, FaaS, and Kubernetes, via Knative's Eventing component. In this step, you can define event channels and subscriptions, which are delivered to your services via a messaging platform such as [Apache Kafka][20] or [NATS streaming][21]. Here's an example of the Event sourcing YAML: + + +``` +apiVersion: sources.eventing.knative.dev/v1alpha1 +kind: CronJobSource +metadata: +name: test-cronjob-source +spec: +schedule: "* * * * *" +data: '{"message": "Event sourcing!!!!"}' +sink: +apiVersion: eventing.knative.dev/v1alpha1 +kind: Channel +name: ch-event-greeter +``` + +### Conclusion + +Developing with Knative will save a lot of time in building serverless applications in the Kubernetes environment. It can also make developers' jobs easier by focusing on developing serverless applications, functions, or cloud-native containers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/enabling-serverless-kubernetes + +作者:[Daniel Oh (Red Hat, Community Moderator)][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/daniel-oh/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes.png?itok=PqDGb6W7 (Kubernetes) +[2]: https://opensource.com/article/18/11/open-source-serverless-platforms +[3]: https://opensource.com/article/18/11/developing-functions-service-apache-openwhisk +[4]: https://kubernetes.io/ +[5]: https://landscape.cncf.io/format=serverless +[6]: https://opensource.com/article/18/8/what-cicd +[7]: https://openwhisk.apache.org/ +[8]: https://projectriff.io/ +[9]: https://kubeless.io/ +[10]: https://cloud.google.com/knative/ +[11]: https://github.com/knative/build +[12]: https://github.com/knative/serving +[13]: https://github.com/knative/eventing +[14]: https://start.spring.io/ +[15]: https://thorntail.io/generator/ +[16]: https://12factor.net/ +[17]: https://opensource.com/sites/default/files/uploads/spring_300.png (Spring Initializr screenshot) +[18]: https://opensource.com/sites/default/files/uploads/springboot_300.png (Thorntail Project Generator screenshot) +[19]: https://istio.io/ +[20]: https://kafka.apache.org/ +[21]: https://nats.io/ diff --git a/sources/tech/20190411 How do you contribute to open source without code.md b/sources/tech/20190411 How do you contribute to open source without code.md new file mode 100644 index 0000000000..659fd9064e --- /dev/null +++ b/sources/tech/20190411 How do you contribute to open source without code.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How do you contribute to open source without code?) +[#]: via: (https://opensource.com/article/19/4/contribute-without-code) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen/users/don-watkins/users/greg-p/users/petercheer) + +How do you contribute to open source without code? +====== + +![Dandelion held out over water][1] + +My earliest open source contributions date back to the mid-1980s when our organization first connected to [UseNet][2] where we discovered the contributed code and the opportunities to share in its development and support. + +Today there are endless contribution opportunities, from contributing code to making how-to videos. + +I'm going to step right over the whole issue of contributing code, other than pointing out that many of us who write code but don't consider ourselves developers can still [contribute code][3]. Instead, I'd like to remind everyone that there are lots of [non-code ways to contribute to open source][4] and talk about three alternatives. + +### Filing bug reports + +One important and concrete kind of contribution could best be described as "not being afraid to file a decent bug report" and [all the consequences related to that][5]. Sometimes it's quite challenging to [file a decent bug report][6]. For example: + + * A bug may be difficult to record or describe. A long and complicated message with all sorts of unrecognizable codes may flash by as the computer is booting, or there may just be some "odd behavior" on the screen with no error messages produced. + * A bug may be difficult to reproduce. It may occur only on certain hardware/software configurations, or it may be rarely triggered, or the precise problem area may not be apparent. + * A bug may be linked to a very specific development environment configuration that is too big, messy, and complicated to share, requiring laborious creation of a stripped-down example. + * When reporting a bug to a distro, the maintainers may suggest filing the bug upstream instead, which can sometimes lead to a lot of work when the version supported by the distro is not the primary version of interest to the upstream community. (This can happen when the version provided in the distro lags the officially supported release and development version.) + + + +Nevertheless, I exhort would-be bug reporters (including me) to press on and try to get bugs fully recorded and acknowledged. + +One way to get started is to use your favorite search tool to look for similar bug reports, see how they are described, where they are filed, and so on. Another important thing to know is the formal mechanism defined for bug reporting by your distro (for example, [Fedora's is here][7]; [openSUSE's is here][8]; [Ubuntu's is here][9]) or software package ([LibreOffice's is here][10]; [Mozilla's seems to be here][11]). + +### Answering user's questions + +I lurk and occasionally participate in various mailing lists and forums, such as the [Ubuntu quality control team][12] and [forums][13], [LinuxQuestions.org][14], and the [ALSA users' mailing list][15]. Here, the contributions may relate less to bugs and more to documenting complex use cases. It's a great feeling for everyone to see someone jumping in to help a person sort out their trouble with a particular issue. + +### Writing about open source + +Finally, another area where I really enjoy contributing is [_writing_][16] about using open source software; whether it's a how-to guide, a comparative evaluation of different solutions to a particular problem, or just generally exploring an area of interest (in my case, using open source music-playing software to enjoy music). A similar option is making an instructional video; it's easy to [record the desktop][17] while demonstrating some fiendishly difficult desktop maneuver, such as creating a splashy logo with GIMP. And those of you who are bi- or multi-lingual can also consider translating existing how-to articles or videos to another language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/contribute-without-code + +作者:[Chris Hermansen (Community Moderator)][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/users/don-watkins/users/greg-p/users/petercheer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dandelion_blue_water_hand.jpg?itok=QggW8Wnw (Dandelion held out over water) +[2]: https://en.wikipedia.org/wiki/Usenet +[3]: https://opensource.com/article/19/2/open-science-git +[4]: https://opensource.com/life/16/1/8-ways-contribute-open-source-without-writing-code +[5]: https://producingoss.com/en/bug-tracker.html +[6]: https://opensource.com/article/19/3/bug-reporting +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ +[8]: https://en.opensuse.org/openSUSE:Submitting_bug_reports +[9]: https://help.ubuntu.com/stable/ubuntu-help/report-ubuntu-bug.html.en +[10]: https://wiki.documentfoundation.org/QA/BugReport +[11]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines +[12]: https://wiki.ubuntu.com/QATeam +[13]: https://ubuntuforums.org/ +[14]: https://www.linuxquestions.org/ +[15]: https://www.alsa-project.org/wiki/Mailing-lists +[16]: https://opensource.com/users/clhermansen +[17]: https://opensource.com/education/16/10/simplescreenrecorder-and-kazam diff --git a/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md new file mode 100644 index 0000000000..890b934ef1 --- /dev/null +++ b/sources/tech/20190411 Managed, enabled, empowered- 3 dimensions of leadership in an open organization.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Managed, enabled, empowered: 3 dimensions of leadership in an open organization) +[#]: via: (https://opensource.com/open-organization/19/4/managed-enabled-empowered) +[#]: author: (Heidi Hess von Ludewig https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack) + +Managed, enabled, empowered: 3 dimensions of leadership in an open organization +====== +Different types of work call for different types of engagement. Should +open leaders always aim for empowerment? +![][1] + +"Empowerment" seems to be the latest people management [buzzword][2]. And it's an important consideration for open organizations, too. After all, we like to think these open organizations thrive when the people inside them are equipped to take initiative to do their best work as they see fit. Shouldn't an open leader's goal be complete and total empowerment of everyone, in all parts of the organization, doing all types of work? + +Not necessarily. + +Before we jump on the employee [empowerment bandwagon][3], we should explore the important connections between empowerment and innovation. That requires placing empowerment in context. + +As Allison Matlack has already demonstrated, employee investment in an organization's mission and activities—and employee _autonomy_ relative to those things—[can take several forms][4], from "managed" to "enabled" to "empowered." Sometimes, complete and total empowerment _isn't_ the most desirable type of investment an open leader would like to activate in a contributor. Projects are always changing. New challenges are always arising. As a result, the _type_ or _degree_ of involvement leaders can expect in different situations is always shifting. "Managed," "enabled," and "empowered," contributors exist simultaneously and dynamically, depending on the work they're performing (and that work's desired outcomes). + +So before we head down to the community center to win a game of buzzword bingo, let's examine the different types of work, how they function, and how they contribute to the overall innovation of a company. Let's refine what we mean by "managed," "enabled," and "empowered" work, and discuss why we need all three. + +### Managed, enabled, empowered + +First, let's consider and define each type of work activity. + +"Managed" work involves tasks that are coordinated using guidance, supervision, and direction in order to achieve specific outcomes. When someone works to coordinate _every_ part of _every_ task, we colloquially call that behavior "micro-managing." "Enabled" associates have the ability to direct themselves while working within boundaries (guidance), and they have access to the materials and resources (information, people, technologies, etc.) they require to problem-solve as they see fit. Lastly, "empowered" individuals _direct themselves_ within organizational limits, have access materials and resources, and also have the authority to represent their team or organization and make decisions about work on behalf using their best judgement, based on the former elements. + +Most important here is the idea that these concepts are _nested_ (see Figure 1). Because each level builds on the one before it, one cannot have the full benefit of "empowered" associates without also having clear guidance and direction ("managed"), and transparency of information and resources ("enabled"). What changes from level to level is the amount of managed or enabled activity that comes before it. + +Let's dive more deeply into the nature of those activities and discuss the roles leaders should play in each. + +#### Managed work + +"Managed" work is just that: work activity supervised and directed to some degree. The amount of management occurring in a situation is dynamic and depends on the activity itself. For instance, in the manufacturing economy, managed work is prominent. I'll call this "widget" work, the point of which is producing a widget the same way, every time. People need to perform this work according to consistent processes with consistent, standardized outcomes. + +Before we jump on the employee empowerment bandwagon, we should explore the important connections between empowerment and innovation. That requires placing empowerment in context. + +Because this work requires consistency, it typically proceeds via explicit guidelines and policies (rules about cost, schedule, quality, quantity, process, and so on—characteristics applicable to all work to a greater or lesser degree). We can find examples of it in a variety of roles across many industries. Quite often, _any_ role in _any_ industry requires _some_ amount of this type of work. Examples include manufacturing precision machine parts, answering a customer support case within a specified timeframe for contractual reasons and with a friendly greeting, etc. In the software industry, a role that's _entirely_ like this would be a rarity, yet even these roles require some work of the "managed" type. For instance, consider the way a support engineer must respond to a case using a set of quality standards (friendliness, perhaps with a professional written tone, a branded signature line, adherence to a participat contractual agreement, usually responding within a particular time frame, etc.). + +"Management" is the best strategy when _work requirements include adhering to a consistent schedule, process, and quality._ + +#### Enabled work + +As the amount of creativity a role requires _increases_ , the amount of directed and "managed" work we find in that role _decreases_. Guidelines get broader, processes looser, schedules lengthened (I wish!). This is because what's required to "be creative" involves other types of work (and new degrees of transparency and authority along with them). Ron McFarland explains this in [his article on adaptive leadership][5]: Many challenges challenges are ambiguous, as opposed to technical, and therefore require specific kinds of leadership. + +To take this idea one step further, we might say open leaders need to be _adaptive_ to how they view and implement the different kinds of work on their teams or in their organizations. "Enabling" associates means growing their skills and knowledge so they can manage themselves. The foundation for this type of activity is information—access to it, sharing it, and opportunities to independently use it to complete work activity. This is the kind of work Peter Drucker was referring to when he coined the term "knowledge work." + +Enabled work liberates associates from the constraints of managed work, though it still involves leaders providing considerable direction and guidance. Outcomes of this work might be familiar and normalized, but the _paths to achieving them_ are more open-ended than in managed work. Methods are more flexible and inclusive of individual preference and capability. + +"Enablement" is the best strategy when _objectives are well-defined and the outcomes are aligned with past outcomes and results_. + +#### Empowered work + +In "[Beyond Engagement][4]," Allison describes empowerment as a state in which employees have "access to all the information, training, tools, and connections to people and others teams that they need to do their best work, as well as a safe environment in which to do that work so they feel comfortable making their own decisions." In other words, empowerment is enablement with the opportunity for associates to _act using their own best judgment as it relates to shared understanding of team and organizational guidelines and objectives._ + +"Empowerment" is the best strategy when _objectives and methods for achieving them are unclear and creative flexibility is necessary for defining them._ Often this work is focused on activities where problem definition and possible solutions (i.e. investigation, planning, and execution) are not well-defined. + +Any role in any organization involves these three types of work occurring at various moments and in various situations. No job requires just one. + +### Supporting innovation through managed, enabled, and empowered work + +The labels "managed," enabled," and "empowered" apply to different work at different times, and _all three_ are embedded in work activity at different times and in different tasks. That means leaders should be paying more attention to the work contributors are doing: the kind of work, its purpose, and its desired outcomes. We're now in a position to consider how _innovation_ factors into this equation. + +Frequently, people discuss the different modes of work by way of _contrast_. Most language about them connotes negativity: managed work is "the worst," while empowered work is "the best." The goal of any leadership practice should be to "move people along the scale"—to create empowered contributors. + +However, just as types of work are located on a continuum that doesn't include this element of negation, so too should our understanding of the types of work. Rather than seeing work as, for example " _always empowered"_ or _"always managed_ ," we should recognize that any role is a function of _of all three types of work at the same time_ , each to a varying degree. Think of the equation this way: + +> _Work = managed (x) + enabled (x) + empowered (x)_ + +Note here that the more enabled and empowered the work is, the more potential there is for creativity when doing that work. This is because creativity (and the creative individual) requires information—consistently updated and "fresh" sources of information—used in conjunction with individual judgment and capacity for interpreting how to _use_ and _combine_ that information to define problems, ideate, and solve problems. Enabled and empowered work can increase inclusivity—that is, draw more closely on an individual's unique skills, perspectives, and talents because, by definition, those kinds of work are less managed and more guided. Open leadership clearly supports hiring for diversity exactly for the reason that it makes inclusivity so much richer. The ambiguity that's characteristic of the challenges we face in modern workplaces means that the work we do is ripe with potential for innovation—if we embrace risk and adapt our leadership styles to liberate it. + +In other words: + +> _Innovation = enabled (x) + empowered (x) / managed (x)_ +> +> _The more enabled and empowered the work is, the more potential for innovation._ + +Focusing on the importance of enabled work and empowered work is not to devalue managed work in any way. I would say that managed work creates a stable foundation on which creative (enabled and empowered) work can blossom. Imagine if all the work we did was empowered; our organizations would be completely chaotic, undefined, and ambiguous. Organizations need a degree of managed work in order to ensure some direction, some understanding of priorities, and some definition of "quality." + +Any role in any organization involves these three types of work occurring at various moments and in various situations. No job requires just one. As open leaders, we must recognize that work isn't an all-or-nothing, one-type-of-work-alone equation. We have to get better at understanding work in _these three different ways_ and using each one to the organization's advantage, depending on the situation. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/managed-enabled-empowered + +作者:[Heidi Hess von Ludewig (Red Hat)][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/heidi-hess-von-ludewig/users/amatlack +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_ControlNotDesirable.png?itok=nrXwSkv7 +[2]: https://www.entrepreneur.com/article/288340 +[3]: https://www.forbes.com/sites/lisaquast/2011/02/28/6-ways-to-empower-others-to-succeed/#5c860b365c62 +[4]: https://opensource.com/open-organization/18/10/understanding-engagement-and-empowerment +[5]: https://opensource.com/open-organization/19/3/adaptive-leadership-review diff --git a/sources/tech/20190411 Testing Small Scale Scrum in the real world.md b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md new file mode 100644 index 0000000000..0e4016435e --- /dev/null +++ b/sources/tech/20190411 Testing Small Scale Scrum in the real world.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing Small Scale Scrum in the real world) +[#]: via: (https://opensource.com/article/19/4/next-steps-small-scale-scrum) +[#]: author: (Agnieszka Gancarczyk Leigh Griffin https://opensource.com/users/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin) + +Testing Small Scale Scrum in the real world +====== +We plan to test the Small Scale Scrum framework in real-world projects +involving small teams. +![Green graph of measurements][1] + +Scrum is built on the three pillars of inspection, adaptation, and transparency. Our empirical research is really the starting point in bringing scrum, one of the most popular agile implementations, to smaller teams. As presented in the diagram below, we are now taking time to inspect this framework and principles by testing them in real-world projects. + +![small-scale-scrum-inspection.png][2] + +Progress in empirical process control + +We plan to implement Small Scale Scrum in several upcoming projects. Our test candidates are customers with real projects where teams of one to three people will undertake short-lived projects (ranging from a few weeks to three months) with an emphasis on quality and outputs. Individual projects, such as final-year projects (over 24 weeks) that are a capstone project after four years in a degree program, are almost exclusively completed by a single person. In projects of this nature, there is an emphasis on the project plan and structure and on maximizing the outputs that a single person can achieve. + +We plan to metricize and publish the results of these projects and hold several retrospectives with the teams involved. We are particularly interested in metrics centered around quality, with a particular emphasis on quality in a software engineering context and management, both project management through the lifecycle with a customer and management of the day-to-day team activities and the delivery, release, handover, and signoff process. + +Ultimately, we will retrospectively analyze the overall framework and principles and see if the Manifesto we envisioned holds up to the reality of executing a project with small numbers. From this data, we will produce the second version of Small Scale Scrum and begin a cyclic pattern of inspecting the model in new projects and adapting it again. + +We want to do all of this transparently. This series of articles is one window into the data, the insights, the experiences, and the reality of running scrum for small teams whose everyday challenges include context switching, communication, and the need for a quality delivery. A follow-up series of articles is planned to examine the outputs and help develop the second edition of Small Scale Scrum entirely in the community. + +We also plan to attend conferences and share our knowledge with the Agile community. Our first conference will be Agile 2019 where the evolution of Small Scale Scrum will be further explored as an Experience Report. We are advising colleges and sharing our structure and approach to managing and executing final-year projects. All our outputs will be freely available in the open source way. + +Given the changes to recommended team sizes in the Scrum Guide, our long-term goal and vision is to have the Scrum Guide reflect that teams of one or more people occupying one or more roles within a project are capable of following scrum. + +* * * + +_Leigh Griffin will present Small Scale Scrum at Agile 2019 in Washington, August 5-9, 2019 as an Experience Report. An expanded paper will be published on[Agile Alliance][3] to accompany this._ + +* * * + +* * * + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/next-steps-small-scale-scrum + +作者:[Agnieszka Gancarczyk (Red Hat)Leigh Griffin (Red Hat)][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/agagancarczyk/users/lgriffin/users/agagancarczyk/users/lgriffin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://opensource.com/sites/default/files/small-scale-scrum-inspection.png (small-scale-scrum-inspection.png) +[3]: https://www.agilealliance.org/ diff --git a/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md b/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md new file mode 100644 index 0000000000..3136ed60a0 --- /dev/null +++ b/sources/tech/20190412 Designing posters with Krita, Scribus, and Inkscape.md @@ -0,0 +1,131 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Designing posters with Krita, Scribus, and Inkscape) +[#]: via: (https://opensource.com/article/19/4/design-posters) +[#]: author: (Raghavendra Kamath https://opensource.com/users/raghukamath/users/seilarashel/users/raghukamath/users/raghukamath/users/greg-p/users/raghukamath) + +Designing posters with Krita, Scribus, and Inkscape +====== +Graphic designers can do professional work with free and open source +tools. +![Hand drawing out the word "code"][1] + +A few months ago, I was asked to design some posters for a local [Free Software Foundation][2] (FSF) event. Richard M. Stallman was [visiting][3] our country, and my friend [Abhas Abhinav][4] wanted to put up some posters and banners to promote his visit. I designed two posters for RMS's talk in Bangalore. + +I create my artwork with F/LOSS (free/libre open source software) tools. Although many artists successfully use free software to create artwork, I repeatedly encounter comments in discussion forums claiming that free software is not made for creative work. This article is my effort to detail the process I typically use to create my artwork and to spread awareness that one can do professional work with the help of F/LOSS tools. + +### Sketching some concepts + +After understanding Abhas' initial requirements, I sat down to visualize some concepts. I am not that great of a copywriter, so I started reading the FSF website to get some copy material. I needed to finish the project in two days time, while simultaneously working on other projects. I started sketching some rough layouts. From five layouts, I liked three. I scanned them using [Skanlite][5]; although these sketches were very rough and would need proper layout and design, they were a good base for me to work from. + +![Skanlite][6] + +![Poster sketches][7] + +![Poster sketch][8] + +I had three concepts: + + * On the [FSF's website][2], I read about taking free software to new frontiers, which made me think about the idea of "conquering a summit." Free software work is also filled with adventures, in my opinion, and sometimes a task may seem like scaling a summit. So, I thought showing some mountaineers would resonate well. + * I also wanted to ask people to donate to FSF, so I sketched a hand giving a heart. I didn't feel any excitement in executing this idea, nevertheless, I kept it for backup in case I fell short of time. + * The FSF website has a hashtag for a donation program called #thankGNU, so I thought about using this as the basis of my design. Repurposing my hand visual, I replaced the heart with a bouquet of flowers that has a heart-shaped card saying #thankGNU! + + + +I know these are somewhat quick and safe concepts, but given the little time I had for the project, I went ahead with them. + +My design process mostly depends on the kind of look I need in the final image. I choose my software and process according to my needs. I may use one software from start to finish or combine various software packages to accomplish what I need. For this project, I used [Krita][9] and [Scribus][10], with some minimal use of [Inkscape][11]. + +### Krita: Making the illustrations + +I imported my sketches into [Krita][12] and started adding more defined lines and shapes. + +For the first image, which has some mountaineers climbing, I used [vector layers][13] in Krita to add basic shapes and then used [Alpha Inheritance][14], which is similar to what is called Clipping Masks in Photoshop, to add texture and gradients inside the shapes. This helped me change the underlying base shape (in this case, the shape of the mountain in the first poster) anytime during the process. Krita also has a nice feature called the Reference Image tool, which lets you pin some references around your canvas (this helps a lot and saves many Alt+Tabs). Once I got the mountain how I wanted, according to the layout, I started painting the mountaineers and added more details for the ice and other features. I like grungy brushes and brushes that have a texture akin to chalks and sponges. Krita has a wide range of brushes as well as a brush engine, which makes replicating a traditional medium easier. After about 3.5 hours of painting, this image was ready for further processing. + +I wanted the second poster to have the feel of an old-style book illustration. So, I created the illustration with inked lines, somewhat similar to what we see in textbooks or novels. Inking in Krita is really a time saver; since it has stabilizer options, your wavy, hand-drawn lines will be smooth and crisp. I added a textured background and some minimal colors beneath the lines. It took me about three hours to do this illustration as well. + +![Poster][15] + +![Poster][16] + +### Scribus: Adding layout and typography + +Once my illustrations were ready, it was time to move on to the next part: adding text and other things to the layout. For this, I used Scribus. Both Scribus and Krita have CMYK support. In both applications, you can soft-proof your artwork and make changes according to the color profile you get from the printer. I mostly do my work in RGB and then, if required, I convert it to CMYK. Since most printers nowadays will do the color conversion, I don't think CMYK is support required, however, it's good to be able to work in CMYK with free software tools. + +I use open source fonts for my design work unless a client has licensed a closed font for use. A good way to browse for suitable fonts is [Google Fonts repository][17]. (I have the entire repository cloned.) Occasionally, I also browse fonts on [Font Library][18], as it also has a nice collection. I decided to use Montserrat by Julieta Ulanovsky for the posters. Placing text was very quick in Scribus; once you create a style, you can apply it to any number of paragraphs or titles. This helped me place text in both designs quickly since I didn't have to re-create the text properties. + +![Poster in Scribus][19] + +I keep two layers in Scribus. One is for the illustrations, which are linked to the original files so if I change an illustration, it will update in Scribus. The other is for text and it's layered on top of the illustration layer. + +### Inkscape: QR codes + +I used Inkscape to generate a QR code that points to the Membership page on FSF's website. To generate a QR code in Scribus, go to **Extensions > Render > Barcode > QR Code** in Inkscape's menu. The logos are also vector; because Scribus supports vector images, you can directly paste things from Inkscape into Scribus. In a way, this helps in designing CMYK-based vector graphics. + +![Final poster design][20] + +![Final poster design][21] + +With the designs ready, I exported them to layered PDF and sent to them to Abhas for feedback. He asked me to add FSF India's logo, which I did and sent a new PDF to him. + +### Printing the posters + +From here, Abhas took over the printing part of the process. His local printer in Bangalore printed the posters in A2 size. He was kind enough to send me some pictures of them. The prints came out well, considering I didn't even convert them to CMYK nor do any color corrections or soft proofing, as I usually do when I get the color profile from my printer. My opinion is that 100% accurate CMYK printing is just a myth; there are too many factors to consider. If I really want perfect color reproduction, I leave this job to the printer, as they know their printer well and can do the conversion. + +![Final poster design][22] + +![Final poster design][23] + +### Accessing the source files + +When we discussed the requirements for these posters, Abhas told me to release the artwork under a Creative Commons license so others can re-use, modify, and share it. I am really glad he mentioned it. Anyone who wants to poke at the files can [download them from my Nextcloud drive][24]. If you have any improvements to make, please go ahead—and do remember to share your work with everybody. + +Let me know what you think about this article by [emailing me][25]. + +* * * + +_[This article][26] originally appeared on [Raghukamath.com][27] and is republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/design-posters + +作者:[Raghavendra Kamath][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/raghukamath/users/seilarashel/users/raghukamath/users/raghukamath/users/greg-p/users/raghukamath +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_hand_draw.png?itok=dpAf--Db (Hand drawing out the word "code") +[2]: https://www.fsf.org/ +[3]: https://rms-tour.gnu.org.in/ +[4]: https://abhas.io/ +[5]: https://kde.org/applications/graphics/skanlite/ +[6]: https://opensource.com/sites/default/files/uploads/skanlite.png (Skanlite) +[7]: https://opensource.com/sites/default/files/uploads/sketch-01.png (Poster sketches) +[8]: https://opensource.com/sites/default/files/uploads/sketch-02.png (Poster sketch) +[9]: https://krita.org/ +[10]: https://www.scribus.net/ +[11]: https://inkscape.org/ +[12]: /life/16/4/nick-hamilton-linuxfest-northwest-2016-krita +[13]: https://docs.krita.org/en/user_manual/vector_graphics.html#vector-graphics +[14]: https://docs.krita.org/en/tutorials/clipping_masks_and_alpha_inheritance.html +[15]: https://opensource.com/sites/default/files/uploads/poster-illo-01.jpg (Poster) +[16]: https://opensource.com/sites/default/files/uploads/poster-illo-02.jpg (Poster) +[17]: https://fonts.google.com/ +[18]: https://fontlibrary.org/ +[19]: https://opensource.com/sites/default/files/uploads/poster-in-scribus.png (Poster in Scribus) +[20]: https://opensource.com/sites/default/files/uploads/final-01.png (Final poster design) +[21]: https://opensource.com/sites/default/files/uploads/final-02.png (Final poster design) +[22]: https://opensource.com/sites/default/files/uploads/posters-in-action-01.jpg (Final poster design) +[23]: https://opensource.com/sites/default/files/uploads/posters-in-action-02.jpg (Final poster design) +[24]: https://box.raghukamath.com/cloud/index.php/s/97KPnTBP4QL4iCx +[25]: mailto:raghu@raghukamath.com?Subject=designing-posters-with-free-software +[26]: https://raghukamath.com/journal/designing-posters-with-free-software/ +[27]: https://raghukamath.com/ diff --git a/sources/tech/20190412 How libraries are adopting open source.md b/sources/tech/20190412 How libraries are adopting open source.md new file mode 100644 index 0000000000..2a8c8806e5 --- /dev/null +++ b/sources/tech/20190412 How libraries are adopting open source.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How libraries are adopting open source) +[#]: via: (https://opensource.com/article/19/4/software-libraries) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +How libraries are adopting open source +====== +Over the past decade, ByWater Solutions has expanded its business by +advocating for open source software. +![][1] + +Four years ago, I [interviewed Nathan Currulla][2], co-founder of ByWater Solutions, a major services and solutions provider for [Koha][3], a popular open source integrated library system (ILS). Since then, I've benefitted directly from his company's work, as my local [Chautauqua–Cattaraugus Library System][4] in western New York migrated from a proprietary software system to a [ByWater Systems][5]' Koha implementation. + +When I learned that ByWater is celebrating its 10th anniversary in 2019, I decided to reach out to Nathan to learn how the company has grown over the last decade. (Our remarks have been edited slightly for grammar and clarity.) + +**Don Watkins** : How has ByWater grown in the last 10 years? + +**Nathan Currulla** : Over the last 10 years, ByWater has grown by leaps and bounds. By the end of 2009, we supported five libraries with five contracts. That number shot up to 117 libraries made up of 46 contracts by the end of 2010. We now support over 1,500 libraries and 450+ contracts. We also went from having two team members to 25 in the past 10 years. The service-focused processes we have developed for migrating new libraries have been adopted by other library companies, and we have become a real market disruptor, putting pressure on other companies to provide better support and lower software subscription fees for libraries using their products. This was our goal from the outset, to change the way libraries work with the technology companies who support them, whomever they may be. + +Since the beginning, we have been rooted in the future, while legacy systems are still rooted in the past. Ten years ago, it was a real struggle for us to overcome the barriers presented by the fear of change in libraries and the outdated perceptions of open source in general. Now, although we still have to deal with change aversion, there are enough users to disprove any misinformation that exists regarding Koha and open source. The conversation is easier now than it ever was. That said, despite the fact that the ideals and morals held by open source are directly aligned with those of libraries, we still have a long way to go until open source technologies are the norm in this marketplace. + +**DW** : What kinds of libraries do you support? + +**NC** : Our partners are made up of a diverse set of library types. About 35% of our partners are public libraries, 35% are academic, and the remaining 30% are made up of museum, corporate, law, school, and other special library types. Because of Koha's flexibility and diverse feature set, we can successfully provide services to a variety of library types despite the current trend of consolidation in the library technology marketplace. + +**DW** : How does ByWater work with and help the Koha community? + +**NC** : We are working with the rest of the Koha community to streamline workflows and further improve the process of submitting and accepting new features into Koha. The vast majority of the community is made up of volunteers; by providing paid positions within the community, we can dedicate more time to the quality assurance and sign-off processes needed to stay competitive with other systems, both open source and proprietary. The number of new features submitted to the Koha community for each release is staggering. The more resources we have to get those features out to our users, the faster Koha can evolve and further shape the library-technology marketplace. + +**DW** : When we talked in 2015, ByWater had recently partnered with library solutions provider [EBSCO][6]. What initiatives are you working on now with EBSCO? + +**NC** : Originally, Catalyst IT of New Zealand worked with EBSCO to create the EBSCO Discovery Service (EDS) plugin that is used by many of our customers. Unlike most discovery systems that sit on top of a library's online public access catalog (OPAC), Koha's integration with EDS uses the Koha OPAC as the frontend, with EDS feeding data into the Koha interface. This allows libraries to choose which interface they prefer (EDS or Koha as the frontend) and provides a unified library service platform (LSP). EBSCO has always been a great partner and has always shown a strong willingness to contribute to the open source initiative. They understand the importance of having fewer barriers between the ILS and the libraries' other content to provide a seamless interface to the end user. + +Outside of Koha, ByWater is working closely with EBSCO to provide implementation, training, and support services for its [Folio LSP][7]. Folio is an open source LSP for academic libraries with the intent to provide even more seamless integration with other content providers using an extensible, open app marketplace. ByWater is developing a separate department for the implementation and ongoing support of Folio, with EBSCO providing hosting services to our mutual customers. The fact that EBSCO is investing millions in the creation of an open source platform lends further credence to the importance and validity of open source technologies in the library market. + +**DW** : What other projects are you supporting? How do they complement Koha? + +**NC** : ByWater also supports Libki, an open source, web-based kiosk and print management solution; Coral, an open source electronic resource management (ERM) solution; and Folio. Libki and Coral seamlessly integrate with Koha to provide a unified LSP. Folio may work in cooperation with Koha on some functionality, but it is too early to tell what that will specifically look like. + +ByWater also offers Koha Klassmates, a program that provides free installations of Koha to over 40 library schools in the US to familiarize the next generation of librarians with open source and the tools they will use daily in the workforce. We are also rolling out a program called Koha University, which will mentor computer science students in writing and submitting code to Koha, one of the largest open source projects in the world. This will give them experience in working in such an environment and provide the opportunity for their names to be listed as official Koha contributors. + +**DW** : What is ByWater's strategic focus over the next five years? + +**NC** : ByWater will continue offering top-rated support to our ever-growing customer base while leveraging new open source opportunities to disprove misinformation surrounding the use of open source solutions in libraries. We will focus on making open source the norm and educating libraries that could be taking advantage of these technologies but do not because of outdated information and perceptions. + +Additionally, our research and development efforts will be focused on analyzing machine learning for advanced education and support services. We also want to work closely with our partners on advancing the marketing efforts (through software) for small and large libraries to help cement their roles as community centers by marketing inventory, programs, and library events. We want to be community builders on different levels, both for our partner libraries and with the open source communities that we are involved in. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/software-libraries + +作者:[Don Watkins (Community Moderator)][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/EDUCATION_opencardcatalog.png?itok=f9PyJEe- +[2]: https://opensource.com/business/15/5/bywater-solutions-empowering-library-tech +[3]: http://www.koha.org/ +[4]: https://catalog.cclsny.org/ +[5]: https://bywatersolutions.com/ +[6]: https://www.ebsco.com/ +[7]: https://www.ebsco.com/products/ebsco-folio-library-services diff --git a/sources/tech/20190412 Joe Doss- How Do You Fedora.md b/sources/tech/20190412 Joe Doss- How Do You Fedora.md new file mode 100644 index 0000000000..bc642fb1d6 --- /dev/null +++ b/sources/tech/20190412 Joe Doss- How Do You Fedora.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Joe Doss: How Do You Fedora?) +[#]: via: (https://fedoramagazine.org/joe-doss-how-do-you-fedora/) +[#]: author: (Charles Profitt https://fedoramagazine.org/author/cprofitt/) + +Joe Doss: How Do You Fedora? +====== + +![Joe Doss][1] + +We recently interviewed Joe Doss on how he uses Fedora. This is part of a [series][2] on the Fedora Magazine. The series profiles Fedora users and how they use Fedora to get things done. Contact us on the [feedback form][3] to express your interest in becoming a interviewee. + +### Who is Joe Doss? + +Joe Doss lives in Chicago, Illinois USA and his favorite food is pizza. He is the Director of Engineering Operations and Kenna Security, Inc. Doss describes his employer this way: “Kenna uses data science to help enterprises combine their infrastructure and application vulnerability data with exploit intelligence to measure risk, predict attacks and prioritize remediation.” + +His first Linux distribution was Red Hat Linux 5. A friend of his showed him a computer that wasn’t running Windows. Doss thought it was just a program to install on Windows when his friend gave him a Red Hat Linux 5 install disk. “I proceeded to install this Linux ‘program’ on my Father’s PC,” he says. Luckily for Doss, his father supported his interest in computers. “I ended up totally wiping out the Windows 95 install as a result and this was how I got my first computer.” + +At Kenna, Doss’ group makes use of Fedora and [Ansible][4]: “We run Fedora Cloud in multiple VPC deployments in AWS and Google Compute with over 200 virtual machines. We use Ansible to automate everything we do with Fedora.” + +Doss brews beer at home and contributes to open source in his free time. He also has a cat named Tibby. “I rescued Tibby off the street the Hyde Park neighborhood of Chicago when she was 7 months old. She is not very smart, but she makes up for that with cuteness.” His favorite place to visit is his childhood home of Michigan, but Doss says, “anywhere with a warm beach, a cool drink, and the ocean is pretty nice too.” + +![Tibby the cute cat!][5] + +### The Fedora community + +Doss became involved with Fedora and the Fedora community through his job at Kenna Security. When he first joined the company they were using Ubuntu and Chef in production. There was a desire to make the infrastructure more reproducible and reliable, and he says, “I was able to greenfield our deployments with Fedora Cloud and Ansible.” This project got him involved in the Fedora Cloud release. + +When asked about his first impression of the Fedora community, Doss said, “Overwhelming to be honest. There is so much going on and it is hard to figure out who are the stakeholders of each part of Fedora.” Once he figured out who he needed to talk to he found the community very welcoming and super supportive. + +One of the ideas he had to improve the community was to unite the various projects and team under on bug tracking tool and community resource. “Pagure, Bugzilla, Github, Fedora Forums, Discourse Forums, Mailing lists… it is all over the place and hard to navigate at first.” Despite the initial complexity of becoming familiar with the Fedora Project, Doss feels it is amazingly rewarding to be involved. “It feels awesome it to be apart of a Linux distro that impacts so many people in very positive ways. You can make a difference.” + +Doss called out Dusty Mabe at Red Hat for helping him become involved, saying Dusty “has been an amazing mentor and resource for enabling me to contribute back to Fedora.” + +Doss has an interesting way of explaining to non-technical friends what he does. “Imagine changing the tires on a very large bus while it is going down the highway at 70 MPH and sometimes you need to get involved with the tire manufacturer to help make this process work well.” This metaphor helps people understand what replacing 200-plus VMs across more than five production VPCs in AWS and Google Compute with every Fedora release. + +Doss drew my attention to one specific incident with Fedora 29 and Vagrant. “Recently we encountered an issue where Vagrant wouldn’t set the hostname on a Fresh Fedora 29 Beta VM. This was due to Fedora 29 Cloud no longer shipping the network service stub in favor of NetworkManager. This led to me working with a colleague at Kenna Security to send a patch upstream to the Vagrant project to help their developers produce a fix for Fedora 29. Vagrant usage with Fedora is a very large part of our development cycle at Kenna, and having this broken before the Fedora 29 release would have impacted us a lot.” As Doss said, “Sometimes you need to help make the tires before they go on the bus.” + +Doss is the [COPR][6] Fedora, RHEL, and CentOS package maintainer for [WireGuard VPN][7]. “The CentOS repo just went over 60 thousand downloads last month which is pretty awesome.” + +### What Hardware? + +Doss uses Fedora 29 cloud in the over five VPC deployments in AWS and Google computer. At home he has a SuperMicro SYS-5019A-FTN4 1U Server that runs Fedora 29 Server with Openshift OKD installed on it. His laptops are all Lenovo. “For Laptops I use a ThinkPad T460s for work and a ThinkPad 25 at home. Both have Fedora 29 installed. ThinkPads are the best with Fedora.” + +### What Software? + +Doss used GNOME 3 as his preferred desktop on Fedora Workstation. “I use Sublime Text 3 for my text editor on the desktop or vim on servers.” For development and testing he uses Vagrant. “Ansible is what I use for any kind of automation with Fedora. I maintain an [Ansible playbook][8] for setting up my workstation.” + +### Ansible + +I asked Doss if he had advice for people trying to learn Ansible. + +“Start small. Automate the stuff that makes your life easier, but don’t over complicate it. [Ansible Galaxy][9] is a great resource to get things done quickly, but if you truly want to learn how to use Ansible, writing your own roles and playbooks the path I would take. + +“I have helped a lot of my coworkers that have joined my Operations team at Kenna get up to speed on using Ansible by buying them a copy of [Ansible for Devops][10] by Jeff Geerling. This book will give anyone new to Ansible the foundation they need to start using it everyday. #ansible on Freenode is a great resource as well along with the [official Ansible docs][11].” + +Doss also said, “Knowing what to automate is most likely the most difficult thing to master without over complicating things. Debugging complex playbooks and roles is a close second.” + +### Home lab + +He recommended setting up a home lab. “At Kenna and at home I use [Vagrant][12] with the [Vagrant-libvirt plugin][13] for developing Ansible roles and playbooks. You can iterate quickly to build your roles and playbooks on your laptop with your favorite editor and run _vagrant provision_ to run your playbook. Quick feedback loop and the ability to burn down your Vagrant VM and start over quickly is an amazing workflow. Below is a sample Vagrant file that I keep handy to spin up a Fedora VM to test my playbooks.” + +``` +-- mode: ruby -- + vi: set ft=ruby : + Vagrant.configure(2) do |config| + config.vm.provision "shell", inline: "dnf install nfs-utils rpcbind @development-tools @ansible-node redhat-rpm-config gcc-c++ -y" + config.ssh.forward_agent = true + config.vm.define "f29", autostart: false do |f29| + f29.vm.box = "fedora/29-cloud-base" + f29.vm.hostname = "f29.example.com" + f29.vm.provider "libvirt" do |vm| + vm.memory = 2048 + vm.cpus = 2 + vm.driver = "kvm" + vm.nic_model_type = "e1000" + end +config.vm.synced_folder '.', '/vagrant', disabled: true + +config.vm.provision "ansible" do |ansible| + ansible.groups = { + } + ansible.playbook = "playbooks/main.yml" + ansible.inventory_path = "inventory/development" + ansible.extra_vars = { + ansible_python_interpreter: "/usr/bin/python3" + } +# ansible.verbose = 'vvv' end +end +end +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/joe-doss-how-do-you-fedora/ + +作者:[Charles Profitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/cprofitt/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/03/IMG_20181029_121944-816x345.jpg +[2]: https://fedoramagazine.org/tag/how-do-you-fedora/ +[3]: https://fedoramagazine.org/submit-an-idea-or-tip/ +[4]: https://ansible.com +[5]: https://fedoramagazine.org/wp-content/uploads/2019/04/IMG_20181231_110920_fixed.jpg +[6]: https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/ +[7]: https://www.wireguard.com/install/ +[8]: https://github.com/jdoss/fedora-workstation +[9]: https://galaxy.ansible.com/ +[10]: https://www.ansiblefordevops.com/ +[11]: https://docs.ansible.com/ansible/latest/index.html +[12]: http://www.vagrantup.com/ +[13]: https://github.com/vagrant-libvirt/vagrant-libvirt%20plugin diff --git a/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md b/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md new file mode 100644 index 0000000000..1e1b451500 --- /dev/null +++ b/sources/tech/20190412 Linux Server Hardening Using Idempotency with Ansible- Part 2.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 2) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-2) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 2 +====== + +![][1] + +[Creative Commons Zero][2] + +In the first part of this series, we introduced something called idempotency, which can provide the ongoing improvements to your server estate’s security posture. In this article, we’ll get a little more hands-on with a look at some specific Ansible examples. + +### Shopping List + +You will need some Ansible experience before being able to make use of the information that follows. Rather than run through the installation and operation of Ansible let’s instead look at some of the idempotency playbook’s content. + +As mentioned earlier there might be hundreds of individual system tweaks to make on just one type of host so we’ll only explore a few suggested Ansible tasks and how I like to structure the Ansible role responsible for the compliance and hardening. You have hopefully picked up on the fact that the devil is in the detail and you should absolutely, unequivocally, understand to as high a level of detail as possible, about the permutations of making changes to your server OS. + +Be aware that I will mix and match between OSs in the Ansible examples that follow. Many examples are OS agnostic but as ever you should pay close attention to the detail. Obvious changes like “apt” to “yum” for the package manager is a given. + +Inside a “tasks” file under our Ansible “hardening” role, or whatever you decide to name it, these named tasks represent the areas of a system with some example code to offer food for thought. In other words, each section that follows will probably be a single YAML file, such as “accounts.yml”, and each will have with varying lengths and complexity. + +Let’s look at some examples with ideas about what should go into each file to get you started. The contents of each file that follow are just the very beginning of a checklist and the following suggestions are far from exhaustive. + +#### SSH Server + +This is the application that almost all engineers immediately look to harden when asked to secure a server. It makes sense as SSH (the OpenSSH package in many cases) is usually only one of a few ports intentionally prised open and of course allows direct access to the command line. The level of hardening that you should adopt is debatable. I believe in tightening the daemon as much as possible without disruption and would usually make around fifteen changes to the standard OpenSSH server config file, “sshd_config”. These changes would include pulling in a MOTD banner (Message Of The Day) for legal compliance (warning of unauthorised access and prosecution), enforcing the permissions on the main SSHD files (so they can’t be tampered with by lesser-privileged users), ensuring the “root” user can’t log in directly, setting an idle session timeout and so on. + +Here’s a very simple Ansible example that you can repeat within other YAML files later on, focusing on enforcing file permissions on our main, critical OpenSSH server config file. Note that you should carefully check every single file that you hard-reset permissions on before doing so. This is because there are horrifyingly subtle differences between Linux distributions. Believe me when I say that it’s worth checking first. + +name: Hard reset permissions on sshd server file + +file: owner=root group=root mode=0600 path=/etc/ssh/sshd_config + +To check existing file permissions I prefer this natty little command for the job: + +``` +$ stat -c "%a %n" /etc/ssh/sshd_config + +644 /etc/ssh/sshd_config +``` + +As our “stat” command shows our Ansible snippet would be an improvement to the current permissions because 0600 means only the “root” user can read and write to that file. Other users or groups can’t even read that file which is of benefit because if we’ve made any mistakes in securing SSH’s config they can’t be discovered as easily by less-privileged users. + +#### System Accounts + +At a simple level this file might define how many users should be on a standard server. Usually a number of users who are admins have home directories with public keys copied into them. However this file might also include performing simple checks that the root user is the only system user with the all-powerful superuser UID 0; in case an attacker has altered user accounts on the system for example. + +#### Kernel + +Here’s a file that can grow arms and legs. Typically I might affect between fifteen and twenty sysctl changes on an OS which I’m satisfied won’t be disruptive to current and, all going well, any future uses of a system. These changes are again at your discretion and, at my last count (as there’s between five hundred and a thousand configurable kernel options using sysctl on a Debian/Ubuntu box) you might opt to split off these many changes up into different categories. + +Such categories might include network stack tuning, stopping core dumps from filling up disk space, disabling IPv6 entirely and so on. Here’s an Ansible example of logging network packets that shouldn’t been routed out onto the Internet, namely those packets using spoofed private IP Addresses, called “martians”. + +name: Keep track of traffic that shouldn’t be routed onto the Internet + +lineinfile: dest="/etc/sysctl.conf" line="{{item.network}}" state=present + +with_items: + +\- { network: 'net.ipv4.conf.all.log_martians = 1' } + +\- { network: 'net.ipv4.conf.default.log_martians = 1' } + +Pay close attention that you probably don’t want to use the file “/etc/sysctl.conf” but create a custom file under the directory “/etc/sysctl.d/” or similar. Again, check your OS’s preference, usually in the comments of the pertinent files. If you’ve not seen martian packets being enabled before then type “dmesg” (sometimes only as the “root” user) to view kernel messages and after a week or two of logging being in place you’ll probably see some traffic polluting your logs. It’s much better to know how attackers are probing your servers than not. A few log entries for reference can only be of value. When it comes to looking after servers, ignorance is certainly not bliss. + +#### Network + +As mentioned you might want to include hardening the network stack within your kernel.yml file, depending on whether there’s many entries or not, or simply for greater clarity. For your network.yml file have a think about stopping old-school broadcast attacks flooding your LAN and ICMP oddities from changing your routing in addition. + +#### Services + +Usually I would stop or start miscellaneous system services (and potentially applications) within this Ansible file. If there weren’t many services then rather than also using a “cron.yml” file specifically for “cron” hardening I’d include those here too. + +There’s a bundle of changes you can make around cron’s file permissions etc. If you haven’t come across it, on some OSs, there’s a “cron.deny” file for example which blacklists certain users from accessing the “crontab” command. Additionally you also have a multitude of cron directories under the “/etc” directory which need permissions enforced and improved, indeed along with the file “/etc/crontab” itself. Once again check with your OS’s current settings before altering these or “bad things” ™ might happen to your uptime. + +In terms of miscellaneous services being purposefully stopped and certain services, such as system logging which is imperative to a healthy and secure system, have a quick look at the Ansible below which I might put in place for syslog as an example. + +name: Insist syslog is definitely installed (so we can receive upstream logs) + +apt: name=rsyslog state=present + +name: Make sure that syslog starts after a reboot + +service: name=rsyslog state=started enabled=yes + +#### IPtables + +The venerable Netfilter which, from within the Linux kernel offers the IPtables software firewall the ability to filter network packets in an exceptionally sophisticated manner, is a must if you can enable it sensibly. If you’re confident that each of your varying flavours of servers (whether it’s a webserver, database server and so on) can use the same IPtables config then copy a file onto the filesystem via Ansible and make sure it’s always loaded up using this YAML file. + +Next time, we’ll wrap up our look at specific system suggestions and talk a little more about how the playbook might be used. + +Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website: [https://www.devsecops.cc][3] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-2 + +作者:[Chris Binnie][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/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/artificial-intelligence-3382507_1280.jpg?itok=PHazitpd +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.devsecops.cc/ diff --git a/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md b/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md new file mode 100644 index 0000000000..657464affb --- /dev/null +++ b/sources/tech/20190414 Working with Microsoft Exchange from your Linux Desktop.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with Microsoft Exchange from your Linux Desktop) +[#]: via: (https://itsfoss.com/microsoft-exchange-linux-desktop/) +[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/) + +Working with Microsoft Exchange from your Linux Desktop +====== + +Recently I had to do some research (and even magic) to be able to work on my Ubuntu Desktop with Exchange Mail Server from my current employer. I am going to share my experience with you. + +### Microsoft Exchange on Linux desktop + +I guess many readers might feel confused, I mean, it shouldn’t be that hard if you simply use [Thunderbird][1] or any other [Linux email client][2] with your Office365 Exchange Account, right? Well, for better or for worse it was not this case for me. + +Here’s my ordeal and what I did to make Microsoft Exchange work on my Linux desktop. + +![][3] + +#### The initial problem, no Office365 + +The first problem encountered in my situation was that we don’t currently use Office365 like probably majority of current people does for hosting their Exchange accounts, we currently use an on premises Exchange server and a very old version of it. + +So, this means I didn’t have the luxury of using automatic configuration that comes in majority of email clients to simply connect to Office365. + +#### Webmail is always an option… right? + +Short answer is yes, however, as I mentioned we are using Exchange 2010, so the webmail interface is not only outdated, it even won’t allow you to have a decent email signature as it has a limit of characters in webmail configuration, so I needed to use an email client if I really wanted to be able to use the email the way I needed. + +#### Another problem, I am picky for my email client + +I am a regular Google user, I have been using GMail for the past 14 years as my personal email, so I really like how it looks and works. I actually use the webmail as I don’t like to be tied to my email client or even my computer device, if something happens and I need to switch to a newer device I don’t want to have to copy things over, I just want things to be there waiting for me to use them. + +This leads me not liking Thunderbird, K-9 or Evolution Mail clients. All of these are capable of being connected to Exchange servers (one way or the other) but again, they don’t meet the standard of a clean, easy and modern GUI I wanted plus they couldn’t even manage my Exchange calendar well (which was a real deal breaker for me). + +#### Found some options as email clients! + +After some other research I found there were a couple of options for email clients that I could use and that actually would work the way I expected. + +These were: [Hiri][4], which had a very modern and innovative user interface and had Exchange Server capabilities and there also was [Mailspring][5] which is a fork of an old foe ([Nylas Mail][6]) and which was my real favorite. + +However, Mailspring couldn’t connect directly to an Exchange server (using Exchange’s protocol) unless you use Office365, it required [IMAP][7] (another luxury!) and the IT department at my office was reluctant to activate IMAP for “security reasons”. + +Hiri is a good option but it’s not free. + +#### No IMAP, no Office365, game over? Not yet! + +I have to confess, I was really ready to give up and simply use the old webmail and learn to live with it, however, I gave a last shot on my research capabilities and I found a possible solution: what if I had a way to put a “man in the middle”? What if I was able to make the IMAP to run locally on my computer while my computer simply pull the emails via Exchange protocol? It was a long shot but, could work… + +So I started looking here and there and found this [DavMail][8], which works as a Gateway to “talk” with an Exchange server and then locally provide you whatever you need in order to use it. Basically it was like a “translator” between by computer and the Exchange and then provided me with whatever service I needed. + +![DavMail Settings][9] + +So basically I only had to give DavMail my Exchange Server’s URL (even OWA URL) and set whatever ports I wanted on my local computer to be the new ports where my email client could connect. + +This way I was free to basically use ANY client I wanted, at least any client which was capable of using IMAP protocol would work, as long as I configure the same ports I set up as my local ports. + +![Mailspring working my office’s on premises Exchange. Information has been blurred due to non-disclosure agreement at my office.][10] + +And that was it! I was able to use MailSpring (which is my preferred choice for email client) under my non favorable conditions. + +#### Bonus point: this is a multi-platform solution! + +What’s best is that this solution will work for any platform! So if you have the same problem while using Windows or macOS, DavMail has a version for all tastes! + +![avatar][11] + +![avatar][11] + +### Helder Martins + +Systems Engineer, technology evangelist, Ubuntu user, Linux enthusiast, father and husband. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/microsoft-exchange-linux-desktop/ + +作者:[It's FOSS Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://www.thunderbird.net/en-US/ +[2]: https://itsfoss.com/best-email-clients-linux/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/microsoft-exchange-linux-desktop.png?resize=800%2C450&ssl=1 +[4]: https://www.hiri.com/ +[5]: https://getmailspring.com/ +[6]: https://itsfoss.com/n1-open-source-email-client/ +[7]: https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol +[8]: http://davmail.sourceforge.net/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/davmail-exchange-settings.png?resize=800%2C597&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/davmail-exchange-settings-1.jpg?ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/helder-martins-1.jpeg?ssl=1 diff --git a/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md new file mode 100644 index 0000000000..f33d614f86 --- /dev/null +++ b/sources/tech/20190415 Blender short film, new license for Chef, ethics in open source, and more news.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blender short film, new license for Chef, ethics in open source, and more news) +[#]: via: (https://opensource.com/article/15/4/news-april-15) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +Blender short film, new license for Chef, ethics in open source, and more news +====== +Here are some of the biggest headlines in open source in the last two +weeks +![][1] + +In this edition of our open source news roundup, we take a look at the 12th Blender short film, Chef shifts away from open core toward a 100% open source license, SuperTuxKart's latest release candidate with online multiplayer support, and more. + +### Blender Animation Studio releases Spring + +[Spring][2], the latest short film from [Blender Animation Studio][3], premiered on April 4th. The [press release on Blender.org][4] describes _Spring_ as "the story of a shepherd girl and her dog, who face ancient spirits in order to continue the cycle of life." The development version of Blender 2.80, as well as other open source tools, were used to create this animated short film. The character and asset files for the film are available from [Blender Cloud][5], and tutorials, walkthroughs, and other instructional material are coming soon. + +### The importance of ethics in open source + +Reuven M. Lerner, writing for [Linux Journal][6], shares his thoughts about need for teaching programmers about ethics in an article titled [Open Source Is Winning, and Now It's Time for People to Win Too][7]. Part retrospective looking back at the history of open source and part call to action for moving forward, Lerner's article discusses many issues relevant to open source beyond just coding. He argues that when we teach kids about open source "[w]e also need to inform them of the societal parts of their work, and the huge influence and power that today's programmers have." He continues by stating "It's sometimes okay—and even preferable—for a company to make less money deliberately, when the alternative would be to do things that are inappropriate or illegal." Overall a very thought-provoking piece, Lerner makes a solid case for making sure to remember that the open source movement is about more than free code. + +### Chef transitions from open core to open source + +Chef, the company behind the well-known DevOps automation tool, [announced][8] that they will be release 100% of their software as open source under an Apache 2.0 license. This move marks a departure from their current [open core model][9]. Given a tendency for companies to try to move in the opposite direction, Chef's move is a big one. By operating under a fully open source model Chef builds a better, stronger relationship with the community, and the community benefits from full access to all the source code. Even developers of competing projects (and the commercial projects based on those products) benefit from being able to learn from Chef's code, as Chef can do from its open source competitors, which is one of the greatest advantages of open source; the best ideas get to win and business relationships are built around trust and quality of service, not proprietary secrets. For a more detailed look at this development, read Steven J. Vaughan-Nichols's [article for ZDNet][10]. + +### SuperTuxKart releases version 0.10 RC1 for testing + +SuperTuxKart, the open source Mario Kart clone featuring open source mascots, is getting very close to releasing a version that supports online multi-player. On April 5th, the SuperTuxKart blog announced the release of [SuperTuxKart 0.10 Release Candidate 1][11], which needs testing before the final release. Users who want to help test the online and LAN multiplayer options can [download the game from SourceForge][12]. In addition to the new online and LAN features, SuperTuxKart 0.10 features a couple new tracks to race on; Ravenbridge Mansion replaces the old Mansion track, and Black Forest, which was an add-on track in earlier versions, is now part of the official track set. + +#### In other news + + * [My code is your code: Embracing the power of open sourcing][13] + * [FOSS means kids can have a big impact][14] + * [Open-source textbooks lighten students’ financial load][15] + * [Developing the ultimate open source radio control transmitter][16] + * [How does open source tech transform Government?][17] + + + +_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/15/4/news-april-15 + +作者:[Joshua Allen Holm (Community Moderator)][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/holmja +[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 +[2]: https://www.youtube.com/watch?v=WhWc3b3KhnY (Spring) +[3]: https://blender.studio/ (Blender Animation Studio) +[4]: https://www.blender.org/press/spring-open-movie/ (Spring Open Movie) +[5]: https://cloud.blender.org/p/spring/ (Spring on Blender Cloud) +[6]: https://www.linuxjournal.com/ (Linux Journal) +[7]: https://www.linuxjournal.com/content/open-source-winning-and-now-its-time-people-win-too (Open Source Is Winning, and Now It's Time for People to Win Too) +[8]: https://blog.chef.io/2019/04/02/chef-software-announces-the-enterprise-automation-stack/ (Introducing the New Chef: 100% Open, Always) +[9]: https://en.wikipedia.org/wiki/Open-core_model (Wikipedia: Open-core model) +[10]: https://www.zdnet.com/article/leading-devops-program-chef-goes-all-in-with-open-source/ (Leading DevOps program Chef goes all in with open source) +[11]: http://blog.supertuxkart.net/2019/04/supertuxkart-010-release-candidate-1.html (SuperTuxKart 0.10 Release Candidate 1 Released) +[12]: https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.10-rc1/ (SourceForge: SuperTuxKart) +[13]: https://www.forbes.com/sites/forbestechcouncil/2019/04/10/my-code-is-your-code-embracing-the-power-of-open-sourcing/ (My code is your code: Embracing the power of open sourcing) +[14]: https://www.linuxjournal.com/content/foss-means-kids-can-have-big-impact (FOSS means kids can have a big impact) +[15]: https://www.schoolnewsnetwork.org/2019/04/09/open-source-textbooks-lighten-students-financial-load/ (Open-source textbooks lighten students’ financial load) +[16]: https://hackaday.com/2019/04/03/developing-the-ultimate-open-source-radio-control-transmitter/ (Developing the ultimate open source radio control transmitter) +[17]: https://www.openaccessgovernment.org/open-source-tech-transform/62059/ (How does open source tech transform Government?) diff --git a/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md new file mode 100644 index 0000000000..50f4981c08 --- /dev/null +++ b/sources/tech/20190416 Linux Server Hardening Using Idempotency with Ansible- Part 3.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Server Hardening Using Idempotency with Ansible: Part 3) +[#]: via: (https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3) +[#]: author: (Chris Binnie https://www.linux.com/users/chrisbinnie) + +Linux Server Hardening Using Idempotency with Ansible: Part 3 +====== + +![][1] + +[Creative Commons Zero][2] + +In the previous articles, we introduced idempotency as a way to approach your server’s security posture and looked at some specific Ansible examples, including the kernel, system accounts, and IPtables. In this final article of the series, we’ll look at a few more server-hardening examples and talk a little more about how the idempotency playbook might be used. + +#### **Time** + +Due to its reduced functionality, and therefore attack surface, the preference amongst a number of OSs has been to introduce “chronyd” over “ntpd”. If you’re new to “chrony” then fret not. It’s still using the NTP (Network Time Protocol) that we all know and love but in a more secure fashion. + +The first thing I do with Ansible within the “chrony.conf” file is alter the “bind address” and if my memory serves there’s also a “command port” option. These config options allow Chrony to only listen on the localhost. In other words you are still syncing as usual with other upstream time servers (just as NTP does) but no remote servers can query your time services; only your local machine has access. + +There’s more information on the “bindcmdaddress 127.0.0.1” and “cmdport 0” on this Chrony page () under “2.5. How can I make chronyd more secure?” which you should read for clarity. This premise behind the comment on that page is a good idea: “you can disable the internet command sockets completely by adding cmdport 0 to the configuration file”. + +Additionally I would also focus on securing the file permissions for Chrony and insist that the service starts as expected just like the syslog config above. Otherwise make sure that your time sources are sane, have a degree of redundancy with multiple sources set up and then copy the whole config file over using Ansible. + +#### **Logging** + +You can clearly affect the level of detail included in the logs from a number pieces of software on a server. Thinking back to what we’ve looked at in relation to syslog already you can also tweak that application’s config using Ansible to your needs and then use the example Ansible above in addition. + +#### **PAM** + +Apparently PAM (Pluggable Authentication Modules) has been a part of Linux since 1997. It is undeniably useful (a common use is that you can force SSH to use it for password logins, as per the SSH YAML file above). It is extensible, sophisticated and can perform useful functions such as preventing brute force attacks on password logins using a clever rate limiting system. The syntax varies a little between OSes but if you have the time then getting PAM working well (even if you’re only using SSH keys and not passwords for your logins) is a worthwhile effort. Attackers like their own users on a system with lots of usernames, something innocuous such as “webadmin” or similar might be easy to miss on a server, and PAM can help you out in this respect. + +#### **Auditd** + +We’ve looked at logging a little already but what about capturing every “system call” that a kernel makes. The Linux kernel is a super-busy component of any system and logging almost every single thing that a system does is an excellent way of providing post-event forensics. This article will hopefully shed some light on where to begin: . Note the comments in that article about performance, there’s little point in paying extra for compute and disk IO resource because you’ve misconfigured your logging so spend some time getting it correct would be my advice. + +For concerns over disk space I will usually change a few lines in the file “/etc/audit/auditd.conf” in order to prevent there firstly being too many log files created and secondly logs that grow very large without being rotated. This is also on the proviso that logs are being ingested upstream via another mechanism too. Clearly the files permissions and the service starting are also the basics you need to cover here too. Generally file permissions for auditd are tight as it’s a “root” oriented service so there’s less changes needed here generally. + +#### **Filesystems** + +With a little reading you can discover which filesystems that are made available to your OS by default. You should disable these (at the “modprode.d” file level) with Ansible to prevent weird and wonderful things being attached unwittingly to your servers. You are reducing the attack surface with this approach. The Ansible might look something like this below for example. + +``` +name: Make sure filesystems which are not needed are forced as off + +lineinfile: dest="/etcmodprobe.d/harden.conf" line='install squashfs /bin/true' state=present +``` + +#### **SELinux** + +The old, but sometimes avoided due to complexity, security favourite, SELinux, should be set to “enforcing” mode. Or, at the every least, set to log sensibly using “permissive” mode. Permissive mode will at least fill your auditd logs up with any correct rule matches nicely. In terms of what Ansible looks like it’s simple and is along these lines: + +``` +name: Configure SElinux to be running in permissive mode + +replace: path=”/etc/selinux/config” regexp='SELINUX=disabled' replace='SELINUX=permissive' +``` + +#### **Packages** + +Needless to say the compliance hardening playbook is also a good place to upgrade all the packages (with some selective exclusions) on the system. Pay attention to the section relating to reboots and idempotency in a moment however. With other mechanisms in place you might not want to update packages here but instead as per the Automation Documents article mentioned in a moment. + +### **Idempotency** + +Now we’ve run through some of the aspects you would want to look at when hardening on a server, let’s think a little more about how the playbook might be used. + +When it comes to cloud platforms most of my professional work has been on AWS and therefore, more often than not, a fresh AMI is launched and then a playbook is run over the top of it. There’s a mountain of detail in one way of doing that in this article () which you may be pleased to discover accommodates a mechanism to spawn a script or playbook. + +It is important to note, when it comes to idempotency, that it may take a little more effort initially to get your head around the logic involved in being able to re-run Ansible repeatedly without disturbing the required status quo of your server estate. + +One thing to be absolutely certain of however (barring rare edge cases) is that after you apply your hardening for the very first time, on a new AMI or server build, you will require a reboot. This is an important element due to a number of system facets not being altered correctly without a reboot. These include applying kernel changes so alterations become live, writing auditd rules as immutable config and also starting or stopping services to improve the security posture. + +Note though that you’re probably not going to want to execute all plays in a playbook every twenty or thirty minutes, such as updating all packages and stopping and restarting key customer-facing services. As a result you should factor the logic into your Ansible so that some tasks only run once initially and then maybe write a “completed” placeholder file to the filesystem afterwards for referencing. There’s a million different ways of achieving a status checker. + +The nice thing about Ansible is that the logic for rerunning playbooks is implicit and unlike shell scripts which for this type of task can be arduous to code the logic into. Sometimes, such as updating the GRUB bootloader for example, trying to guess the many permutations of a system change can be painful. + +### **Bedtime Reading** + +I still think that you can’t beat trial and error when it comes to computing. Experience is valued for good reason. + +Be warned that you’ll find contradictory advice sometimes from the vast array of online resources in this area. Advice differs probably because of the different use cases. The only way to harden the varying flavours of OS to my mind is via a bespoke approach. This is thanks to the environments that servers are used within and the requirements of the security framework or standard that an organisation needs to meet. + +For OS hardening details you can check with resources such as the NSA ([https://www.nsa.gov][3]), the Cloud Security Alliance (), proprietary training organisations such as GIAC ([https://www.giac.org][4]) who offer resources (), the diverse CIS Benchmarks ([https://www.cisecurity.org][5]) for industry consensus-based benchmarking, the SANS Institute (), NIST’s Computer Security Research ([https://csrc.nist.gov][6]) and of course print media too. + +### **Conclusion** + +Hopefully, you can see how powerful an idempotent server infrastructure is and are tempted to try it for yourself. + +The ever-present threat of APT (Advanced Persistent Threat) attacks on infrastructure, where a successful attacker will sit silently monitoring events and then when it’s opportune infiltrate deeper into an estate, makes this type of configuration highly valuable. + +The amount of detail that goes into the tests and configuration changes is key to the value that such an approach will bring to an organisation. Like the tests in a CI/CD pipeline they’re only as ever as good as their coverage. + +Chris Binnie’s latest book, Linux Server Security: Hack and Defend, shows you how to make your servers invisible and perform a variety of attacks. You can find out more about DevSecOps, containers and Linux security on his website: [https://www.devsecops.cc][7] + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/linux-server-hardening-using-idempotency-ansible-part-3 + +作者:[Chris Binnie][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/chrisbinnie +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/tech-1495181_1280.jpg?itok=5WcwApNN +[2]: /LICENSES/CATEGORY/CREATIVE-COMMONS-ZERO +[3]: https://www.nsa.gov/ +[4]: https://www.giac.org/ +[5]: https://www.cisecurity.org/ +[6]: https://csrc.nist.gov/ +[7]: https://www.devsecops.cc/ diff --git a/sources/tech/20190417 How to use Ansible to document procedures.md b/sources/tech/20190417 How to use Ansible to document procedures.md new file mode 100644 index 0000000000..51eddfe92c --- /dev/null +++ b/sources/tech/20190417 How to use Ansible to document procedures.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use Ansible to document procedures) +[#]: via: (https://opensource.com/article/19/4/ansible-procedures) +[#]: author: (Marco Bravo https://opensource.com/users/marcobravo/users/shawnhcorey/users/marcobravo) + +How to use Ansible to document procedures +====== +In Ansible, the documentation is the playbook, so the documentation +naturally evolves alongside the code +![][1] + +> "Documentation is a love letter that you write to your future self." —[Damian Conway][2] + +I use [Ansible][3] as my personal notebook for documenting coding procedures—both the ones I use often and the ones I rarely use. This process facilitates my work and reduces the time it takes to do repetitive tasks, the ones where specific commands in a certain sequence are executed to accomplish a specific result. + +By documenting with Ansible, I don't need to memorize all the parameters for each command or all the steps involved with a specific procedure, and it's easy to share the details with my teammates. + +Traditional approaches for documentation, like wikis or shared drives, are useful for general documents, but inevitably they become outdated and can't keep pace with the rapid changes in infrastructure and environments. For specific procedures, it's better to document directly into the code using a tool like Ansible. + +### Ansible's advantages + +Before we begin, let's recap some basic Ansible concepts: a _playbook_ is a high-level organization of procedures using plays; _plays_ are specific procedures for a group of hosts; _tasks_ are specific actions, _modules_ are units of code, and _inventory_ is a list of managed nodes. + +Ansible's great advantage is that the documentation is the playbook itself, so it evolves with and is contained inside the code. This is not only useful; it's also practical because, more than just documenting solutions with Ansible, you're also coding a playbook that permits you to write your procedures and commands, reproduce them, and automate them. This way, you can look back in six months and be able to quickly understand and execute them again. + +It's true that this way of resolving problems could take more time at first, but it will definitely save a lot of time in the long term. By being courageous and disciplined to adopt these new habits, you will improve your skills in each iteration. + +Following are some other important elements and support tools that will facilitate your process. + +### Use source code control + +> "First do it, then do it right, then do it better." —[Addy Osmani][4] + +When working with Ansible playbooks, it's very important to implement a playbook-as-code strategy. A good way to accomplish this is to use a source code control repository that will permit to you start with a simple solution and iterate to improve it. + +A source code control repository provides many advantages as you collaborate with other developers, restore previous versions, and back up your work. But in creating documentation, its main advantages are that you get traceability about what are you doing and can iterate around small changes to improve your work. + +The most popular source control system is [Git][5], but there are [others][6] like [Subversion][7], [Bazaar][8], [BitKeeper][9], and [Mercurial][10]. + +### Keep idempotency in mind + +In infrastructure automation, idempotency means to reach a specific end state that remains the same, no matter how many times the process is executed. So when you are preparing to automate your procedures, keep the desired result in mind and write scripts and commands that will achieve them consistently. + +This concept exists in most Ansible modules because after you specify the desired final state, Ansible will accomplish it. For instance, there are modules for creating filesystems, modifying iptables, and managing cron entries. All of these modules are idempotent by default, so you should give them preference. + +If you are using some of the lower-level modules, like command or shell, or developing your own modules, be careful to write code that will be idempotent and safe to repeat many times to get the same result. + +The idempotency concept is important when you prepare procedures for automation because it permits you to evaluate several scenarios and incorporate the ones that will make your code safer and create an abstraction level that points to the desired result. + +### Test it! + +Testing your deployment workflow creates fewer surprises when your code arrives in production. Ansible's belief that you shouldn't need another framework to validate basic things in your infrastructure is true. But your focus should be on application testing, not infrastructure testing. + +Ansible's documentation offers several [testing strategies for your procedures][11]. For testing Ansible playbooks, you can use [Molecule][12], which is designed to aid in the development and testing of Ansible roles. Molecule supports testing with multiple instances, operating systems/distributions, virtualization providers, test frameworks, and testing scenarios. This means Molecule will run through all the testing steps: linting verifications, checking playbook syntax, building Docker environments, running playbooks against Docker environments, running the playbook again to verify idempotence, and cleaning everything up afterward. [Testing Ansible roles with Molecule][13] is a good introduction to Molecule. + +### Run it! + +Running Ansible playbooks can create logs that are formatted in an unfriendly and difficult-to-read way. In those cases, the Ansible Run Analysis (ARA) is a great complementary tool for running Ansible playbooks, as it provides an intuitive interface to browse them. Read [Analyzing Ansible runs using ARA][14] for more information. + +Remember to protect your passwords and other sensitive information with [Ansible Vault][15]. Vault can encrypt binary files, **group_vars** , **host_vars** , **include_vars** , and **var_files**. But this encrypted data is exposed when you run a playbook in **-v** (verbose) mode, so it's a good idea to combine it with the keyword **no_log** set to **true** to hide any task's information, as it indicates that the value of the argument should not be logged or displayed. + +### A basic example + +Do you need to connect to a server to produce a report file and copy the file to another server? Or do you need a lot of specific parameters to connect? Maybe you're not sure where to store the parameters. Or are your procedures are taking a long time because you need to collect all the parameters from several sources? + +Suppose you have a network topology with some restrictions and you need to copy a file from a server that you can access ( **server1** ) to another server that is managed by a third party ( **server2** ). The parameters to connect are: + + +``` +Source server: server1 +Target server: server2 +Port: 2202 +User: transfers +SSH Key: transfers_key +File to copy: file.log +Remote directory: /logs/server1/ +``` + +In this scenario, you need to connect to **server1** and copy the file using these parameters. You can accomplish this using a one-line command: + + +``` +`ssh server1 "scp -P 2202 -oUser=transfers -i ~/.ssh/transfers_key file.log server2:/logs/server1/"` +``` + +Now your playbook can do the procedure. + +### Useful combinations + +If you produce a lot of Ansible playbooks, you can organize all your procedures with other tools like [AWX][16] (Ansible Works Project), which provides a web-based user interface, a REST API, and a task engine built on top of Ansible so that users can better control their Ansible project use in IT environments. + +Other interesting combinations are Ansible with [Rundeck][17], which provides procedures as self-service jobs, and [Jenkins][18] for continuous integration and continuous delivery processes. + +### Conclusion + +I hope that these tips for using Ansible will help you improve your automation processes, coding, and documentation. If you have more interest, dive in and learn more. And I would like to hear your ideas or questions, so please share them in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/ansible-procedures + +作者:[Marco Bravo][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/marcobravo/users/shawnhcorey/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 +[2]: https://en.wikipedia.org/wiki/Damian_Conway +[3]: https://www.ansible.com/ +[4]: https://addyosmani.com/ +[5]: https://git-scm.com/ +[6]: https://en.wikipedia.org/wiki/Comparison_of_version_control_software +[7]: https://subversion.apache.org/ +[8]: https://bazaar.canonical.com/en/ +[9]: https://www.bitkeeper.org/ +[10]: https://www.mercurial-scm.org/ +[11]: https://docs.ansible.com/ansible/latest/reference_appendices/test_strategies.html +[12]: https://molecule.readthedocs.io/en/latest/ +[13]: https://opensource.com/article/18/12/testing-ansible-roles-molecule +[14]: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara +[15]: https://docs.ansible.com/ansible/latest/user_guide/vault.html +[16]: https://github.com/ansible/awx +[17]: https://www.rundeck.com/ansible +[18]: https://www.redhat.com/en/blog/integrating-ansible-jenkins-cicd-process diff --git a/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md new file mode 100644 index 0000000000..5c81f2d8bc --- /dev/null +++ b/sources/tech/20190418 Electronics designed in 5 different countries with open hardware.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Electronics designed in 5 different countries with open hardware) +[#]: via: (https://opensource.com/article/19/4/hardware-international) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg) + +Electronics designed in 5 different countries with open hardware +====== +This month's open source hardware column looks at certified open +hardware from five countries that may surprise you. +![Gadgets and open hardware][1] + +The Open Source Hardware Association's [Hardware Registry][2] lists hardware from 29 different countries on five continents, demonstrating the broad, international footprint of certified open source hardware. + +![Open source hardware map][3] + +In some ways, this international reach shouldn't be a surprise. Like many other open source communities, the open source hardware community is built on top of the internet, not grounded in any specific geographical location. The focus on documentation, sharing, and openness makes it easy for people in different places with different backgrounds to connect and work together to develop new hardware. Even the community-developed open source hardware [definition][4] has been translated into 11 languages from the original English. + +Even if you're familiar with the international nature of open source hardware, it can still be refreshing to step back and remember what it means in practice. While it may not surprise you that there are many certifications from the United States, Germany, and India, some of the other countries boasting certifications might be a bit less expected. Let's look at six such projects from five of those countries. + +### Bulgaria + +Bulgaria may have the highest per-capita open source hardware certification rate of any country on earth. That distinction is mostly due to the work of two companies: [ANAVI Technology][5] and [Olimex][6]. + +ANAVI focuses mostly on IoT projects built on top of the Raspberry Pi and ESP8266. The concept of "creator contribution" means that these projects can be certified open source even though they are built upon non-open bases. That is because all of ANAVI's work to develop the hardware on top of these platforms (ANAVI's "creator contribution") has been open sourced in compliance with the certification requirements. + +The [ANAVI Light pHAT][7] was the first piece of Bulgarian hardware to be certified by OSHWA. The Light pHAT makes it easy to add a 12V RGB LED strip to a Raspberry Pi. + +![ANAVI-Light-pHAT][8] + +[ANAVI-Light-pHAT][9] + +Olimex's first OSHWA certification was for the [ESP32-PRO][10], a highly connectable IoT board built around an ESP32 microcontroller. + +![Olimex ESP32-PRO][11] + +[Olimex ESP32-PRO][12] + +### China + +While most people know China is a hotbed for hardware development, fewer realize that it is also the home to a thriving _open source_ hardware culture. One of the reasons is the tireless advocacy of Naomi Wu (also known as [SexyCyborg][13]). It is fitting that the first piece of certified hardware from China is one she helped develop: the [sino:bit][14]. The sino:bit is designed to help introduce students to programming and includes China-specific features like a LED matrix big enough to represent Chinese characters. + +![sino:bit][15] + +[ sino:bit][16] + +### Mexico + +Mexico has also produced a range of certified open source hardware. A recent certification is the [Meow Meow][17], a capacitive touch interface from [Electronic Cats][18]. Meow Meow makes it easy to use a wide range of objects—bananas are always a favorite—as controllers for your computer. + +![Meow Meow][19] + +[Meow Meow][20] + +### Saudi Arabia + +Saudi Arabia jumped into open source hardware earlier this year with the [M1 Rover][21]. The robot is an unmanned vehicle that you can build (and build upon). It is compatible with a number of different packages designed for specific purposes, so you can customize it for a wide range of applications. + +![M1-Rover ][22] + +[M1-Rover][23] + +### Sri Lanka + +This project from Sri Lanka is part of a larger effort to improve traffic flow in urban areas. The team behind the [Traffic Wave Disruptor][24] read research about how many traffic jams are caused by drivers slamming on their brakes when they drive too close to the car in front of them, producing a ripple of rapid breaking on the road behind them. This stop/start effect can be avoided if cars maintain a consistent, optimal distance from one another. If you reduce the stop/start pattern, you also reduce the number of traffic jams. + +![Traffic Wave Disruptor][25] + +[Traffic Wave Disruptor][26] + +But how can drivers know if they are keeping an optimal distance? The prototype Traffic Wave Disruptor aims to give drivers feedback when they fail to keep optimal spacing. Wider adoption could help increase traffic flow without building new highways nor reducing the number of cars using them. + +* * * + +You may have noticed that all the hardware featured here is based on electronics. In next month's open source hardware column, we will take a look at open source hardware for the outdoors, away from batteries and plugs. Until then, [certify][27] your open source hardware project (especially if your country is not yet on the registry). It might be featured in a future column. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/hardware-international + +作者:[Michael Weinberg][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/mweinberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openhardwaretools_0.png?itok=NUIvc-R1 (Gadgets and open hardware) +[2]: https://certification.oshwa.org/list.html +[3]: https://opensource.com/sites/default/files/uploads/opensourcehardwaremap.jpg (Open source hardware map) +[4]: https://www.oshwa.org/definition/ +[5]: http://anavi.technology/ +[6]: https://www.olimex.com/ +[7]: https://certification.oshwa.org/bg000001.html +[8]: https://opensource.com/sites/default/files/uploads/anavi-light-phat.png (ANAVI-Light-pHAT) +[9]: http://anavi.technology/#products +[10]: https://certification.oshwa.org/bg000010.html +[11]: https://opensource.com/sites/default/files/uploads/olimex-esp32-pro.png (Olimex ESP32-PRO) +[12]: https://www.olimex.com/Products/IoT/ESP32/ESP32-PRO/open-source-hardware +[13]: https://www.youtube.com/channel/UCh_ugKacslKhsGGdXP0cRRA +[14]: https://certification.oshwa.org/cn000001.html +[15]: https://opensource.com/sites/default/files/uploads/sinobit.png (sino:bit) +[16]: https://github.com/sinobitorg/hardware +[17]: https://certification.oshwa.org/mx000003.html +[18]: https://electroniccats.com/ +[19]: https://opensource.com/sites/default/files/uploads/meowmeow.png (Meow Meow) +[20]: https://electroniccats.com/producto/meowmeow/ +[21]: https://certification.oshwa.org/sa000001.html +[22]: https://opensource.com/sites/default/files/uploads/m1-rover.png (M1-Rover ) +[23]: https://www.hackster.io/AhmedAzouz/m1-rover-362c05 +[24]: https://certification.oshwa.org/lk000001.html +[25]: https://opensource.com/sites/default/files/uploads/traffic-wave-disruptor.png (Traffic Wave Disruptor) +[26]: https://github.com/Aightm8/Traffic-wave-disruptor +[27]: https://certification.oshwa.org/ diff --git a/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md new file mode 100644 index 0000000000..7c9d844315 --- /dev/null +++ b/sources/tech/20190418 How to organize with Calculist- Ideas, events, and more.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to organize with Calculist: Ideas, events, and more) +[#]: via: (https://opensource.com/article/19/4/organize-calculist) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +How to organize with Calculist: Ideas, events, and more +====== +Give structure to your ideas and plans with Calculist, an open source +web app for creating outlines. +![Team checklist][1] + +Thoughts. Ideas. Plans. We all have a few of them. Often, more than a few. And all of us want to make some or all of them a reality. + +Far too often, however, those thoughts and ideas and plans are a jumble inside our heads. They refuse to take a discernable shape, preferring instead to rattle around here, there, and everywhere in our brains. + +One solution to that problem is to put everything into [an outline][2]. An outline can be a great way to organize what you need to organize and give it the shape you need to take it to the next step. + +A number of people I know rely on a popular web-based tool called WorkFlowy for their outlining needs. If you prefer your applications (including web ones) to be open source, you'll want to take a look at [Calculist][3]. + +The brainchild of [Dan Allison][4], Calculist is billed as _the thinking tool for problem solvers_. It does much of what WorkFlowy does, and it has a few features that its rival is missing. + +Let's take a look at using Calculist to organize your ideas (and more). + +### Getting started + +If you have a server, you can try to [install Calculist][5] on it. If, like me, you don't have server or just don't have the technical chops, you can turn to the [hosted version][6] of Calculist. + +[Sign up][7] for a no-cost account, then log in. Once you've done that, you're ready to go. + +### Creating a basic outline + +What you use Calculist for really depends on your needs. I use Calculist to create outlines for articles and essays, to create lists of various sorts, and to plan projects. Regardless of what I'm doing, every outline I create follows the same pattern. + +To get started, click the **New List** button. This creates a blank outline (which Calculist calls a _list_ ). + +![Create a new list in Calculist][8] + +The outline is a blank slate waiting for you to fill it up. Give the outline a name, then press Enter. When you do that, Calculist adds the first blank line for your outline. Use that as your starting point. + +![A new outline in Calculist][9] + +Add a new line by pressing Enter. To indent a line, press the Tab key while on that line. If you need to create a hierarchy, you can indent lines as far as you need to indent them. Press Shift+Tab to outdent a line. + +Keep adding lines until you have a completed outline. Calculist saves your work every few seconds, so you don't need to worry about that. + +![Calculist outline][10] + +### Editing an outline + +Outlines are fluid. They morph. They grow and shrink. Individual items in an outline change. Calculist makes it easy for you to adapt and make those changes. + +You already know how to add an item to an outline. If you don't, go back a few paragraphs for a refresher. To edit text, click on an item and start typing. Don't double-click (more on this in a few moments). If you accidentally double-click on an item, press Esc on your keyboard and all will be well. + +Sometimes you need to move an item somewhere else in the outline. Do that by clicking and holding the bullet for that item. Drag the item and drop it wherever you want it. Anything indented below the item moves with it. + +At the moment, Calculist doesn't support adding notes or comments to an item in an outline. A simple workaround I use is to add a line indented one level deeper than the item where I want to add the note. That's not the most elegant solution, but it works. + +### Let your keyboard do the walking + +Not everyone likes to use their mouse to perform actions in an application. Like a good desktop application, you're not at the mercy of your mouse when you use Calculist. It has many keyboard shortcuts that you can use to move around your outlines and manipulate them. + +The keyboard shortcuts I mentioned a few paragraphs ago are just the beginning. There are a couple of dozen keyboard shortcuts that you can use. + +For example, you can focus on a single portion of an outline by pressing Ctrl+Right Arrow key. To get back to the full outline, press Ctrl+Left Arrow key. There are also shortcuts for moving up and down in your outline, expanding and collapsing lists, and deleting items. + +You can view the list of shortcuts by clicking on your user name in the upper-right corner of the Calculist window and clicking **Preferences**. You can also find a list of [keyboard shortcuts][11] in the Calculist GitHub repository. + +If you need or want to, you can change the shortcuts on the **Preferences** page. Click on the shortcut you want to change—you can, for example, change the shortcut for zooming in on an item to Ctrl+0. + +### The power of commands + +Calculist's keyboard shortcuts are useful, but they're only the beginning. The application has command mode that enables you to perform basic actions and do some interesting and complex tasks. + +To use a command, double-click an item in your outline or press Ctrl+Enter while on it. The item turns black. Type a letter or two, and a list of commands displays. Scroll down to find the command you want to use, then press Enter. There's also a [list of commands][12] in the Calculist GitHub repository. + +![Calclulist commands][13] + +The commands are quite comprehensive. While in command mode, you can, for example, delete an item in an outline or delete an entire outline. You can import or export outlines, sort and group items in an outline, or change the application's theme or font. + +### Final thoughts + +I've found that Calculist is a quick, easy, and flexible way to create and view outlines. It works equally well on my laptop and my phone, and it packs not only the features I regularly use but many others (including support for [LaTeX math expressions][14] and a [table/spreadsheet mode][15]) that more advanced users will find useful. + +That said, Calculist isn't for everyone. If you prefer your outlines on the desktop, then check out [TreeLine][16], [Leo][17], or [Emacs org-mode][18]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/organize-calculist + +作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://en.wikipedia.org/wiki/Outline_(list) +[3]: https://calculist.io/ +[4]: https://danallison.github.io/ +[5]: https://github.com/calculist/calculist-web +[6]: https://app.calculist.io/ +[7]: https://app.calculist.io/join +[8]: https://opensource.com/sites/default/files/uploads/calculist-new-list.png (Create a new list in Calculist) +[9]: https://opensource.com/sites/default/files/uploads/calculist-getting-started.png (A new outline in Calculist) +[10]: https://opensource.com/sites/default/files/uploads/calculist-outline.png (Calculist outline) +[11]: https://github.com/calculist/calculist/wiki/Keyboard-Shortcuts +[12]: https://github.com/calculist/calculist/wiki/Command-Mode +[13]: https://opensource.com/sites/default/files/uploads/calculist-commands.png (Calculist commands) +[14]: https://github.com/calculist/calculist/wiki/LaTeX-Expressions +[15]: https://github.com/calculist/calculist/issues/32 +[16]: https://opensource.com/article/18/1/creating-outlines-treeline +[17]: http://www.leoeditor.com/ +[18]: https://orgmode.org/ diff --git a/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md new file mode 100644 index 0000000000..411adc44fa --- /dev/null +++ b/sources/tech/20190418 Level up command-line playgrounds with WebAssembly.md @@ -0,0 +1,196 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Level up command-line playgrounds with WebAssembly) +[#]: via: (https://opensource.com/article/19/4/command-line-playgrounds-webassembly) +[#]: author: (Robert Aboukhalil https://opensource.com/users/robertaboukhalil) + +Level up command-line playgrounds with WebAssembly +====== +WebAssembly is a powerful tool for bringing command line utilities to +the web and giving people the chance to tinker with tools. +![Various programming languages in use][1] + +[WebAssembly][2] (Wasm) is a new low-level language designed with the web in mind. Its main goal is to enable developers to compile code written in other languages—such as C, C++, and Rust—into WebAssembly and run that code in the browser. In an environment where JavaScript has traditionally been the only option, WebAssembly is an appealing counterpart, and it enables portability along with the promise for near-native runtimes. WebAssembly has also already been used to port lots of tools to the web, including [desktop applications][3], [games][4], and even [data science tools written in Python][5]! + +Another application of WebAssembly is command line playgrounds, where users are free to play with a simulated version of a command line tool. In this article, we'll explore a concrete example of leveraging WebAssembly for this purpose, specifically to port the tool **[jq][6]** —which is normally confined to the command line—to run directly in the browser. + +If you haven't heard, jq is a very powerful command line tool for querying, modifying, and wrangling JSON objects on the command line. + +### Why WebAssembly? + +Aside from WebAssembly, there are two other approaches we can take to build a jq playground: + + 1. **Set up a sandboxed environment** on your server that executes queries and returns the result to the user via API calls. Although this means your users get to play with the real thing, the thought of hosting, securing, and sanitizing user inputs for such an application is worrisome. Aside from security, the other concern is responsiveness; the additional round trips to the server can introduce noticeable latencies and negatively impact the user experience. + 2. **Simulate the command line environment using JavaScript** , where you define a series of steps that the user can take. Although this approach is more secure than option 1, it involves _a lot_ more work, as you need to rewrite the logic of the tool in JavaScript. This method is also limiting: when I'm learning a new tool, I'm not just interested in the "happy path"; I want to break things! + + + +These two solutions are not ideal because we have to choose between security and a meaningful learning experience. Ideally, we could simply run the command line tool directly in the browser, with no servers and no simulations. Lucky for us, WebAssembly is just the solution we need to achieve that. + +### Set up your environment + +In this article, we'll use the [Emscripten tool][7] to port jq from C to WebAssembly. Conveniently, it provides us with drop-in replacements for the most common C/C++ build tools, including gcc, make, and configure. + +Instead of [installing Emscripten from scratch][8] (the build process can take a long time), we'll use a Docker image I put together that comes prepackaged with everything you'll need for this article (and beyond!). + +Let's start by pulling the image and creating a container from it: + + +``` +# Fetch docker image containing Emscripten +docker pull robertaboukhalil/emsdk:1.38.26 + +# Create container from that image +docker run -dt --name wasm robertaboukhalil/emsdk:1.38.26 + +# Enter the container +docker exec -it wasm bash + +# Make sure we can run emcc, Emscripten's wrapper around gcc +emcc --version +``` + +If you see the Emscripten version on the screen, you're good to go! + +### Porting jq to WebAssembly + +Next, let's clone the jq repository: + + +``` +git clone +cd jq +git checkout 9fa2e51 +``` + +Note that we're checking out a specific commit, just in case the jq code changes significantly after this article is published. + +Before we compile jq to WebAssembly, let's first consider how we would normally compile jq to binary for use on the command line. + +From the [README file][9], here is what we need to build jq to binary (don't type this in yet): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +make LDFLAGS=-all-static +``` + +Instead, to compile jq to WebAssembly, we'll leverage Emscripten's drop-in replacements for the configure and make build tools (note the differences here from the previous entry: **emconfigure** and **emmake** in the Run and Build statements, respectively): + + +``` +# Fetch jq dependencies +git submodule update --init + +# Generate ./configure file +autoreconf -fi + +# Run ./configure +emconfigure ./configure \ +\--with-oniguruma=builtin \ +\--disable-maintainer-mode + +# Build jq executable +emmake make LDFLAGS=-all-static +``` + +If you type the commands above inside the Wasm container we created earlier, you'll notice that emconfigure and emmake will make sure jq is compiled using emcc instead of gcc (Emscripten also has a g++ replacement called em++). + +So far, this was surprisingly easy: we just prepended a handful of commands with Emscripten tools and ported a codebase—comprising tens of thousands of lines—from C to WebAssembly. Note that it won't always be this easy, especially for more complex codebases and graphical applications, but that's for [another article][10]. + +Another advantage of Emscripten is that it can generate some JavaScript glue code for us that handles initializing the WebAssembly module, calling C functions from JavaScript, and even providing a [virtual filesystem][11]. + +Let's generate that glue code from the executable file jq that emmake outputs: + + +``` +# But first, rename the jq executable to a .o file; otherwise, +# emcc complains that the "file has an unknown suffix" +mv jq jq.o + +# Generate .js and .wasm files from jq.o +# Disable errors on undefined symbols to avoid warnings about llvm_fma_f64 +emcc jq.o -o jq.js \ +-s ERROR_ON_UNDEFINED_SYMBOLS=0 +``` + +To make sure it works, let's try an example from the [jq tutorial][12] directly on the command line: + + +``` +# Output the description of the latest commit on the jq repo +$ curl -s "" | \ +node jq.js '.[0].commit.message' +"Restore cfunction arity in builtins/0\n\nCount arguments up-front at definition/invocation instead of doing it at\nbind time, which comes after generating builtins/0 since e843a4f" +``` + +And just like that, we are now ready to run jq in the browser! + +### The result + +Using the output of emcc above, we can put together a user interface that calls jq on a JSON blob the user provides. This is the approach I took to build [jqkungfu][13] (source code [available on GitHub][14]): + +![jqkungfu screenshot][15] + +jqkungfu, a playground built by compiling jq to WebAssembly + +Although there are similar web apps that let you execute arbitrary jq queries in the browser, they are generally implemented as server-side applications that execute user queries in a sandbox (option #1 above). + +Instead, by compiling jq from C to WebAssembly, we get the best of both worlds: the flexibility of the server and the security of the browser. Specifically, the benefits are: + + 1. **Flexibility** : Users can "choose their own adventure" and use the app with fewer limitations + 2. **Speed** : Once the Wasm module is loaded, executing queries is extremely fast because all the magic happens in the browser + 3. **Security** : No backend means we don't have to worry about our servers being compromised or used to mine Bitcoins + 4. **Convenience** : Since we don't need a backend, jqkungfu is simply hosted as static files on a cloud storage platform + + + +### Conclusion + +WebAssembly is a powerful tool for bringing existing command line utilities to the web. When included as part of a tutorial, such playgrounds can become powerful teaching tools. They can even allow your users to test-drive your tool before they bother installing it. + +If you want to dive further into WebAssembly and learn how to build applications like jqkungfu (or games like Pacman!), check out my book [_Level up with WebAssembly_][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/command-line-playgrounds-webassembly + +作者:[Robert Aboukhalil][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/robertaboukhalil +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_language_c.png?itok=mPwqDAD9 (Various programming languages in use) +[2]: https://webassembly.org/ +[3]: https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/ +[4]: http://www.continuation-labs.com/projects/d3wasm/ +[5]: https://hacks.mozilla.org/2019/03/iodide-an-experimental-tool-for-scientific-communicatiodide-for-scientific-communication-exploration-on-the-web/ +[6]: https://stedolan.github.io/jq/ +[7]: https://emscripten.org/ +[8]: https://emscripten.org/docs/getting_started/downloads.html +[9]: https://github.com/stedolan/jq/blob/9fa2e51099c55af56e3e541dc4b399f11de74abe/README.md +[10]: https://medium.com/@robaboukhalil/porting-games-to-the-web-with-webassembly-70d598e1a3ec?sk=20c835664031227eae5690b8a12514f0 +[11]: https://emscripten.org/docs/porting/files/file_systems_overview.html +[12]: https://stedolan.github.io/jq/tutorial/ +[13]: http://jqkungfu.com +[14]: https://github.com/robertaboukhalil/jqkungfu/ +[15]: https://opensource.com/sites/default/files/uploads/jqkungfu.gif (jqkungfu screenshot) +[16]: http://levelupwasm.com/ diff --git a/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md new file mode 100644 index 0000000000..e9fa0cb7fd --- /dev/null +++ b/sources/tech/20190418 Simplifying organizational change- A guide for the perplexed.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Simplifying organizational change: A guide for the perplexed) +[#]: via: (https://opensource.com/open-organization/19/4/simplifying-change) +[#]: author: (Jen Kelchner https://opensource.com/users/jenkelchner) + +Simplifying organizational change: A guide for the perplexed +====== +Here's a 4-step, open process for making change easier—both for you and +your organization. +![][1] + +Most organizational leaders have encountered a certain paralysis around efforts to implement culture change—perhaps because of perceived difficulty or the time necessary for realizing our work. But change is only as difficult as we choose to make it. In order to lead successful change efforts, we must simplify our understanding and approach to change. + +Change isn't something rare. We live everyday life in a continuous state of change—from grappling with the speed of innovation to simply interacting with the environment around us. Quite simply, *change is how we process, disseminate, and adopt new information. *And whether you're leading a team or an organization—or are simply breathing—you'll benefit from a more focused, simplified approach to change. Here's a process that can save you time and reduce frustration. + +### Three interactions with change + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. In fact, [only 5% of decision making involves conscious processing][2]. Even when you don't _think_ you're making a decision, you are actually making a decision (that is, to not take action). + +So you see, two actors are at play in situations involving change. The first is the human decision maker. The second is the information _coming to_ the decision maker. Both are present in three sets of interactions at varying stages in the decision-making process. + +#### **Engaging change** + +First, we must understand that uncertainty is really the result of "new information" we must process. We must accept where we are, at that moment, while waiting for additional information. Engaging with change requires us to trust—at the very least, ourselves and our capacity to manage—as new information continues to arrive. Everyone will respond to new information differently, and those responses are based on multiple factors: general hardwiring, unconscious needs that need to be met to feel safe, and so on. How do you feel safe in periods of uncertainty? Are you routine driven? Do you need details or need to assess risk? Are you good with figuring it out on the fly? Or does safety feel like creating something brand new? + +#### **Navigating change** + +"Navigating" doesn't necessarily mean "going around" something safely. It's knowing how to "get through it." Navigating change truly requires "all hands on deck" in order to keep everything intact and moving forward as we encounter each oncoming wave of new information. Everyone around you has something to contribute to the process of navigation; leverage them for “smooth sailing." + +#### **Adopting change** + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. Consider taking advantage of what researchers call "[the pendulum effect][3]," which holds that a group as small as 5% of an organization's population can influence a crowd's direction (the other 95% will follow along without realizing it). Moreover, [scientists at Rensselaer Polytechnic Institute have found][4] that when just 10% of a population holds an unshakable belief, that belief will always be adopted by a majority. Findings from this cognitive study have implications for the spread of innovations and movements within a collective group of people. Opportunities for mass adoption are directly related to your influence with the external parties around you. + +Everyone interacts with change in different ways. Those differences are based on who we are, our own unique experiences, and our core beliefs. + +### A useful matrix to guide culture change + +So far, we've identified three "interactions" every person, team, or department will experience with change: "engaging," "navigating," and "adopting." When we examine the work of _implementing_ change in the broader context of an organization (any kind), we can also identify _three relationships_ that drive the success of each interaction: "people," "capacity," and "information." + +Here's a brief list of considerations you should make—at every moment and with every relationship—to help you build roadmaps thoughtfully. + +#### **Engaging—People** + +Organizational success comes from the overlap of awareness and action of the "I" and the "We." + + * _Individuals (I)_ are aware of and engage based on their [natural response strength][5]. + * _Teams (We)_ are aware of and balance their responsibilities based on the Individual strengths by initiative. + * _Leaders (I/We) l_ everage insight based on knowing their (I) and the collective (We). + + + +#### **Engaging—Capacity** + +"Capacity" applies to skills, processes, and culture that is clearly structured, documented, and accessible with your organization. It is the “space” within which you operate and achieve solutions. + + * _Current state_ awareness allows you to use what and who you have available and accessible through your known operational capacity. + * _Future state_ needs will show you what is required of you to learn, _or stretch_ , in order to bridge any gaps; essentially, you will design the recoding of your organization. + + + +#### **Engaging—Information** + + * _Access to information_ is readily available to all based on appropriate needs within protocols. + * _Communication flows_ easily and is reciprocated at all levels. + * _Communication flow_ is timely and transparent. + + + +#### **Navigating—People** + + * Balance responses from both individuals and the collective will impact your outcomes. + * Balance the _I_ with the _We_. This allows for responses to co-exist in a seamless, collaborative way—which fuels every project. + + + +#### **Navigating—Capacity** + + * _Skills_ : Assuring a continuous state of assessment and learning through various modalities allows you to navigate with ease as each person graduates their understanding in preparation for the next iteration of change. + * _Culture:_ Be clear on goals and mission with a supported ecosystem in which your teams can operate by contributing their best efforts when working together. + * _Processes:_ Review existing processes and let go of anything that prevents you from evolving. Open practices and methodologies do allow for a higher rate of adaptability and decision making. + * _Utilize Talent:_ Discover who is already in your organization and how you can leverage their talent in new ways. Go beyond your known teams and seek out sources of new perspectives. + + + +#### **Navigating—Information** + + * Be clear on your mission. + * Be very clear on your desired endgame so everyone knows what you are navigating toward (without clearly defined and posted directions, it's easy to waste time, money and efforts resulting in missed targets). + + + +#### **Adopting—People** + + * _Behaviors_ have a critical impact on influence and adoption. + * For _internal adoption_ , consider the [pendulum of thought][3] swung by the committed few. + + + +#### **Adopting—Capacity** + + * _Sustainability:_ Leverage people who are more routine and legacy-oriented to help stabilize and embed your new initiatives. + * Allows your innovators and co-creators to move into the next phase of development and begin solving problems while other team members can perform follow-through efforts. + + + +#### **Adopting—Information** + + * Be open and transparent with your external communication. + * Lead the way in _what_ you do and _how_ you do it to create a tidal wave of change. + * Remember that mass adoption has a tipping point of 10%. + + + +[**Download a one-page guide to this model on GitHub.**][6] +--- + +### Four steps to simplify change + +You now understand what change is and how you are processing it. You've seen how you and your organization can reframe various interactions with it. Now, let's examine the four steps to simplify how you interact with and implement change as an individual, team leader, or organizational executive. + +#### **1\. Understand change** + +Change is receiving and processing new information and determining how to respond and participate with it (think personal or organizational operating system). Change is a _reciprocal_ action between yourself and incoming new information (think system interface). Change is an evolutionary process that happens in layers and stages in a continuous cycle (think data processing, bug fixes, and program iterations). + +#### **2\. Know your people** + +Change is personal and responses vary by context. People's responses to change are not indicators of the speed of adoption. Knowing how your people and your teams interact with change allows you to balance and optimize your efforts to solving problems, building solutions and sustaining implementations. Are they change makers, fast followers, innovators, stabilizers? When you know how you, _or others_ , process change, you can leverage your risk mitigators to sweep for potential pitfalls; and, your routine minded folks to be responsible for implementation follow through. + +Only a small set of members in your organization will be truly comfortable with adopting change. But that committed and confident minority can spread the fire of change and help you grow some innovative ideas within your organization. + +#### **3\. Know your capacity** + +Your capacity to implement widespread change will depend on your culture, your processes, and decision-making models. Get familiar with your operational capacity and guardrails (process and policy). + +#### **4\. Prepare for Interaction** + +Each interaction uses your people, capacity (operational), and information flow. Working with the stages of change is not always a linear process and may overlap at certain points along the way. Understand that [_people_ feed all engagement, navigation, and adoption actions][7]. + +Humans are built for adaptation to our environments. Yes, any kind of change can be scary at first. But it need not involve some major new implementation with a large, looming deadline that throws you off. Knowing that you can take a simplified approach to change, hopefully, you're able to engage new information with ease. Using this approach over time—and integrating it as habit—allows for both the _I_ and the _We_ to experience continuous cycles of change without the tensions of old. + +_Want to learn more about simplifying change?[View additional resources on GitHub][8]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/4/simplifying-change + +作者:[Jen Kelchner][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/jenkelchner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/GOV_2dot0.png?itok=bKJ41T85 +[2]: http://www.simplifyinginterfaces.com/2008/08/01/95-percent-of-brain-activity-is-beyond-our-conscious-awareness/ +[3]: http://www.leeds.ac.uk/news/article/397/sheep_in_human_clothing__scientists_reveal_our_flock_mentality +[4]: https://news.rpi.edu/luwakkey/2902 +[5]: https://opensource.com/open-organization/18/7/transformation-beyond-digital-2 +[6]: https://github.com/jenkelchner/simplifying-change/blob/master/Visual_%20Simplifying%20Change%20(1).pdf +[7]: https://opensource.com/open-organization/17/7/digital-transformation-people-1 +[8]: https://github.com/jenkelchner/simplifying-change diff --git a/sources/tech/20190422 9 ways to save the planet.md b/sources/tech/20190422 9 ways to save the planet.md new file mode 100644 index 0000000000..d3301006cc --- /dev/null +++ b/sources/tech/20190422 9 ways to save the planet.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 ways to save the planet) +[#]: via: (https://opensource.com/article/19/4/save-planet) +[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce) + +9 ways to save the planet +====== +These ideas have an open source twist. +![][1] + +What can be done to help save the planet? The question can seem depressing at a time when it feels like an individual's contribution isn't enough. But, who are we Earth dwellers if not for a collection of individuals? So, I asked our writer community to share ways that open source software or hardware can be used to make a difference. Here's what I heard back. + +### 9 ways to save the planet with an open source twist + +**1.** **Disable the blinking cursor in your terminal.** + +It might sound silly, but the trivial, blinking cursor can cause up to [2 watts per hour of extra power consumption][2]. To disable it, go to Terminal Settings: Edit > Preferences > Cursor > Cursor blinking > Disabled. + +_Recommended by Mars Toktonaliev_ + +**2\. Reduce your consumption of animal products and processed foods.** + +One way to do this is to add these open source apps to your phone: Daily Dozen, OpenFoodFacts, OpenVegeMap, and Food Restrictions. These apps will help you eat a healthy, plant-based diet, find vegan- and vegetarian-friendly restaurants, and communicate your dietary needs to others, even if they do not speak the same language. To learn more about these apps read [_4 open source apps to support eating a plant-based diet_][3]. + +_Recommendation by Joshua Allen Holm_ + +**3\. Recycle old computers.** + +How? With Linux, of course. Pay it forward by giving creating a new computer for someone who can't one and keep a computer out of the landfill. Here's how we do it at [The Asian Penguins][4]. + +_Recommendation by Stu Keroff_ + +**4\. Turn off devices when you're not using them.** + +Use "smart power strips" that have a "master" outlet and several "controlled" outlets. Plug your PC into the master outlet, and when you turn on the computer, your monitor, printer, and anything else plugged into the controlled outlets turns on too. A simpler, low-tech solution is a power strip with a timer. That's what I use at home. You can use switches on the timer to set a handy schedule to turn the power on and off at specific times. Automatically turn off your network printer when no one is at home. Or for my six-year-old laptop, extend the life of the battery with a schedule to alternate when it's running from wall power (outlet is on) and when it's running from the battery (outlet is off). + +_Recommended by Jim Hall_ + +**5\. Reduce the use of your HVAC system.** + +Sunlight shining through windows adds a lot of heat to your home during the summer. Use Home Assistant to [automatically adjust][5] window blinds and awnings [based on the time of day][6], or even based on the angle of the sun. + +_Recommended by Michael Hrivnak_ + +**6\. Turn your thermostat off or to a lower setting while you're away.** + +If your home thermostat has an "Away" feature, activating it on your way out the door is easy to forget. With a touch of automation, any connected thermostat can begin automatically saving energy while you're not home. [Stataway][7] is one such project that uses your phone's GPS coordinates to determine when it should set your thermostat to "Home" or "Away". + +_Recommended by Michael Hrivnak_ + +**7\. Save computing power for later.** + +I have an idea: Create a script that can read the power output from an alternative energy array (wind and solar) and begin turning on servers (taking them from a power-saving sleep mode to an active mode) in a computing cluster until the overload power is used (whatever excess is produced beyond what can be stored/buffered for later use). Then use the overload power during high-production times for compute-intensive projects like rendering. This process would be essentially free of cost because the power can't be buffered for other uses. I'm sure the monitoring, power management, and server array tools must exist to do this. Then, it's just an integration problem, making it all work together. + +_Recommended by Terry Hancock_ + +**8\. Turn off exterior lights.** + +Light pollution affects more than 80% of the world's population, according to the [World Atlas of Artificial Night Sky Brightness][8], published (Creative Commons Attribution-NonCommercial 4.0) in 2016 in the open access journal _Science Advances_. Turning off exterior lights is a quick way to benefit wildlife, human health, our ability to enjoy the night sky, and of course energy consumption. Visit [darksky.org][9] for more ideas on how to reduce the impact of your exterior lighting. + +_Recommended by Michael Hrivnak_ + +**9\. Reduce your CPU count.** + +For me, I remember I used to have a whole bunch of computers running in my basement as my IT playground/lab. I've become more conscious now of power consumption and so have really drastically reduced my CPU count. I like to take advantage of VMs, zones, containers... that type of technology a lot more these days. Also, I'm really glad that small form factor and SoC computers, such as the Raspberry Pi, exist because I can do a lot with one, such as run a DNS or Web server, without heating the room and running up my electricity bill. + +P.S. All of these computers are running Linux, FreeBSD, or Raspbian! + +_Recommended by Alan Formy-Duvall_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/save-planet + +作者:[Jen Wike Huger ][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike/users/alanfdoss/users/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pixelated-world.png?itok=fHjM6m53 +[2]: https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02406.html +[3]: https://opensource.com/article/19/4/apps-plant-based-diets +[4]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[5]: https://www.home-assistant.io/docs/automation/trigger/#sun-trigger +[6]: https://www.home-assistant.io/components/cover/ +[7]: https://github.com/mhrivnak/stataway +[8]: http://advances.sciencemag.org/content/2/6/e1600377 +[9]: http://darksky.org/ diff --git a/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md new file mode 100644 index 0000000000..66b0345586 --- /dev/null +++ b/sources/tech/20190422 Strawberry- A Fork of Clementine Music Player.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Strawberry: A Fork of Clementine Music Player) +[#]: via: (https://itsfoss.com/strawberry-music-player/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Strawberry: A Fork of Clementine Music Player +====== + +In this age of streaming music and cloud services, there are still people who need an application to collect and play their music. If you are such a person, this article should interest you. + +We have earlier covered [Sayonara music player][1]. Today, we will be taking a look at the Strawberry Music Player. + +### Strawberry Music Player: A fork of Clementine + +The [Strawberry Music Player][2] is, quite simply, an application to manage and play your music. + +![Strawberry media library][3] + +Strawberry contains the following list of features: + + * Play and organize music + * Supports WAV, FLAC, WavPack, DSF, DSDIFF, Ogg Vorbis, Speex, MPC, TrueAudio, AIFF, MP4, MP3, ASF and Monkey’s Audio Audio CD playback + * Native desktop notifications + * Support for playlists in multiple formats + * Advanced audio output and device configuration for bit-perfect playback on Linux + * Edit tags on music files + * Fetch tags from [MusicBrainz Picard][4] + * Album cover art from [Last.fm][5], MusicBrainz and Discogs + * Song lyrics from [AudD][6] + * Support for multiple backends + * Audio analyzer + * Audio equalizer + * Transfer music to iPod, iPhone, MTP or mass-storage USB player + * Streaming support for Tidal + * Scrobbler with support for Last.fm, Libre.fm and ListenBrainz + + + +If you take a look at the screenshots, they probably look familiar. That is because Strawberry is a fork of the [Clementine Music Player][7]. Clementine has not been updated since 2016, while the most recent version of Strawberry (0.5.3) was released early April 2019. + +Trivia + +You might think that Strawberry music player is named after the fruit. However, its [creator][8] claims that he has named the project after the band [Strawbs][9]. + +### Installing Strawberry Music player + +Now let’s take a look at how you can install Strawberry on your system. + +#### Ubuntu + +The easiest way to install Strawberry on Ubuntu is to install the [official snap][10]. Just type: + +``` +sudo snap install strawberry +``` + +If you are not a fan of snaps, you can download a .deb file from Strawberry’s GitHub [release page][11]. You can [install the .deb file][12] by double-clicking it and opening it via the Software Center. + +Strawberry is not available in the main [Ubuntu repositories][13]. + +#### Fedora + +Installing Strawberry on Fedora is much simpler. Strawberry is in the Fedora repos, so you just have to type `sudo dnf strawberry`. Strawberry is not available on Flatpak. + +#### Arch + +Just like Fedora, Strawberry is in the Arch repos. All you have to type is `sudo pacman -S strawberry`. The same is true for Manjaro. + +You can find a list of Linux distros that have Strawberry in their repos [here][14]. If you have openSUSE or Mageia, click [here][15]. You can also compile Strawberry from source. + +### Experience with Strawberry Music Player + +![Playing an audio book with Strawberry][16] + +I installed Strawberry on Fedora and Windows. I have used Clementine in the past, so I knew what to expect. I downloaded a number of audiobooks and several [Old Time Radio][17] [shows][18] as I don’t listen to a lot of music. Instead of using a dedicated [audiobook player like Cozy][19], I used Strawberry for listening to these radio shows. + +Once I told Strawberry where my files were located, it quickly imported them. I used [EasyTag][20] to fix some of the MP3 information on the old time radio shows. Strawberry has a tag editor, but EasyTag allows you to edit several folders very quickly. Strawberry undated the media library instantaneously. + +The big plus for me was performance. It loaded quickly and ran well. This might have something to do with the fact that it is not another Electron app. Strawberry is written in good-old-fashioned C++ and Qt 5. No need to load a whole web browser every time you want to play music, or in my case listen to audio dramas. + +I was not able to test the Tidal streaming feature because I don’t have an account. Also, I don’t sync music to my iPod. + +### Final Thoughts + +Strawberry is like a standard music player that makes managing and playing your audio library very easy. + +The features that I miss from Clementine include the option to access your media from cloud storage systems (like Box and Dropbox) and the ability to download podcasts. But then, I don’t store my media in the cloud and I mainly listen to podcasts on my iPod. + +I recommend giving Strawberry a try. You just might like it as much as I do. + +Have you ever used Strawberry? What is your favorite music player/manager? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][21]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/strawberry-music-player/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/sayonara-music-player/ +[2]: https://strawbs.org/ +[3]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry1-800x471.png +[4]: https://itsfoss.com/musicbrainz-picard/ +[5]: https://www.last.fm/ +[6]: https://audd.io/ +[7]: https://www.clementine-player.org/ +[8]: https://github.com/jonaski +[9]: https://en.wikipedia.org/wiki/Strawbs +[10]: https://snapcraft.io/strawberry +[11]: https://github.com/jonaski/strawberry/releases +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://itsfoss.com/ubuntu-repositories/ +[14]: https://repology.org/project/strawberry/versions +[15]: https://download.opensuse.org/repositories/home:/jonaski:/audio/ +[16]: https://itsfoss.com/wp-content/uploads/2019/04/strawberry3-800x471.png +[17]: https://en.wikipedia.org/wiki/Golden_Age_of_Radio +[18]: https://zootradio.com/ +[19]: https://itsfoss.com/cozy-audiobook-player/ +[20]: https://wiki.gnome.org/Apps/EasyTAG +[21]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190425 Debian has a New Project Leader.md b/sources/tech/20190425 Debian has a New Project Leader.md new file mode 100644 index 0000000000..00f114b907 --- /dev/null +++ b/sources/tech/20190425 Debian has a New Project Leader.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Debian has a New Project Leader) +[#]: via: (https://itsfoss.com/debian-project-leader-election/) +[#]: author: (Shirish https://itsfoss.com/author/shirish/) + +Debian has a New Project Leader +====== + +Like each year, the Debian Secretary announced a call for nominations for the post of Debian Project Leader (commonly known as DPL) in early March. Soon 5 candidates shared their nomination. One of the DPL candidates backed out due to personal reasons and we had [four candidates][1] as can be seen in the Nomination section of the Vote page. + +### Sam Hartman, the new Debian Project Leader + +![][2] + +While I will not go much into details as Sam already outlined his position on his [platform][3], it is good to see that most Debian developers recognize that it’s no longer just the technical excellence which need to be looked at. I do hope he is able to create more teams which would leave some more time in DPL’s hands and less stress going forward. + +As he has shared, he would be looking into also helping the other DPL candidates, all of which presented initiatives to make Debian better. + +Apart from this, there had been some excellent suggestions, for example modernizing debian-installer, making lists.debian.org have a [Mailman 3][4] instance, modernizing Debian packaging and many more. + +While probably a year is too short a time for any of the deliverables that Debian people are thinking, some sort of push or start should enable Debian to reach greater heights than today. + +### A brief history of DPL elections + +In the beginning, Debian was similar to many distributions which have a [BDFL][5], although from the very start Debian had a sort of rolling leadership. While I wouldn’t go through the whole history, from October 1998 there was an idea [germinated][6] to have a Debian Constitution. + +After quite a bit of discussion between Debian users, contributors, developers etc. [Debian 1.0 Constitution][7] was released on December 2nd, 1998. One of the big changes was that it formalised the selection of Debian Project Leader via elections. + +From 1998 till 2019 13 Debian project leaders have been elected till date with Sam Hartman being the latest (2019). + +Before Sam, [Chris Lamb][8] was DPL in 2017 and again stood up for re-election in 2018. One of the biggest changes in Chris’s tenure was having more impetus to outreach than ever before. This made it possible to have many more mini-debconfs all around the world and thus increasing more number of Debian users and potential Debian Developers. + +[][9] + +Suggested read SemiCode OS: A Linux Distribution For Programmers And Web Developers + +### Duties and Responsibilities of the Debian Project Leader + +![][10] + +Debian Project Leader (DPL) is a non-monetary position which means that the DPL doesn’t get a salary or any monetary benefits in the traditional sense but it’s a prestigious position. + +Curious what what a DPL does? Here are some of the duties, responsibilities, prestige and perks associated with this position. + +#### Travelling + +As the DPL is the public face of the project, she/he is supposed to travel to many places in the world to share about Debian. While the travel may be a perk, it is and could be discounted by being not paid for the time spent articulating Debian’s position in various free software and other communities. Also travel, language, politics of free software are also some of the stress points that any DPL would have to go through. + +#### Communication + +A DPL is expected to have excellent verbal and non-verbal communication skills as she/he is the expected to share Debian’s vision of computing to technical and non-technical people. As she/he is also expected to weigh in many a sensitive matter, the Project Leader has to make choices about which communications should be made public and which should be private. + +#### Budgeting + +Quite a bit of the time the Debian Project Leader has to look into the finances along with the Secretary and take a call at various initiatives mooted by the larger community. The Project Leader has to ask and then make informed decisions on the same. + +#### Delegation + +One of the important tasks of the DPL is to delegate different tasks to suitable people. Some sensitive delegations include ftp-master, ftp-assistant, list-managers, debian-mirror, debian-infrastructure and so on. + +#### Influence + +Last but not the least, just like any other election, the people who contest for DPL have a platform where they share their ideas about where they would like to see the Debian project heading and how they would go about doing it. + +This is by no means an exhaustive list. I would suggest to read Lucas Nussbaum’s [mail][11] in which he outlines some more responsibilities as a Debian Project Leader. + +[][12] + +Suggested read Lightweight Linux Distribution Bodhi Linux 5.0 Released + +**In the end…** + +I wish Sam Hartman all the luck. I look forward to see how Debian grows under his leadership. + +I also hope that you learned a few non-technical thing around Debian. If you are an [ardent Debian user][13], stuff like this make you feel more involved with Debian project. What do you say? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-project-leader-election/ + +作者:[Shirish][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/shirish/ +[b]: https://github.com/lujun9972 +[1]: https://www.debian.org/vote/2019/vote_001 +[2]: https://itsfoss.com/wp-content/uploads/2019/04/Debian-Project-Leader-election-800x450.png +[3]: https://www.debian.org/vote/2019/platforms/hartmans +[4]: http://docs.mailman3.org/en/latest/ +[5]: https://en.wikipedia.org/wiki/Benevolent_dictator_for_life +[6]: https://lists.debian.org/debian-devel/1998/09/msg00506.html +[7]: https://www.debian.org/devel/constitution.1.0 +[8]: https://www.debian.org/vote/2017/platforms/lamby +[9]: https://itsfoss.com/semicode-os-linux/ +[10]: https://itsfoss.com/wp-content/uploads/2019/04/leadership-800x450.jpg +[11]: https://lists.debian.org/debian-vote/2019/03/msg00023.html +[12]: https://itsfoss.com/bodhi-linux-5/ +[13]: https://itsfoss.com/reasons-why-i-love-debian/ diff --git a/sources/tech/20190426 NomadBSD, a BSD for the Road.md b/sources/tech/20190426 NomadBSD, a BSD for the Road.md new file mode 100644 index 0000000000..d31f9b4a90 --- /dev/null +++ b/sources/tech/20190426 NomadBSD, a BSD for the Road.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (NomadBSD, a BSD for the Road) +[#]: via: (https://itsfoss.com/nomadbsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +NomadBSD, a BSD for the Road +====== + +As regular It’s FOSS readers should know, I like diving into the world of BSDs. Recently, I came across an interesting BSD that is designed to live on a thumb drive. Let’s take a look at NomadBSD. + +### What is NomadBSD? + +![Nomadbsd Desktop][1] + +[NomadBSD][2] is different than most available BSDs. NomadBSD is a live system based on FreeBSD. It comes with automatic hardware detection and an initial config tool. NomadBSD is designed to “be used as a desktop system that works out of the box, but can also be used for data recovery, for educational purposes, or to test FreeBSD’s hardware compatibility.” + +This German BSD comes with an [OpenBox][3]-based desktop with the Plank application dock. NomadBSD makes use of the [DSB project][4]. DSB stands for “Desktop Suite (for) (Free)BSD” and consists of a collection of programs designed to create a simple and working environment without needing a ton of dependencies to use one tool. DSB is created by [Marcel Kaiser][5] one of the lead devs of NomadBSD. + +Just like the original BSD projects, you can contact the NomadBSD developers via a [mailing list][6]. + +[][7] + +Suggested read Enjoy Netflix? You Should Thank FreeBSD + +#### Included Applications + +NomadBSD comes with the following software installed: + + * Thunar file manager + * Asunder CD ripper + * Bash 5.0 + * Filezilla FTP client + * Firefox web browser + * Fish Command line + * Gimp + * Qpdfview + * Git + + + * Hexchat IRC client + * Leafpad text editor + * Midnight Commander file manager + * PaleMoon web browser + * PCManFM file manager + * Pidgin messaging client + * Transmission BitTorrent client + + + * Redshift + * Sakura terminal emulator + * Slim login manager + * Thunderbird email client + * VLC media player + * Plank application dock + * Z Shell + + + +You can see a complete of the pre-installed applications in the [MANIFEST file][8]. + +![Nomadbsd Openbox Menu][9] + +#### Version 1.2 Released + +NomadBSD recently released version 1.2 on April 21, 2019. This means that NomadBSD is now based on FreeBSD 12.0-p3. TRIM is now enabled by default. One of the biggest changes is that the initial command-line setup was replaced with a Qt graphical interface. They also added a Qt5 tool to install NomadBSD to your hard drive. A number of fixes were included to improve graphics support. They also added support for creating 32-bit images. + +[][10] + +Suggested read 6 Reasons Why Linux Users Switch to BSD + +### Installing NomadBSD + +Since NomadBSD is designed to be a live system, we will need to add the BSD to a USB drive. First, you will need to [download it][11]. There are several options to choose from: 64-bit, 32-bit, or 64-bit Mac. + +You will be a USB drive that has at least 4GB. The system that you are installing to should have a 1.2 GHz processor and 1GB of RAM to run NomadBSD comfortably. Both BIOS and UEFI are supported. + +All of the images available for download are compressed as a `.lzma` file. So, once you have downloaded the file, you will need to extract the `.img` file. On Linux, you can use either of these commands: `lzma -d nomadbsd-x.y.z.img.lzma` or `xzcat nomadbsd-x.y.z.img.lzma`. (Be sure to replace x.y.z with the correct file name you just downloaded.) + +Before we proceed, we need to find out the id of your USB drive. (Hopefully, you have inserted it by now.) I use the `lsblk` command to find my USB drive, which in my case is `sdb`. To write the image file, use this command `sudo dd if=nomadbsd-x.y.z.img of=/dev/sdb bs=1M conv=sync`. (Again, don’t forget to correct the file name.) If you are uncomfortable using `dd`, you can use [Etcher][12]. If you have Windows, you will need to use [7-zip][13] to extract the image file and Etcher or [Rufus][14] to write the image to the USB drive. + +When you boot from the USB drive, you will encounter a simple config tool. Once you answer the required questions, you will be greeted with a simple Openbox desktop. + +### Thoughts on NomadBSD + +I first discovered NomadBSD back in January when they released 1.2-RC1. At the time, I had been unable to install [Project Trident][15] on my laptop and was very frustrated with BSDs. I downloaded NomadBSD and tried it out. I initially ran into issues reaching the desktop, but RC2 fixed that issue. However, I was unable to get on the internet, even though I had an Ethernet cable plugged in. Luckily, I found the wifi manager in the menu and was able to connect to my wifi. + +Overall, my experience with NomadBSD was pleasant. Once I figured out a few things, I was good to go. I hope that NomadBSD is the first of a new generation of BSDs that focus on mobility and ease of use. BSD has conquered the server world, it’s about time they figured out how to be more user-friendly. + +Have you ever used NomadBSD? What is your BSD? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][16]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/nomadbsd/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-desktop-800x500.jpg +[2]: http://nomadbsd.org/ +[3]: http://openbox.org/wiki/Main_Page +[4]: https://freeshell.de/%7Emk/projects/dsb.html +[5]: https://github.com/mrclksr +[6]: http://nomadbsd.org/contact.html +[7]: https://itsfoss.com/netflix-freebsd-cdn/ +[8]: http://nomadbsd.org/download/nomadbsd-1.2.manifest +[9]: https://itsfoss.com/wp-content/uploads/2019/04/NomadBSD-Openbox-menu-800x500.jpg +[10]: https://itsfoss.com/why-use-bsd/ +[11]: http://nomadbsd.org/download.html +[12]: https://www.balena.io/etcher/ +[13]: https://www.7-zip.org/ +[14]: https://rufus.ie/ +[15]: https://itsfoss.com/project-trident-interview/ +[16]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190429 Awk utility in Fedora.md b/sources/tech/20190429 Awk utility in Fedora.md new file mode 100644 index 0000000000..21e40641f7 --- /dev/null +++ b/sources/tech/20190429 Awk utility in Fedora.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Awk utility in Fedora) +[#]: via: (https://fedoramagazine.org/awk-utility-in-fedora/) +[#]: author: (Stephen Snow https://fedoramagazine.org/author/jakfrost/) + +Awk utility in Fedora +====== + +![][1] + +Fedora provides _awk_ as part of its default installation, including all its editions, including the immutable ones like Silverblue. But you may be asking, what is _awk_ and why would you need it? + +_Awk_ is a data driven programming language that acts when it matches a pattern. On Fedora, and most other distributions, GNU _awk_ or _gawk_ is used. Read on for more about this language and how to use it. + +### A brief history of awk + +_Awk_ began at Bell Labs in 1977. Its name is an acronym from the initials of the designers: Alfred V. Aho, Peter J. Weinberger, and Brian W. Kernighan. + +> The specification for _awk_ in the POSIX Command Language and Utilities standard further clarified the language. Both the _gawk_ designers and the original _awk_ designers at Bell Laboratories provided feedback for the POSIX specification. +> +> From [The GNU Awk User’s Guide][2] + +For a more in-depth look at how _awk/gawk_ ended up being as powerful and useful as it is, follow the link above. Numerous individuals have contributed to the current state of _gawk_. Among those are: + + * Arnold Robbins and David Trueman, the creators of _gawk_ + * Michael Brennan, the creator of _mawk_ , which later was merged with _gawk_ + * Jurgen Kahrs, who added networking capabilities to _gawk_ in 1997 + * John Hague, who rewrote the _gawk_ internals and added an _awk_ -level debugger in 2011 + + + +### Using awk + +The following sections show various ways of using _awk_ in Fedora. + +#### At the command line + +The simples way to invoke _awk_ is at the command line. You can search a text file for a particular pattern, and if found, print out the line(s) of the file that match the pattern anywhere. As an example, use _cat_ to take a look at the command history file in your home director: + +``` +$ cat ~/.bash_history +``` + +There are probably many lines scrolling by right now. + +_Awk_ helps with this type of file quite easily. Instead of printing the entire file out to the terminal like _cat_ , you can use _awk_ to find something of specific interest. For this example, type the following at the command line if you’re running a standard Fedora edition: + +``` +$ awk '/dnf/' ~/.bash_history +``` + +If you’re running Silverblue, try this instead: + +``` +$ awk '/rpm-ostree/' ~/.bash_history +``` + +In both cases, more data likely appears than what you really want. That’s no problem for _awk_ since it can accept regular expressions. Using the previous example, you can change the pattern to more closely match search requirements of wanting to know about installs only. Try changing the search pattern to one of these: + +``` +$ awk '/rpm-ostree install/' ~/.bash_history +$ awk '/dnf install/' ~/.bash_history +``` + +All the entries of your bash command line history appear that have the pattern specified at any position along the line. Awk works on one line of a data file at a time. It matches pattern, then performs an action, then moves to next line until the end of file (EOF) is reached. + +#### From an _awk_ program + +Using awk at the command line as above is not much different than piping output to _grep_ , like this: + +``` +$ cat .bash_history | grep 'dnf install' +``` + +The end result of printing to standard output ( _stdout_ ) is the same with both methods. + +Awk is a programming language, and the command _awk_ is an interpreter of that language. The real power and flexibility of _awk_ is you can make programs with it, and combine them with shell scripts to create even more powerful programs. For more feature rich development with _awk_ , you can also incorporate C or C++ code using [Dynamic-Extensions][3]. + +Next, to show the power of _awk_ , let’s make a couple of program files to print the header and draw five numbers for the first row of a bingo card. To do this we’ll create two awk program files. + +The first file prints out the header of the bingo card. For this example it is called _bingo-title.awk_. Use your favorite editor to save this text as that file name: +``` + +``` + +BEGIN { +print "B\tI\tN\tG\tO" +} +``` + +``` + +Now the title program is ready. You could try it out with this command: + +``` +$ awk -f bingo-title.awk +``` + +The program prints the word BINGO, with a tab space ( _\t_ ) between the characters. For the number selection, let’s use one of awk’s builtin numeric functions called _rand()_ and use two of the control statements, _for_ and _switch._ (Except the editor changed my program, so no switch statement used this time). + +The title of the second awk program is _bingo-num.awk_. Enter the following into your favorite editor and save with that file name: +``` + +``` + +@include "bingo-title.awk" +BEGIN { +for (i = 1; i < = 5; i++) { +b = int(rand() * 15) + (15*(i-1)) +printf "%s\t", b +} +print +} +``` + +``` + +The _@include_ statement in the file tells the interpreter to process the included file first. In this case the interpreter processs the _bingo-title.awk_ file so the title prints out first. + +#### Running the test program + +Now enter the command to pick a row of bingo numbers: + +``` +$ awk -f bingo-num.awk +``` + +Output appears similar to the following. Note that the _rand()_ function in _awk_ is not ideal for truly random numbers. It’s used here only as for example purposes. +``` + +``` + +$ awk -f bingo-num.awk +B I N G O +13 23 34 53 71 +``` + +``` + +In the example, we created two programs with only beginning sections that used actions to manipulate data generated from within the awk program. In order to satisfy the rules of Bingo, more work is needed to achieve the desirable results. The reader is encouraged to fix the programs so they can reliably pick bingo numbers, maybe look at the awk function _srand()_ for answers on how that could be done. + +### Final examples + +_Awk_ can be useful even for mundane daily search tasks that you encounter, like listing all _flatpak’s_ on the _Flathub_ repository from _org.gnome_ (providing you have the Flathub repository setup). The command to do that would be: + +``` +$ flatpak remote-ls flathub --system | awk /org.gnome/ +``` + +A listing appears that shows all output from _remote-ls_ that matches the _org.gnome_ pattern. To see flatpaks already installed from org.gnome, enter this command: + +``` +$ flatpak list --system | awk /org.gnome/ +``` + +Awk is a powerful and flexible programming language that fills a niche with text file manipulation exceedingly well. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/awk-utility-in-fedora/ + +作者:[Stephen Snow][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/jakfrost/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/awk-816x345.jpg +[2]: https://www.gnu.org/software/gawk/manual/gawk.html#Foreword3 +[3]: https://www.gnu.org/software/gawk/manual/gawk.html#Dynamic-Extensions diff --git a/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md new file mode 100644 index 0000000000..ce667a1dff --- /dev/null +++ b/sources/tech/20190429 How To Turn On And Shutdown The Raspberry Pi -Absolute Beginner Tip.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip]) +[#]: via: (https://itsfoss.com/turn-on-raspberry-pi/) +[#]: author: (Chinmay https://itsfoss.com/author/chinmay/) + +How To Turn On And Shutdown The Raspberry Pi [Absolute Beginner Tip] +====== + +_**Brief: This quick tip teaches you how to turn on Raspberry Pi and how to shut it down properly afterwards.**_ + +The [Raspberry Pi][1] is one of the [most popular SBC (Single-Board-Computer)][2]. If you are interested in this topic, I believe that you’ve finally got a Pi device. I also advise to get all the [additional Raspberry Pi accessories][3] to get started with your device. + +You’re ready to turn it on and start to tinker around with it. It has it’s own similarities and differences compared to traditional computers like desktops and laptops. + +Today, let’s go ahead and learn how to turn on and shutdown a Raspberry Pi as it doesn’t really feature a ‘power button’ of sorts. + +For this article I’m using a Raspberry Pi 3B+, but it’s the same for all the Raspberry Pi variants. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +Bestseller No. 2 + +[][6] + +[CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply][6] + +CanaKit - Personal Computers + +$54.99 [][5] + +### Turn on Raspberry Pi + +![Micro USB port for Power][7] + +The micro USB port powers the Raspberry Pi, the way you turn it on is by plugging in the power cable into the micro USB port. But, before you do that you should make sure that you have done the following things. + + * Preparing the micro SD card with Raspbian according to the official [guide][8] and inserting into the micro SD card slot. + * Plugging in the HDMI cable, USB keyboard and a Mouse. + * Plugging in the Ethernet Cable(Optional). + + + +Once you have done the above, plug in the power cable. This turns on the Raspberry Pi and the display will light up and load the Operating System. + +Bestseller No. 1 + +[][4] + +[CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)][4] + +CanaKit - Personal Computers + +$79.99 [][5] + +### Shutting Down the Pi + +Shutting down the Pi is pretty straight forward, click the menu button and choose shutdown. + +![Turn off Raspberry Pi graphically][9] + +Alternatively, you can use the [shutdown command][10] in the terminal: + +``` +sudo shutdown now +``` + +Once the shutdown process has started **wait** till it completely finishes and then you can cut the power to it. Once the Pi shuts down, there is no real way to turn the Pi back on without turning off and turning on the power. You could the GPIO’s to turn on the Pi from the shutdown state but it’ll require additional modding. + +[][2] + +Suggested read 12 Single Board Computers: Alternative to Raspberry Pi + +_Note: Micro USB ports tend to be fragile, hence turn-off/on the power at source instead of frequently unplugging and plugging into the micro USB port._ + +Well, that’s about all you should know about turning on and shutting down the Pi, what do you plan to use it for? Let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/turn-on-raspberry-pi/ + +作者:[Chinmay][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/chinmay/ +[b]: https://github.com/lujun9972 +[1]: https://www.raspberrypi.org/ +[2]: https://itsfoss.com/raspberry-pi-alternatives/ +[3]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[4]: https://www.amazon.com/CanaKit-Raspberry-Starter-Premium-Black/dp/B07BCC8PK7?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BCC8PK7&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) Starter Kit (32 GB EVO+ Edition, Premium Black Case)) +[5]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[6]: https://www.amazon.com/CanaKit-Raspberry-Premium-Clear-Supply/dp/B07BC7BMHY?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B07BC7BMHY&keywords=raspberry%20pi%20kit (CanaKit Raspberry Pi 3 B+ (B Plus) with Premium Clear Case and 2.5A Power Supply) +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/raspberry-pi-3-microusb.png?fit=800%2C532&ssl=1 +[8]: https://www.raspberrypi.org/documentation/installation/installing-images/README.md +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/Raspbian-ui-menu.jpg?fit=800%2C492&ssl=1 +[10]: https://linuxhandbook.com/linux-shutdown-command/ diff --git a/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md b/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md new file mode 100644 index 0000000000..27bf04eb05 --- /dev/null +++ b/sources/tech/20190501 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-1.md @@ -0,0 +1,247 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-1) +[#]: via: (https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-part1/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-1 +====== + +As **Docker** usage and adoption is growing faster and faster, monitoring **Docker container** images is becoming more challenging. As multiple Docker container images are getting created day-by-day, monitoring them is very important. There are already some in built tools and technologies, but configuring them is little complex. As micro-services based architecture is becoming the de-facto standard in coming days, learning such tool adds one more arsenal to your tool-set. + +Based on the above scenarios, there was in need of one light weight and robust tool requirement was growing. So Portainer.io addressed this. “ **Portainer.io** “,(Latest version is 1.20.2) the tool is very light weight(with 2-3 commands only one can configure it) and has become popular among Docker users. + +**This tool has advantages over other tools; some of these are as below** , + + * Light weight (requires only 2-3 commands to be required to run to install this tool) {Also installation image is only around 26-30MB of size) + * Robust and easy to use + * Can be used for Docker monitor and Build + * This tool provides us a detailed overview of your Docker environments + * This tool allows us to manage your containers, images, networks and volumes. + * Portainer is simple to deploy – this requires just one Docker command (can be run from anywhere.) + * Complete Docker-container environment can be monitored easily + + + +**Portainer is also equipped with** , + + * Community support + * Enterprise support + * Has professional services available(along with partner OEM services) + + + +**Functionality and features of Portainer tool are,** + + 1. It comes-up with nice Dashboard, easy to use and monitor. + 2. Many in-built templates for ease of operation and creation + 3. Support of services (OEM, Enterprise level) + 4. Monitoring of Containers, Images, Networks, Volume and configuration at almost real-time. + 5. Also includes Docker-Swarm monitoring + 6. User management with many fancy capabilities + + + +**Read Also :[How to Install Docker CE on Ubuntu 16.04 / 18.04 LTS System][1]** + +### How to install and configure Portainer.io on Ubuntu Linux / RHEL / CentOS + +**Note:** This installation is done on Ubuntu 18.04 but the installation on RHEL & CentOS would be same. We are assuming Docker CE is already installed on your system. + +``` +root@linuxtechi:~$ lsb_release -a +No LSB modules are available. +Distributor ID: Ubuntu +Description: Ubuntu 18.04 LTS +Release: 18.04 +Codename: bionic +root@linuxtechi:~$ +``` + +Create the Volume for portainer + +``` +root@linuxtechi:~$ sudo docker volume create portainer_data +portainer_data +root@linuxtechi:~$ +``` + +Launch and start Portainer Container using the beneath docker command, + +``` +root@linuxtechi:~$ sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer +Unable to find image 'portainer/portainer:latest' locally +latest: Pulling from portainer/portainer +d1e017099d17: Pull complete +0b1e707a06d2: Pull complete +Digest: sha256:d6cc2c20c0af38d8d557ab994c419c799a10fe825e4aa57fea2e2e507a13747d +Status: Downloaded newer image for portainer/portainer:latest +35286de9f2e21d197309575bb52b5599fec24d4f373cc27210d98abc60244107 +root@linuxtechi:~$ +``` + +Once the complete installation is done, use the ip of host or Docker using port 9000 of the Docker engine where portainer is running using your browser. + +**Note:** If OS firewall is enabled on your Docker host then make sure 9000 port is allowed else its GUI will not come up. + +In my case, IP address of my Docker Host / Engine is “192.168.1.16” so URL will be, + + + +[![Portainer-Login-User-Name-Password][2]][3] + +Please make sure that you enter 8-character passwords. Let the admin be the user as it is and then click “Create user”. + +Now the following screen appears, in this select “Local” rectangle box. + +[![Connect-Portainer-Local-Docker][4]][5] + +Click on “Connect” + +Nice GUI with admin as user home screen appears as below, + +[![Portainer-io-Docker-Monitor-Dashboard][6]][7] + +Now Portainer is ready to launch and manage your Docker containers and it can also be used for containers monitoring. + +### Bring-up container image on Portainer tool + +[![Portainer-Endpoints][8]][9] + +Now check the present status, there are two container images are already running, if you create one more that appears instantly. + +From your command line kick-start one or two containers as below, + +``` +root@linuxtechi:~$ sudo docker run --name test -it debian +Unable to find image 'debian:latest' locally +latest: Pulling from library/debian +e79bb959ec00: Pull complete +Digest: sha256:724b0fbbda7fda6372ffed586670573c59e07a48c86d606bab05db118abe0ef5 +Status: Downloaded newer image for debian:latest +root@linuxtechi:/# +``` + +Now click Refresh button (Are you sure message appears, click “continue” on this) in Portainer GUI, you will now see 3 container images as highlighted below, + +[![Portainer-io-new-container-image][10]][11] + +Click on the “ **containers** ” (in which it is red circled above), next window appears with “ **Dashboard Endpoint summary** ” + +[![Portainer-io-Docker-Container-Dash][12]][13] + +In this page, click on “ **Containers** ” as highlighted in red color. Now you are ready to monitor your container image. + +### Simple Docker container image monitoring + +From the above step, it appears that a fancy and nice looking “Container List” page appears as below, + +[![Portainer-Container-List][14]][15] + +All the container images can be controlled from here (stop, start, etc) + +**1)** Now from this page, stop the earlier started {“test” container (this was the debian image that we started earlier)} + +To do this select the check box in front of this image and click stop button from above, + +[![Stop-Container-Portainer-io-dashboard][16]][17] + +From the command line option, you will see that this image has been stopped or exited now, + +``` +root@linuxtechi:~$ sudo docker container ls -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d45902e717c0 debian "bash" 21 minutes ago Exited (0) 49 seconds ago test +08b96eddbae9 centos:7 "/bin/bash" About an hour ago Exited (137) 9 minutes ago mycontainer2 +35286de9f2e2 portainer/portainer "/portainer" 2 hours ago Up About an hour 0.0.0.0:9000->9000/tcp compassionate_benz +root@linuxtechi:~$ +``` + +**2)** Now start the stopped containers (test & mycontainer2) from Portainer GUI, + +Select the check box in front of stopped containers, and the click on Start + +[![Start-Containers-Portainer-GUI][18]][19] + +You will get a quick window saying, “ **Container successfully started** ” and with running state + +[![Conatiner-Started-successfully-Portainer-GUI][20]][21] + +### Various other options and features are explored as below step-by-step + +**1)** Click on “ **Images** ” which is highlighted, you will get the below window, + +[![Docker-Container-Images-Portainer-GUI][22]][23] + +This is the list of container images that are available but some may not running. These images can be imported, exported or uploaded to various locations, below screen shot shows the same, + +[![Upload-Docker-Container-Image-Portainer-GUI][24]][25] + +**2)** Click on “ **volumes”** which is highlighted, you will get the below window, + +[![Volume-list-Portainer-io-gui][26]][27] + +**3)** Volumes can be added easily with following option, click on add volume button, below window appears, + +Provide the name as “ **myvol** ” in the name box and click on “ **create the volume** ” button. + +[![Volume-Creation-Portainer-io-gui][28]][29] + +The newly created volume appears as below, (with unused state) + +[![Volume-unused-Portainer-io-gui][30]][31] + +#### Conclusion: + +As from the above installation steps, configuration and playing around with various options you can see how easy and fancy looking is Portainer.io tool is. This provides multiple features and options to explore on building, monitoring docker container. As explained this is very light weight tool, so doesn’t add any overload to host system. Next set-of options will be explored in part-2 of this series. + +Read Also: **[Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2][32]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-part1/ + +作者:[Shashidhar Soppin][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/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/how-to-setup-docker-on-ubuntu-server-16-04/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Login-User-Name-Password-1024x681.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Login-User-Name-Password.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Connect-Portainer-Local-Docker-1024x538.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Connect-Portainer-Local-Docker.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Monitor-Dashboard-1024x544.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Monitor-Dashboard.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Endpoints-1024x252.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Endpoints.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-new-container-image-1024x544.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-new-container-image.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Container-Dash-1024x544.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-io-Docker-Container-Dash.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Container-List-1024x538.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-Container-List.jpg +[16]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Stop-Container-Portainer-io-dashboard-1024x447.jpg +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Stop-Container-Portainer-io-dashboard.jpg +[18]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Start-Containers-Portainer-GUI-1024x449.jpg +[19]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Start-Containers-Portainer-GUI.jpg +[20]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Conatiner-Started-successfully-Portainer-GUI-1024x538.jpg +[21]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Conatiner-Started-successfully-Portainer-GUI.jpg +[22]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker-Container-Images-Portainer-GUI-1024x544.jpg +[23]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker-Container-Images-Portainer-GUI.jpg +[24]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Upload-Docker-Container-Image-Portainer-GUI-1024x544.jpg +[25]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Upload-Docker-Container-Image-Portainer-GUI.jpg +[26]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-list-Portainer-io-gui-1024x544.jpg +[27]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-list-Portainer-io-gui.jpg +[28]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-Creation-Portainer-io-gui-1024x544.jpg +[29]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-Creation-Portainer-io-gui.jpg +[30]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-unused-Portainer-io-gui-1024x544.jpg +[31]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Volume-unused-Portainer-io-gui.jpg +[32]: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/ diff --git a/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md new file mode 100644 index 0000000000..fe36e37b9c --- /dev/null +++ b/sources/tech/20190502 Crowdsourcing license compliance with ClearlyDefined.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Crowdsourcing license compliance with ClearlyDefined) +[#]: via: (https://opensource.com/article/19/5/license-compliance-clearlydefined) +[#]: author: (Jeff McAffer https://opensource.com/users/jeffmcaffer) + +Crowdsourcing license compliance with ClearlyDefined +====== +Licensing is what holds open source together, and ClearlyDefined takes +the mystery out of projects' licenses, copyright, and source location. +![][1] + +Open source use continues to skyrocket, not just in use cases and scenarios but also in volume. It is trivial for a developer to depend on a 1,000 JavaScript packages from a single run of `npm install` or have thousands of packages in a [Docker][2] image. At the same time, there is increased interest in ensuring license compliance. + +Without the right license you may not be able to legally use a software component in the way you intend or may have obligations that run counter to your business model. For instance, a JavaScript package could be marked as [MIT license][3], which allows commercial reuse, while one of its dependencies is licensed has a [copyleft license][4] that requires you give your software away under the same license. Complying means finding the applicable license(s), and assessing and adhering to the terms, which is not too bad for individual components adn can be daunting for large initiatives. + +Fortunately, this open source challenge has an open source solution: [ClearlyDefined][5]. ClearlyDefined is a crowdsourced, open source, [Open Source Initiative][6] (OSI) effort to gather, curate, and upstream/normalize data about open source components, such as license, copyright, and source location. This data is the cornerstone of reducing the friction in open source license compliance. + +The premise behind ClearlyDefined is simple: we are all struggling to find and understand key information related to the open source we use—whether it is finding the license, knowing who to attribute, or identifying the source that goes with a particular package. Rather than struggling independently, ClearlyDefined allows us to collaborate and share the compliance effort. Moreover, the ClearlyDefined community seeks to upstream any corrections so future releases are more clearly defined and make conventions more explicit to improve community understanding of project intent. + +### How it works + +![ClearlyDefined's harvest, curate, upstream process][7] + +ClearlyDefined monitors the open source ecosystem and automatically harvests relevant data from open source components using a host of open source tools such as [ScanCode][8], [FOSSology][9], and [Licensee][10]. The results are summarized and aggregated to create a _definition_ , which is then surfaced to users via an API and a UI. Each definition includes: + + * Declared license of the component + * Licenses and copyrights discovered across all files + * Exact source code location to the commit level + * Release date + * List of embedded components + + + +Coincidentally (well, not really), this is exactly the data you need to do license compliance. + +### Curating + +Any given definition may have gaps or imperfections due to tool issues or the data being missing or incorrect at the origin. ClearlyDefined enables users to curate the results by refining the values and filling in the gaps. These contributions are reviewed and merged, as with any open source project. The result is an improved dataset for all to use. + +### Getting ahead + +To a certain degree, this process is still chasing the problem—analyzing and curating after the packages have already been published. To get ahead of the game, the ClearlyDefined community also feeds merged curations back to the originating projects as pull requests (e.g., adding a license file, clarifying a copyright). This increases the clarity of future release and sets up a virtuous cycle. + +### Adapting, not mandating + +In doing the analysis, we've found quite a number of approaches to expressing license-related data. Different communities put LICENSE files in different places or have different practices around attribution. The ClearlyDefined philosophy is to discover these conventions and adapt to them rather than asking the communities to do something different. A side benefit of this is that implicit conventions can be made more explicit, improving clarity for all. + +Related to this, ClearlyDefined is careful to not look too hard for this interesting data. If we have to be too smart and infer too much to find the data, then there's a good chance the origin is not all that clear. Instead, we prefer to work with the community to better understand and clarify the conventions being used. From there, we can update the tools accordingly and make it easier to be "clearly defined." + +#### NOTICE files + +As an added bonus for users, we set up an API and UI for generating NOTICE files, making it trivial for you to comply with the attribution requirements found in most open source licenses. You can give ClearlyDefined a list of components (e.g., _drag and drop an npm package-lock.json file on the UI_ ) and get back a fully formed NOTICE file rendered by one of several renderers (e.g., text, HTML, Handlebars.js template). This is a snap, given that we already have all the compliance data. Big shout out to the [OSS Attribution Builder project][11] for making a simple and pluggable NOTICE renderer we could just pop into the ClearlyDefined service. + +### Getting involved + +You can get involved with ClearlyDefined in several ways: + + * Become an active user, contributing to your compliance workflow + * Review other people's curations using the interface + * Get involved in [the code][12] (Node and React) + * Ask and answer questions on [our mailing list][13] or [Discord channel][14] + * Contribute money to the OSI targeted to ClearlyDefined. We'll use that to fund development and curation. + + + +We are excited to continue to grow our community of contributors so that licensing can continue to become an understable part of any team's open source adoption. For more information, check out [https://clearlydefined.io][15]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/license-compliance-clearlydefined + +作者:[Jeff McAffer][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/jeffmcaffer +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Crowdfunding_520x292_9597717_0612CM.png?itok=lxSKyFXU +[2]: https://opensource.com/resources/what-docker +[3]: /article/19/4/history-mit-license +[4]: /resources/what-is-copyleft +[5]: https://clearlydefined.io +[6]: https://opensource.org +[7]: https://opensource.com/sites/default/files/uploads/clearlydefined.png (ClearlyDefined's harvest, curate, upstream process) +[8]: https://github.com/nexB/scancode-toolkit +[9]: https://www.fossology.org/ +[10]: https://github.com/licensee/licensee +[11]: https://github.com/amzn/oss-attribution-builder +[12]: https://github.com/clearlydefined +[13]: mailto:clearlydefined@googlegroups.com +[14]: %C2%A0https://clearlydefined.io/discord) +[15]: https://clearlydefined.io/ diff --git a/sources/tech/20190502 The making of the Breaking the Code electronic book.md b/sources/tech/20190502 The making of the Breaking the Code electronic book.md new file mode 100644 index 0000000000..6786df8549 --- /dev/null +++ b/sources/tech/20190502 The making of the Breaking the Code electronic book.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The making of the Breaking the Code electronic book) +[#]: via: (https://opensource.com/article/19/5/code-book) +[#]: author: (Alicia Gibb https://opensource.com/users/aliciagibb/users/don-watkins) + +The making of the Breaking the Code electronic book +====== +Offering a safe space for middle school girls to learn technology speaks +volumes about who should be sitting around the tech table. +![Open hardware electronic book][1] + +I like a good challenge. The [Open Source Stories team][2] came to me with a great one: Create a hardware project where students could create their own thing that would be put together as a larger thing. The students would be middle school girls. My job was to figure out the hardware and make this thing make sense. + +After days of sketching out concepts, I was wandering through my local public library, and it dawned on me that the perfect piece of hardware where everyone could design their own part to create something whole is a book! The idea of a book using paper electronics was exciting, simple enough to be taught in a day, and fit the criteria of needing no special equipment, like soldering irons. + +!["Breaking the Code" book cover][3] + +I designed two parts to the electronics within the book. Half the circuits were developed with copper tape, LEDs, and DIY buttons, and half were developed with LilyPad Arduino microcontrollers, sensors, LEDs, and DIY buttons. Using the electronics in the book, the girls could make pages light up, buzz, or play music using various inputs such as button presses, page turns, or tilting the book. + +!['Breaking the Code' interior pages][4] + +We worked with young adult author [Lauren Sabel][5] to come up with the story, which features two girls who get locked in the basement of their school and have to solve puzzles to get out. Setting the scene in the basement gave us lots of opportunities to use lights! Along with the story, we received illustrations that the girls enhanced with electronics. The girls got creative, for example, using lights as the skeleton's eyes, not just for the obvious light bulb in the room. + +Creating a curriculum that was flexible enough to empower each girl to build her own successfully functioning circuit was a vital piece of the user experience. We chose components so the circuit wouldn't need to be over-engineered. We also used breakout boards and LEDs with built-in resistors so that the circuits allowed flexibility and functioned with only basic knowledge of circuit design—without getting too muddled in the deep end. + +!['Breaking the Code' interior pages][6] + +The project curriculum gave girls the confidence and skills to understand electronics by building two circuits, in the process learning circuit layout, directional aspects, cause-and-effect through inputs and outputs, and how to identify various components. Controlling electrons by pushing them through a circuit feels a bit like you're controlling a tiny part of the universe. And seeing the girls' faces light up is like seeing a universe of opportunities open in front of them. + +!['Breaking the Code' interior pages][7] + +The girls were ecstatic to see their work as a completed book, taking pride in their pages and showing others what they had built. + +![About 'Breaking the Code'][8] + +Teaching them my little corner of the world for the day was a truly empowering experience for me. As a woman in tech, I think this is the right approach for companies trying to change the gender inequalities we see in tech. Offering a safe space to learn—with lots of people in the room who look like you as mentors—speaks volumes about who should be sitting around the tech table. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-book + +作者:[Alicia Gibb][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/aliciagibb/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_book_electronics_hardware.jpg?itok=zb-zaiwz (Open hardware electronic book) +[2]: https://www.redhat.com/en/open-source-stories +[3]: https://opensource.com/sites/default/files/uploads/codebook_cover.jpg ("Breaking the Code" book cover) +[4]: https://opensource.com/sites/default/files/uploads/codebook_38-39.jpg ('Breaking the Code' interior pages) +[5]: https://www.amazon.com/Lauren-Sabel/e/B01M0FW223 +[6]: https://opensource.com/sites/default/files/uploads/codebook_lightbulb.jpg ('Breaking the Code' interior pages) +[7]: https://opensource.com/sites/default/files/uploads/codebook_10-11.jpg ('Breaking the Code' interior pages) +[8]: https://opensource.com/sites/default/files/uploads/codebook_pg1.jpg (About 'Breaking the Code') diff --git a/sources/tech/20190503 Mirror your System Drive using Software RAID.md b/sources/tech/20190503 Mirror your System Drive using Software RAID.md new file mode 100644 index 0000000000..1b5936dfa0 --- /dev/null +++ b/sources/tech/20190503 Mirror your System Drive using Software RAID.md @@ -0,0 +1,306 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Mirror your System Drive using Software RAID) +[#]: via: (https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Mirror your System Drive using Software RAID +====== + +![][1] + +Nothing lasts forever. When it comes to the hardware in your PC, most of it can easily be replaced. There is, however, one special-case hardware component in your PC that is not as easy to replace as the rest — your hard disk drive. + +### Drive Mirroring + +Your hard drive stores your personal data. Some of your data can be backed up automatically by scheduled backup jobs. But those jobs scan the files to be backed up for changes and trying to scan an entire drive would be very resource intensive. Also, anything that you’ve changed since your last backup will be lost if your drive fails. [Drive mirroring][2] is a better way to maintain a secondary copy of your entire hard drive. With drive mirroring, a secondary copy of _all the data_ on your hard drive is maintained _in real time_. + +An added benefit of live mirroring your hard drive to a secondary hard drive is that it can [increase your computer’s performance][3]. Because disk I/O is one of your computer’s main performance [bottlenecks][4], the performance improvement can be quite significant. + +Note that a mirror is not a backup. It only protects your data from being lost if one of your physical drives fail. Types of failures that drive mirroring, by itself, does not protect against include: + + * [File System Corruption][5] + * [Bit Rot][6] + * Accidental File Deletion + * Simultaneous Failure of all Mirrored Drives (highly unlikely) + + + +Some of the above can be addressed by other file system features that can be used in conjunction with drive mirroring. File system features that address the above types of failures include: + + * Using a [Journaling][7] or [Log-Structured][8] file system + * Using [Checksums][9] ([ZFS][10] , for example, does this automatically and transparently) + * Using [Snapshots][11] + * Using [BCVs][12] + + + +This guide will demonstrate one method of mirroring your system drive using the Multiple Disk and Device Administration (mdadm) toolset. Just for fun, this guide will show how to do the conversion without using any extra boot media (CDs, USB drives, etc). For more about the concepts and terminology related to the multiple device driver, you can skim the _md_ man page: + +``` +$ man md +``` + +### The Procedure + + 1. **Use** [**sgdisk**][13] **to (re)partition the _extra_ drive that you have added to your computer** : + +``` + $ sudo -i +# MY_DISK_1=/dev/sdb +# sgdisk --zap-all $MY_DISK_1 +# test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_1 $MY_DISK_1 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_1 $MY_DISK_1 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_1 $MY_DISK_1 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_1 $MY_DISK_1 +``` + +– If the drive that you will be using for the second half of the mirror in step 12 is smaller than this drive, then you will need to adjust down the size of the last partition so that the total size of all the partitions is not greater than the size of your second drive. +– A few of the commands in this guide are prefixed with a test for the existence of an _efivars_ directory. This is necessary because those commands are slightly different depending on whether your computer is BIOS-based or UEFI-based. + + 2. **Use** [**mdadm**][14] **to create RAID devices that use the new partitions to store their data** : + +``` + # mdadm --create /dev/md/boot --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/boot_1 missing +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/swap_1 missing +# mdadm --create /dev/md/root --homehost=any --metadata=1.0 --level=1 --raid-devices=2 /dev/disk/by-partlabel/root_1 missing + +# cat << END > /etc/mdadm.conf +MAILADDR root +AUTO +all +DEVICE partitions +END + +# mdadm --detail --scan >> /etc/mdadm.conf +``` + +– The _missing_ parameter tells mdadm to create an array with a missing member. You will add the other half of the mirror in step 14. +– You should configure [sendmail][15] so you will be notified if a drive fails. +– You can configure [Evolution][16] to [monitor a local mail spool][17]. + + 3. **Use** [**dracut**][18] **to update the initramfs** : + +``` +# dracut -f --add mdraid --add-drivers xfs +``` + +– Dracut will include the /etc/mdadm.conf file you created in the previous section in your initramfs _unless_ you build your initramfs with the _hostonly_ option set to _no_. If you build your initramfs with the hostonly option set to no, then you should either manually include the /etc/mdadm.conf file, manually specify the UUID’s of the RAID arrays to assemble at boot time with the _rd.md.uuid_ kernel parameter, or specify the _rd.auto_ kernel parameter to have all RAID arrays automatically assembled and started at boot time. This guide will demonstrate the _rd.auto_ option since it is the most generic. + + 4. **Format the RAID devices** : + +``` + # mkfs -t vfat /dev/md/boot +# mkswap /dev/md/swap +# mkfs -t xfs /dev/md/root +``` + +– The new [Boot Loader Specification][19] states “if the OS is installed on a disk with GPT disk label, and no ESP partition exists yet, a new suitably sized (let’s say 500MB) ESP should be created and should be used as $BOOT” and “$BOOT must be a VFAT (16 or 32) file system”. + + 5. **Reboot and set the _rd.auto_ , _rd.break_ and _single_ kernel parameters** : + +``` +# reboot +``` + +– You may need to [set your root password][20] before rebooting so that you can get into _single-user mode_ in step 7. +– See “[Making Temporary Changes to a GRUB 2 Menu][21]” for directions on how to set kernel parameters on compters that use the GRUB 2 boot loader. + + 6. **Use** [**the dracut shell**][18] **to copy the root file system** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# shopt -s dotglob +# cp -ax /sysroot/* /newroot +# rm -rf /newroot/boot/* +# umount /newroot +# exit +``` + +– The _dotglob_ flag is set for this bash session so that the [wildcard character][22] will match hidden files. +– Files are removed from the _boot_ directory because they will be copied to a separate partition in the next step. +– This copy operation is being done from the dracut shell to insure that no processes are accessing the files while they are being copied. + + 7. **Use _single-user mode_ to copy the non-root file systems** : + +``` + # mkdir /newroot +# mount /dev/md/root /newroot +# mount /dev/md/boot /newroot/boot +# shopt -s dotglob +# cp -Lr /boot/* /newroot/boot +# test -d /newroot/boot/efi/EFI && mv /newroot/boot/efi/EFI/* /newroot/boot/efi && rmdir /newroot/boot/efi/EFI +# test -d /sys/firmware/efi/efivars && ln -sfr /newroot/boot/efi/fedora/grub.cfg /newroot/etc/grub2-efi.cfg +# cp -ax /home/* /newroot/home +# exit +``` + +– It is OK to run these commands in the dracut shell shown in the previous section instead of doing it from single-user mode. I’ve demonstrated using single-user mode to avoid having to explain how to mount the non-root partitions from the dracut shell. +– The parameters being past to the _cp_ command for the _boot_ directory are a little different because the VFAT file system doesn’t support symbolic links or Unix-style file permissions. +– In rare cases, the _rd.auto_ parameter is known to cause LVM to fail to assemble due to a [race condition][23]. If you see errors about your _swap_ or _home_ partition failing to mount when entering single-user mode, simply try again by repeating step 5 but omiting the _rd.break_ paramenter so that you will go directly to single-user mode. + + 8. **Update _fstab_ on the new drive** : + +``` + # cat << END > /newroot/etc/fstab +/dev/md/root / xfs defaults 0 0 +/dev/md/boot /boot vfat defaults 0 0 +/dev/md/swap swap swap defaults 0 0 +END +``` + + 9. **Configure the boot loader on the new drive** : + +``` + # NEW_GRUB_CMDLINE_LINUX=$(cat /etc/default/grub | sed -n 's/^GRUB_CMDLINE_LINUX="\(.*\)"/\1/ p') +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//rd.lvm.*([^ ])} +# NEW_GRUB_CMDLINE_LINUX=${NEW_GRUB_CMDLINE_LINUX//resume=*([^ ])} +# NEW_GRUB_CMDLINE_LINUX+=" selinux=0 rd.auto" +# sed -i "/^GRUB_CMDLINE_LINUX=/s/=.*/=\"$NEW_GRUB_CMDLINE_LINUX\"/" /newroot/etc/default/grub +``` + +– You can re-enable selinux after this procedure is complete. But you will have to [relabel your file system][24] first. + + 10. **Install the boot loader on the new drive** : + +``` + # sed -i '/^GRUB_DISABLE_OS_PROBER=.*/d' /newroot/etc/default/grub +# echo "GRUB_DISABLE_OS_PROBER=true" >> /newroot/etc/default/grub +# MY_DISK_1=$(mdadm --detail /dev/md/boot | grep active | grep -m 1 -o "/dev/sd.") +# for i in dev dev/pts proc sys run; do mount -o bind /$i /newroot/$i; done +# chroot /newroot env MY_DISK_1=$MY_DISK_1 bash --login +# test -d /sys/firmware/efi/efivars || MY_GRUB_DIR=/boot/grub2 +# test -d /sys/firmware/efi/efivars && MY_GRUB_DIR=$(find /boot/efi -type d -name 'fedora' -print -quit) +# test -e /usr/sbin/grub2-switch-to-blscfg && grub2-switch-to-blscfg --grub-directory=$MY_GRUB_DIR +# grub2-mkconfig -o $MY_GRUB_DIR/grub.cfg \; +# test -d /sys/firmware/efi/efivars && test /boot/grub2/grubenv -nt $MY_GRUB_DIR/grubenv && cp /boot/grub2/grubenv $MY_GRUB_DIR/grubenv +# test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_1" +# logout +# for i in run sys proc dev/pts dev; do umount /newroot/$i; done +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_1" -p 1 -l "$(find /newroot/boot -name shimx64.efi -printf '/%P\n' -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 1" +``` + +– The _grub2-switch-to-blscfg_ command is optional. It is only supported on Fedora 29+. +– The _cp_ command above should not be necessary, but there appears to be a bug in the current version of grub which causes it to write to $BOOT/grub2/grubenv instead of $BOOT/efi/fedora/grubenv on UEFI systems. +– You can use the following command to verify the contents of the _grub.cfg_ file right after running the _grub2-mkconfig_ command above: + +``` +# sed -n '/BEGIN .*10_linux/,/END .*10_linux/ p' $MY_GRUB_DIR/grub.cfg +``` + +– You should see references to _mdraid_ and _mduuid_ in the output from the above command if the RAID array was detected properly. + + 11. **Boot off of the new drive** : + +``` +# reboot +``` + +– How to select the new drive is system-dependent. It usually requires pressing one of the **F12** , **F10** , **Esc** or **Del** keys when you hear the [System OK BIOS beep code][25]. +– On UEFI systems the boot loader on the new drive should be labeled “Fedora RAID Disk 1”. + + 12. **Remove all the volume groups and partitions from your old drive** : + +``` + # MY_DISK_2=/dev/sda +# MY_VOLUMES=$(pvs | grep $MY_DISK_2 | awk '{print $2}' | tr "\n" " ") +# test -n "$MY_VOLUMES" && vgremove $MY_VOLUMES +# sgdisk --zap-all $MY_DISK_2 +``` + +– **WARNING** : You want to make certain that everything is working properly on your new drive before you do this. A good way to verify that your old drive is no longer being used is to try booting your computer once without the old drive connected. +– You can add another new drive to your computer instead of erasing your old one if you prefer. + + 13. **Create new partitions on your old drive to match the ones on your new drive** : + +``` + # test -d /sys/firmware/efi/efivars || sgdisk -n 0:0:+1MiB -t 0:ef02 -c 0:grub_2 $MY_DISK_2 +# sgdisk -n 0:0:+1GiB -t 0:ea00 -c 0:boot_2 $MY_DISK_2 +# sgdisk -n 0:0:+4GiB -t 0:fd00 -c 0:swap_2 $MY_DISK_2 +# sgdisk -n 0:0:0 -t 0:fd00 -c 0:root_2 $MY_DISK_2 +``` + +– It is important that the partitions match in size and type. I prefer to use the _parted_ command to display the partition table because it supports setting the display unit: + +``` + # parted /dev/sda unit MiB print +# parted /dev/sdb unit MiB print +``` + + 14. **Use mdadm to add the new partitions to the RAID devices** : + +``` + # mdadm --manage /dev/md/boot --add /dev/disk/by-partlabel/boot_2 +# mdadm --manage /dev/md/swap --add /dev/disk/by-partlabel/swap_2 +# mdadm --manage /dev/md/root --add /dev/disk/by-partlabel/root_2 +``` + + 15. **Install the boot loader on your old drive** : + +``` + # test -d /sys/firmware/efi/efivars || grub2-install "$MY_DISK_2" +# test -d /sys/firmware/efi/efivars && efibootmgr -c -d "$MY_DISK_2" -p 1 -l "$(find /boot -name shimx64.efi -printf "/%P\n" -quit | sed 's!/!\\!g')" -L "Fedora RAID Disk 2" +``` + + 16. **Use mdadm to test that email notifications are working** : + +``` +# mdadm --monitor --scan --oneshot --test +``` + + + + +As soon as your drives have finished synchronizing, you should be able to select either drive when restarting your computer and you will receive the same live-mirrored operating system. If either drive fails, mdmonitor will send an email notification. Recovering from a drive failure is now simply a matter of swapping out the bad drive with a new one and running a few _sgdisk_ and _mdadm_ commands to re-create the mirrors (steps 13 through 15). You will no longer have to worry about losing any data if a drive fails! + +### Video Demonstrations + +Converting a UEFI PC to RAID1 + +Converting a BIOS PC to RAID1 + + * TIP: Set the the quality to 720p on the above videos for best viewing. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/mirror-your-system-drive-using-software-raid/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/raid_mirroring-816x345.jpg +[2]: https://en.wikipedia.org/wiki/Disk_mirroring +[3]: https://en.wikipedia.org/wiki/Disk_mirroring#Additional_benefits +[4]: https://en.wikipedia.org/wiki/Bottleneck_(software) +[5]: https://en.wikipedia.org/wiki/Data_corruption +[6]: https://en.wikipedia.org/wiki/Data_degradation +[7]: https://en.wikipedia.org/wiki/Journaling_file_system +[8]: https://www.quora.com/What-is-the-difference-between-a-journaling-vs-a-log-structured-file-system +[9]: https://en.wikipedia.org/wiki/File_verification +[10]: https://en.wikipedia.org/wiki/ZFS#Summary_of_key_differentiating_features +[11]: https://en.wikipedia.org/wiki/Snapshot_(computer_storage)#File_systems +[12]: https://en.wikipedia.org/wiki/Business_continuance_volume +[13]: https://fedoramagazine.org/managing-partitions-with-sgdisk/ +[14]: https://fedoramagazine.org/managing-raid-arrays-with-mdadm/ +[15]: https://fedoraproject.org/wiki/QA:Testcase_Sendmail +[16]: https://en.wikipedia.org/wiki/Evolution_(software) +[17]: https://dotancohen.com/howto/root_email.html +[18]: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ +[19]: https://systemd.io/BOOT_LOADER_SPECIFICATION#technical-details +[20]: https://docs.fedoraproject.org/en-US/Fedora/26/html/System_Administrators_Guide/sec-Changing_and_Resetting_the_Root_Password.html +[21]: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Making_Temporary_Changes_to_a_GRUB_2_Menu +[22]: https://en.wikipedia.org/wiki/Wildcard_character#File_and_directory_patterns +[23]: https://en.wikipedia.org/wiki/Race_condition +[24]: https://wiki.centos.org/HowTos/SELinux#head-867ca18a09f3103705cdb04b7d2581b69cd74c55 +[25]: https://en.wikipedia.org/wiki/Power-on_self-test#Original_IBM_POST_beep_codes diff --git a/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md new file mode 100644 index 0000000000..63802d4976 --- /dev/null +++ b/sources/tech/20190503 SuiteCRM- An Open Source CRM Takes Aim At Salesforce.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (SuiteCRM: An Open Source CRM Takes Aim At Salesforce) +[#]: via: (https://itsfoss.com/suitecrm-ondemand/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +SuiteCRM: An Open Source CRM Takes Aim At Salesforce +====== + +SuiteCRM is one of the most popular open source CRM (Customer Relationship Management) software available. With its unique-priced managed CRM hosting service, SuiteCRM is aiming to challenge enterprise CRMs like Salesforce. + +### SuiteCRM: An Open Source CRM Software + +CRM stands for Customer Relationship Management. It is used by businesses to manage the interaction with customers, keep track of services, supplies and other things that help the business manage their customers. + +![][1] + +[SuiteCRM][2] came into existence after the hugely popular [SugarCRM][3] decided to stop developing its open source version. The open source version of SugarCRM was then forked into SuiteCRM by UK-based [SalesAgility][4] team. + +In just a couple of years, SuiteCRM became immensely popular and started to be considered the best open source CRM software out there. You can gauge its popularity from the fact that it’s nearing a million download and it has over 100,000 community members. There are around 4 million SuiteCRM users worldwide (a CRM software usually has more than one user) and it is available in several languages. It’s even used by National Health Service ([NHS][5]) in UK. + +Since SuiteCRM is a free and open source software, you are free to download it and deploy it on your cloud server such as [UpCloud][6] (we at It’s FOSS use it), [DigitalOcean][7], [AWS][8] or any Linux server of our own. + +But configuring the software, deploying it and managing it a tiresome job and requires certain skill level or a the services of a sysadmin. This is why business oriented open source software provide a hosted version of their software. + +This enables you to enjoy the open source software without the additional headache and the team behind the software has a way to generate revenue and continue the development of their software. + +### Suite:OnDemand – Cost effective managed hosting of SuiteCRM + +So, recently, [SalesAgility][4] – the creators/maintainers of SuiteCRM, decided to challenge [Salesforce][9] and other enterprise CRMs by introducing [Suite:OnDemand][10] , a hosted version of SuiteCRM. + +[][11] + +Suggested read Papyrus: An Open Source Note Manager + +Normally, you will observe pricing plans on the basis of number of users. But, with SuiteCRM’s OnDemand cloud hosting plans, they are trying to give businesses an affordable solution on a “per-server” basis instead of paying for every user you add. + +In other words, they want you to pay extra only for advanced features, not for more users. + +Here’s what SalesAgility mentioned in their [press release][12]: + +> Unlike Salesforce and other enterprise CRM vendors, the practice of pricing per user has been abandoned in favour of per-server hosting packages all of which will support unlimited users. In addition, there’s no increase in cost for access to advanced features. With Suite:OnDemand every feature and benefit is available with each hosting package. + +Of course, unlimited users does not mean that you will have to abuse the term. So, there’s a recommended number of users for every hosting plan you opt for. + +![Suitecrm Hosting][13] + +The CEO of SalesAgility also had to describe their goals for this step: + +“ _We want SuiteCRM to be available to all businesses and to all users within a business,_ ”said **Dale Murray CEO** of **SalesAgility**. + +In addition to that, they also mentioned that they want to revolutionize the way enterprise-class CRM is being currently offered in order to make it more accessible to businesses and organizations: + +> “Many organisations do not have the experience to run and support our product on-premise or it is not part of their technology strategy to do so. With Suite:OnDemand we are providing our customers with a quick and easy solution to access all the features of SuiteCRM without a per user cost. We’re also saying to Salesforce that enterprise-class CRM can be delivered, enhanced, maintained and supported without charging mouth-wateringly expensive monthly fees. Our aim is to transform the CRM market to enable users to make CRM pervasive within their organisations.” +> +> Dale Murray, CEO of SalesAgility + +### Why is this a big deal? + +This is a huge relief for small business owners and startups because other CRMs like Saleforce and SugarCRM charge $30-$40 per month per user. If you have 10 members in your team, this will increase the cost to $300-$400 per month. + +[][14] + +Suggested read Winds Beautifully Combines Feed Reader and Podcast Player in One Single App + +This is also a good news for the open source community that we will have an affordable alternative to Salesforce. + +In addition to this, SuiteCRM is fully open source meaning there are no license fees or vendor lock-in – as they mention. You are always free to use it on your own. + +It is interesting to see different strategies and solutions being applied for an open source CRM software to take an aim at Salesforce directly. + +What do you think? Let us know your thoughts in the comments below. + +_With inputs from Abhishek Prakash._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/suitecrm-ondemand/ + +作者:[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/wp-content/uploads/2019/05/suite-crm-800x450.png +[2]: https://suitecrm.com/ +[3]: https://www.sugarcrm.com/ +[4]: https://salesagility.com/ +[5]: https://www.nhs.uk/ +[6]: https://www.upcloud.com/register/?promo=itsfoss +[7]: https://m.do.co/c/d58840562553 +[8]: https://aws.amazon.com/ +[9]: https://www.salesforce.com +[10]: https://suitecrm.com/suiteondemand/ +[11]: https://itsfoss.com/papyrus-open-source-note-manager/ +[12]: https://suitecrm.com/sod-pr/ +[13]: https://itsfoss.com/wp-content/uploads/2019/05/suitecrm-hosting-800x457.jpg +[14]: https://itsfoss.com/winds-podcast-feedreader/ diff --git a/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md new file mode 100644 index 0000000000..692b4ecba8 --- /dev/null +++ b/sources/tech/20190503 Tutanota Launches New Encrypted Tool to Support Press Freedom.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tutanota Launches New Encrypted Tool to Support Press Freedom) +[#]: via: (https://itsfoss.com/tutanota-secure-connect/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Tutanota Launches New Encrypted Tool to Support Press Freedom +====== + +A secure email provider has announced the release of a new product designed to help whistleblowers get their information to the media. The tool is free for journalists. + +### Tutanota helps you protect your privacy + +![][1] + +[Tutanota][2] is a German-based company that provides “world’s most secure email service, easy to use and private by design.” They offer end-to-end encryption for their [secure email service][3]. Recently Tutanota announced a [desktop app for their email service][4]. + +They also make use of two-factor authentication and [open source the code][5] that they use. + +While you can get an account for free, you don’t have to worry about your information being sold or seeing ads. Tutanota makes money by charging for extra features and storage. They also offer solutions for non-profit organizations. + +Tutanota has launched a new service to further help journalists, social activists and whistleblowers in communicating securely. + +[][6] + +Suggested read Purism's New Offering is a Dream Come True for Privacy Concerned People + +### Secure Connect: An encrypted form for websites + +![][7] + +Tutanota has released a new piece of software named Secure Connect. Secure Connect is “an open source encrypted contact form for news sites”. The goal of the project is to create a way so that “whistleblowers can get in touch with journalists securely”. Tutanota picked the right day because May 3rd is the [Day of Press Freedom][8]. + +According to Tutanota, Secure Connect is designed to be easily added to websites, but can also work on any blog to ensure access by smaller news agencies. A whistleblower would access Secure Connect app on a news site, preferably using Tor, and type in any information that they want to bring to light. The whistleblower would also be able to upload files. Once they submit the information, Secure Connect will assign a random address and password, “which lets the whistleblower re-access his sent message at a later stage and check for replies from the news site.” + +![Secure Connect Encrypted Contact Form][9] + +While Tutanota will be offering Secure Connect to journalists for free, they know that someone will have to foot the bill. They plan to pay for further development of the project by selling it to businesses, such as “lawyers, financial institutions, medical institutions, educational institutions, and the authorities”. Non-journalists would have to pay €24 per month. + +You can see a demo of Secure Connect, by clicking [here][10]. If you are a journalist interested in adding Secure Connect to your website or blog, you can contact them at [[email protected]][11] Be sure to include a link to your website. + +[][12] + +Suggested read 8 Privacy Oriented Alternative Search Engines To Google in 2019 + +### Final Thoughts on Secure Connect + +I have read repeatedly about whistleblowers whose identities were accidentally exposed, either by themselves or others. Tutanota’s project looks like it would remove that possibility by making it impossible for others to discover their identity. It also gives both parties an easy way to exchange information without having to worry about encryption or PGP keys. + +I understand that it’s not the same as [Firefox Send][13], another encrypted file sharing program from Mozilla. The only question I have is whose servers will the whistleblowers’ information be sitting on? + +Do you think that Tutanota’s Secure Connect will be a boon for whistleblowers and activists? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][14]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tutanota-secure-connect/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2018/02/tutanota-featured-800x450.png +[2]: https://tutanota.com/ +[3]: https://itsfoss.com/tutanota-review/ +[4]: https://itsfoss.com/tutanota-desktop/ +[5]: https://tutanota.com/blog/posts/open-source-email +[6]: https://itsfoss.com/librem-one/ +[7]: https://itsfoss.com/wp-content/uploads/2019/05/secure-communication.jpg +[8]: https://en.wikipedia.org/wiki/World_Press_Freedom_Day +[9]: https://itsfoss.com/wp-content/uploads/2019/05/secure-connect-encrypted-contact-form.png +[10]: https://secureconnect.tutao.de/contactform/demo +[11]: /cdn-cgi/l/email-protection +[12]: https://itsfoss.com/privacy-search-engines/ +[13]: https://itsfoss.com/firefox-send/ +[14]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md b/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md new file mode 100644 index 0000000000..9e0ebd4381 --- /dev/null +++ b/sources/tech/20190504 Fedora 30 Workstation Installation Guide with Screenshots.md @@ -0,0 +1,207 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora 30 Workstation Installation Guide with Screenshots) +[#]: via: (https://www.linuxtechi.com/fedora-30-workstation-installation-guide/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Fedora 30 Workstation Installation Guide with Screenshots +====== + +If you are a **Fedora distribution** lover and always try the things at Fedora Workstation and Servers, then it is good news for you as Fedora has released its latest OS edition as **Fedora 30** for the Workstation and Server. One of the important updates in Fedora 30 from its previous release is that it has introduced **Fedora CoreOS** as a replacement of Fedora Atomic host. + +Some other noticeable updates in Fedora 30 are listed beneath: + + * Updated Desktop Gnome 3.32 + * New Linux Kernel 5.0.9 + * Updated Bash Version 5.0, PHP 7.3 & GCC 9 + * Updated Python 3.7.3, JDK12, Ruby 2.6 Mesa 19.0.2 and Golang 1.12 + * Improved DNF (Default Package Manager) + + + +In this article we will walk through the Fedora 30 workstation Installation steps for laptop or desktop. + +**Following are the minimum system requirement for Fedora 30 workstation,** + + * 1GHz Processor (Recommended 2 GHz Dual Core processor) + * 2 GB RAM + * 15 GB unallocated Hard Disk + * Bootable Media (USB / DVD) + * nternet Connection (Optional) + + + +Let’s Jump into Installation steps, + +### Step:1) Download Fedora 30 Workstation ISO File + +Download the Fedora 30 Workstation ISO file on your system from its Official Web Site + + + +Once the ISO file is downloaded, then burn it either in USB drive or DVD and make it bootable. + +### Step:2) Boot Your Target System with Bootable media (USB Drive or DVD) + +Reboot your target machine (i.e. machine where you want to install Fedora 30), Set the boot medium as USB or DVD from Bios settings so system boots up with bootable media. + +### Step:3) Choose Start Fedora-Workstation-30 Live + +When the system boots up with bootable media then we will get the following screen, to begin with installation on your system’s hard disk, choose “ **Start Fedora-Workstation-30 Live** “, + + + +### Step:4) Select Install to Hard Drive Option + +Select “ **Install to Hard Drive** ” option to install Fedora 30 on your system’s hard disk, you can also try Fedora on your system without installing it, for that select “ **Try Fedora** ” Option + + + +### Step:5) Choose appropriate language for your Fedora 30 Installation + +In this step choose your language which will be used during Fedora 30 Installation, + + + +Click on Continue + +### Step:6) Choose Installation destination and partition Scheme + +In the next window we will be present the following screen, here we will choose our installation destination, means on which hard disk we will do installation + + + +In the next screen we will see the local available hard disk, select the disk that suits your installation and then choose how you want to create partitions on it from storage configuration tab. + +If you choose “ **Automatic** ” partition scheme, then installer will create the necessary partition for your system automatically but if you want to create your own customize partition scheme then choose “ **Custom** ” option, + + + +Click on Done + +In this article I will demonstrate how to create [**LVM**][1] based custom partitions, in my case I have around 40 GB unallocated hard drive, so I will be creating following partitions on it, + + * /boot = 2 GB (ext4 file system) + * /home = 15 GB (ext4 file system) + * /var = 10 GB (ext4 file system) + * / = 10 GB (ext4 file system) + * Swap = 2 GB + + + + + +Select “ **LVM** ” as partitioning scheme and then click on plus (+) symbol, + +Specify the mount point as /boot and partition size as 2 GB and then click on “Add mount point” + + + + + +Now create next partition as /home of size 15 GB, Click on + symbol + + + +Click on “ **Add mount point** ” + + + +If you might have noticed, /home partition is created as LVM partition under default Volume Group, if you wish to change default Volume Group name then click on “ **Modify** ” option from Volume Group Tab, + +Mention the Volume Group name you want to set and then click on Save. Now onward all the LVM partition will be part of fedora30 volume group. + + + +Similarly create the next two partitions **/var** and **/** of size 10 GB respectively, + +**/var partition:** + + + +**/ (slash) partition:** + + + +Now create the last partition as swap of size 2 GB, + + + +In the next window, click on Done + + + +In the next screen, choose “ **Accept Changes** ” + + + +Now we will get Installation Summary window, here you can also change the time zone that suits to your installation and then click on “ **Begin Installation** ” + + + +### Step:7) Fedora 30 Installation started + +In this step we can see Fedora 30 Installation has been started and it is in progress, + + + +Once the Installation is completed, you will be prompted to restart your system + + + +Click on Quit and reboot your system. + +Don’t forget the Change boot medium from Bios settings so your system boots up with hard disk. + +### Step:8) Welcome message and login Screen after reboot + +When we first time reboot Fedora 30 system after the successful installation, we will get below welcome screen, + + + +Click on Next + +In the next screen you can Sync your online accounts or else you can skip, + + + +In the next window you will be required to specify the local account (user name) and its password, later this account will be used to login to the system + + + + + +Click on Next + +And finally, we will get below screen which confirms that we are ready to use Fedora 30, + + + +Click on “ **Start Using Fedora** ” + + + +Above Gnome Desktop Screen confirms that we have successfully installed Fedora 30 Workstation, now explore it and have fun 😊 + +In Fedora 30 workstation, if you want to install any packages or software from command line use DNF command. + +Read More On: **[26 DNF Command Examples for Package Management in Fedora Linux][2]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/fedora-30-workstation-installation-guide/ + +作者:[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/lvm-good-way-to-utilize-disks-space/ +[2]: https://www.linuxtechi.com/dnf-command-examples-rpm-management-fedora-linux/ diff --git a/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md new file mode 100644 index 0000000000..a05f9a6b4f --- /dev/null +++ b/sources/tech/20190504 May the fourth be with you- How Star Wars (and Star Trek) inspired real life tech.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech) +[#]: via: (https://opensource.com/article/19/5/may-the-fourth-star-wars-trek) +[#]: author: (Jeff Macharyas https://opensource.com/users/jeffmacharyas) + +May the fourth be with you: How Star Wars (and Star Trek) inspired real life tech +====== +The technologies may have been fictional, but these two acclaimed sci-fi +series have inspired open source tech. +![Triangulum galaxy, NASA][1] + +Conventional wisdom says you can either be a fan of _Star Trek_ or of _Star Wars_ , but mixing the two is like mixing matter and anti-matter. I'm not sure that's true, but even if the laws of physics cannot be changed, these two acclaimed sci-fi series have influenced the open source universe and created their own open source multi-verses. + +For example, fans have used the original _Star Trek_ as "source code" to create fan-made films, cartoons, and games. One of the more notable fan creations was the web series _Star Trek Continues_ , which faithfully adapted Gene Roddenberry's universe and redistributed it to the world. + +"Eventually we realized that there is no more profound way in which people could express what _Star Trek_ has meant to them than by creating their own very personal _Star Trek_ things," [Roddenberry said][2]. However, due to copyright restrictions, this "open source" channel [has since been curtailed][3]. + +_Star Wars_ has a different approach to open sourcing its universe. [Jess Paguaga writes][4] on FanSided: "With a variety [of] fan film awards dating back to 2002, the _Star Wars_ brand has always supported and encouraged the creation of short films that help expand the universe of a galaxy far, far away." + +But, _Star Wars_ is not without its own copyright prime directives. In one case, a Darth Vader film by a YouTuber called Star Wars Theory has drawn a copyright claim from Disney. The claim does not stop production of the film, but diverts monetary gains from it, [reports James Richards][5] on FanSided. + +This could be one of the [Ferengi Rules of Acquisition][6], perhaps. + +But if you can't watch your favorite fan film, you can still get your [_Star Wars_ fix right in the Linux terminal][7] by entering: + + +``` +`telnet towel.blinkenlights.nl` +``` + +And _Star Trek_ fans can also interact with the Federation with the original text-based video game from 1971. While a high-school senior, Mike Mayfield ported the game from punch cards to HP BASIC. If you'd like to go old school and battle Klingons, the source code is available at the [Code Project][8]. + +### Real-life star tech + +Both _Star Wars_ and _Star Trek_ have inspired real-life technologies. Although those technologies were fictional, many have become the practical, open technology we use today. Some of them inspired technologies that are still in development now. + +In the early 1970s, Motorola engineer Martin Cooper was trying to beat AT&T at the car-phone game. He says he was watching Captain Kirk use a "communicator" on an episode of _Star Trek_ and had a eureka moment. His team went on to create the first portable cellular 800MHz phone prototype in 90 days. + +In _Star Wars_ , scout stormtroopers of the Galactic Empire rode the Aratech 74-Z Speeder Bike, and a real-life counterpart is the [Aero-X][9] being developed by California's Aerofex. + +Perhaps the most visible _Star Wars_ tech to enter our lives is droids. We first encountered R2-D2 back in the 1970s, but now we have droids vacuuming our carpets and mowing our lawns, from Roombas to the [Worx Landroid][10] lawnmower. + +And, in _Star Wars_ , Princess Leia appeared to Obi-Wan Kenobi as a hologram, and in Star Trek: Voyager, the ship's chief medical officer was an interactive hologram that could diagnose and treat patients. The technology to bring characters like these to "life" is still a ways off, but there are some interesting open source developments that hint of things to come. [OpenHolo][11], "an open source library containing algorithms and software implementations for holograms in various fields," is one such project. + +### Where's the beef? + +> "She handled… real meat… touched it, and cut it?" —Keiko O'Brien, Star Trek: The Next Generation + +In the _Star Trek_ universe, crew members get their meals by simply ordering a replicator to produce whatever food they desire. That could one day become a reality thanks to a concept created by two German students for an open source "meat-printer" they call the [Cultivator][12]. It would use bio-printing to produce something that appears to be meat; the user could even select its mineral and fat content. Perhaps with more collaboration and development, the Cultivator could become the replicator in tomorrow's kitchen! + +### The 501st + +Cosplayers, people from all walks of life who dress as their favorite characters, are the "open source embodiment" of their favorite universes. The [501st][13] [Legion][13] is an all-volunteer _Star Wars_ fan organization "formed for the express purpose of bringing together costume enthusiasts under a collective identity within which to operate," according to its charter. + +Jon Stallard, a member of Garrison Tyranus, the Central Virginia chapter of the 501st Legion says, "Everybody wanted to be something else when they were a kid, right? Whether it was Neil Armstrong, Batman, or the Six Million Dollar Man. Every backyard playdate was some kind of make-believe. The 501st lets us participate in our fan communities while contributing to the community at large." + +Are cosplayers really "open source characters"? Well, that depends. The copyright laws around cosplay and using unique props, costumes, and more are very complex, [writes Meredith Filak Rose][14] for _Public Knowledge_. "We're lucky to be living in a time where fandom generally enjoys a positive relationship with the creators whose work it admires," Rose concludes. + +So, it is safe to say that stormtroopers, Ferengi, Vulcans, and Yoda are all here to stay for a long, long time, near, and far, far away. + +Live long and prosper, you shall. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/may-the-fourth-star-wars-trek + +作者:[Jeff Macharyas ][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/jeffmacharyas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/triangulum_galaxy_nasa_stars.jpg?itok=NdS19A7m +[2]: https://fanlore.org/wiki/Gene_Roddenberry#His_Views_Regarding_Fanworks +[3]: https://trekmovie.com/2016/06/23/cbs-and-paramount-release-fan-film-guidelines/ +[4]: https://dorksideoftheforce.com/2019/01/17/star-wars-fan-films/ +[5]: https://dorksideoftheforce.com/2019/01/16/disney-claims-copyright-star-wars-theory/ +[6]: https://en.wikipedia.org/wiki/Rules_of_Acquisition +[7]: https://itsfoss.com/star-wars-linux/ +[8]: https://www.codeproject.com/Articles/28228/Star-Trek-1971-Text-Game +[9]: https://www.livescience.com/58943-real-life-star-wars-technology.html +[10]: https://www.digitaltrends.com/cool-tech/best-robot-lawnmowers/ +[11]: http://openholo.org/ +[12]: https://www.pastemagazine.com/articles/2016/05/the-future-is-vegan-according-to-star-trek.html +[13]: https://www.501st.com/ +[14]: https://www.publicknowledge.org/news-blog/blogs/copyright-and-cosplay-working-with-an-awkward-fit diff --git a/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md new file mode 100644 index 0000000000..cc8a660252 --- /dev/null +++ b/sources/tech/20190505 -Review- Void Linux, a Linux BSD Hybrid.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ([Review] Void Linux, a Linux BSD Hybrid) +[#]: via: (https://itsfoss.com/void-linux/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +[Review] Void Linux, a Linux BSD Hybrid +====== + +There are distros that follow the crowd and there are others that try to make their own path through the tall weed. Today, we’ll be looking at a small distro that looks to challenge how a distro should work. We’ll be looking at Void Linux. + +### What is Void Linux? + +[Void Linux][1] is a “general purpose operating system, based on the monolithic Linux kernel. Its package system allows you to quickly install, update and remove software; software is provided in binary packages or can be built directly from sources with the help of the XBPS source packages collection.” + +![Void Linux Neofetch][2] + +Like Solus, Void Linux is written from scratch and does not depend on any other operating system. It is a rolling release. Unlike the majority of Linux distros, Void does not use [systemd][3]. Instead, it uses [runit][4]. Another thing that separates Void from the rest of Linux distros is the fact that they use LibreSSL instead of OpenSSL. Void also offers support for the [musl C library][5]. In fact, when you download a .iso file, you can choose between `glibc` and `musl`. + +The homegrown package manager that Void uses is named X Binary Package System (or xbps). According to the [Void wiki][6], xbps has the following features: + + * Supports multiple local and remote repositories (HTTP/HTTPS/FTP). + * RSA signed remote repositories + * SHA256 hashes for package metadata, files, and binary packages + * Supports package states (ala dpkg) to mitigate broken package * installs/updates + * Ability to resume partial package install/updates + * Ability to unpack only files that have been modified in * package updates + * Ability to use virtual packages + * Ability to check for incompatible shared libraries in reverse dependencies + * Ability to replace packages + * Ability to put packages on hold (to never update them) + * Ability to preserve/update configuration files + * Ability to force reinstallation of any installed package + * Ability to downgrade any installed package + * Ability to execute pre/post install/remove/update scriptlets + * Ability to check package integrity: missing files, hashes, missing or unresolved (reverse)dependencies, dangling or modified symlinks, etc. + + + +#### System Requirements + +According to the [Void Linux download page][7], the system requirements differ based on the architecture you choose. 64-bit images require “EM64T CPU, 96MB RAM, 350MB disk, Ethernet/WiFi for network installation”. 32-bit images require “Pentium 4 CPU (SSE2), 96MB RAM, 350MB disk, Ethernet / WiFi for network installation”. The [Void Linux handbook][8] recommends 700 MB for storage and also notes that “Flavor installations require more resources. How much more depends on the flavor.” + +Void also supports ARM devices. You can download [ready to boot images][9] for Raspberry Pi and several other [Raspberry Pi alternatives][10]. + +[][11] + +Suggested read NomadBSD, a BSD for the Road + +### Void Linux Installation + +NOTE: you can either install [Void Linux download page][7] via a live image or use a net installer. I used a live image. + +I was able to successfully install Void Linux on my Dell Latitude D630. This laptop has an Intel Centrino Duo Core processor running at 2.00 GHz, NVIDIA Quadro NVS 135M graphics chip, and 4 GB of RAM. + +![Void Linux Mate][12] + +After I `dd`ed the 800 MB Void Linux MATE image to my thumb drive and inserted it, I booted my computer. I was very quickly presented with a vanilla MATE desktop. To start installing Void, I opened up a terminal and typed `sudo void-installer`. After using the default password `voidlinux`, the installer started. The installer reminded me a little bit of the terminal Debian installer, but it was laid out more like FreeBSD. It was divided into keyboard, network, source, hostname, locale, timezone, root password, user account, bootloader, partition, and filesystems sections. + +Most of the sections where self-explanatory. In the source section, you could choose whether to install the packages from the local image or grab them from the web. I chose local because I did not want to eat up bandwidth or take longer than I had to. The partition and filesystems sections are usually handled automatically by most installers, but not on Void. In this case, the first section allows you to use `cfdisk` to create partitions and the second allows to specify what filesystems will be used in those partitions. I followed the partition layout on [this page][13]. + +If you install Void Linux from the local image, you definitely need to update your system. The [Void wiki][14] recommends running `xbps-install -Suv` until there are no more updates to install. It would probably be a good idea to reboot between batches of updates. + +### Experience with Void Linux + +So far in my Linux journey, Void Linux has been by far the most difficult. It feels more like I’m [using a BSD than a Linux distro][15]. (I guess that should not be surprising since Void was created by a former [NetBSD][16] developer who wanted to experiment with his own package manager.) The steps in the command line installer are closer to that of [FreeBSD][17] than Debian. + +Once Void was installed and updated, I went to work installing apps. Unfortunately, I ran into an issue with missing applications. Most of these applications come preinstalled on other distros. I had to install wget, unzip, git, nano, LibreOffice to name just a few. + +Void does not come with a graphical package manager. There are three unofficial frontends for the xbps package manager and [one is based on qt][18]. I ran into issues getting one of the Bash-based tools to work. It hadn’t been updated in 4-5 years. + +![Octoxbps][19] + +The xbps package manager is kinda interesting. It downloads the package and its signature to verify it. You can see the [terminal print out][20] from when I installed Mcomix. Xbps does not use the normal naming convention used in most package managers (ie `apt install` or `pacman -R`), instead, it uses `xbps-install`, `xbps-query`, `xbps-remove`. Luckily, the Void wiki had a [page][21] to show what xbps command relates to apt or dnf commands. + +[][22] + +Suggested read How To Solve: error: no such partition grub rescue in Ubuntu Linux + +The main repo for Void is located in Germany, so I decided to switch to a more local server to ease the burden on that server and to download packages quicker. Switching to a local mirror took a couple of tries because the documentation was not very clear. Documentation for Void is located in two different places: the [wiki][23] and the [handbook][24]. For me, the wiki’s [explanation][25] was confusing and I ran into issues. So, I searched for an answer on DuckDuckGo. From there I stumbled upon the [handbook’s instructions][26], which were much clearer. (The handbook is not linked on the Void Linux website and I had to stumble across it via search.) + +One of the nice things about Void is the speed of the system once everything was installed. It had the quickest boot time I have ever encountered. Overall, the system was very responsive. I did not run into any system crashes. + +### Final Thoughts + +Void Linux took more work to get to a useable state than any other distro I have tried. Even the BSDs I tried felt more polished than Void. I think the tagline “General purpose Linux” is misleading. It should be “Linux with hackers and tinkerers in mind”. Personally, I prefer using distros that are ready for me to use after installing. While it is an interesting combination of Linux and BSD ideas, I don’t think I’ll add Void to my short list of go-to distros. + +If you like tinkering with your Linux system or like building it from scratch, give [Void Linux][7] a try. + +Have you ever used Void Linux? What is your favorite Debian-based distro? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][27]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/void-linux/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://voidlinux.org/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Neofetch.png?resize=800%2C562&ssl=1 +[3]: https://en.wikipedia.org/wiki/Systemd +[4]: http://smarden.org/runit/ +[5]: https://www.musl-libc.org/ +[6]: https://wiki.voidlinux.org/XBPS +[7]: https://voidlinux.org/download/ +[8]: https://docs.voidlinux.org/installation/base-requirements.html +[9]: https://voidlinux.org/download/#download-ready-to-boot-images-for-arm +[10]: https://itsfoss.com/raspberry-pi-alternatives/ +[11]: https://itsfoss.com/nomadbsd/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/04/Void-Linux-Mate.png?resize=800%2C640&ssl=1 +[13]: https://wiki.voidlinux.org/Disks#Filesystems +[14]: https://wiki.voidlinux.org/Post_Installation#Updates +[15]: https://itsfoss.com/why-use-bsd/ +[16]: https://itsfoss.com/netbsd-8-release/ +[17]: https://www.freebsd.org/ +[18]: https://github.com/aarnt/octoxbps +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/04/OctoXBPS.jpg?resize=800%2C534&ssl=1 +[20]: https://pastebin.com/g31n1bFT +[21]: https://wiki.voidlinux.org/Rosetta_stone +[22]: https://itsfoss.com/solve-error-partition-grub-rescue-ubuntu-linux/ +[23]: https://wiki.voidlinux.org/ +[24]: https://docs.voidlinux.org/ +[25]: https://wiki.voidlinux.org/XBPS#Official_Repositories +[26]: https://docs.voidlinux.org/xbps/repositories/mirrors/changing.html +[27]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md new file mode 100644 index 0000000000..bb1d187ea4 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - An Introduction To Hyperledger Project (HLP) -Part 8.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – An Introduction To Hyperledger Project (HLP) [Part 8] +====== + +![Introduction To Hyperledger Project][1] + +Once a new technology platform reaches a threshold level of popularity in terms of active development and commercial interests, major global companies and smaller start-ups alike rush to catch a slice of the pie. **Linux** was one such platform back in the day. Once the ubiquity of its applications was realized individuals, firms, and institutions started displaying their interest in it and by 2000 the **Linux foundation** was formed. + +The Linux foundation aims to standardize and develop Linux as a platform by sponsoring their development team. The Linux Foundation is a non-profit organization that is supported by software and IT behemoths such as Microsoft, Oracle, Samsung, Cisco, IBM, Intel among others[1]. This is excluding the hundreds of individual developers who offer their services for the betterment of the platform. Over the years the Linux foundation has taken many projects under its roof. The **Hyperledger Project** is their fastest growing one till date. + +Such consortium led development have a lot of advantages when it comes to furthering tech into usable useful forms. Developing the standards, libraries and all the back-end protocols for large scale projects are expensive and resource intensive without a shred of income generating from it. Hence, it makes sense for companies to pool in their resources to develop the common “boring” parts by supporting such organizations and later upon completing work on these standard parts to simply plug & play and customize their products afterwards. Apart from the economics of the model, such collaborative efforts also yield standards allowing for easier use and integration into aspiring products and services. + +Other major innovations that were once or are currently being developed following the said consortium model include standards for WiFi (The Wi-Fi alliance), Mobile Telephony etc. + +### Introduction to Hyperledger Project (HLP) + +The Hyperledger project was launched in December 2015 by the Linux foundation as is currently among the fastest growing project they’ve incubated. It’s an umbrella organization for collaborative efforts into developing and advancing tools & standards for [**blockchain**][2] based distributed ledger technologies(DLT). Major industry players supporting the project include **IBM** , **Intel** and **SAP Ariba** among [**others**][3]. The HLP aims to create frameworks for individuals and companies to create shared as well as closed blockchains as required to further their own requirements. The design principles include a strong tilt toward developing a globally deployable, scalable, robust platform with a focus on privacy, and future auditability[2]. It is also important to note that most of the blockchains proposed and the frame. + +### Development goals and structure: Making it plug & play + +Although enterprise facing platforms exist from the likes of the Ethereum alliance, HLP is by definition business facing and supported by industry behemoths who contribute and further development in the many modules that come under the HLP banner. The HLP incubates projects in development after their induction into the cause and after finishing work on it and correcting the knick-knacks rolls it out for the public. Members of the Hyperledger project contribute their own work such as how IBM contributed their Fabric platform for collaborative development. The codebase is absorbed and developed in house by the group in the project and rolled out for all members equally for their use. + +Such processes make the modules in HLP highly flexible plug-in frameworks which will support rapid development and roll-outs in enterprise settings. Furthermore, other comparable platforms are open **permission-less blockchains** or rather **public chains** by default and even though it is possible to adapt them to specific applications, HLP modules support the feature natively. + +The differences and use cases of public & private blockchains are covered more [**here**][4] in this comparative primer on the same. + +The Hyperledger project’s mission is four-fold according to **Brian Behlendorf** , the executive director of the project. + +They are: + + 1. To create an enterprise grade DLT framework and standards which anyone can port to suit their specific industrial or personal needs. + 2. To give rise to a robust open source community to aid the ecosystem. + 3. To promote and further participation of industry members of the said ecosystem such as member firms. + 4. To host a neutral unbiased infrastructure for the HLP community to gather and share updates and developments regarding the same. + + + +The original document can be accessed [**here**][5]****. + +### Structure of the HLP + +The **HLP consists of 12 projects** that are classified as independent modules, each usually structured and working independently to develop their module. These are first studied for their capabilities and viability before being incubated. Proposals for additions can be made by any member of the organization. After the project is incubated active development ensues after which it is rolled out. The interoperability between these modules are given a high priority, hence regular communication between these groups are maintained by the community. Currently 4 of these projects are categorized as active. The active tag implies these are ready for use but not ready for a major release yet. These 4 are arguably the most significant or rather fundamental modules to furthering the blockchain revolution. We’ll look at the individual modules and their functionalities at a later time in detail. However, a brief description of a the Hyperledger Fabric platform, arguably the most popular among them follows. + +### Hyperledger Fabric + +The **Hyperledger Fabric** [2] is a fully open-source, permissioned (non-public) blockchain-based DLT platform that is designed keeping enterprise uses in mind. The platform provides features and is structured to fit the enterprise environment. It is highly modular allowing its developers to choose from different consensus protocols, **chain code protocols ([smart contracts][6])** , or identity management systems etc., as they go along. **It is a permissioned blockchain based platform** that’s makes use of an identity management system, meaning participants will be aware of each other’s identities which is required in an enterprise setting. Fabric allows for smart contract ( _ **“chaincode”, is the term that the Hyperledger team uses**_ ) development in a variety of mainstream programming languages including **Java** , **Javascript** , **Go** etc. This allows institutions and enterprises to make use of their existing talent in the area without hiring or re-training developers to develop their own smart contracts. Fabric also uses an execute-order-validate system to handle smart contracts for better reliability compared to the standard order-validate system that is used by other platforms providing smart contract functionality. Pluggable performance, identity management systems, DBMS, Consensus platforms etc. are other features of Fabric that keeps it miles ahead of its competition. + +### Conclusion + +Projects such as the Hyperledger Fabric platforms enable a faster rate of adoption of blockchain technology in mainstream use-cases. The Hyperledger community structure itself supports open governance principles and since all the projects are led as open source platforms, this improves the security and accountability that the teams exhibit in pushing out commitments. + +Since major applications of such projects involve working with enterprises to further development of platforms and standards, the Hyperledger project is currently at a great position with respect to comparable projects by others. + +**References:** + + * **[1][Samsung takes a seat with Intel and IBM at the Linux Foundation | TheINQUIRER][7]** + * **[2] E. Androulaki et al., “Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains,” 2018.** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Introduction-To-Hyperledger-Project-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.hyperledger.org/members +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: http://www.hitachi.com/rev/archive/2017/r2017_01/expert/index.html +[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[7]: https://www.theinquirer.net/inquirer/news/2182438/samsung-takes-seat-intel-ibm-linux-foundation diff --git a/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md new file mode 100644 index 0000000000..a4669a2eb0 --- /dev/null +++ b/sources/tech/20190505 Blockchain 2.0 - What Is Ethereum -Part 9.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – What Is Ethereum [Part 9]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – What Is Ethereum [Part 9] +====== + +![Ethereum][1] + +In the previous guide of this series, we discussed about [**Hyperledger Project (HLP)**][2], a fastest growing product developed by **Linux Foundation**. In this guide, we are going to discuss about what is **Ethereum** and its features in detail. Many researchers opine that the future of the internet will be based on principles of decentralized computing. Decentralized computing was in fact among one of the broader objectives of having the internet in the first place. However, the internet took another turn owing to differences in computing capabilities available. While modern server capabilities make the case for server-side processing and execution, lack of decent mobile networks in large parts of the world make the case for the same on the client side. Modern smartphones now have **SoCs** (system on a chip or system on chip) capable of handling many such operations on the client side itself, however, limitations owing to retrieving and storing data securely still pushes developers to have server-side computing and data management. Hence, a bottleneck in regards to data transfer capabilities is currently observed. + +All of that might soon change because of advancements in distributed data storage and program execution platforms. [**The blockchain**][3], for the first time in the history of the internet, basically allows for secure data management and program execution on a distributed network of users as opposed to central servers. + +**Ethereum** is one such blockchain platform that gives developers access to frameworks and tools used to build and run applications on such a decentralized network. Though more popularly known in general for its cryptocurrency, Ethereum is more than just **ethers** (the cryptocurrency). It’s a full **Turing complete programming language** that is designed to develop and deploy **DApps** or **Distributed APPlications** [1]. We’ll look at DApps in more detail in one of the upcoming posts. + +Ethereum is an open-source, supports by default a public (non-permissioned) blockchain, and features an extensive smart contract platform **(Solidity)** underneath. Ethereum provides a virtual computing environment called the **Ethereum virtual machine** to run applications and [**smart contracts**][4] as well[2]. The Ethereum virtual machine runs on thousands of participating nodes all over the world, meaning the application data while being secure, is almost impossible to be tampered with or lost. + +### Getting behind Ethereum: What sets it apart + +In 2017, a 30 plus group of the who’s who of the tech and financial world got together to leverage the Ethereum blockchain’s capabilities. Thus, the **Ethereum Enterprise Alliance (EEA)** was formed by a long list of supporting members including _Microsoft_ , _JP Morgan_ , _Cisco Systems_ , _Deloitte_ , and _Accenture_. JP Morgan already has **Quorum** , a decentralized computing platform for financial services based on Ethereum currently in operation, while Microsoft has Ethereum based cloud services it markets through its Azure cloud business[3]. + +### What is ether and how is it related to Ethereum + +Ethereum creator **Vitalik Buterin** understood the true value of a decentralized processing platform and the underlying blockchain tech that powered bitcoin. He failed to gain majority agreement for his idea of proposing that Bitcoin should be developed to support running distributed applications (DApps) and programs (now referred to as smart contracts). + +Hence in 2013, he proposed the idea of Ethereum in a white paper he published. The original white paper is still maintained and available for readers **[here][5]**. The idea was to develop a blockchain based platform to run smart contracts and applications designed to run on nodes and user devices instead of servers. + +The Ethereum system is often mistaken to just mean the cryptocurrency ether, however, it has to be reiterated that Ethereum is a full stack platform for developing applications and executing them as well and has been so since inception whereas bitcoin isn’t. **Ether is currently the second biggest cryptocurrency** by market capitalization and trades at an average of $170 per ether at the time of writing this article[4]. + +### Features and technicalities of the platform[5] + + * As we’ve already mentioned, the cryptocurrency called ether is simply one of the things the platform features. The purpose of the system is more than taking care of financial transactions. In fact, the key difference between the Ethereum platform and Bitcoin is in their scripting capabilities. Ethereum is developed in a Turing complete programming language which means it has scripting and application capabilities similar to other major programming languages. Developers require this feature to create DApps and complex smart contracts on the platform, a feature that bitcoin misses on. + * The “mining” process of ether is more stringent and complex. While specialized ASICs may be used to mine bitcoin, the basic hashing algorithm used by Ethereum **(EThash)** reduces the advantage that ASICs have in this regard. + * The transaction fees itself to be paid as an incentive to miners and node operators for running the network is calculated using a computational token called **Gas**. Gas improves the system’s resilience and resistance to external hacks and attacks by requiring the initiator of the transaction to pay ethers proportionate to the number of computational resources that are required to carry out that transaction. This is in contrast to other platforms such as Bitcoin where the transaction fee is measured in tandem with the transaction size. As such, the average transaction costs in Ethereum is radically less than Bitcoin. This also implies that running applications running on the Ethereum virtual machine will require a fee depending straight up on the computational problems that the application is meant to solve. Basically, the more complex an execution, the more the fee. + * The block time for Ethereum is estimated to be around _**10-15 seconds**_. The block time is the average time that is required to timestamp and create a block on the blockchain network. Compared to the 10+ minutes the same transaction will take on the bitcoin network, it becomes apparent that _**Ethereum is much faster**_ with respect to transactions and verification of blocks. + * _It is also interesting to note that there is no hard cap on the amount of ether that can be mined or the rate at which ether can be mined leading to less radical system design than bitcoin._ + + + +### Conclusion + +While Ethereum is comparable and far outpaces similar platforms, the platform itself lacked a definite path for development until the Ethereum enterprise alliance started pushing it. While the definite push for enterprise developments are made by the Ethereum platform, it has to be noted that Ethereum also caters to small-time developers and individuals as well. As such developing the platform for end users and enterprises leave a lot of specific functionality out of the loop for Ethereum. Also, the blockchain model proposed and developed by the Ethereum foundation is a public model whereas the one proposed by projects such as the Hyperledger project is private and permissioned. + +While only time can tell which platform among the ones put forward by Ethereum, Hyperledger, and R3 Corda among others will find the most fans in real-world use cases, such systems do prove the validity behind the claim of a blockchain powered future. + +**References:** + + * [1] [**Gabriel Nicholas, “Ethereum Is Coding’s New Wild West | WIRED,” Wired , 2017**][6]. + * [2] [**What is Ethereum? — Ethereum Homestead 0.1 documentation**][7]. + * [3] [**Ethereum, a Virtual Currency, Enables Transactions That Rival Bitcoin’s – The New York Times**][8]. + * [4] [**Cryptocurrency Market Capitalizations | CoinMarketCap**][9]. + * [5] [**Introduction — Ethereum Homestead 0.1 documentation**][10]. + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/04/Ethereum-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[5]: https://github.com/ethereum/wiki/wiki/White-Paper +[6]: https://www.wired.com/story/ethereum-is-codings-new-wild-west/ +[7]: http://www.ethdocs.org/en/latest/introduction/what-is-ethereum.html#ethereum-virtual-machine +[8]: https://www.nytimes.com/2016/03/28/business/dealbook/ethereum-a-virtual-currency-enables-transactions-that-rival-bitcoins.html +[9]: https://coinmarketcap.com/ +[10]: http://www.ethdocs.org/en/latest/introduction/index.html diff --git a/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md new file mode 100644 index 0000000000..2169f04e51 --- /dev/null +++ b/sources/tech/20190505 Five Methods To Check Your Current Runlevel In Linux.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Five Methods To Check Your Current Runlevel In Linux?) +[#]: via: (https://www.2daygeek.com/check-current-runlevel-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Five Methods To Check Your Current Runlevel In Linux? +====== + +A run level is an operating system state on Linux system. + +There are seven runlevels exist, numbered from zero to six. + +A system can be booted into any of the given runlevel. Run levels are identified by numbers. + +Each runlevel designates a different system configuration and allows access to a different combination of processes. + +By default Linux boots either to runlevel 3 or to runlevel 5. + +Only one runlevel is executed at a time on startup. It doesn’t execute one after another. + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit system. + +But systemd systems doesn’t read this file and it uses the following file `/etc/systemd/system/default.target` to get default runlevel information. + +We can check the Linux system current runlevel using the below five methods. + + * **`runlevel Command:`** runlevel prints the previous and current runlevel of the system. + * **`who Command:`** Print information about users who are currently logged in. It will print the runlevel information with “-r” option. + * **`systemctl Command:`** It controls the systemd system and service manager. + * **`Using /etc/inittab File:`** The default runlevel for a system is specified in the /etc/inittab file for SysVinit System. + * **`Using /etc/systemd/system/default.target File:`** The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + + + +Detailed runlevels information is described in the below table. + +**Runlevel** | **SysVinit System** | **systemd System** +---|---|--- +0 | Shutdown or Halt the system | shutdown.target +1 | Single user mode | rescue.target +2 | Multiuser, without NFS | multi-user.target +3 | Full multiuser mode | multi-user.target +4 | unused | multi-user.target +5 | X11 (Graphical User Interface) | graphical.target +6 | reboot the system | reboot.target + +The system will execute the programs/service based on the runlevel. + +For SysVinit system, it will be execute from the following location. + + * Run level 0 – /etc/rc.d/rc0.d/ + * Run level 1 – /etc/rc.d/rc1.d/ + * Run level 2 – /etc/rc.d/rc2.d/ + * Run level 3 – /etc/rc.d/rc3.d/ + * Run level 4 – /etc/rc.d/rc4.d/ + * Run level 5 – /etc/rc.d/rc5.d/ + * Run level 6 – /etc/rc.d/rc6.d/ + + + +For systemd system, it will be execute from the following location. + + * runlevel1.target – /etc/systemd/system/rescue.target + * runlevel2.target – /etc/systemd/system/multi-user.target.wants + * runlevel3.target – /etc/systemd/system/multi-user.target.wants + * runlevel4.target – /etc/systemd/system/multi-user.target.wants + * runlevel5.target – /etc/systemd/system/graphical.target.wants + + + +### 1) How To Check Your Current Runlevel In Linux Using runlevel Command? + +runlevel prints the previous and current runlevel of the system. + +``` +$ runlevel +N 5 +``` + + * **`N:`** “N” indicates that the runlevel has not been changed since the system was booted. + * **`5:`** “5” indicates the current runlevel of the system. + + + +### 2) How To Check Your Current Runlevel In Linux Using who Command? + +Print information about users who are currently logged in. It will print the runlevel information with `-r` option. + +``` +$ who -r + run-level 5 2019-04-22 09:32 +``` + +### 3) How To Check Your Current Runlevel In Linux Using systemctl Command? + +systemctl is used to controls the systemd system and service manager. systemd is system and service manager for Unix like operating systems. + +It can work as a drop-in replacement for sysvinit system. systemd is the first process get started by kernel and holding PID 1. + +systemd uses `.service` files Instead of bash scripts (SysVinit uses). systemd sorts all daemons into their own Linux cgroups and you can see the system hierarchy by exploring `/cgroup/systemd` file. + +``` +$ systemctl get-default +graphical.target +``` + +### 4) How To Check Your Current Runlevel In Linux Using /etc/inittab File? + +The default runlevel for a system is specified in the /etc/inittab file for SysVinit System but systemd systemd doesn’t read the files. + +So, it will work only on SysVinit system and not in systemd system. + +``` +$ cat /etc/inittab +# inittab is only used by upstart for the default runlevel. +# +# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. +# +# System initialization is started by /etc/init/rcS.conf +# +# Individual runlevels are started by /etc/init/rc.conf +# +# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf +# +# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf, +# with configuration in /etc/sysconfig/init. +# +# For information on how to write upstart event handlers, or how +# upstart works, see init(5), init(8), and initctl(8). +# +# Default runlevel. The runlevels used are: +# 0 - halt (Do NOT set initdefault to this) +# 1 - Single user mode +# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) +# 3 - Full multiuser mode +# 4 - unused +# 5 - X11 +# 6 - reboot (Do NOT set initdefault to this) +# +id:5:initdefault: +``` + +### 5) How To Check Your Current Runlevel In Linux Using /etc/systemd/system/default.target File? + +The default runlevel for a system is specified in the /etc/systemd/system/default.target file for systemd System. + +It doesn’t work on SysVinit system. + +``` +$ cat /etc/systemd/system/default.target +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-current-runlevel-in-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 diff --git a/sources/tech/20190505 How To Navigate Directories Faster In Linux.md b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md new file mode 100644 index 0000000000..e0979b3915 --- /dev/null +++ b/sources/tech/20190505 How To Navigate Directories Faster In Linux.md @@ -0,0 +1,350 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Navigate Directories Faster In Linux) +[#]: via: (https://www.ostechnix.com/navigate-directories-faster-linux/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Navigate Directories Faster In Linux +====== + +![Navigate Directories Faster In Linux][1] + +Today we are going to learn some command line productivity hacks. As you already know, we use “cd” command to move between a stack of directories in Unix-like operating systems. In this guide I am going to teach you how to navigate directories faster without having to use “cd” command often. There could be many ways, but I only know the following five methods right now! I will keep updating this guide when I came across any methods or utilities to achieve this task in the days to come. + +### Five Different Methods To Navigate Directories Faster In Linux + +##### Method 1: Using “Pushd”, “Popd” And “Dirs” Commands + +This is the most frequent method that I use everyday to navigate between a stack of directories. The “Pushd”, “Popd”, and “Dirs” commands comes pre-installed in most Linux distributions, so don’t bother with installation. These trio commands are quite useful when you’re working in a deep directory structure and scripts. For more details, check our guide in the link given below. + + * **[How To Use Pushd, Popd And Dirs Commands For Faster CLI Navigation][2]** + + + +##### Method 2: Using “bd” utility + +The “bd” utility also helps you to quickly go back to a specific parent directory without having to repeatedly typing “cd ../../.” on your Bash. + +Bd is also available in the [**Debian extra**][3] and [**Ubuntu universe**][4] repositories. So, you can install it using “apt-get” package manager in Debian, Ubuntu and other DEB based systems as shown below: + +``` +$ sudo apt-get update + +$ sudo apt-get install bd +``` + +For other distributions, you can install as shown below. + +``` +$ sudo wget --no-check-certificate -O /usr/local/bin/bd https://raw.github.com/vigneshwaranr/bd/master/bd + +$ sudo chmod +rx /usr/local/bin/bd + +$ echo 'alias bd=". bd -si"' >> ~/.bashrc + +$ source ~/.bashrc +``` + +To enable auto completion, run: + +``` +$ sudo wget -O /etc/bash_completion.d/bd https://raw.github.com/vigneshwaranr/bd/master/bash_completion.d/bd + +$ source /etc/bash_completion.d/bd +``` + +The Bd utility has now been installed. Let us see few examples to understand how to quickly move through stack of directories using this tool. + +Create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +The above command will create a hierarchy of directories. Let us check [**directory structure**][5] using command: + +``` +$ tree dir1/ +dir1/ +└── dir2 + └── dir3 + └── dir4 + └── dir5 + └── dir6 + └── dir7 + └── dir8 + └── dir9 + └── dir10 + +9 directories, 0 files +``` + +Alright, we have now 10 directories. Let us say you’re currently in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Normally you would type: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +Right? yes! But it not necessary though! To go back to dir3, just type: + +``` +$ bd dir3 +``` + +Now you will be in dir3. + +![][6] + +Navigate Directories Faster In Linux Using “bd” Utility + +Easy, isn’t it? It supports auto complete, so you can just type the partial name of a directory and hit the tab key to auto complete the full path. + +To check the contents of a specific parent directory, you don’t need to inside that particular directory. Instead, just type: + +``` +$ ls `bd dir1` +``` + +The above command will display the contents of dir1 from your current working directory. + +For more details, check out the following GitHub page. + + * [**bd GitHub repository**][7] + + + +##### Method 3: Using “Up” Shell script + +The “Up” is a shell script allows you to move quickly to your parent directory. It works well on many popular shells such as Bash, Fish, and Zsh etc. Installation is absolutely easy too! + +To install “Up” on **Bash** , run the following commands one bye: + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc +``` + +The up script registers the “up” function and some completion functions via your “.bashrc” file. + +Update the changes using command: + +``` +$ source ~/.bashrc +``` + +On **zsh** : + +``` +$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh + +$ echo 'source ~/.config/up/up.sh' >> ~/.zshrc +``` + +The up script registers the “up” function and some completion functions via your “.zshrc” file. + +Update the changes using command: + +``` +$ source ~/.zshrc +``` + +On **fish** : + +``` +$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish + +$ source ~/.config/up/up.fish +``` + +The up script registers the “up” function and some completion functions via “funcsave”. + +Now it is time to see some examples. + +Let us create some directories. + +``` +$ mkdir -p dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dir10 +``` + +Let us say you’re in 7th directory i.e dir7. + +``` +$ pwd +/home/sk/dir1/dir2/dir3/dir4/dir5/dir6/dir7 +``` + +You want to move to dir3. Using “cd” command, we can do this by typing the following command: + +``` +$ cd /home/sk/dir1/dir2/dir3 +``` + +But it is really easy to go back to dir3 using “up” script: + +``` +$ up dir3 +``` + +That’s it. Now you will be in dir3. To go one directory up, just type: + +``` +$ up 1 +``` + +To go back two directory type: + +``` +$ up 2 +``` + +It’s that simple. Did I type the full path? Nope. Also it supports tab completion. So just type the partial directory name and hit the tab to complete the full path. + +For more details, check out the GitHub page. + + * [**Up GitHub Repository**][8] + + + +Please be mindful that “bd” and “up” tools can only help you to go backward i.e to the parent directory of the current working directory. You can’t move forward. If you want to switch to dir10 from dir5, you can’t! Instead, you need to use “cd” command to switch to dir10. These two utilities are meant for quickly moving you to the parent directory! + +##### Method 4: Using “Shortcut” tool + +This is yet another handy method to switch between different directories quickly and easily. This is somewhat similar to [**alias**][9] command. In this method, we create shortcuts to frequently used directories and use the shortcut name to go to that respective directory without having to type the path. If you’re working in deep directory structure and stack of directories, this method will greatly save some time. You can learn how it works in the guide given below. + + * [**Create Shortcuts To The Frequently Used Directories In Your Shell**][10] + + + +##### Method 5: Using “CDPATH” Environment variable + +This method doesn’t require any installation. **CDPATH** is an environment variable. It is somewhat similar to **PATH** variable which contains many different paths concatenated using **‘:’** (colon). The main difference between PATH and CDPATH variables is the PATH variable is usable with all commands whereas CDPATH works only for **cd** command. + +I have the following directory structure. + +![][11] + +Directory structure + +As you see, there are four child directories under a parent directory named “ostechnix”. + +Now add this parent directory to CDPATH using command: + +``` +$ export CDPATH=~/ostechnix +``` + +You now can instantly cd to the sub-directories of the parent directory (i.e **~/ostechnix** in our case) from anywhere in the filesystem. + +For instance, currently I am in **/var/mail/** location. + +![][12] + +To cd into **~/ostechnix/Linux/** directory, we don’t have to use the full path of the directory as shown below: + +``` +$ cd ~/ostechnix/Linux +``` + +Instead, just mention the name of the sub-directory you want to switch to: + +``` +$ cd Linux +``` + +It will automatically cd to **~/ostechnix/Linux** directory instantly. + +![][13] + +As you can see in the above output, I didn’t use “cd ”. Instead, I just used “cd ” command. + +Please note that CDPATH will allow you to quickly navigate to only one child directory of the parent directory set in CDPATH variable. It doesn’t much help for navigating a stack of directories (directories inside sub-directories, of course). + +To find the values of CDPATH variable, run: + +``` +$ echo $CDPATH +``` + +Sample output would be: + +``` +/home/sk/ostechnix +``` + +**Set multiple values to CDPATH** + +Similar to PATH variable, we can also set multiple values (more than one directory) to CDPATH separated by colon (:). + +``` +$ export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +**Make the changes persistent** + +As you already know, the above command (export) will only keep the values of CDPATH until next reboot. To permanently set the values of CDPATH, just add them to your **~/.bashrc** or **~/.bash_profile** files. + +``` +$ vi ~/.bash_profile +``` + +Add the values: + +``` +export CDPATH=.:~/ostechnix:/etc:/var:/opt +``` + +Hit **ESC** key and type **:wq** to save and exit. + +Apply the changes using command: + +``` +$ source ~/.bash_profile +``` + +**Clear CDPATH** + +To clear the values of CDPATH, use **export CDPATH=””**. Or, simply delete the entire line from **~/.bashrc** or **~/.bash_profile** files. + +In this article, you have learned the different ways to navigate directory stack faster and easier in Linux. As you can see, it’s not that difficult to browse a pile of directories faster. Now stop typing “cd ../../..” endlessly by using these tools. If you know any other worth trying tool or method to navigate directories faster, feel free to let us know in the comment section below. I will review and add them in this guide. + +And, that’s all for now. Hope this helps. More good stuffs to come. Stay tuned! + +Cheers! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/navigate-directories-faster-linux/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2017/12/Navigate-Directories-Faster-In-Linux-720x340.png +[2]: https://www.ostechnix.com/use-pushd-popd-dirs-commands-faster-cli-navigation/ +[3]: https://tracker.debian.org/pkg/bd +[4]: https://launchpad.net/ubuntu/+source/bd +[5]: https://www.ostechnix.com/view-directory-tree-structure-linux/ +[6]: http://www.ostechnix.com/wp-content/uploads/2017/12/Navigate-Directories-Faster-1.png +[7]: https://github.com/vigneshwaranr/bd +[8]: https://github.com/shannonmoeller/up +[9]: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-examples/ +[10]: https://www.ostechnix.com/create-shortcuts-frequently-used-directories-shell/ +[11]: http://www.ostechnix.com/wp-content/uploads/2018/12/tree-command-output.png +[12]: http://www.ostechnix.com/wp-content/uploads/2018/12/pwd-command.png +[13]: http://www.ostechnix.com/wp-content/uploads/2018/12/cdpath.png diff --git a/sources/tech/20190506 Use udica to build SELinux policy for containers.md b/sources/tech/20190506 Use udica to build SELinux policy for containers.md new file mode 100644 index 0000000000..4e31288a43 --- /dev/null +++ b/sources/tech/20190506 Use udica to build SELinux policy for containers.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use udica to build SELinux policy for containers) +[#]: via: (https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/) +[#]: author: (Lukas Vrabec https://fedoramagazine.org/author/lvrabec/) + +Use udica to build SELinux policy for containers +====== + +![][1] + +While modern IT environments move towards Linux containers, the need to secure these environments is as relevant as ever. Containers are a process isolation technology. While containers can be a defense mechanism, they only excel when combined with SELinux. + +Fedora SELinux engineering built a new standalone tool, **udica** , to generate SELinux policy profiles for containers by automatically inspecting them. This article focuses on why _udica_ is needed in the container world, and how it makes SELinux and containers work better together. You’ll find examples of SELinux separation for containers that let you avoid turning protection off because the generic SELinux type _container_t_ is too tight. With _udica_ you can easily customize the policy with limited SELinux policy writing skills. + +### SELinux technology + +SELinux is a security technology that brings proactive security to Linux systems. It’s a labeling system that assigns a label to all _subjects_ (processes and users) and _objects_ (files, directories, sockets, etc.). These labels are then used in a security policy that controls access throughout the system. It’s important to mention that what’s not allowed in an SELinux security policy is denied by default. The policy rules are enforced by the kernel. This security technology has been in use on Fedora for several years. A real example of such a rule is: + +``` +allow httpd_t httpd_log_t: file { append create getattr ioctl lock open read setattr }; +``` + +The rule allows any process labeled as _httpd_t_ ****to create, append, read and lock files labeled as _httpd_log_t_. Using the _ps_ command, you can list all processes with their labels: + +``` +$ ps -efZ | grep httpd +system_u:system_r:httpd_t:s0 root 13911 1 0 Apr14 ? 00:05:14 /usr/sbin/httpd -DFOREGROUND +... +``` + +To see which objects are labeled as httpd_log_t, use _semanage_ : + +``` +# semanage fcontext -l | grep httpd_log_t +/var/log/httpd(/.)? all files system_u:object_r:httpd_log_t:s0 +/var/log/nginx(/.)? all files system_u:object_r:httpd_log_t:s0 +... +``` + +The SELinux security policy for Fedora is shipped in the _selinux-policy_ RPM package. + +### SELinux vs. containers + +In Fedora, the _container-selinux_ RPM package provides a generic SELinux policy for all containers started by engines like _podman_ or _docker_. Its main purposes are to protect the host system against a container process, and to separate containers from each other. For instance, containers confined by SELinux with the process type _container_t_ can only read/execute files in _/usr_ and write to _container_file_t_ ****files type on host file system. To prevent attacks by containers on each other, Multi-Category Security (MCS) is used. + +Using only one generic policy for containers is problematic, because of the huge variety of container usage. On one hand, the default container type ( _container_t_ ) is often too strict. For example: + + * [Fedora SilverBlue][2] needs containers to read/write a user’s home directory + * [Fluentd][3] project needs containers to be able to read logs in the _/var/log_ directory + + + +On the other hand, the default container type could be too loose for certain use cases: + + * It has no SELinux network controls — all container processes can bind to any network port + * It has no SELinux control on [Linux capabilities][4] — all container processes can use all capabilities + + + +There is one solution to handle both use cases: write a custom SELinux security policy for the container. This can be tricky, because SELinux expertise is required. For this purpose, the _udica_ tool was created. + +### Introducing udica + +Udica generates SELinux security profiles for containers. Its concept is based on the “block inheritance” feature inside the [common intermediate language][5] (CIL) supported by SELinux userspace. The tool creates a policy that combines: + + * Rules inherited from specified CIL blocks (templates), and + * Rules discovered by inspection of container JSON file, which contains mountpoints and ports definitions + + + +You can load the final policy immediately, or move it to another system to load into the kernel. Here’s an example, using a container that: + + * Mounts _/home_ as read only + * Mounts _/var/spool_ as read/write + * Exposes port _tcp/21_ + + + +The container starts with this command: + +``` +# podman run -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The default container type ( _container_t_ ) doesn’t allow any of these three actions. To prove it, you could use the _sesearch_ tool to query that the _allow_ rules are present on system: + +``` +# sesearch -A -s container_t -t home_root_t -c dir -p read +``` + +There’s no _allow_ rule present that lets a process labeled as _container_t_ access a directory labeled _home_root_t_ (like the _/home_ directory). The same situation occurs with _/var/spool_ , which is labeled _var_spool_t:_ + +``` +# sesearch -A -s container_t -t var_spool_t -c dir -p read +``` + +On the other hand, the default policy completely allows network access. + +``` +# sesearch -A -s container_t -t port_type -c tcp_socket +allow container_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +allow sandbox_net_domain port_type:tcp_socket { name_bind name_connect recv_msg send_msg }; +``` + +### Securing the container + +It would be great to restrict this access and allow the container to bind just on TCP port _21_ or with the same label. Imagine you find an example container using _podman ps_ whose ID is _37a3635afb8f_ : + +``` +# podman ps -q +37a3635afb8f +``` + +You can now inspect the container and pass the inspection file to the _udica_ tool. The name for the new policy is _my_container_. + +``` +# podman inspect 37a3635afb8f > container.json +# udica -j container.json my_container +Policy my_container with container id 37a3635afb8f created! + +Please load these modules using: + # semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} + +Restart the container with: "--security-opt label=type:my_container.process" parameter +``` + +That’s it! You just created a custom SELinux security policy for the example container. Now you can load this policy into the kernel and make it active. The _udica_ output above even tells you the command to use: + +``` +# semodule -i my_container.cil /usr/share/udica/templates/{base_container.cil,net_container.cil,home_container.cil} +``` + +Now you must restart the container to allow the container engine to use the new custom policy: + +``` +# podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +``` + +The example container is now running in the newly created _my_container.process_ SELinux process type: + +``` +# ps -efZ | grep my_container.process +unconfined_u:system_r:container_runtime_t:s0-s0:c0.c1023 root 2275 434 1 13:49 pts/1 00:00:00 podman run --security-opt label=type:my_container.process -v /home:/home:ro -v /var/spool:/var/spool:rw -p 21:21 -it fedora bash +system_u:system_r:my_container.process:s0:c270,c963 root 2317 2305 0 13:49 pts/0 00:00:00 bash +``` + +### Seeing the results + +The command _sesearch_ now shows _allow_ rules for accessing _/home_ and _/var/spool:_ + +``` +# sesearch -A -s my_container.process -t home_root_t -c dir -p read +allow my_container.process home_root_t:dir { getattr ioctl lock open read search }; +# sesearch -A -s my_container.process -t var_spool_t -c dir -p read +allow my_container.process var_spool_t:dir { add_name getattr ioctl lock open read remove_name search write } +``` + +The new custom SELinux policy also allows _my_container.process_ to bind only to TCP/UDP ports labeled the same as TCP port 21: + +``` +# semanage port -l | grep 21 | grep ftp + ftp_port_t tcp 21, 989, 990 +# sesearch -A -s my_container.process -c tcp_socket -p name_bind + allow my_container.process ftp_port_t:tcp_socket name_bind; +``` + +### Conclusion + +The _udica_ tool helps you create SELinux policies for containers based on an inspection file without any SELinux expertise required. Now you can increase the security of containerized environments. Sources are available on [GitHub][6], and an RPM package is available in Fedora repositories for Fedora 28 and later. + +* * * + +*Photo by _[_Samuel Zeller_][7]_ on *[ _Unsplash_.][8] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-udica-to-build-selinux-policy-for-containers/ + +作者:[Lukas Vrabec][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/lvrabec/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/udica-816x345.jpg +[2]: https://silverblue.fedoraproject.org +[3]: https://www.fluentd.org +[4]: http://man7.org/linux/man-pages/man7/capabilities.7.html +[5]: https://en.wikipedia.org/wiki/Common_Intermediate_Language +[6]: https://github.com/containers/udica +[7]: https://unsplash.com/photos/KVG-XMOs6tw?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/lockers?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20190507 Prefer table driven tests.md b/sources/tech/20190507 Prefer table driven tests.md new file mode 100644 index 0000000000..0a41860207 --- /dev/null +++ b/sources/tech/20190507 Prefer table driven tests.md @@ -0,0 +1,521 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Prefer table driven tests) +[#]: via: (https://dave.cheney.net/2019/05/07/prefer-table-driven-tests) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Prefer table driven tests +====== + +I’m a big fan of testing, specifically [unit testing][1] and TDD ([done correctly][2], of course). A practice that has grown around Go projects is the idea of a table driven test. This post explores the how and why of writing a table driven test. + +Let’s say we have a function that splits strings: + +``` +// Split slices s into all substrings separated by sep and +// returns a slice of the substrings between those separators. +func Split(s, sep string) []string { + var result []string + i := strings.Index(s, sep) + for i > -1 { + result = append(result, s[:i]) + s = s[i+len(sep):] + i = strings.Index(s, sep) + } + return append(result, s) +} +``` + +In Go, unit tests are just regular Go functions (with a few rules) so we write a unit test for this function starting with a file in the same directory, with the same package name, `strings`. + +``` +package split + +import ( + "reflect" + "testing" +) + +func TestSplit(t *testing.T) { + got := Split("a/b/c", "/") + want := []string{"a", "b", "c"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +Tests are just regular Go functions with a few rules: + + 1. The name of the test function must start with `Test`. + 2. The test function must take one argument of type `*testing.T`. A `*testing.T` is a type injected by the testing package itself, to provide ways to print, skip, and fail the test. + + + +In our test we call `Split` with some inputs, then compare it to the result we expected. + +### Code coverage + +The next question is, what is the coverage of this package? Luckily the go tool has a built in branch coverage. We can invoke it like this: + +``` +% go test -coverprofile=c.out +PASS +coverage: 100.0% of statements +ok split 0.010s +``` + +Which tells us we have 100% branch coverage, which isn’t really surprising, there’s only one branch in this code. + +If we want to dig in to the coverage report the go tool has several options to print the coverage report. We can use `go tool cover -func` to break down the coverage per function: + +``` +% go tool cover -func=c.out +split/split.go:8: Split 100.0% +total: (statements) 100.0% +``` + +Which isn’t that exciting as we only have one function in this package, but I’m sure you’ll find more exciting packages to test. + +#### Spray some .bashrc on that + +This pair of commands is so useful for me I have a shell alias which runs the test coverage and the report in one command: + +``` +cover () { + local t=$(mktemp -t cover) + go test $COVERFLAGS -coverprofile=$t $@ \ + && go tool cover -func=$t \ + && unlink $t +} +``` + +### Going beyond 100% coverage + +So, we wrote one test case, got 100% coverage, but this isn’t really the end of the story. We have good branch coverage but we probably need to test some of the boundary conditions. For example, what happens if we try to split it on comma? + +``` +func TestSplitWrongSep(t *testing.T) { + got := Split("a/b/c", ",") + want := []string{"a/b/c"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +Or, what happens if there are no separators in the source string? + +``` +func TestSplitNoSep(t *testing.T) { + got := Split("abc", "/") + want := []string{"abc"} + if !reflect.DeepEqual(want, got) { + t.Fatalf("expected: %v, got: %v", want, got) + } +} +``` + +We’re starting build a set of test cases that exercise boundary conditions. This is good. + +### Introducing table driven tests + +However the there is a lot of duplication in our tests. For each test case only the input, the expected output, and name of the test case change. Everything else is boilerplate. What we’d like to to set up all the inputs and expected outputs and feel them to a single test harness. This is a great time to introduce table driven testing. + +``` +func TestSplit(t *testing.T) { + type test struct { + input string + sep string + want []string + } + + tests := []test{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} +``` + +We declare a structure to hold our test inputs and expected outputs. This is our table. The `tests` structure is usually a local declaration because we want to reuse this name for other tests in this package. + +In fact, we don’t even need to give the type a name, we can use an anonymous struct literal to reduce the boilerplate like this: + +``` +func TestSplit(t *testing.T) { + tests := []struct { + input string + sep string + want []string + }{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + } +} +``` + +Now, adding a new test is a straight forward matter; simply add another line the `tests` structure. For example, what will happen if our input string has a trailing separator? + +``` +{input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, +{input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, +{input: "abc", sep: "/", want: []string{"abc"}}, +{input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, // trailing sep +``` + +But, when we run `go test`, we get + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:24: expected: [a b c], got: [a b c ] +``` + +Putting aside the test failure, there are a few problems to talk about. + +The first is by rewriting each test from a function to a row in a table we’ve lost the name of the failing test. We added a comment in the test file to call out this case, but we don’t have access to that comment in the `go test` output. + +There are a few ways to resolve this. You’ll see a mix of styles in use in Go code bases because the table testing idiom is evolving as people continue to experiment with the form. + +### Enumerating test cases + +As tests are stored in a slice we can print out the index of the test case in the failure message: + +``` +func TestSplit(t *testing.T) { + tests := []struct { + input string + sep . string + want []string + }{ + {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {input: "abc", sep: "/", want: []string{"abc"}}, + {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for i, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("test %d: expected: %v, got: %v", i+1, tc.want, got) + } + } +} +``` + +Now when we run `go test` we get this + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:24: test 4: expected: [a b c], got: [a b c ] +``` + +Which is a little better. Now we know that the fourth test is failing, although we have to do a little bit of fudging because slice indexing—​and range iteration—​is zero based. This requires consistency across your test cases; if some use zero base reporting and others use one based, it’s going to be confusing. And, if the list of test cases is long, it could be difficult to count braces to figure out exactly which fixture constitutes test case number four. + +### Give your test cases names + +Another common pattern is to include a name field in the test fixture. + +``` +func TestSplit(t *testing.T) { + tests := []struct { + name string + input string + sep string + want []string + }{ + {name: "simple", input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + {name: "wrong sep", input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + {name: "no sep", input: "abc", sep: "/", want: []string{"abc"}}, + {name: "trailing sep", input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for _, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("%s: expected: %v, got: %v", tc.name, tc.want, got) + } + } +} +``` + +Now when the test fails we have a descriptive name for what the test was doing. We no longer have to try to figure it out from the output—​also, now have a string we can search on. + +``` +% go test +--- FAIL: TestSplit (0.00s) + split_test.go:25: trailing sep: expected: [a b c], got: [a b c ] +``` + +We can dry this up even more using a map literal syntax: + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("%s: expected: %v, got: %v", name, tc.want, got) + } + } +} +``` + +Using a map literal syntax we define our test cases not as a slice of structs, but as map of test names to test fixtures. There’s also a side benefit of using a map that is going to potentially improve the utility of our tests. + +Map iteration order is _undefined_ 1 This means each time we run `go test`, our tests are going to be potentially run in a different order. + +This is super useful for spotting conditions where test pass when run in statement order, but not otherwise. If you find that happens you probably have some global state that is being mutated by one test with subsequent tests depending on that modification. + +### Introducing sub tests + +Before we fix the failing test there are a few other issues to address in our table driven test harness. + +The first is we’re calling `t.Fatalf` when one of the test cases fails. This means after the first failing test case we stop testing the other cases. Because test cases are run in an undefined order, if there is a test failure, it would be nice to know if it was the only failure or just the first. + +The testing package would do this for us if we go to the effort to write out each test case as its own function, but that’s quite verbose. The good news is since Go 1.7 a new feature was added that lets us do this easily for table driven tests. They’re called [sub tests][3]. + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got := Split(tc.input, tc.sep) + if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %v, got: %v", tc.want, got) + } + }) + } +} +``` + +As each sub test now has a name we get that name automatically printed out in any test runs. + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +Each subtest is its own anonymous function, therefore we can use `t.Fatalf`, `t.Skipf`, and all the other `testing.T`helpers, while retaining the compactness of a table driven test. + +#### Individual sub test cases can be executed directly + +Because sub tests have a name, you can run a selection of sub tests by name using the `go test -run` flag. + +``` +% go test -run=.*/trailing -v +=== RUN TestSplit +=== RUN TestSplit/trailing_sep +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +### Comparing what we got with what we wanted + +Now we’re ready to fix the test case. Let’s look at the error. + +``` +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: [a b c], got: [a b c ] +``` + +Can you spot the problem? Clearly the slices are different, that’s what `reflect.DeepEqual` is upset about. But spotting the actual difference isn’t easy, you have to spot that extra space after `c`. This might look simple in this simple example, but it is any thing but when you’re comparing two complicated deeply nested gRPC structures. + +We can improve the output if we switch to the `%#v` syntax to view the value as a Go(ish) declaration: + +``` +got := Split(tc.input, tc.sep) +if !reflect.DeepEqual(tc.want, got) { + t.Fatalf("expected: %#v, got: %#v", tc.want, got) +} +``` + +Now when we run our test it’s clear that the problem is there is an extra blank element in the slice. + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:25: expected: []string{"a", "b", "c"}, got: []string{"a", "b", "c", ""} +``` + +But before we go to fix our test failure I want to talk a little bit more about choosing the right way to present test failures. Our `Split` function is simple, it takes a primitive string and returns a slice of strings, but what if it worked with structs, or worse, pointers to structs? + +Here is an example where `%#v` does not work as well: + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + fmt.Printf("%v %v\n", x, y) + fmt.Printf("%#v %#v\n", x, y) +} +``` + +The first `fmt.Printf`prints the unhelpful, but expected slice of addresses; `[0xc000096000 0xc000096008 0xc000096010] [0xc000096018 0xc000096020 0xc000096028]`. However our `%#v` version doesn’t fare any better, printing a slice of addresses cast to `*main.T`;`[]*main.T{(*main.T)(0xc000096000), (*main.T)(0xc000096008), (*main.T)(0xc000096010)} []*main.T{(*main.T)(0xc000096018), (*main.T)(0xc000096020), (*main.T)(0xc000096028)}` + +Because of the limitations in using any `fmt.Printf` verb, I want to introduce the [go-cmp][4] library from Google. + +The goal of the cmp library is it is specifically to compare two values. This is similar to `reflect.DeepEqual`, but it has more capabilities. Using the cmp pacakge you can, of course, write: + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + fmt.Println(cmp.Equal(x, y)) // false +} +``` + +But far more useful for us with our test function is the `cmp.Diff` function which will produce a textual description of what is different between the two values, recursively. + +``` +func main() { + type T struct { + I int + } + x := []*T{{1}, {2}, {3}} + y := []*T{{1}, {2}, {4}} + diff := cmp.Diff(x, y) + fmt.Printf(diff) +} +``` + +Which instead produces: + +``` +% go run +{[]*main.T}[2].I: + -: 3 + +: 4 +``` + +Telling us that at element 2 of the slice of `T`s the `I`field was expected to be 3, but was actually 4. + +Putting this all together we have our table driven go-cmp test + +``` +func TestSplit(t *testing.T) { + tests := map[string]struct { + input string + sep string + want []string + }{ + "simple": {input: "a/b/c", sep: "/", want: []string{"a", "b", "c"}}, + "wrong sep": {input: "a/b/c", sep: ",", want: []string{"a/b/c"}}, + "no sep": {input: "abc", sep: "/", want: []string{"abc"}}, + "trailing sep": {input: "a/b/c/", sep: "/", want: []string{"a", "b", "c"}}, + } + + for name, tc := range tests { + t.Run(name, func(t *testing.T) { + got := Split(tc.input, tc.sep) + diff := cmp.Diff(tc.want, got) + if diff != "" { + t.Fatalf(diff) + } + }) + } +} +``` + +Running this we get + +``` +% go test +--- FAIL: TestSplit (0.00s) + --- FAIL: TestSplit/trailing_sep (0.00s) + split_test.go:27: {[]string}[?->3]: + -: + +: "" +FAIL +exit status 1 +FAIL split 0.006s +``` + +Using `cmp.Diff` our test harness isn’t just telling us that what we got and what we wanted were different. Our test is telling us that the strings are different lengths, the third index in the fixture shouldn’t exist, but the actual output we got an empty string, “”. From here fixing the test failure is straight forward. + + 1. Please don’t email me to argue that map iteration order is _random_. [It’s not][5]. + + + +#### Related posts: + + 1. [Writing table driven tests in Go][6] + 2. [Internets of Interest #7: Ian Cooper on Test Driven Development][7] + 3. [Automatically run your package’s tests with inotifywait][8] + 4. [How to write benchmarks in Go][9] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2019/04/03/absolute-unit-test +[2]: https://www.youtube.com/watch?v=EZ05e7EMOLM +[3]: https://blog.golang.org/subtests +[4]: https://github.com/google/go-cmp +[5]: https://golang.org/ref/spec#For_statements +[6]: https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go (Writing table driven tests in Go) +[7]: https://dave.cheney.net/2018/10/15/internets-of-interest-7-ian-cooper-on-test-driven-development (Internets of Interest #7: Ian Cooper on Test Driven Development) +[8]: https://dave.cheney.net/2016/06/21/automatically-run-your-packages-tests-with-inotifywait (Automatically run your package’s tests with inotifywait) +[9]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go) diff --git a/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md new file mode 100644 index 0000000000..083a8c9768 --- /dev/null +++ b/sources/tech/20190508 Innovations on the Linux desktop- A look at Fedora 30-s new features.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Innovations on the Linux desktop: A look at Fedora 30's new features) +[#]: via: (https://opensource.com/article/19/5/fedora-30-features) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva/users/marcobravo/users/alanfdoss/users/ansilva) + +Innovations on the Linux desktop: A look at Fedora 30's new features +====== +Learn about some of the highlights in the latest version of Fedora +Linux. +![Fedora Linux distro on laptop][1] + +The latest version of Fedora Linux was released at the end of April. As a full-time Fedora user since its original release back in 2003 and an active contributor since 2007, I always find it satisfying to see new features and advancements in the community. + +If you want a TL;DR version of what's has changed in [Fedora 30][2], feel free to ignore this article and jump straight to Fedora's [ChangeSet][3] wiki page. Otherwise, keep on reading to learn about some of the highlights in the new version. + +### Upgrade vs. fresh install + +I upgraded my Lenovo ThinkPad T series from Fedora 29 to 30 using the [DNF system upgrade instructions][4], and so far it is working great! + +I also had the chance to do a fresh install on another ThinkPad, and it was a nice surprise to see a new boot screen on Fedora 30—it even picked up the Lenovo logo. I did not see this new and improved boot screen on the upgrade above; it was only on the fresh install. + +![Fedora 30 boot screen][5] + +### Desktop changes + +If you are a GNOME user, you'll be happy to know that Fedora 30 comes with the latest version, [GNOME 3.32][6]. It has an improved on-screen keyboard (handy for touch-screen laptops), brand new icons for core applications, and a new "Applications" panel under Settings that allows users to gain a bit more control on GNOME default handlers, access permissions, and notifications. Version 3.32 also improves Google Drive performance so that Google files and calendar appointments will be integrated with GNOME. + +![Applications panel in GNOME Settings][7] + +The new Applications panel in GNOME Settings + +Fedora 30 also introduces two new Desktop environments: Pantheon and Deepin. Pantheon is [ElementaryOS][8]'s default desktop environment and can be installed with a simple: + + +``` +`$ sudo dnf groupinstall "Pantheon Desktop"` +``` + +I haven't used Pantheon yet, but I do use [Deepin][9]. Installation is simple; just run: + + +``` +`$ sudo dnf install deepin-desktop` +``` + +then log out of GNOME and log back in, choosing "Deepin" by clicking on the gear icon on the login screen. + +![Deepin desktop on Fedora 30][10] + +Deepin desktop on Fedora 30 + +Deepin appears as a very polished, user-friendly desktop environment that allows you to control many aspects of your environment with a click of a button. So far, the only issue I've had is that it can take a few extra seconds to complete login and return control to your mouse pointer. Other than that, it is brilliant! It is the first desktop environment I've used that seems to do high dots per inch (HiDPI) properly—or at least close to correctly. + +### Command line + +Fedora 30 upgrades the Bourne Again Shell (aka Bash) to version 5.0.x. If you want to find out about every change since its last stable version (4.4), read this [description][11]. I do want to mention that three new environments have been introduced in Bash 5: + + +``` +$ echo $EPOCHSECONDS +1556636959 +$ echo $EPOCHREALTIME +1556636968.012369 +$ echo $BASH_ARGV0 +bash +``` + +Fedora 30 also updates the [Fish shell][12], a colorful shell with auto-suggestion, which can be very helpful for beginners. Fedora 30 comes with [Fish version 3][13], and you can even [try it out in a browser][14] without having to install it on your machine. + +(Note that Fish shell is not the same as guestfish for mounting virtual machine images, which comes with the libguestfs-tools package.) + +### Development + +Fedora 30 brings updates to the following languages: [C][15], [Boost (C++)][16], [Erlang][17], [Go][18], [Haskell][19], [Python][20], [Ruby][21], and [PHP][22]. + +Regarding these updates, the most important thing to know is that Python 2 is deprecated in Fedora 30. The community and Fedora leadership are requesting that all package maintainers that still depend on Python 2 port their packages to Python 3 as soon as possible, as the plan is to remove virtually all Python 2 packages in Fedora 31. + +### Containers + +If you would like to run Fedora as an immutable OS for a container, kiosk, or appliance-like environment, check out [Fedora Silverblue][23]. It brings you all of Fedora's technology managed by [rpm-ostree][24], which is a hybrid image/package system that allows automatic updates and easy rollbacks for developers. It is a great option for anyone who wants to learn more and play around with [Flatpak deployments][25]. + +Fedora Atomic is no longer available under Fedora 30, but you can still [download it][26]. If your jam is containers, don't despair: even though Fedora Atomic is gone, a brand new [Fedora CoreOS][27] is under development and should be going live soon! + +### What else is new? + +As of Fedora 30, **/usr/bin/gpg** points to [GnuPG][28] v2 by default, and [NFS][29] server configuration is now located at **/etc/nfs.conf** instead of **/etc/sysconfig/nfs**. + +There have also been a [few changes][30] for installation and boot time. + +Last but not least, check out [Fedora Spins][31] for a spin of Fedora that defaults to your favorite Window manager and [Fedora Labs][32] for functionally curated software bundles built on Fedora 30 (i.e. astronomy, security, and gaming). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/fedora-30-features + +作者:[Anderson Silva ][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/ansilva/users/marcobravo/users/alanfdoss/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fedora_on_laptop_lead.jpg?itok=XMc5wo_e (Fedora Linux distro on laptop) +[2]: https://getfedora.org/ +[3]: https://fedoraproject.org/wiki/Releases/30/ChangeSet +[4]: https://fedoraproject.org/wiki/DNF_system_upgrade#How_do_I_use_it.3F +[5]: https://opensource.com/sites/default/files/uploads/fedora30_fresh-boot.jpg (Fedora 30 boot screen) +[6]: https://help.gnome.org/misc/release-notes/3.32/ +[7]: https://opensource.com/sites/default/files/uploads/fedora10_gnome.png (Applications panel in GNOME Settings) +[8]: https://elementary.io/ +[9]: https://www.deepin.org/en/dde/ +[10]: https://opensource.com/sites/default/files/uploads/fedora10_deepin.png (Deepin desktop on Fedora 30) +[11]: https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS +[12]: https://fishshell.com/ +[13]: https://fishshell.com/release_notes.html +[14]: https://rootnroll.com/d/fish-shell/ +[15]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_C/ +[16]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Boost/ +[17]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Erlang/ +[18]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Go/ +[19]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Haskell/ +[20]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Python/ +[21]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Ruby/ +[22]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/developers/Development_Web/ +[23]: https://silverblue.fedoraproject.org/ +[24]: https://rpm-ostree.readthedocs.io/en/latest/ +[25]: https://flatpak.org/setup/Fedora/ +[26]: https://getfedora.org/en/atomic/ +[27]: https://coreos.fedoraproject.org/ +[28]: https://gnupg.org/index.html +[29]: https://en.wikipedia.org/wiki/Network_File_System +[30]: https://docs.fedoraproject.org/en-US/fedora/f30/release-notes/sysadmin/Installation/ +[31]: https://spins.fedoraproject.org +[32]: https://labs.fedoraproject.org/ diff --git a/sources/tech/20190509 A day in the life of an open source performance engineering team.md b/sources/tech/20190509 A day in the life of an open source performance engineering team.md new file mode 100644 index 0000000000..373983e8bc --- /dev/null +++ b/sources/tech/20190509 A day in the life of an open source performance engineering team.md @@ -0,0 +1,138 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A day in the life of an open source performance engineering team) +[#]: via: (https://opensource.com/article/19/5/life-performance-engineer) +[#]: author: (Aakarsh Gopi https://opensource.com/users/aakarsh/users/portante/users/anaga/users/gameloid) + +A day in the life of an open source performance engineering team +====== +Collaborating with the community enables performance engineering to +address the confusion and complexity that come with working on a broad +spectrum of products. +![Team checklist and to dos][1] + +In today's world, open source software solutions are a collaborative effort of the community. Can a performance engineering team operate the same way, by collaborating with the community to address the confusion and complexity that come with working on a broad spectrum of products? + +To answer that question, we need to explore some basic questions: + + * What does a performance engineering team do? + * How does a performance engineering team fulfill its responsibilities? + * How are open source tools developed or leveraged for performance analysis? + + + +The term "performance engineering" has different meanings, which causes difficulty in figuring out a performance engineering team's responsibilities. Adding to the confusion, a team may be charged with working on a broad spectrum of products, ranging from an operating system like RHEL, whose performance can be significantly impacted by hardware components (CPU caches, network interface controllers, disk technologies, etc.), to something much higher up in the stack like Kubernetes, which comes with the added challenges of operating at scale without compromising on performance. + +Performance engineering has progressed a lot since the days of running manual A/B testing and single-system benchmarks. Now, these teams test cloud infrastructures and add machine learning classifiers as a component in the CI/CD pipeline for identifying performance regression in releases of products. + +### What does a performance engineering team do? + +A performance engineering team is generally responsible for the following (among other things): + + * Identifying potential performance issues + * Identifying any scale issues that could occur + * Developing tuning guides and/or tools that would enable the user to achieve the most out of a product + * Developing guides and/or working with customers to help with capacity planning + * Providing customers with performance expectations for different use cases of the product + + + +The mission of our specific team is to: + + * Establish performance and scale leadership of the Red Hat portfolio; the scope includes component level, system, and solution analysis + * Collaborate with engineering, product management, product marketing, and Customer Experience and Engagement (CEE), as well as hardware and software partners + * Deliver public-facing guidance, internal enablement, and continuous integration tests + + + +Our team fulfills our mission in the following ways: + + * We work with product teams to set performance goals and develop performance tests to run against those products deployed to see how they measure up to those goals. + * We also work to re-run performance tests to ensure there are no regressions in behaviors. + * We develop open source tooling to achieve our product performance goals, making them available to the communities where the products are derived to re-create what we do. + * We work to be transparent and open about how we do performance engineering; sharing these methods and approaches benefits communities, allowing them to reuse our work, and benefits us by leveraging the work they contribute with these tools. + + + +### How does a performance engineering team fulfill its responsibilities? + +Meeting these responsibilities requires collaboration with other teams, such as product management, development, QA/QE, documentation, and consulting, and with the communities. + +_Collaboration_ allows a team to be successful by pulling together team members' diverse knowledge and experience. A performance engineering team builds tools to share their knowledge both within the team and with the community, furthering the value of collaboration. + +Our performance engineering team achieves success through: + + * **Collaboration:** _Intra_ -team collaboration is as important as _inter_ -team collaboration for our performance engineering team + * Most performance engineers tend to create a niche for themselves in one or more sub-disciplines of performance engineering via tooling, performance analysis, systems knowledge, systems configuration, and such. Our team is composed of engineers with knowledge of setting up/configuring systems across the product stack, those who know how a configuration option would affect the system's performance, and so on. Our team's success is heavily reliant on effective collaboration between performance engineers on the team. + * Our team works closely with other organizations at various levels within Red Hat and the communities where our products are derived. + * **Knowledge:** To understand the performance implications of configuration and/or system changes, deep knowledge of the product alone is not sufficient. + * Our team has the knowledge to cover performance across all levels of the stack: + * Hardware setup and configuration + * Networking and scale considerations + * Operating system setup and configuration (Linux kernel, userspace stack) + * Storage sub-systems (Ceph) + * Cloud infrastructure (OpenStack, RHV) + * Cloud deployments (OpenShift/Kubernetes) + * Product architectures + * Software technologies (databases like Postgres; software-defined networking and storage) + * Product interactions with the underlying hardware + * Tooling to monitor and accomplish repeatable benchmarking + * **Tooling:** The differentiator for our performance engineering team is the data collected through its tools to help tackle performance analysis complexity in the environments where our products are deployed. + + + +### How are open source tools developed or leveraged for performance analysis? + +Tooling is no longer a luxury but a need for today's performance engineering teams. With today's product solutions being so complex (and increasing in complexity as more solutions are composed to solve ever-larger problems), we need tools to help us run performance test suites in a repeatable manner, collect data about those runs, and help us distill that data so it becomes understandable and usable. + +Yet, no performance engineering team is judged on how performance analysis is done, but rather on the results achieved from this analysis. + +This tension can be resolved by collaboratively developing tools. A performance engineering team can't spend all its time developing tools, since that would prevent it from effectively collecting data. By developing its tools in a collaborative manner, a team can leverage work from the community to make further progress while still generating the result by which they will be measured. + +Tooling is the backbone of our performance engineering team, and we strive to use the tools already available upstream. When no tools are available in the community that fit our needs, we've built tools that help us achieve our goals and made them available to the community. Open sourcing our tools has helped us immensely because we receive contributions from our competitors and partners, allowing us to solve problems collectively through collaboration. + +![Performance Engineering Tools][2] + +Following are some of the tools our team has contributed to and rely upon for our work: + + * **[Perf-c2c][3]:** Is your performance impacted by false sharing in CPU caches? The perf-c2c tool can help you tackle this problem by helping you inspect the cache lines where false sharing is detected and understand the readers/writers accessing those cache lines along with the offsets where those accesses occurred. You can read more about this tool on [Joe Mario's blog][4]. + * **[Pbench][5]:** Do you repeat the same steps when collecting data about performance, but fail to do it consistently? Or do you find it difficult to compare results with others because you're collecting different configuration data? Pbench is a tool that attempts to standardize the way data is collected for performance so comparisons and historical reviews are much easier. Pbench is at the heart of our tooling efforts, as most of the other tools consume it in some form. Pbench is a Swiss Army Knife, as it allows the user to run benchmarks such as fio, uperf, or custom, user-defined tests while gathering metrics through tools such as sar, iostat, and pidstat, standardizing the methods of collecting configuration data about the environment. Pbench provides a dashboard UI to help review and analyze the data collected. + * **[Browbeat][6]:** Do you want to monitor a complex environment such as an OpenStack cluster while running tests? Browbeat is the solution, and its power lies in its ability to collect comprehensive data, ranging from logs to system metrics, about an OpenStack cluster while it orchestrates workloads. Browbeat can also monitor the OpenStack cluster while users run test/workloads of their choice either manually or through their own automation. + * **[Ripsaw][7]:** Do you want to compare the performance of different Kubernetes distros against the same platform? Do you want to compare the performance of the same Kubernetes distros deployed on different platforms? Ripsaw is a relatively new tool created to run workloads through Kubernetes native calls using the Ansible operator framework to provide solutions to the above questions. Ripsaw's unique selling point is that it can run against any kind of Kubernetes distribution, thus it would run the same against a Kubernetes cluster, on Minikube, or on an OpenShift cluster deployed on OpenStack or bare metal. + * **[ClusterLoader][8]:** Ever wondered how an OpenShift component would perform under different cluster states? If you are looking for an answer that can stress the cluster, ClusterLoader will help. The team has generalized the tool so it can be used with any Kubernetes distro. It is currently hosted in the [perf-tests repository][9]. + + + +### Bottom line + +Given the scale at which products are evolving rapidly, performance engineering teams need to build tooling to help them keep up with products' evolution and diversification. + +Open source-based software solutions are a collaborative effort of the community. Our performance engineering team operates in the same way, collaborating with the community to address the confusion and complexity that comes with working on a broad spectrum of products. By developing our tools in a collaborative manner and using tools from the community, we are leveraging the community's work to make progress, while still generating the results we are measured on. + +_Collaboration_ is our key to accomplish our goals and ensure the success of our team. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/life-performance-engineer + +作者:[Aakarsh Gopi ][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/aakarsh/users/portante/users/anaga/users/gameloid +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/sites/default/files/uploads/performanceengineeringtools.png (Performance Engineering Tools) +[3]: http://man7.org/linux/man-pages/man1/perf-c2c.1.html +[4]: https://joemario.github.io/blog/2016/09/01/c2c-blog/ +[5]: https://github.com/distributed-system-analysis/pbench +[6]: https://github.com/openstack/browbeat +[7]: https://github.com/cloud-bulldozer/ripsaw +[8]: https://github.com/openshift/origin/tree/master/test/extended/cluster +[9]: https://github.com/kubernetes/perf-tests/tree/master/clusterloader diff --git a/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md new file mode 100644 index 0000000000..3db9708c81 --- /dev/null +++ b/sources/tech/20190509 Query freely available exchange rate data with ExchangeRate-API.md @@ -0,0 +1,162 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Query freely available exchange rate data with ExchangeRate-API) +[#]: via: (https://opensource.com/article/19/5/exchange-rate-data) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +Query freely available exchange rate data with ExchangeRate-API +====== +In this interview, ExchangeRate-API's founder explains why exchange rate +data should be freely accessible to developers who want to build useful +stuff. +![scientific calculator][1] + +Last year, [I wrote about][2] using the Groovy programming language to access foreign exchange rate data from an API to simplify my expense records. I showed how two exchange rate sites, [fixer.io][3] and apilayer.net (now [apilayer.com][4]), could provide the data I needed, allowing me to convert between Indian rupees (INR) and Canadian dollars (CAD) using the former, and Chilean pesos (CLP) and Canadian dollars using the latter. + +Recently, David over at [ExchangeRate-API.com][5] reached out to me to say, "the free API you mentioned (Fixer) has been bought by CurrencyLayer and had its no-signup/unlimited access deprecated." He also told me, "I run a free API called ExchangeRate-API.com that has the same JSON format as the original Fixer, doesn't require any signup, and allows unlimited requests." + +After exchanging a few emails, we decided to turn our conversation into an interview. Below the interview, you can find scripts and usage instructions. (The interview has been edited slightly for clarity.) + +### About ExchangeRate-API + +_**Chris:** How is ExchangeRate-API different from other online exchange-rate services? What motivates you to provide this service?_ + +**David:** When I started ExchangeRate-API with a friend in 2010, we built and released it for free because we really needed this service for another project and couldn't find one despite extensive googling. There are now around 20 such APIs offering quite a few different approaches. Over the years, I've tried a number of different approaches, but offering quality data for free has always proven the most popular. I'm also motivated by the thought that this data should be freely accessible to developers who want to build useful stuff even if they don't have a budget. + +Thus, the main difference with our currency conversion API is that it's unlimited and requires no signup. This also makes starting to use it really fast—you literally just copy the endpoint URL and you're good to go. + +There are one or two other free and unlimited APIs, but these typically just serve the daily reference rates provided by the European Central Bank. ExchangeRate-API collects the public reference rates from a number of central banks and then blends them to reduce the risk of outlying values. It also does acceptance checking to ensure the rates aren't wildly wrong (for instance an inverted data capture recording US dollars to CLP instead of CLP to USD) and weights different sources based on their historical accuracy. This makes the service quite reliable. I'm currently working on a transparency project to compare and show the accuracy of this public reference rate blend against a proprietary data source so potential users can make more informed decisions on what type of currency data service is right for them. + +_**Chris:** I'm delighted that you've included Canadian dollars and Indian rupees, as that is one problem I need to solve. I'm sad to see that you don't have Chilean pesos (another problem I need to solve). Can you tell us how you select the list of currencies? Do you anticipate adding other currencies to your list?_ + +**David:** Since my main aim for this service is to offer stable and reliable exchange rate data, I only include currencies when there is more than one data source for that currency code. For instance, after you mentioned that you're looking for CLP data, I added the daily reference rates published by the Central Bank of Chile to our system. If I can find another source that includes CLP, it would be included in our list of supported currencies, but until then, unfortunately not. The goal is to support as many currencies as possible. + +One thing to note is that, for some currencies, the service has the minimum two sources, but a few currency pairs (for instance USD/EUR) are included in almost every set of public reference rates. The transparent accuracy project I mentioned will hopefully make this difference clear so that users can understand why our USD/EUR rate might be more accurate than less common pairs like CLP/INR and also the degree of variance in accuracy between the pairs. It will take some work to make showing this information quick and easy to understand. + +### The API's architecture + +_**Chris:** Can you tell us a bit about your API's architecture? Do you use open source components to deliver your service?_ + +**David:** I exclusively use open source software to run ExchangeRate-API. I'm definitely an open source enthusiast and am always getting friends to switch to open source, explaining licenses, and donating when I can to the projects I use most. I also try to email maintainers of projects I use to say thanks, but I don't do this enough. + +The stack is currently Ubuntu LTS, MariaDB, Nginx, PHP 7, and Memcached. I also use Bootstrap and Picnic open source CSS frameworks. I use Let's Encrypt for HTTPS certificates via the Electronic Frontier Foundation's open source ACME client, [Certbot][6]. The service makes extensive use of classic tools like UFW/iptables, cURL, OpenSSH, and Git. + +My approach is typically to keep everything as simple as possible while using the tried-and-tested open source building blocks. For a project that aims to _always_ be available for users to convert currencies, this feels like the best route to reliability. I love reading about innovative new projects that could be useful for a project like this (for example, CockroachDB), but I wouldn't use them until they are considered really bulletproof. Obviously, things like [Heartbleed][7] show that there are risks with "boring" projects too—but I think these are easier to manage than the potential for unknown risks with newer, cutting-edge projects. + +In terms of the infrastructure setup, I've steadily built and improved the system over the last nine years, and it now comprises roughly three tiers. The main cluster runs on Amazon Web Services (AWS) and consists of Ubuntu EC2 servers and a high-availability MariaDB relational database service (RDS) instance. The EC2 instances are spread across multiple AWS Availability Zones and fronted by the managed AWS Elastic Load Balancing (ELB) service. Between the RDS database instance with automated cross-zone failover and the ELB-fronted EC2 instances spread across availability zones, this setup is exceptionally available. It is, however, only in one locale. So I've set up a second tier of virtual private server (VPS) instances in different geographic locations to reduce latency and distribute the load away from the more expensive AWS infrastructure. These are currently with Linode, but I have also used DigitalOcean and Vultr recently. + +Finally, this is all protected behind Cloudflare. With a free service, it's inevitable that some users will choose to abuse the system, and Cloudflare is an amazing product that's vital to ExchangeRate-API. Our servers can be protected and our users get low-latency, in-region caches. Cloudflare is set up with both the load balancing and traffic steering products to reduce latency and instantly shift traffic from unhealthy parts of the infrastructure to available origins. + +With this very redundant approach, there hasn't been downtime as a result of infrastructure problems or user load for around three years. The few periods of degraded service experienced in this time are all due to issues with code, deployment strategy, or config mistakes. The setup currently handles hundreds of millions of requests per month with low load levels and manageable costs, so there's plenty of room for growth. + +The actual application code is PHP with heavy use of Memcached. Memcached is an amazing open source project started by Brad Fitzpatrick in 2003. It's not particularly glamorous, but it is an incredibly reliable and performant distributed in-memory key value store. + +### Engaging with the open source community + +_**Chris:** There is an impressive amount of open source in your configuration. How do you engage with the broader community of users in these projects?_ + +**David:** I really struggle with the best way to be a good open source citizen while running a side project SaaS. I've considered building an open source library of some sort and releasing it, but I haven't thought of something that hasn't already been done and that I would be able to make the time commitment to reliably maintain. I'd only start a project like this if I could be confident I'd have the time to ensure users who choose the project wouldn't suddenly find themselves depending on abandonware. I've also looked into contributing to the projects that ExchangeRate-API depends on, but since I only use the biggest, most established options, I lack the expertise to make a meaningful contribution to such serious projects. + +I'm currently working on a new "Pro" plan for the service and I'm going to set a percentage of this income to donate to my open source dependencies. This still feels like a bandage though—answering this question makes me realize I need to put more time into starting an open source project that calls ExchangeRate-API home! + +### Looking ahead + +_**Chris:** We can only query the latest exchange rate, but it appears that you may be offering historical rates sometime later this year. Can you tell us more about the technical challenges with serving up historical data?_ + +**David:** There is a dataset of historical rates blended using our same algorithm from multiple central bank reference sets. However, I stopped new signups for it due to some issues with the data quality. The dataset reaches back to 1990, and there were a few earlier periods that need better data validation. As such, I'm building a better system for checking and comparing the data as it's ingested as well as adding an additional data source. The plan is to have a clean and more comprehensively verified-as-accurate dataset available later this year. + +In terms of the technical side of things, historical data is slightly more complex than live data. Compared to the live dataset (which is just a few bytes) the historical data is millions of database rows. This data was originally served from the database infrastructure with a long time-to-live (TTL) intermediary-caching layer. This was largely performant but struggled in situations where users wanted to dump the entire dataset as fast as the network could handle it. If the cache was sufficiently warm, this was fine, but if reboots, new server deployments, etc. had taken place recently, these big request sets would "miss" enough on the cache that the database would have problematic load spikes. + +Obviously, the goal is an infrastructure that can handle even aggressive use cases with normal performance, so the new historical rates dataset will be accompanied by a preemptive in-memory cache rather than a request-driven one. Thankfully, RAM is cheap these days, and putting a couple hundred megabytes of data entirely into RAM is a plausible approach even for a small project like ExchangeRate-API.com. + +_**Chris:** It sounds like you've been through quite a few iterations of this service to get to where it is today! Where do you see it going in the next few years?_ + +**David:** I'd aim for it to have reached coverage of every world currency so that anyone looking for this sort of software can easily and programmatically get the exchange rates they need for free. + +I'd also definitely like to have an affordable Pro plan that really resonates with users. Getting this right would mean better infrastructure and lower latency for free users as well. + +Finally, I'd like to have some sort of useful open source library under the ExchangeRate-API banner. Starting a small project that finds an enthusiastic community would be really rewarding. It's great to run something that's free-as-in-beer, but it would be even better if part of it was free-as-in-speech, as well. + +### How to use the service + +It's easy enough to test out the service using **wget** , as follows: + + +``` +clh@marseille:~$ wget -O - +\--2019-04-26 13:48:23-- +Resolving api.exchangerate-api.com (api.exchangerate-api.com)... 2606:4700:20::681a:c80, 2606:4700:20::681a:d80, 104.26.13.128, ... +Connecting to api.exchangerate-api.com (api.exchangerate-api.com)|2606:4700:20::681a:c80|:443... connected. +HTTP request sent, awaiting response... 200 OK +Length: unspecified [application/json] +Saving to: ‘STDOUT’ + +\- [<=> +] 0 --.-KB/s {"base":"INR","date":"2019-04-26","time_last_updated":1556236800,"rates":{"INR":1,"AUD":0.020343,"BRL":0.056786,"CAD":0.019248,"CHF":0.014554,"CNY":0.096099,"CZK":0.329222,"DKK":0.095497,"EUR":0.012789,"GBP":0.011052,"HKD":0.111898,"HUF":4.118615,"IDR":199.61769,"ILS":0.051749,"ISK":1.741659,"JPY":1.595527,"KRW":16.553091,"MXN":0.272383,"MYR":0.058964,"NOK":0.123365,"NZD":0.02161,"PEN":0.047497,"PHP":0.744974,"PLN":0.054927,"RON":0.060923,"RUB":0.921808,"SAR":0.053562,"SEK":0.135226,"SGD":0.019442,"THB":0.457501,"TRY":0- [ <=> ] 579 --.-KB/s in 0s + +2019-04-26 13:48:23 (15.5 MB/s) - written to stdout [579] + +clh@marseille:~$ +``` + +The result is returned as a JSON payload, giving conversion rates from Indian rupees (the currency I requested in the URL) to all the currencies handled by ExchangeRate-API. + +The Groovy shell can access the API: + + +``` +clh@marseille:~$ groovysh +Groovy Shell (2.5.3, JVM: 1.8.0_212) +Type ':help' or ':h' for help. +\---------------------------------------------------------------------------------------------------------------------------------- +groovy:000> import groovy.json.JsonSlurper +===> groovy.json.JsonSlurper +groovy:000> result = (new JsonSlurper()).parse( +groovy:001> new InputStreamReader((new URL(')) +groovy:002> ) +===> [base:INR, date:2019-04-26, time_last_updated:1556236800, rates:[INR:1, AUD:0.020343, BRL:0.056786, CAD:0.019248, CHF:0.014554, CNY:0.096099, CZK:0.329222, DKK:0.095497, EUR:0.012789, GBP:0.011052, HKD:0.111898, HUF:4.118615, IDR:199.61769, ILS:0.051749, ISK:1.741659, JPY:1.595527, KRW:16.553091, MXN:0.272383, MYR:0.058964, NOK:0.123365, NZD:0.02161, PEN:0.047497, PHP:0.744974, PLN:0.054927, RON:0.060923, RUB:0.921808, SAR:0.053562, SEK:0.135226, SGD:0.019442, THB:0.457501, TRY:0.084362, TWD:0.441385, USD:0.014255, ZAR:0.206271]] +groovy:000> +``` + +The same JSON payload is returned as a result of the Groovy JSON slurper operating on the URL. Of course, since this is Groovy, the JSON is converted into a Map, so you can do stuff like this: + + +``` +groovy:000> println result.base +INR +===> null +groovy:000> println result.date +2019-04-26 +===> null +groovy:000> println result.rates.CAD +0.019248 +===> null +``` + +And that's it! + +Do you use ExchangeRate-API or a similar service? Share how you use exchange rate data in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/exchange-rate-data + +作者:[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/calculator_money_currency_financial_tool.jpg?itok=2QMa1y8c (scientific calculator) +[2]: https://opensource.com/article/18/3/groovy-calculate-foreign-exchange +[3]: https://fixer.io/ +[4]: https://apilayer.com/ +[5]: https://www.exchangerate-api.com/ +[6]: https://certbot.eff.org/ +[7]: https://en.wikipedia.org/wiki/Heartbleed diff --git a/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md b/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md new file mode 100644 index 0000000000..0b2d9e55c6 --- /dev/null +++ b/sources/tech/20190509 Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots.md @@ -0,0 +1,256 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots) +[#]: via: (https://www.linuxtechi.com/rhel-8-installation-steps-screenshots/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Red Hat Enterprise Linux (RHEL) 8 Installation Steps with Screenshots +====== + +Red Hat has released its most awaited OS **RHEL 8** on 7th May 2019. RHEL 8 is based on **Fedora 28** distribution and Linux **kernel version 4.18**. One of the important key features in RHEL 8 is that it has introduced “ **Application Streams** ” which allows developers tools, frameworks and languages to be updated frequently without impacting the core resources of base OS. In other words, application streams will help to segregate the users space packages from OS Kernel Space. + +Apart from this, there are many new features which are noticed in RHEL 8 like: + + * XFS File system supports copy-on-write of file extents + * Introduction of Stratis filesystem, Buildah, Podman, and Skopeo + * Yum utility is based on DNF + * Chrony replace NTP. + * Cockpit is the default Web Console tool for Server management. + * OpenSSL 1.1.1 & TLS 1.3 support + * PHP 7.2 + * iptables replaced by nftables + + + +### Minimum System Requirements for RHEL 8: + + * 4 GB RAM + * 20 GB unallocated disk space + * 64-bit x86 or ARM System + + + +**Note:** RHEL 8 supports the following architectures: + + * AMD or Intel x86 64-bit + * 64-bit ARM + * IBM Power Systems, Little Endian & IBM Z + + + +In this article we will demonstrate how to install RHEL 8 step by step with screenshots. + +### RHEL 8 Installation Steps with Screenshots + +### Step:1) Download RHEL 8.0 ISO file + +Download RHEL 8 iso file from its official web site, + + + +I am assuming you have the active subscription if not then register yourself for evaluation and then download ISO file + +### Step:2) Create Installation bootable media (USB or DVD) + +Once you have downloaded RHEL 8 ISO file, make it bootable by burning it either into a USB drive or DVD. Reboot the target system where you want to install RHEL 8 and then go to its bios settings and set the boot medium as USB or DVD, + +### Step:3) Choose “Install Red Hat Enterprise Linux 8.0” option + +When the system boots up with installation media (USB or DVD), we will get the following screen, choose “ **Install Red Hat Enterprise Linux 8.0** ” and hit enter, + + + +### Step:4) Choose your preferred language for RHEL 8 installation + +In this step, you need to choose a language that you want to use for RHEL 8 installation, so make a selection that suits to your setup. + + + +Click on Continue + +### Step:5) Preparing RHEL 8 Installation + +In this step we will decide the installation destination for RHEL 8, apart from this we can configure the followings: + + * Time Zone + * Kdump (enabled/disabled) + * Software Selection (Packages) + * Networking and Hostname + * Security Policies & System purpose + + + + + +By default, installer will automatically pick time zone and will enable the **kdump** , if wish to change the time zone then click on “ **Time & Date**” option and set your preferred time zone and then click on Done. + + + +To configure IP address and Hostname click on “ **Network & Hostname**” option from installation summary screen, + +If your system is connected to any switch or modem, then it will try to get IP from DHCP server otherwise we can configure IP manually. + +Mention the hostname that you want to set and then click on “ **Apply”**. Once you are done with IP address and hostname configuration click on “Done” + + + +To define the installation disk and partition scheme for RHEL 8, click on “ **Installation Destination** ” option, + + + +Click on Done + +As we can see I have around 60 GB free disk space on sda drive, I will be creating following customize lvm based partitions on this disk, + + * /boot = 2GB (xfs file system) + * / = 20 GB (xfs file system) + * /var = 10 GB (xfs file system) + * /home = 15 GB (xfs file system) + * /tmp = 5 GB (xfs file system) + * Swap = 2 GB (xfs file system) + + + +**Note:** If you don’t want to create manual partitions then select “ **Automatic** ” option from Storage Configuration Tab + + + +Let’s create our first partition as /boot of size 2 GB, Select LVM as mount point partitioning scheme and then click on + “plus” symbol, + + + +Click on “ **Add mount point** ” + + + +To create next partition as / of size 20 GB, click on + symbol and specify the details as shown below, + + + +Click on “Add mount point” + + + +As we can see installer has created the Volume group as “ **rhel_rhel8** “, if you want to change this name then click on Modify option and specify the desired name and then click on Save + + + +Now onward all partitions will be part of Volume Group “ **VolGrp** ” + +Similarly create next three partitions **/home** , **/var** and **/tmp** of size 15GB, 10 GB and 5 GB respectively + +**/home partition:** + + + +**/var partition:** + + + +**/tmp partition:** + + + +Now finally create last partition as swap of size of 2 GB, + + + +Click on “Add mount point” + +Once you are done with partition creations, click on Done on Next screen, example is shown below + + + +In the next window, choose “ **Accept Changes** ” + + + +### Step:6) Select Software Packages and Choose Security Policy and System purpose + +After accepting the changes in above step, we will be redirected to installation summary window. + +By default, installer will select “ **Server with GUI”** as software packages and if you want to change it then click on “ **Software Selection** ” option and choose your preferred “ **Basic Environment** ” + + + +Click on Done + +If you want to set the security policies during the installation, the choose the required profile from Security polices option else you can leave as it is. + +From “ **System Purpose** ” option specify the Role, Red Hat Service Level Agreement and Usage. Though You can leave this option as it is. + + + +Click on Done to proceed further. + +### Step:7) Choose “Begin Installation” option to start installation + +From the Installation summary window click on “Begin Installation” option to start the installation, + + + +As we can see below RHEL 8 Installation is started & is in progress + + + +Set the root password, + + + +Specify the local user details like its Full Name, user name and its password, + + + +Once the installation is completed, installer will prompt us to reboot the system, + + + +Click on “Reboot” to restart your system and don’t forget to change boot medium from bios settings so that system boots up with hard disk. + +### Step:8) Initial Setup after installation + +When the system is rebooted first time after the successful installation then we will get below window there we need to accept the license (EULA), + + + +Click on Done, + +In the next Screen click on “ **Finish Configuration** ” + + + +### Step:8) Login Screen of RHEL 8 Server after Installation + +As we have installed RHEL 8 Server with GUI, so we will get below login screen, use the same user name and password that we created during the installation + + + +After the login we will get couple of Welcome Screen and follow the screen instructions and then finally we will get the following screen, + + + +Click on “Start Using Red Hat Enterprise Linux” + + + +This confirms that we have successfully installed RHEL 8, that’s all from this article. We will be writing articles on RHEL 8 in the coming future till then please do share your feedback and comments on this article. + +Read Also :** [How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File][1]** + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/rhel-8-installation-steps-screenshots/ + +作者:[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/setup-local-yum-dnf-repository-rhel-8/ diff --git a/sources/tech/20190510 5 open source hardware products for the great outdoors.md b/sources/tech/20190510 5 open source hardware products for the great outdoors.md new file mode 100644 index 0000000000..357fbfdcb8 --- /dev/null +++ b/sources/tech/20190510 5 open source hardware products for the great outdoors.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source hardware products for the great outdoors) +[#]: via: (https://opensource.com/article/19/5/hardware-outdoors) +[#]: author: (Michael Weinberg https://opensource.com/users/mweinberg/users/aliciagibb) + +5 open source hardware products for the great outdoors +====== +Here's some equipment you can buy or make yourself for hitting the great +outdoors, no generators or batteries required. +![Tree clouds][1] + +When people think about open source hardware, they often think about the general category of electronics that can be soldered and needs batteries. While there are [many][2] fantastic open source pieces of electronics, the overall category of open source hardware is much broader. This month we take a look at open source hardware that you can take out into the world, no power outlet or batteries required. + +### Hummingbird Hammocks + +[Hummingbird Hammocks][3] offers an entire line of open source camping gear. You can set up an open source [rain tarp][4]... + +![An open source rain tarp from Hummingbird Hammocks][5] + +...with open source [friction adjusters][6] + +![Open source friction adjusters from Hummingbird Hammocks.][7] + +Open source friction adjusters from Hummingbird Hammocks. + +...over your open source [hammock][8] + +![An open source hammock from Hummingbird Hammocks.][9] + +An open source hammock from Hummingbird Hammocks. + +...hung with open source [tree straps][10]. + +![Open source tree straps from Hummingbird Hammocks.][11] + +Open source tree straps from Hummingbird Hammocks. + +The design for each of these items is fully documented, so you can even use them as a starting point for making your own outdoor gear (if you are willing to trust friction adjusters you design yourself). + +### Openfoil + +[Openfoil][12] is an open source hydrofoil for kitesurfing. Hydrofoils are attached to the bottom of kiteboards and allow the rider to rise out of the water. This aspect of the design makes riding in low wind situations and with smaller kites easier. It can also reduce the amount of noise the board makes on the water, making for a quieter experience. Because this hydrofoil is open source you can customize it to your needs and adventure tolerance. + +![Openfoil, an open source hydrofoil for kitesurfing.][13] + +Openfoil, an open source hydrofoil for kitesurfing. + +### Solar water heater + +If you prefer your outdoors-ing a bit closer to home, you could build this open source [solar water heater][14] created by the [Anisa Foundation][15]. This appliance focuses energy from the sun to heat water that can then be used in your home, letting you reduce your carbon footprint without having to give up long, hot showers. Of course, you can also [monitor its temperature ][16]over the internet if you need to feel connected. + +![An open source solar water heater from the Anisa Foundation.][17] + +An open source solar water heater from the Anisa Foundation. + +## Wrapping up + +As these projects make clear, open source hardware is more than just electronics. You can take it with you to the woods, to the beach, or just to your roof. Next month we’ll talk about open source instruments and musical gear. Until then, [certify][18] your open source hardware! + +Learn how and why you may want to start using the Open Source Hardware Certification logo on an... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/hardware-outdoors + +作者:[Michael Weinberg][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/mweinberg/users/aliciagibb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_tree_clouds.png?itok=b_ftihhP (Tree clouds) +[2]: https://certification.oshwa.org/list.html +[3]: https://hummingbirdhammocks.com/ +[4]: https://certification.oshwa.org/us000102.html +[5]: https://opensource.com/sites/default/files/uploads/01-hummingbird_hammocks_rain_tarp.png (An open source rain tarp from Hummingbird Hammocks) +[6]: https://certification.oshwa.org/us000105.html +[7]: https://opensource.com/sites/default/files/uploads/02-hummingbird_hammocks_friction_adjusters_400_px.png (Open source friction adjusters from Hummingbird Hammocks.) +[8]: https://certification.oshwa.org/us000095.html +[9]: https://opensource.com/sites/default/files/uploads/03-hummingbird_hammocks_hammock_400_px.png (An open source hammock from Hummingbird Hammocks.) +[10]: https://certification.oshwa.org/us000098.html +[11]: https://opensource.com/sites/default/files/uploads/04-hummingbird_hammocks_tree_straps_400_px_0.png (Open source tree straps from Hummingbird Hammocks.) +[12]: https://certification.oshwa.org/fr000004.html +[13]: https://opensource.com/sites/default/files/uploads/05-openfoil-original_size.png (Openfoil, an open source hydrofoil for kitesurfing.) +[14]: https://certification.oshwa.org/mx000002.html +[15]: http://www.fundacionanisa.org/index.php?lang=en +[16]: https://thingspeak.com/channels/72565 +[17]: https://opensource.com/sites/default/files/uploads/06-solar_water_heater_500_px.png (An open source solar water heater from the Anisa Foundation.) +[18]: https://certification.oshwa.org/ diff --git a/sources/tech/20190510 Check storage performance with dd.md b/sources/tech/20190510 Check storage performance with dd.md new file mode 100644 index 0000000000..8cdea81f69 --- /dev/null +++ b/sources/tech/20190510 Check storage performance with dd.md @@ -0,0 +1,432 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check storage performance with dd) +[#]: via: (https://fedoramagazine.org/check-storage-performance-with-dd/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +Check storage performance with dd +====== + +![][1] + +This article includes some example commands to show you how to get a _rough_ estimate of hard drive and RAID array performance using the _dd_ command. Accurate measurements would have to take into account things like [write amplification][2] and [system call overhead][3], which this guide does not. For a tool that might give more accurate results, you might want to consider using [hdparm][4]. + +To factor out performance issues related to the file system, these examples show how to test the performance of your drives and arrays at the block level by reading and writing directly to/from their block devices. **WARNING** : The _write_ tests will destroy any data on the block devices against which they are run. **Do not run them against any device that contains data you want to keep!** + +### Four tests + +Below are four example dd commands that can be used to test the performance of a block device: + + 1. One process reading from $MY_DISK: + +``` +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + + 2. One process writing to $MY_DISK: + +``` +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + + 3. Two processes reading concurrently from $MY_DISK: + +``` +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + + 4. Two processes writing concurrently to $MY_DISK: + +``` +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + + + + +– The _iflag=nocache_ and _oflag=direct_ parameters are important when performing the read and write tests (respectively) because without them the dd command will sometimes show the resulting speed of transferring the data to/from [RAM][5] rather than the hard drive. + +– The values for the _bs_ and _count_ parameters are somewhat arbitrary and what I have chosen should be large enough to provide a decent average in most cases for current hardware. + +– The _null_ and _zero_ devices are used for the destination and source (respectively) in the read and write tests because they are fast enough that they will not be the limiting factor in the performance tests. + +– The _skip=200_ parameter on the second dd command in the concurrent read and write tests is to ensure that the two copies of dd are operating on different areas of the hard drive. + +### 16 examples + +Below are demonstrations showing the results of running each of the above four tests against each of the following four block devices: + + 1. MY_DISK=/dev/sda2 (used in examples 1-X) + 2. MY_DISK=/dev/sdb2 (used in examples 2-X) + 3. MY_DISK=/dev/md/stripped (used in examples 3-X) + 4. MY_DISK=/dev/md/mirrored (used in examples 4-X) + + + +A video demonstration of the these tests being run on a PC is provided at the end of this guide. + +Begin by putting your computer into _rescue_ mode to reduce the chances that disk I/O from background services might randomly affect your test results. **WARNING** : This will shutdown all non-essential programs and services. Be sure to save your work before running these commands. You will need to know your _root_ password to get into rescue mode. The _passwd_ command, when run as the root user, will prompt you to (re)set your root account password. + +``` +$ sudo -i +# passwd +# setenforce 0 +# systemctl rescue +``` + +You might also want to temporarily disable logging to disk: + +``` +# sed -r -i.bak 's/^#?Storage=.*/Storage=none/' /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +``` + +If you have a swap device, it can be temporarily disabled and used to perform the following tests: + +``` +# swapoff -a +# MY_DEVS=$(mdadm --detail /dev/md/swap | grep active | grep -o "/dev/sd.*") +# mdadm --stop /dev/md/swap +# mdadm --zero-superblock $MY_DEVS +``` + +#### Example 1-1 (reading from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.7003 s, 123 MB/s +``` + +#### Example 1-2 (writing to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67117 s, 125 MB/s +``` + +#### Example 1-3 (reading concurrently from sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.42875 s, 61.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52614 s, 59.5 MB/s +``` + +#### Example 1-4 (writing concurrently to sda) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 1) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.2435 s, 64.7 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.60872 s, 58.1 MB/s +``` + +#### Example 2-1 (reading from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67285 s, 125 MB/s +``` + +#### Example 2-2 (writing to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67198 s, 125 MB/s +``` + +#### Example 2-3 (reading concurrently from sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.52808 s, 59.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.57736 s, 58.6 MB/s +``` + +#### Example 2-4 (writing concurrently to sdb) + +``` +# MY_DISK=$(echo $MY_DEVS | cut -d ' ' -f 2) +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.7841 s, 55.4 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 3.81475 s, 55.0 MB/s +``` + +#### Example 3-1 (reading from RAID0) + +``` +# mdadm --create /dev/md/stripped --homehost=any --metadata=1.0 --level=0 --raid-devices=2 $MY_DEVS +# MY_DISK=/dev/md/stripped +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.837419 s, 250 MB/s +``` + +#### Example 3-2 (writing to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 0.823648 s, 255 MB/s +``` + +#### Example 3-3 (reading concurrently from RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.31025 s, 160 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.80016 s, 116 MB/s +``` + +#### Example 3-4 (writing concurrently to RAID0) + +``` +# MY_DISK=/dev/md/stripped +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.65026 s, 127 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.81323 s, 116 MB/s +``` + +#### Example 4-1 (reading from RAID1) + +``` +# mdadm --stop /dev/md/stripped +# mdadm --create /dev/md/mirrored --homehost=any --metadata=1.0 --level=1 --raid-devices=2 --assume-clean $MY_DEVS +# MY_DISK=/dev/md/mirrored +# dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74963 s, 120 MB/s +``` + +#### Example 4-2 (writing to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.74625 s, 120 MB/s +``` + +#### Example 4-3 (reading concurrently from RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache &); (dd if=$MY_DISK of=/dev/null bs=1MiB count=200 iflag=nocache skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67171 s, 125 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 1.67685 s, 125 MB/s +``` + +#### Example 4-4 (writing concurrently to RAID1) + +``` +# MY_DISK=/dev/md/mirrored +# (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct &); (dd if=/dev/zero of=$MY_DISK bs=1MiB count=200 oflag=direct skip=200 &) +``` + +``` +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.09666 s, 51.2 MB/s +200+0 records in +200+0 records out +209715200 bytes (210 MB, 200 MiB) copied, 4.1067 s, 51.1 MB/s +``` + +#### Restore your swap device and journald configuration + +``` +# mdadm --stop /dev/md/stripped /dev/md/mirrored +# mdadm --create /dev/md/swap --homehost=any --metadata=1.0 --level=1 --raid-devices=2 $MY_DEVS +# mkswap /dev/md/swap +# swapon -a +# mv /etc/systemd/journald.conf.bak /etc/systemd/journald.conf +# systemctl restart systemd-journald.service +# reboot +``` + +### Interpreting the results + +Examples 1-1, 1-2, 2-1, and 2-2 show that each of my drives read and write at about 125 MB/s. + +Examples 1-3, 1-4, 2-3, and 2-4 show that when two reads or two writes are done in parallel on the same drive, each process gets at about half the drive’s bandwidth (60 MB/s). + +The 3-x examples show the performance benefit of putting the two drives together in a RAID0 (data stripping) array. The numbers, in all cases, show that the RAID0 array performs about twice as fast as either drive is able to perform on its own. The trade-off is that you are twice as likely to lose everything because each drive only contains half the data. A three-drive array would perform three times as fast as a single drive (all drives being equal) but it would be thrice as likely to suffer a [catastrophic failure][6]. + +The 4-x examples show that the performance of the RAID1 (data mirroring) array is similar to that of a single disk except for the case where multiple processes are concurrently reading (example 4-3). In the case of multiple processes reading, the performance of the RAID1 array is similar to that of the RAID0 array. This means that you will see a performance benefit with RAID1, but only when processes are reading concurrently. For example, if a process tries to access a large number of files in the background while you are trying to use a web browser or email client in the foreground. The main benefit of RAID1 is that your data is unlikely to be lost [if a drive fails][7]. + +### Video demo + +Testing storage throughput using dd + +### Troubleshooting + +If the above tests aren’t performing as you expect, you might have a bad or failing drive. Most modern hard drives have built-in Self-Monitoring, Analysis and Reporting Technology ([SMART][8]). If your drive supports it, the _smartctl_ command can be used to query your hard drive for its internal statistics: + +``` +# smartctl --health /dev/sda +# smartctl --log=error /dev/sda +# smartctl -x /dev/sda +``` + +Another way that you might be able to tune your PC for better performance is by changing your [I/O scheduler][9]. Linux systems support several I/O schedulers and the current default for Fedora systems is the [multiqueue][10] variant of the [deadline][11] scheduler. The default performs very well overall and scales extremely well for large servers with many processors and large disk arrays. There are, however, a few more specialized schedulers that might perform better under certain conditions. + +To view which I/O scheduler your drives are using, issue the following command: + +``` +$ for i in /sys/block/sd?/queue/scheduler; do echo "$i: $(<$i)"; done +``` + +You can change the scheduler for a drive by writing the name of the desired scheduler to the /sys/block//queue/scheduler file: + +``` +# echo bfq > /sys/block/sda/queue/scheduler +``` + +You can make your changes permanent by creating a [udev rule][12] for your drive. The following example shows how to create a udev rule that will set all [rotational drives][13] to use the [BFQ][14] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-rotational.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" +END +``` + +Here is another example that sets all [solid-state drives][15] to use the [NOOP][16] I/O scheduler: + +``` +# cat << END > /etc/udev/rules.d/60-ioscheduler-solid-state.rules +ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none" +END +``` + +Changing your I/O scheduler won’t affect the raw throughput of your devices, but it might make your PC seem more responsive by prioritizing the bandwidth for the foreground tasks over the background tasks or by eliminating unnecessary block reordering. + +* * * + +_Photo by _[ _James Donovan_][17]_ on _[_Unsplash_][18]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/check-storage-performance-with-dd/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/04/dd-performance-816x345.jpg +[2]: https://www.ibm.com/developerworks/community/blogs/ibmnas/entry/misalignment_can_be_twice_the_cost1?lang=en +[3]: https://eklitzke.org/efficient-file-copying-on-linux +[4]: https://en.wikipedia.org/wiki/Hdparm +[5]: https://en.wikipedia.org/wiki/Random-access_memory +[6]: https://blog.elcomsoft.com/2019/01/why-ssds-die-a-sudden-death-and-how-to-deal-with-it/ +[7]: https://www.computerworld.com/article/2484998/ssds-do-die--as-linus-torvalds-just-discovered.html +[8]: https://en.wikipedia.org/wiki/S.M.A.R.T. +[9]: https://en.wikipedia.org/wiki/I/O_scheduling +[10]: https://lwn.net/Articles/552904/ +[11]: https://en.wikipedia.org/wiki/Deadline_scheduler +[12]: http://www.reactivated.net/writing_udev_rules.html +[13]: https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics +[14]: http://algo.ing.unimo.it/people/paolo/disk_sched/ +[15]: https://en.wikipedia.org/wiki/Solid-state_drive +[16]: https://en.wikipedia.org/wiki/Noop_scheduler +[17]: https://unsplash.com/photos/0ZBRKEG_5no?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[18]: https://unsplash.com/search/photos/speed?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20190510 Keeping an open source project alive when people leave.md b/sources/tech/20190510 Keeping an open source project alive when people leave.md new file mode 100644 index 0000000000..31a0ab7412 --- /dev/null +++ b/sources/tech/20190510 Keeping an open source project alive when people leave.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keeping an open source project alive when people leave) +[#]: via: (https://opensource.com/article/19/5/code-missing-community-management) +[#]: author: (Rodrigo Duarte Sousa https://opensource.com/users/rodrigods/users/tellesnobrega) + +Keeping an open source project alive when people leave +====== +How to find out what's done, what's not, and what's missing. +![][1] + +Suppose you wake up one day and decide to finally use that recipe video you keep watching all over social media. You get the ingredients, organize the necessary utensils, and start to follow the recipe steps. You cut this, cut that, then start heating the oven at the same time you put butter and onions in a pan. Then, your phone reminds you: you have a dinner appointment with your boss, and you're already late! You turn off everything and leave immediately, stopping the cooking process somewhere near the end. + +Some minutes later, your roommate arrives at home ready to have dinner and finds only the _ongoing work_ in the kitchen. They have the following options: + + 1. Clean up the mess and start cooking something from scratch. + 2. Order dinner and don’t bother to cook and/or fix the mess you left. + 3. Start cooking “around” the mess you left, which will probably take more time since most of the utensils are dirty and there isn’t much space left in the kitchen. + + + +If you left the printed version of the recipe somewhere, your roommate also has a fourth option. They could finish what you started! The problem is that they have no idea what's missing. It is not like you crossed out each completed step. Their best bet is either to call you or to examine all of your _changes_ to infer what is missing. + +In this example, the kitchen is like a software project, the utensils are the code, and the recipe is a new feature being implemented. Leaving something behind is not usually doable in a company's private project since you're accountable for your work and—in a scenario where you need to leave—it's almost certain that there is someone tracking/following the project, so they avoid having a "single point of failure." With open source projects, though, this continuity rarely happens. So how can we in the open source community deal with legacy, unfinished code, or code that is completed but no one dares touch it? + +### Knowledge legacy in open source projects + +We have always felt that open source is one of the best ways for an inexperienced software engineer to improve her skills. For many, open source projects offer their first hands-on experience with particular tools. [Version control systems][2], [unit][3] and [integration][4] tests, [continuous delivery][5], [code reviews][6], [features planning][7], [bug reporting/fixing][8], and more. + +In addition to learning opportunities, we can also view open source projects as a career opportunity—many senior engineers in the community get paid to be there, and you can add your contributions to your resume. That’s pretty cool. There's nothing like learning while improving your resume and getting potential employers' attention so you can pay your rent. + +Is this whole situation an infinite loop where everyone wins? The answer is obviously no. This post focuses on one of the main issues that arise in any project: the [bus/truck factor][9]. In the open source context, specifically, when people experience major changes such as a new job or other more personal factors, they tend to leave the community. We will first describe the problems that can arise from people leaving their _recipes_ unfinished by using [OpenStack][10] as an example. Then, we'll try to discuss some ideas to try to mitigate the issues. + +### Common problems + +In the past few years, we've seen a lot of changes in the [OpenStack][11] community, where some projects lost some portion of their active contributors team. These losses led to incomplete work and even finished modules without clear maintainers. Below are other examples of what happens when people suddenly leave. While this article uses OpenStack terms, such as “specs,” these issues easily apply to software development in general: + + * **Broken documentation:** A new API or setting either wasn't documented, or it was documented but not implemented. + * **Hard to resolve knowledge deficits:** For example, a new requirement and/or feature requires part of the code to be refactored but no one has the necessary expertise. + * **Incomplete features:** What are the missing tasks required for each feature? Which tasks were completed? + * **Debugging drama:** If the person who wrote the code isn't there, meaning that it takes a lot of engineering hours just to decrypt—so to speak—the code path that needs to be fixed. + + + +To illustrate, we will use the [Project Tree Deletion][12] feature. Project Tree Deletion is a tiny feature that one of us proposed more than three years ago and couldn’t complete. Basically, the main goal was to enable an OpenStack user/operator to erase a whole branch of projects without having to manually disable/delete every single of them starting from the leaves. Very straightforward, right? The PTD spec has been merged and has the following _work items_ : + + * Update API spec documentation. + * Add new rules to the file **policy.json**. + * Add new endpoints to mirror the new features. + * Implement the new deletion/disabling behavior for the project’s hierarchy. + + + +What about the sequence of steps (roadmap) to get these work items done? How do we know where to start and when what to tackle next? Are there any logical dependencies between the work items? How do we know where to start, and with what? + +Also, how do we know which work has been completed (if any)? One of the things that we do is look in the [blueprint][13] and/or the new [bug tracker][14], for example: + + * Recursive deletion and project disabling: (merged) + * API changes for Reseller: (merged) + * Add parent_id to GET /projects: (merged) + * Manager support for project cascade update: (merged) + * API support for cascade update: (abandoned) + * Manager support for project delete cascade: (merged) + * API support for project cascade delete: (abandoned) + * Add backend support for deleting a projects list: (merged) + * Test list project hierarchy is correct for a large tree: (merged) + * Fix cascade operations documentation: (merged) + * Revert “Fix cascade operations documentation”: (merged) + * Remove the APIs from the doc that aren't supported yet: (merged) + + + +Here we can see a lot of merged patches, but also that some were abandoned, and that some include the words Revert and Remove in their titles. Now we have strong evidence that this work is not completed, but at least some work was started to clean it up and avoid exposing something incomplete in the service API. Let’s dig a little bit deeper and look at the [_current_ delete project code][15]. + +There, we can see an added **cascade** argument (“cascade” resembles deleting related things together, so this argument must be somehow related to the proposed feature), and that it has a special block to treat the cases for the possible values of **cascade** : + + +``` +`def _delete_project(self, project, initiator=None, cascade=False):`[/code] [code] + +if cascade: +# Getting reversed project's subtrees list, i.e. from the leaves +# to the root, so we do not break parent_id FK. +subtree_list = self.list_projects_in_subtree(project_id) +subtree_list.reverse() +if not self._check_whole_subtree_is_disabled( +project_id, subtree_list=subtree_list): +raise exception.ForbiddenNotSecurity( +_('Cannot delete project %(project_id)s since its subtree ' +'contains enabled projects.') +% {'project_id': project_id}) + +project_list = subtree_list + [project] +projects_ids = [x['id'] for x in project_list] + +ret = self.driver.delete_projects_from_ids(projects_ids) +for prj in project_list: +self._post_delete_cleanup_project(prj['id'], prj, initiator) +else: +ret = self.driver.delete_project(project_id) +self._post_delete_cleanup_project(project_id, project, initiator) +``` + +What about the callers of this function? Do they use **cascade** at all? If we search for it, we only find occurrences in the backend tests: + + +``` +$ git grep "delete_project" | grep "cascade" | grep -v "def" +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(root_project['id'], cascade=True) +keystone/tests/unit/resource/test_backends.py: PROVIDERS.resource_api.delete_project(p1['id'], cascade=True) +``` + +We can also confirm this finding by looking at the [delete projects API implementation][16]. + +So it seems that we have a problem here, something simple that I started was left behind a very long time ago. How could the community or I have prevented this from happening? + +From the example above, one of the most apparent problems is the lack of a clear roadmap and list of completed tasks somewhere. To follow the actual implementation status, we had to dig into the blueprint/bug comments and the code. + +Based on this issue, we can sketch an idea: for each new feature, we need a roadmap stored somewhere to reflect the implementation status. Once the roadmap is defined within a spec, we can track each step as a [Launchpad][17] entry, for example, and have a better view of the progress status of that spec. + +Of course, these steps won’t prevent unfinished projects and they add a little bit of process, but following them can give a better view of what's missing so someone else from the community could finish or even revert what's there. + +### That’s not all + +What about other aspects of the project besides feature completion? We shouldn’t expect that every person on the core team is an expert in every single project module. This issue highlights another very important aspect of any open source community: mentoring. + +New people come to the community all the time and many have an incentive to continuing coming back as we discussed earlier. However, are our current community members willing to mentor them? How many times have you participated as a mentor in a program such as [Outreachy ][18]or [Google Summer of Code][19], or taken time to answer questions in the project’s chat? + +We also know that people eventually move on to other open source communities, so we have the chance of not leaving what we learned behind. We can always transmit that knowledge directly to those who are currently interested and actively asking questions, or indirectly, by writing documentation, blog posts, giving talks, and so forth. + +In order to have a healthy open source community, knowledge can’t be dominated by few people. We need to make an effort to have as many people capable of moving the project forward as possible. Also, a key aspect of mentoring is not only related to coding, but also to leadership skills. Preparing people to take roles like Project Team Lead, joining the Technical Committee, and so on is crucial if we intend to see the community grow even when we're not around anymore. + +Needless to say, mentoring is also an important skill for climbing the engineering ladder in most companies. Consider that another motivation. + +### To conclude + +Open source should not be treated as only the means to an end. Collaboration is a crucial part of these projects, and alongside mentoring, should always be treated as a first citizen in any open source community. And, of course, we will fix the unfinished spec used as this article's example. + +If you are part of an open source community, it is your responsibility to be focusing on sharing your knowledge while you are still around. Chances are that no one is going to tell you to do so, it should be part of the routine of any open source collaborator. + +What are other ways of sharing knowledge? What are your thoughts and ideas about the issue? + +_This original article was posted on[rodrigods][20]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/code-missing-community-management + +作者:[Rodrigo Duarte Sousa][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/rodrigods/users/tellesnobrega +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_question_B.png?itok=f88cyt00 +[2]: https://en.wikipedia.org/wiki/Version_control +[3]: https://en.wikipedia.org/wiki/Unit_testing +[4]: https://en.wikipedia.org/wiki/Integration_testing +[5]: https://en.wikipedia.org/wiki/Continuous_delivery +[6]: https://en.wikipedia.org/wiki/Code_review +[7]: https://www.agilealliance.org/glossary/sprint-planning/ +[8]: https://www.softwaretestinghelp.com/how-to-write-good-bug-report/ +[9]: https://en.wikipedia.org/wiki/Bus_factor +[10]: https://www.openstack.org/ +[11]: /resources/what-is-openstack +[12]: https://review.opendev.org/#/c/148730/35 +[13]: https://blueprints.launchpad.net/keystone/+spec/project-tree-deletion +[14]: https://bugs.launchpad.net/keystone/+bug/1816105 +[15]: https://github.com/openstack/keystone/blob/master/keystone/resource/core.py#L475-L519 +[16]: https://github.com/openstack/keystone/blob/master/keystone/api/projects.py#L202-L214 +[17]: https://launchpad.net +[18]: https://www.outreachy.org/ +[19]: https://summerofcode.withgoogle.com/ +[20]: https://blog.rodrigods.com/knowledge-legacy-the-issue-of-passing-the-baton/ diff --git a/sources/tech/20190510 Learn to change history with git rebase.md b/sources/tech/20190510 Learn to change history with git rebase.md new file mode 100644 index 0000000000..4d46fef81f --- /dev/null +++ b/sources/tech/20190510 Learn to change history with git rebase.md @@ -0,0 +1,597 @@ +Translating by Scoutydren.... + + +[#]: collector: (lujun9972) +[#]: translator: (Scoutydren) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn to change history with git rebase!) +[#]: via: (https://git-rebase.io/) +[#]: author: (git-rebase https://git-rebase.io/) + +Learn to change history with git rebase! +====== +One of Git 's core value-adds is the ability to edit history. Unlike version control systems that treat the history as a sacred record, in git we can change history to suit our needs. This gives us a lot of powerful tools and allows us to curate a good commit history in the same way we use refactoring to uphold good software design practices. These tools can be a little bit intimidating to the novice or even intermediate git user, but this guide will help to demystify the powerful git-rebase . + +``` +A word of caution : changing the history of public, shared, or stable branches is generally advised against. Editing the history of feature branches and personal forks is fine, and editing commits that you haven't pushed yet is always okay. Use git push -f to force push your changes to a personal fork or feature branch after editing your commits. +``` + +Despite the scary warning, it's worth mentioning that everything mentioned in this guide is a non-destructive operation. It's actually pretty difficult to permanently lose data in git. Fixing things when you make mistakes is covered at the end of this guide. + +### Setting up a sandbox + +We don't want to mess up any of your actual repositories, so throughout this guide we'll be working with a sandbox repo. Run these commands to get started: + +``` +git init /tmp/rebase-sandbox +cd /tmp/rebase-sandbox +git commit --allow-empty -m"Initial commit" +``` + +If you run into trouble, just run rm -rf /tmp/rebase-sandbox and run these steps again to start over. Each step of this guide can be run on a fresh sandbox, so it's not necessary to re-do every task. + + +### Amending your last commit + +Let's start with something simple: fixing your most recent commit. Let's add a file to our sandbox - and make a mistake: + +``` +echo "Hello wrold!" >greeting.txt + git add greeting.txt + git commit -m"Add greeting.txt" +``` + +Fixing this mistake is pretty easy. We can just edit the file and commit with `--amend`, like so: + +``` +echo "Hello world!" >greeting.txt + git commit -a --amend +``` + +Specifying `-a` automatically stages (i.e. `git add`'s) all files that git already knows about, and `--amend` will squash the changes into the most recent commit. Save and quit your editor (you have a chance to change the commit message now if you'd like). You can see the fixed commit by running `git show`: + +``` +commit f5f19fbf6d35b2db37dcac3a55289ff9602e4d00 (HEAD -> master) +Author: Drew DeVault +Date: Sun Apr 28 11:09:47 2019 -0400 + + Add greeting.txt + +diff --git a/greeting.txt b/greeting.txt +new file mode 100644 +index 0000000..cd08755 +--- /dev/null ++++ b/greeting.txt +@@ -0,0 +1 @@ ++Hello world! +``` + +### Fixing up older commits + +Amending only works for the most recent commit. What happens if you need to correct an older commit? Let's start by setting up our sandbox accordingly: + +``` +echo "Hello!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "Goodbye world!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" +``` + +Looks like `greeting.txt` is missing "world". Let's write a commit normally which fixes that: + +``` +echo "Hello world!" >greeting.txt +git commit -a -m"fixup greeting.txt" +``` + +So now the files look correct, but our history could be better - let's use the new commit to "fixup" the last one. For this, we need to introduce a new tool: the interactive rebase. We're going to edit the last three commits this way, so we'll run `git rebase -i HEAD~3` (`-i` for interactive). This'll open your text editor with something like this: + +``` +pick 8d3fc77 Add greeting.txt +pick 2a73a77 Add farewell.txt +pick 0b9d0bb fixup greeting.txt + +# Rebase f5f19fb..0b9d0bb onto f5f19fb (3 commands) +# +# Commands: +# p, pick = use commit +# f, fixup = like "squash", but discard this commit's log message +``` + +This is the rebase plan, and by editing this file you can instruct git on how to edit history. I've trimmed the summary to just the details relevant to this part of the rebase guide, but feel free to skim the full summary in your text editor. + +When we save and close our editor, git is going to remove all of these commits from its history, then execute each line one at a time. By default, it's going to pick each commit, summoning it from the heap and adding it to the branch. If we don't edit this file at all, we'll end up right back where we started, picking every commit as-is. We're going to use one of my favorite features now: fixup. Edit the third line to change the operation from "pick" to "fixup" and move it to immediately after the commit we want to "fix up": + +``` +pick 8d3fc77 Add greeting.txt +fixup 0b9d0bb fixup greeting.txt +pick 2a73a77 Add farewell.txt +``` + +**Tip** : We can also abbreviate this with just "f" to speed things up next time. + +Save and quit your editor - git will run these commands. We can check the log to verify the result: + +``` +$ git log -2 --oneline +fcff6ae (HEAD -> master) Add farewell.txt +a479e94 Add greeting.txt +``` + +### Squashing several commits into one + +As you work, you may find it useful to write lots of commits as you reach small milestones or fix bugs in previous commits. However, it may be useful to "squash" these commits together, to make a cleaner history before merging your work into master. For this, we'll use the "squash" operation. Let's start by writing a bunch of commits - just copy and paste this if you want to speed it up: + +``` +git checkout -b squash +for c in H e l l o , ' ' w o r l d; do + echo "$c" >>squash.txt + git add squash.txt + git commit -m"Add '$c' to squash.txt" +done +``` + +That's a lot of commits to make a file that says "Hello, world"! Let's start another interactive rebase to squash them together. Note that we checked out a branch to try this on, first. Because of that, we can quickly rebase all of the commits since we branched by using `git rebase -i master`. The result: + +``` +pick 1e85199 Add 'H' to squash.txt +pick fff6631 Add 'e' to squash.txt +pick b354c74 Add 'l' to squash.txt +pick 04aaf74 Add 'l' to squash.txt +pick 9b0f720 Add 'o' to squash.txt +pick 66b114d Add ',' to squash.txt +pick dc158cd Add ' ' to squash.txt +pick dfcf9d6 Add 'w' to squash.txt +pick 7a85f34 Add 'o' to squash.txt +pick c275c27 Add 'r' to squash.txt +pick a513fd1 Add 'l' to squash.txt +pick 6b608ae Add 'd' to squash.txt + +# Rebase 1af1b46..6b608ae onto 1af1b46 (12 commands) +# +# Commands: +# p, pick = use commit +# s, squash = use commit, but meld into previous commit +``` + +**Tip** : your local master branch evolves independently of the remote master branch, and git stores the remote branch as `origin/master`. Combined with this trick, `git rebase -i origin/master` is often a very convenient way to rebase all of the commits which haven't been merged upstream yet! + +We're going to squash all of these changes into the first commit. To do this, change every "pick" operation to "squash", except for the first line, like so: + +``` +pick 1e85199 Add 'H' to squash.txt +squash fff6631 Add 'e' to squash.txt +squash b354c74 Add 'l' to squash.txt +squash 04aaf74 Add 'l' to squash.txt +squash 9b0f720 Add 'o' to squash.txt +squash 66b114d Add ',' to squash.txt +squash dc158cd Add ' ' to squash.txt +squash dfcf9d6 Add 'w' to squash.txt +squash 7a85f34 Add 'o' to squash.txt +squash c275c27 Add 'r' to squash.txt +squash a513fd1 Add 'l' to squash.txt +squash 6b608ae Add 'd' to squash.txt +``` + +When you save and close your editor, git will think about this for a moment, then open your editor again to revise the final commit message. You'll see something like this: + +``` +# This is a combination of 12 commits. +# This is the 1st commit message: + +Add 'H' to squash.txt + +# This is the commit message #2: + +Add 'e' to squash.txt + +# This is the commit message #3: + +Add 'l' to squash.txt + +# This is the commit message #4: + +Add 'l' to squash.txt + +# This is the commit message #5: + +Add 'o' to squash.txt + +# This is the commit message #6: + +Add ',' to squash.txt + +# This is the commit message #7: + +Add ' ' to squash.txt + +# This is the commit message #8: + +Add 'w' to squash.txt + +# This is the commit message #9: + +Add 'o' to squash.txt + +# This is the commit message #10: + +Add 'r' to squash.txt + +# This is the commit message #11: + +Add 'l' to squash.txt + +# This is the commit message #12: + +Add 'd' to squash.txt + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +This defaults to a combination of all of the commit messages which were squashed, but leaving it like this is almost always not what you want. The old commit messages may be useful for reference when writing the new one, though. + +**Tip** : the "fixup" command you learned about in the previous section can be used for this purpose, too - but it discards the messages of the squashed commits. + +Let's delete everything and replace it with a better commit message, like this: + +``` +Add squash.txt with contents "Hello, world" + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Date: Sun Apr 28 14:21:56 2019 -0400 +# +# interactive rebase in progress; onto 1af1b46 +# Last commands done (12 commands done): +# squash a513fd1 Add 'l' to squash.txt +# squash 6b608ae Add 'd' to squash.txt +# No commands remaining. +# You are currently rebasing branch 'squash' on '1af1b46'. +# +# Changes to be committed: +# new file: squash.txt +# +``` + +Save and quit your editor, then examine your git log - success! + +``` +commit c785f476c7dff76f21ce2cad7c51cf2af00a44b6 (HEAD -> squash) +Author: Drew DeVault +Date: Sun Apr 28 14:21:56 2019 -0400 + + Add squash.txt with contents "Hello, world" +``` + +Before we move on, let's pull our changes into the master branch and get rid of this scratch one. We can use `git rebase` like we use `git merge`, but it avoids making a merge commit: + +``` +git checkout master +git rebase squash +git branch -D squash +``` + +We generally prefer to avoid using git merge unless we're actually merging unrelated histories. If you have two divergent branches, a git merge is useful to have a record of when they were... merged. In the course of your normal work, rebase is often more appropriate. + +### Splitting one commit into several + +Sometimes the opposite problem happens - one commit is just too big. Let's look into splitting it up. This time, let's write some actual code. Start with a simple C program2 (you can still copy+paste this snippet into your shell to do this quickly): + +``` +cat <main.c +int main(int argc, char *argv[]) { + return 0; +} +EOF +``` + +We'll commit this first. + +``` +git add main.c +git commit -m"Add C program skeleton" +``` + +Next, let's extend the program a bit: + +``` +cat <main.c +#include <stdio.h> + +const char *get_name() { + static char buf[128]; + scanf("%s", buf); + return buf; +} + +int main(int argc, char *argv[]) { + printf("What's your name? "); + const char *name = get_name(); + printf("Hello, %s!\n", name); + return 0; +} +EOF +``` + +After we commit this, we'll be ready to learn how to split it up. + +``` +git commit -a -m"Flesh out C program" +``` + +The first step is to start an interactive rebase. Let's rebase both commits with `git rebase -i HEAD~2`, giving us this rebase plan: + +``` +pick 237b246 Add C program skeleton +pick b3f188b Flesh out C program + +# Rebase c785f47..b3f188b onto c785f47 (2 commands) +# +# Commands: +# p, pick = use commit +# e, edit = use commit, but stop for amending +``` + +Change the second commit's command from "pick" to "edit", then save and close your editor. Git will think about this for a second, then present you with this: + +``` +Stopped at b3f188b... Flesh out C program +You can amend the commit now, with + + git commit --amend + +Once you are satisfied with your changes, run + + git rebase --continue +``` + +We could follow these instructions to add new changes to the commit, but instead let's do a "soft reset"3 by running `git reset HEAD^`. If you run `git status` after this, you'll see that it un-commits the latest commit and adds its changes to the working tree: + +``` +Last commands done (2 commands done): + pick 237b246 Add C program skeleton + edit b3f188b Flesh out C program +No commands remaining. +You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. + (Once your working directory is clean, run "git rebase --continue") + +Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: main.c + +no changes added to commit (use "git add" and/or "git commit -a") +``` + +To split this up, we're going to do an interactive commit. This allows us to selectively commit only specific changes from the working tree. Run `git commit -p` to start this process, and you'll be presented with the following prompt: + +``` +diff --git a/main.c b/main.c +index b1d9c2c..3463610 100644 +--- a/main.c ++++ b/main.c +@@ -1,3 +1,14 @@ ++#include <stdio.h> ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { ++ printf("What's your name? "); ++ const char *name = get_name(); ++ printf("Hello, %s!\n", name); + return 0; + } +Stage this hunk [y,n,q,a,d,s,e,?]? +``` + +Git has presented you with just one "hunk" (i.e. a single change) to consider committing. This one is too big, though - let's use the "s" command to "split" up the hunk into smaller parts. + +``` +Split into 2 hunks. +@@ -1 +1,9 @@ ++#include ++ ++const char *get_name() { ++ static char buf[128]; ++ scanf("%s", buf); ++ return buf; ++} ++ + int main(int argc, char *argv[]) { +Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? +``` + +**Tip** : If you're curious about the other options, press "?" to summarize them. + +This hunk looks better - a single, self-contained change. Let's hit "y" to answer the question (and stage that "hunk"), then "q" to "quit" the interactive session and proceed with the commit. Your editor will pop up to ask you to enter a suitable commit message. + +``` +Add get_name function to C program + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# interactive rebase in progress; onto c785f47 +# Last commands done (2 commands done): +# pick 237b246 Add C program skeleton +# edit b3f188b Flesh out C program +# No commands remaining. +# You are currently splitting a commit while rebasing branch 'master' on 'c785f47'. +# +# Changes to be committed: +# modified: main.c +# +# Changes not staged for commit: +# modified: main.c +# +``` + +Save and close your editor, then we'll make the second commit. We could do another interactive commit, but since we just want to include the rest of the changes in this commit we'll just do this: + +``` +git commit -a -m"Prompt user for their name" +git rebase --continue +``` + +That last command tells git that we're done editing this commit, and to continue to the next rebase command. That's it! Run `git log` to see the fruits of your labor: + +``` +$ git log -3 --oneline +fe19cc3 (HEAD -> master) Prompt user for their name +659a489 Add get_name function to C program +237b246 Add C program skeleton +``` + +### Reordering commits + +This one is pretty easy. Let's start by setting up our sandbox: + +``` +echo "Goodbye now!" >farewell.txt +git add farewell.txt +git commit -m"Add farewell.txt" + +echo "Hello there!" >greeting.txt +git add greeting.txt +git commit -m"Add greeting.txt" + +echo "How're you doing?" >inquiry.txt +git add inquiry.txt +git commit -m"Add inquiry.txt" +``` + +The git log should now look like this: + +``` +f03baa5 (HEAD -> master) Add inquiry.txt +a4cebf7 Add greeting.txt +90bb015 Add farewell.txt +``` + +Clearly, this is all out of order. Let's do an interactive rebase of the past 3 commits to resolve this. Run `git rebase -i HEAD~3` and this rebase plan will appear: + +``` +pick 90bb015 Add farewell.txt +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt + +# Rebase fe19cc3..f03baa5 onto fe19cc3 (3 commands) +# +# Commands: +# p, pick = use commit +# +# These lines can be re-ordered; they are executed from top to bottom. +``` + +The fix is now straightforward: just reorder these lines in the order you wish for the commits to appear. Should look something like this: + +``` +pick a4cebf7 Add greeting.txt +pick f03baa5 Add inquiry.txt +pick 90bb015 Add farewell.txt +``` + +Save and close your editor and git will do the rest for you. Note that it's possible to end up with conflicts when you do this in practice - click here for help resolving conflicts. + +### git pull --rebase + +If you've been writing some commits on a branch which has been updated upstream, normally `git pull` will create a merge commit. In this respect, `git pull`'s behavior by default is equivalent to: + +``` +git fetch origin +git merge origin/master +``` + +There's another option, which is often more useful and leads to a much cleaner history: `git pull --rebase`. Unlike the merge approach, this is equivalent to the following: + +``` +git fetch origin +git rebase origin/master +``` + +The merge approach is simpler and easier to understand, but the rebase approach is almost always what you want to do if you understand how to use git rebase. If you like, you can set it as the default behavior like so: + +``` +git config --global pull.rebase true +``` + +When you do this, technically you're applying the procedure we discuss in the next section... so let's explain what it means to do that deliberately, too. + +### Using git rebase to... rebase + +Ironically, the feature of git rebase that I use the least is the one it's named for: rebasing branches. Say you have the following branches: + +``` +o--o--o--o--> master + \--o--o--> feature-1 + \--o--> feature-2 +``` + +It turns out feature-2 doesn't depend on any of the changes in feature-1, so you can just base it off of master. The fix is thus: + +``` +git checkout feature-2 +git rebase master +``` + +The non-interactive rebase does the default operation for all implicated commits ("pick")4, which simply rolls your history back to the last common anscestor and replays the commits from both branches. Your history now looks like this: + +``` +o--o--o--o--> master + | \--o--> feature-2 + \--o--o--> feature-1 +``` + +### Resolving conflicts + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +The details on resolving merge conflicts are beyond the scope of this guide - keep your eye out for another guide for this in the future. Assuming you're familiar with resolving conflicts in general, here are the specifics that apply to rebasing. + +Sometimes you'll get a merge conflict when doing a rebase, which you can handle just like any other merge conflict. Git will set up the conflict markers in the affected files, `git status` will show you what you need to resolve, and you can mark files as resolved with `git add` or `git rm`. However, in the context of a git rebase, there are two options you should be aware of. + +The first is how you complete the conflict resolution. Rather than `git commit` like you'll use when addressing conflicts that arise from `git merge`, the appropriate command for rebasing is `git rebase --continue`. However, there's another option available to you: `git rebase --skip`. This will skip the commit you're working on, and it won't be included in the rebase. This is most common when doing a non-interactive rebase, when git doesn't realize that a commit it's pulled from the "other" branch is an updated version of the commit that it conflicts with on "our" branch. + +### Help! I broke it! + +No doubt about it - rebasing can be hard sometimes. If you've made a mistake and in so doing lost commits which you needed, then `git reflog` is here to save the day. Running this command will show you every operation which changed a ref, or reference - that is, branches and tags. Each line shows you what the old reference pointed to, and you can `git cherry-pick`, `git checkout`, `git show`, or use any other operation on git commits once thought lost. + + +-------------------------------------------------------------------------------- + +via: https://git-rebase.io/ + +作者:[git-rebase][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://git-rebase.io/ +[b]: https://github.com/lujun9972 diff --git a/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md b/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md new file mode 100644 index 0000000000..c136a83deb --- /dev/null +++ b/sources/tech/20190512 How to Setup Local Yum-DNF Repository on RHEL 8 Server Using DVD or ISO File.md @@ -0,0 +1,164 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File) +[#]: via: (https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Setup Local Yum/DNF Repository on RHEL 8 Server Using DVD or ISO File +====== + +Recently Red Hat has released its most awaited operating system “ **RHEL 8** “, in case you have installed RHEL 8 Server on your system and wondering how to setup local yum or dnf repository using installation DVD or ISO file then refer below steps and procedure. + + + +In RHEL 8, we have two package repositories: + + * BaseOS + * Application Stream + + + +BaseOS repository have all underlying OS packages where as Application Stream repository have all application related packages, developer tools and databases etc. Using Application stream repository, we can have multiple of versions of same application and Database. + +### Step:1) Mount RHEL 8 ISO file / Installation DVD + +To mount RHEL 8 ISO file inside your RHEL 8 server use the beneath mount command, + +``` +[root@linuxtechi ~]# mount -o loop rhel-8.0-x86_64-dvd.iso /opt/ +``` + +**Note:** I am assuming you have already copied RHEL 8 ISO file inside your system, + +In case you have RHEL 8 installation DVD, then use below mount command to mount it, + +``` +[root@linuxtechi ~]# mount /dev/sr0 /opt +``` + +### Step:2) Copy media.repo file from mounted directory to /etc/yum.repos.d/ + +In our case RHEL 8 Installation DVD or ISO file is mounted under /opt folder, use cp command to copy media.repo file to /etc/yum.repos.d/ directory, + +``` +[root@linuxtechi ~]# cp -v /opt/media.repo /etc/yum.repos.d/rhel8.repo +'/opt/media.repo' -> '/etc/yum.repos.d/rhel8.repo' +[root@linuxtechi ~]# +``` + +Set “644” permission on “ **/etc/yum.repos.d/rhel8.repo** ” + +``` +[root@linuxtechi ~]# chmod 644 /etc/yum.repos.d/rhel8.repo +[root@linuxtechi ~]# +``` + +### Step:3) Add repository entries in “/etc/yum.repos.d/rhel8.repo” file + +By default, **rhel8.repo** file will have following content, + + + +Edit rhel8.repo file and add the following contents, + +``` +[root@linuxtechi ~]# vi /etc/yum.repos.d/rhel8.repo +[InstallMedia-BaseOS] +name=Red Hat Enterprise Linux 8 - BaseOS +metadata_expire=-1 +gpgcheck=1 +enabled=1 +baseurl=file:///opt/BaseOS/ +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release + +[InstallMedia-AppStream] +name=Red Hat Enterprise Linux 8 - AppStream +metadata_expire=-1 +gpgcheck=1 +enabled=1 +baseurl=file:///opt/AppStream/ +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +``` + +rhel8.repo should look like above once we add the content, In case you have mounted the Installation DVD or ISO on different folder then change the location and folder name in base url line for both repositories and rest of parameter leave as it is. + +### Step:4) Clean Yum / DNF and Subscription Manager Cache + +Use the following command to clear yum or dnf and subscription manager cache, + +``` +root@linuxtechi ~]# dnf clean all +[root@linuxtechi ~]# subscription-manager clean +All local data removed +[root@linuxtechi ~]# +``` + +### Step:5) Verify whether Yum / DNF is getting packages from Local Repo + +Use dnf or yum repolist command to verify whether these commands are getting packages from Local repositories or not. + +``` +[root@linuxtechi ~]# dnf repolist +Updating Subscription Management repositories. +Unable to read consumer identity +This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. +Last metadata expiration check: 1:32:44 ago on Sat 11 May 2019 08:48:24 AM BST. +repo id repo name status +InstallMedia-AppStream Red Hat Enterprise Linux 8 - AppStream 4,672 +InstallMedia-BaseOS Red Hat Enterprise Linux 8 - BaseOS 1,658 +[root@linuxtechi ~]# +``` + +**Note :** You can use either dnf or yum command, if you use yum command then its request is redirecting to DNF itself because in RHEL 8 yum is based on DNF command. + +If you have noticed the above command output carefully, we are getting warning message “ **This system is not registered to Red Hat Subscription Management**. **You can use subscription-manager to register”** , if you want to suppress or prevent this message while running dnf / yum command then edit the file “/etc/yum/pluginconf.d/subscription-manager.conf”, changed the parameter “enabled=1” to “enabled=0” + +``` +[root@linuxtechi ~]# vi /etc/yum/pluginconf.d/subscription-manager.conf +[main] +enabled=0 +``` + +save and exit the file. + +### Step:6) Installing packages using DNF / Yum + +Let’s assume we want to install nginx web server then run below dnf command, + +``` +[root@linuxtechi ~]# dnf install nginx +``` + +![][1] + +Similarly if you want to install **LEMP** stack on your RHEL 8 system use the following dnf command, + +``` +[root@linuxtechi ~]# dnf install nginx mariadb php -y +``` + +[![][2]][3] + +This confirms that we have successfully configured Local yum / dnf repository on our RHEL 8 server using Installation DVD or ISO file. + +In case these steps help you technically, please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/setup-local-yum-dnf-repository-rhel-8/ + +作者:[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/wp-content/uploads/2019/05/dnf-install-nginx-rhel8-1024x376.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/LEMP-Stack-Install-RHEL8-1024x540.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/LEMP-Stack-Install-RHEL8.jpg diff --git a/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md new file mode 100644 index 0000000000..c685af487c --- /dev/null +++ b/sources/tech/20190513 Blockchain 2.0 - Introduction To Hyperledger Fabric -Part 10.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Blockchain 2.0 – Introduction To Hyperledger Fabric [Part 10] +====== + +![Hyperledger Fabric][1] + +### Hyperledger Fabric + +The [**Hyperledger project**][2] is an umbrella organization of sorts featuring many different modules and systems under development. Among the most popular among these individual sub-projects is the **Hyperledger Fabric**. This post will explore the features that would make the Fabric almost indispensable in the near future once blockchain systems start proliferating into main stream use. Towards the end we will also take a quick look at what developers and enthusiasts need to know regarding the technicalities of the Hyperledger Fabric. + +### Inception + +In the usual fashion for the Hyperledger project, Fabric was “donated” to the organization by one of its core members, **IBM** , who was previously the principle developer of the same. The technology platform shared by IBM was put to joint development at the Hyperledger project with contributions from over a 100 member companies and institutions. + +Currently running on **v1.4** of the LTS version, Fabric has come a long way and is currently seen as the go to enterprise solution for managing business data. The core vision that surrounds the Hyperledger project inevitably permeates into the Fabric as well. The Hyperledger Fabric system carries forward all the enterprise ready and scalable features that are hard coded into all projects under the Hyperledger organization. + +### Highlights Of Hyperledger Fabric + +Hyperledger Fabric offers a wide variety of features and standards that are built around the mission of supporting fast development and modular architectures. Furthermore, compared to its competitors (primarily **Ripple** and [**Ethereum**][3]), Fabric takes an explicit stance toward closed and [**permissioned blockchains**][4]. Their core objective here is to develop a set of tools which will aid blockchain developers in creating customized solutions and not to create a standalone ecosystem or a product. + +Some of the highlights of the Hyperledger Fabric are given below: + + * **Permissioned blockchain systems** + + + +This is a category where other platforms such as Ethereum and Ripple differ quite a lot with Hyperledger Fabric. The Fabric by default is a tool designed to implement a private permissioned blockchain. Such blockchains cannot be accessed by everyone and the nodes working to offer consensus or to verify transactions are chosen by a central authority. This might be important for some applications such as banking and insurance, where transactions have to be verified by the central authority rather than participants. + + * **Confidential and controlled information flow** + + + +The Fabric has built in permission systems that will restrict information flow within a specific group or certain individuals as the case may be. Unlike a public blockchain where anyone and everyone who runs a node will have a copy and selective access to data stored in the blockchain, the admin of the system can choose how to and who to share access to the information. There are also subsystems which will encrypt the stored data at better security standards compared to existing competition. + + * **Plug and play architecture** + + + +Hyperledger Fabric has a plug and play type architecture. Individual components of the system may be chosen to be implemented and components of the system that developers don’t see a use for maybe discarded. The Fabric takes a highly modular and customizable route to development rather than a one size fits all approach taken by its competitors. This is especially attractive for firms and companies looking to build a lean system fast. This combined with the interoperability of the Fabric with other Hyperledger components implies that developers and designers now have access to a diverse set of standardized tools instead of having to pull code from different sources and integrate them afterwards. It also presents a rather fail-safe way to build robust modular systems. + + * **Smart contracts and chaincode** + + + +A distributed application running on a blockchain is called a [**Smart contract**][5]. While the smart contract term is more or less associated with the Ethereum platform, chaincode is the name given to the same in the Hyperledger camp. Apart from possessing all the benefits of **DApps** being present in chaincode applications, what sets Hyperledger apart is the fact that the code for the same may be written in multiple high-level programming language. It supports [**Go**][6] and **JavaScript** out of the box and supports many other after integration with appropriate compiler modules as well. Though this fact might not mean much at this point, the fact remains that if existing talent can be used for ongoing projects involving blockchain that has the potential to save companies billions of dollars in personnel training and management in the long run. Developers can code in languages they’re comfortable in to start building applications on the Hyperledger Fabric and need not learn nor train in platform specific languages and syntax. This presents flexibility which current competitors of the Hyperledger Fabric do not offer. + + * The Hyperledger Fabric is a back-end driver platform and is mainly aimed at integration projects where a blockchain or another distributed ledger technology is required. As such it does not provide any user facing services except for minor scripting capabilities. (Think of it to be more like a scripting language.) + * Hyperledger Fabric supports building sidechains for specific use-cases. In case, the developer wishes to isolate a set of users or participants to a specific part or functionality of the application, they may do so by implementing side-chains. Side-chains are blockchains that derive from a main parent, but form a different chain after their initial block. This block which gives rise to the new chain will stay immune to further changes in the new chain and the new chain remains immutable even if new information is added to the original chain. This functionality will aid in scaling the platform being developed and usher in user specific and case specific processing capabilities. + * The previous feature also means that not all users will have an “exact” copy of all the data in the blockchain as is expected usually from public chains. Participating nodes will have a copy of data that is only relevant to them. For instance, consider an application similar to PayTM in India. The app has wallet functionality as well as an e-commerce end. However, not all its wallet users use PayTM to shop online. In this scenario, only active shoppers will have the corresponding chain of transactions on the PayTM e-commerce site, whereas the wallet users will just have a copy of the chain that stores wallet transactions. This flexible architecture for data storage and retrieval is important while scaling, since massive singular blockchains have been shown to increase lead times for processing transactions. The chain can be kept lean and well categorised this way. + + + +We will look at other modules under the Hyperledger Project in detail in upcoming posts. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.ostechnix.com/blockchain-2-0-public-vs-private-blockchain-comparison/ +[5]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[6]: https://www.ostechnix.com/install-go-language-linux/ diff --git a/sources/tech/20190513 How To Set Password Complexity On Linux.md b/sources/tech/20190513 How To Set Password Complexity On Linux.md new file mode 100644 index 0000000000..e9a3171c6b --- /dev/null +++ b/sources/tech/20190513 How To Set Password Complexity On Linux.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Set Password Complexity On Linux?) +[#]: via: (https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Set Password Complexity On Linux? +====== + +User management is one of the important task of Linux system administration. + +There are many aspect is involved in this and implementing the strong password policy is one of them. + +Navigate to the following URL, if you would like to **[generate a strong password on Linux][1]**. + +It will Restrict unauthorized access to systems. + +By default Linux is secure that everybody know. however, we need to make necessary tweak on this to make it more secure. + +Insecure password will leads to breach security. So, take additional care on this. + +Navigate to the following URL, if you would like to see the **[password strength and score][2]** of the generated strong password. + +In this article, we will teach you, how to implement the best security policy on Linux. + +We can use PAM (the “pluggable authentication module”) to enforce password policy On most Linux systems. + +The file can be found in the following location. + +For Redhat based systems @ `/etc/pam.d/system-auth` and Debian based systems @ `/etc/pam.d/common-password`. + +The default password aging details can be found in the `/etc/login.defs` file. + +I have trimmed this file for better understanding. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 99999 +PASS_MIN_DAYS 0 +PASS_MIN_LEN 5 +PASS_WARN_AGE 7 +``` + +**Details:** + + * **`PASS_MAX_DAYS:`**` ` Maximum number of days a password may be used. + * **`PASS_MIN_DAYS:`**` ` Minimum number of days allowed between password changes. + * **`PASS_MIN_LEN:`**` ` Minimum acceptable password length. + * **`PASS_WARN_AGE:`**` ` Number of days warning given before a password expires. + + + +We will show you, how to implement the below eleven password policies in Linux. + + * Password Max days + * Password Min days + * Password warning days + * Password history or Deny Re-Used Passwords + * Password minimum length + * Minimum upper case characters + * Minimum lower case characters + * Minimum digits in password + * Minimum other characters (Symbols) + * Account lock – retries + * Account unlock time + + + +### What Is Password Max days? + +This parameter limits the maximum number of days a password can be used. It’s mandatory for user to change his/her account password before expiry. + +If they forget to change, they are not allowed to login into the system. They need to work with admin team to get rid of it. + +It can be set in `/etc/login.defs` file. I’m going to set `90 days`. + +``` +# vi /etc/login.defs + +PASS_MAX_DAYS 90 +``` + +### What Is Password Min days? + +This parameter limits the minimum number of days after password can be changed. + +Say for example, if this parameter is set to 15 and user changed password today. Then he won’t be able to change the password again before 15 days from now. + +It can be set in `/etc/login.defs` file. I’m going to set `15 days`. + +``` +# vi /etc/login.defs + +PASS_MIN_DAYS 15 +``` + +### What Is Password Warning Days? + +This parameter controls the password warning days and it will warn the user when the password is going to expires. + +A warning will be given to the user regularly until the warning days ends. This can helps user to change their password before expiry. Otherwise we need to work with admin team for unlock the password. + +It can be set in `/etc/login.defs` file. I’m going to set `10 days`. + +``` +# vi /etc/login.defs + +PASS_WARN_AGE 10 +``` + +**Note:** All the above parameters only applicable for new accounts and not for existing accounts. + +### What Is Password History Or Deny Re-Used Passwords? + +This parameter keep controls of the password history. Keep history of passwords used (the number of previous passwords which cannot be reused). + +When the users try to set a new password, it will check the password history and warn the user when they set the same old password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `5` for history of password. + +``` +# vi /etc/pam.d/system-auth + +password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5 +``` + +### What Is Password Minimum Length? + +This parameter keeps the minimum password length. When the users set a new password, it will check against this parameter and warn the user if they try to set the password length less than that. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `12` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 +``` + +**try_first_pass retry=3** : Allow users to set a good password before the passwd command aborts. + +### Set Minimum Upper Case Characters? + +This parameter keeps, how many upper case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any upper case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character for minimum password length. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ucredit=-1 +``` + +### Set Minimum Lower Case Characters? + +This parameter keeps, how many lower case characters should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any lower case characters in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 lcredit=-1 +``` + +### Set Minimum Digits In Password? + +This parameter keeps, how many digits should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any digits in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 dcredit=-1 +``` + +### Set Minimum Other Characters (Symbols) In Password? + +This parameter keeps, how many Symbols should be added in the password. These are password strengthening parameters ,which increase the password strength. + +When the users set a new password, it will check against this parameter and warn the user if they are not including any Symbol in the password. + +It can be set in `/etc/pam.d/system-auth` file. I’m going to set `1` character. + +``` +# vi /etc/pam.d/system-auth + +password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ocredit=-1 +``` + +### Set Account Lock? + +This parameter controls users failed attempts. It locks user account after reaches the given number of failed login attempts. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 +account required pam_tally2.so +``` + +### Set Account Unlock Time? + +This parameter keeps users unlock time. If the user account is locked after consecutive failed authentications. + +It’s unlock the locked user account after reaches the given time. Sets the time (900 seconds = 15 minutes) for which the account should remain locked. + +It can be set in `/etc/pam.d/system-auth` file. + +``` +# vi /etc/pam.d/system-auth + +auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 +account required pam_tally2.so +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/5-ways-to-generate-a-random-strong-password-in-linux-terminal/ +[2]: https://www.2daygeek.com/how-to-check-password-complexity-strength-and-score-in-linux/ diff --git a/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md new file mode 100644 index 0000000000..c8e82151ef --- /dev/null +++ b/sources/tech/20190513 Manage business documents with OpenAS2 on Fedora.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage business documents with OpenAS2 on Fedora) +[#]: via: (https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/) +[#]: author: (Stuart D Gathman https://fedoramagazine.org/author/sdgathman/) + +Manage business documents with OpenAS2 on Fedora +====== + +![][1] + +Business documents often require special handling. Enter Electronic Document Interchange, or **EDI**. EDI is more than simply transferring files using email or http (or ftp), because these are documents like orders and invoices. When you send an invoice, you want to be sure that: + +1\. It goes to the right destination, and is not intercepted by competitors. +2\. Your invoice cannot be forged by a 3rd party. +3\. Your customer can’t claim in court that they never got the invoice. + +The first two goals can be accomplished by HTTPS or email with S/MIME, and in some situations, a simple HTTPS POST to a web API is sufficient. What EDI adds is the last part. + +This article does not cover the messy topic of formats for the files exchanged. Even when using a standardized format like ANSI or EDIFACT, it is ultimately up to the business partners. It is not uncommon for business partners to use an ad-hoc CSV file format. This article shows you how to configure Fedora to send and receive in an EDI setup. + +### Centralized EDI + +The traditional solution is to use a Value Added Network, or **VAN**. The VAN is a central hub that transfers documents between their customers. Most importantly, it keeps a secure record of the documents exchanged that can be used as evidence in disputes. The VAN can use different transfer protocols for each of its customers + +### AS Protocols and MDN + +The AS protocols are a specification for adding a digital signature with optional encryption to an electronic document. What it adds over HTTPS or S/MIME is the Message Disposition Notification, or **MDN**. The MDN is a signed and dated response that says, in essence, “We got your invoice.” It uses a secure hash to identify the specific document received. This addresses point #3 without involving a third party. + +The [AS2 protocol][2] uses HTTP or HTTPS for transport. Other AS protocols target [FTP][3] and [SMTP][4]. AS2 is used by companies big and small to avoid depending on (and paying) a VAN. + +### OpenAS2 + +OpenAS2 is an open source Java implemention of the AS2 protocol. It is available in Fedora since 28, and installed with: + +``` +$ sudo dnf install openas2 +$ cd /etc/openas2 +``` + +Configuration is done with a text editor, and the config files are in XML. The first order of business before starting OpenAS2 is to change the factory passwords. + +Edit _/etc/openas2/config.xml_ and search for _ChangeMe_. Change those passwords. The default password on the certificate store is _testas2_ , but that doesn’t matter much as anyone who can read the certificate store can read _config.xml_ and get the password. + +### What to share with AS2 partners + +There are 3 things you will exchange with an AS2 peer. + +#### AS2 ID + +Don’t bother looking up the official AS2 standard for legal AS2 IDs. While OpenAS2 implements the standard, your partners will likely be using a proprietary product which doesn’t. While AS2 allows much longer IDs, many implementations break with more than 16 characters. Using otherwise legal AS2 ID chars like ‘:’ that can appear as path separators on a proprietary OS is also a problem. Restrict your AS2 ID to upper and lower case alpha, digits, and ‘_’ with no more than 16 characters. + +#### SSL certificate + +For real use, you will want to generate a certificate with SHA256 and RSA. OpenAS2 ships with two factory certs to play with. Don’t use these for anything real, obviously. The certificate file is in PKCS12 format. Java ships with _keytool_ which can maintain your PKCS12 “keystore,” as Java calls it. This article skips using _openssl_ to generate keys and certificates. Simply note that _sudo keytool -list -keystore as2_certs.p12_ will list the two factory practice certs. + +#### AS2 URL + +This is an HTTP URL that will access your OpenAS2 instance. HTTPS is also supported, but is redundant. To use it you have to uncomment the https module configuration in _config.xml_ , and supply a certificate signed by a public CA. This requires another article and is entirely unnecessary here. + +By default, OpenAS2 listens on 10080 for HTTP and 10443 for HTTPS. OpenAS2 can talk to itself, so it ships with two partnerships using __ as the AS2 URL. If you don’t find this a convincing demo, and can install a second instance (on a VM, for instance), you can use private IPs for the AS2 URLs. Or install [Cjdns][5] to get IPv6 mesh addresses that can be used anywhere, resulting in AS2 URLs like _http://[fcbf:fc54:e597:7354:8250:2b2e:95e6:d6ba]:10080_. + +Most businesses will also want a list of IPs to add to their firewall. This is actually [bad practice][6]. An AS2 server has the same security risk as a web server, meaning you should isolate it in a VM or container. Also, the difficulty of keeping mutual lists of IPs up to date grows with the list of partners. The AS2 server rejects requests not signed by a configured partner. + +### OpenAS2 Partners + +With that in mind, open _partnerships.xml_ in your editor. At the top is a list of “partners.” Each partner has a name (referenced by the partnerships below as “sender” or “receiver”), AS2 ID, certificate, and email. You need a partner definition for yourself and those you exchange documents with. You can define multiple partners for yourself. OpenAS2 ships with two partners, OpenAS2A and OpenAS2B, which you’ll use to send a test document. + +### OpenAS2 Partnerships + +Next is a list of “partnerships,” one for each direction. Each partnership configuration includes the sender, receiver, and the AS2 URL used to send the documents. By default, partnerships use synchronous MDN. The MDN is returned on the same HTTP transaction. You could uncomment the _as2_receipt_option_ for asynchronous MDN, which is sent some time later. Use synchronous MDN whenever possible, as tracking pending MDNs adds complexity to your application. + +The other partnership options select encryption, signature hash, and other protocol options. A fully implemented AS2 receiver can handle any combination of options, but AS2 partners may have incomplete implementations or policy requirements. For example, DES3 is a comparatively weak encryption algorithm, and may not be acceptable. It is the default because it is almost universally implemented. + +If you went to the trouble to set up a second physical or virtual machine for this test, designate one as OpenAS2A and the other as OpenAS2B. Modify the _as2_url_ on the OpenAS2A-to-OpenAS2B partnership to use the IP (or hostname) of OpenAS2B, and vice versa for the OpenAS2B-to-OpenAS2A partnership. Unless they are using the FedoraWorkstation firewall profile, on both machines you’ll need: + +``` +# sudo firewall-cmd --zone=public --add-port=10080/tcp +``` + +Now start the _openas2_ service (on both machines if needed): + +``` +# sudo systemctl start openas2 +``` + +### Resetting the MDN password + +This initializes the MDN log database with the factory password, not the one you changed it to. This is a packaging bug to be fixed in the next release. To avoid frustration, here’s how to change the h2 database password: + +``` +$ sudo systemctl stop openas2 +$ cat >h2passwd <<'DONE' +#!/bin/bash +AS2DIR="/var/lib/openas2" +java -cp "$AS2DIR"/lib/h2* org.h2.tools.Shell \ + -url jdbc:h2:"$AS2DIR"/db/openas2 \ + -user sa -password "$1" <testdoc <<'DONE' +This is not a real EDI format, but is nevertheless a document. +DONE +$ sudo chown openas2 testdoc +$ sudo mv testdoc /var/spool/openas2/toOpenAS2B +$ sudo journalctl -f -u openas2 +... log output of sending file, Control-C to stop following log +^C +``` + +OpenAS2 does not send a document until it is writable by the _openas2_ user or group. As a consequence, your actual business application will copy, or generate in place, the document. Then it changes the group or permissions to send it on its way, to avoid sending a partial document. + +Now, on the OpenAS2B machine, _/var/spool/openas2/OpenAS2A_OID-OpenAS2B_OID/inbox_ shows the message received. That should get you started! + +* * * + +_Photo by _[ _Beatriz Pérez Moya_][7]_ on _[_Unsplash_][8]_._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-business-documents-with-openas2-on-fedora/ + +作者:[Stuart D Gathman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/sdgathman/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/openas2-816x345.jpg +[2]: https://en.wikipedia.org/wiki/AS2 +[3]: https://en.wikipedia.org/wiki/AS3_(networking) +[4]: https://en.wikipedia.org/wiki/AS1_(networking) +[5]: https://fedoramagazine.org/decentralize-common-fedora-apps-cjdns/ +[6]: https://www.ld.com/as2-part-2-best-practices/ +[7]: https://unsplash.com/photos/XN4T2PVUUgk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[8]: https://unsplash.com/search/photos/documents?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText diff --git a/sources/tech/20190514 Why bother writing tests at all.md b/sources/tech/20190514 Why bother writing tests at all.md new file mode 100644 index 0000000000..2b80dbaf40 --- /dev/null +++ b/sources/tech/20190514 Why bother writing tests at all.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why bother writing tests at all?) +[#]: via: (https://dave.cheney.net/2019/05/14/why-bother-writing-tests-at-all) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Why bother writing tests at all? +====== + +In previous posts and presentations I talked about [how to test][1], and [when to test][2]. To conclude this series of I’m going to ask the question, _why test at all?_ + +### Even if you don’t, someone _will_ test your software + +I’m sure no-one reading this post thinks that software should be delivered without being tested first. Even if that were true, your customers are going to test it, or at least use it. If nothing else, it would be good to discover any issues with the code before your customers do. If not for the reputation of your company, at least for your professional pride. + +So, if we agree that software should be tested, the question becomes: _who_ should do that testing? + +### The majority of testing should be performed by development teams + +I argue that the majority of the testing should be done by development groups. Moreover, testing should be automated, and thus the majority of these tests should be unit style tests. + +To be clear, I am _not_ saying you shouldn’t write integration, functional, or end to end tests. I’m also _not_ saying that you shouldn’t have a QA group, or integration test engineers. However at a recent software conference, in a room of over 1,000 engineers, nobody raised their hand when I asked if they considered themselves in a pure quality assurance role. + +You might argue that the audience was self selecting, that QA engineers did not feel a software conference was relevant–or welcoming–to them. However, I think this proves my point, the days of [one developer to one test engineer][3] are gone and not coming back. + +If development teams aren’t writing the majority of tests, who is? + +### Manual testing should not be the majority of your testing because manual testing is O(n) + +Thus, if individual contributors are expected to test the software they write, why do we need to automate it? Why is a manual testing plan not good enough? + +Manual testing of software or manual verification of a defect is not sufficient because it does not scale. As the number of manual tests grows, engineers are tempted to skip them or only execute the scenarios they _think_ are could be affected. Manual testing is expensive in terms of time, thus dollars, and it is boring. 99.9% of the tests that passed last time are _expected_ to pass again. Manual testing is looking for a needle in a haystack, except you don’t stop when you find the first needle. + +This means that your first response when given a bug to fix or a feature to implement should be to write a failing test. This doesn’t need to be a unit test, but it should be an automated test. Once you’ve fixed the bug, or added the feature, now have the test case to prove it worked–and you can check them in together. + +### Tests are the critical component that ensure you can always ship your master branch + +As a development team, you are judged on your ability to deliver working software to the business. No, seriously, the business could care less about OOP vs FP, CI/CD, table tennis or limited run La Croix. + +Your super power is, at any time, anyone on the team should be confident that the master branch of your code is shippable. This means at any time they can deliver a release of your software to the business and the business can recoup its investment in your development R&D. + +I cannot emphasise this enough. If you want the non technical parts of the business to believe you are heros, you must never create a situation where you say “well, we can’t release right now because we’re in the middle of an important refactoring. It’ll be a few weeks. We hope.” + +Again, I’m not saying you cannot refactor, but at every stage your product must be shippable. Your tests have to pass. It may not have all the desired features, but the features that are there should work as described on the tin. + +### Tests lock in behaviour + +Your tests are the contract about what your software does and does not do. Unit tests should lock in the behaviour of the package’s API. Integration tests do the same for complex interactions. Tests describe, in code, what the program promises to do. + +If there is a unit test for each input permutation, you have defined the contract for what the code will do _in code_ , not documentation. This is a contract anyone on your team can assert by simply running the tests. At any stage you _know_ with a high degree of confidence that the behaviour people relied on before your change continues to function after your change. + +### Tests give you confidence to change someone else’s code + +Lastly, and this is the biggest one, for programmers working on a piece of code that has been through many hands. Tests give you the confidence to make changes. + +Even though we’ve never met, something I know about you, the reader, is you will eventually leave your current employer. Maybe you’ll be moving on to a new role, or perhaps a promotion, perhaps you’ll move cities, or follow your partner overseas. Whatever the reason, the succession of the maintenance of programs you write is key. + +If people cannot maintain our code then as you and I move from job to job we’ll leave behind programs which cannot be maintained. This goes beyond advocacy for a language or tool. Programs which cannot be changed, programs which are too hard to onboard new developers, or programs which feel like career digression to work on them will reach only one end state–they are a dead end. They represent a balance sheet loss for the business. They will be replaced. + +If you worry about who will maintain your code after you’re gone, write good tests. + +#### Related posts: + + 1. [Writing table driven tests in Go][4] + 2. [Prefer table driven tests][5] + 3. [Automatically run your package’s tests with inotifywait][6] + 4. [The value of TDD][7] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/14/why-bother-writing-tests-at-all + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests +[2]: https://dave.cheney.net/paste/absolute-unit-test-london-gophers.pdf +[3]: https://docs.microsoft.com/en-us/azure/devops/learn/devops-at-microsoft/evolving-test-practices-microsoft +[4]: https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go (Writing table driven tests in Go) +[5]: https://dave.cheney.net/2019/05/07/prefer-table-driven-tests (Prefer table driven tests) +[6]: https://dave.cheney.net/2016/06/21/automatically-run-your-packages-tests-with-inotifywait (Automatically run your package’s tests with inotifywait) +[7]: https://dave.cheney.net/2016/04/11/the-value-of-tdd (The value of TDD) diff --git a/sources/tech/20190515 How to manage access control lists with Ansible.md b/sources/tech/20190515 How to manage access control lists with Ansible.md new file mode 100644 index 0000000000..692dd70599 --- /dev/null +++ b/sources/tech/20190515 How to manage access control lists with Ansible.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to manage access control lists with Ansible) +[#]: via: (https://opensource.com/article/19/5/manage-access-control-lists-ansible) +[#]: author: (Taz Brown https://opensource.com/users/heronthecli) + +How to manage access control lists with Ansible +====== +Automating ACL management with Ansible's ACL module is a smart way to +strengthen your security strategy. +![Data container block with hexagons][1] + +Imagine you're a new DevOps engineer in a growing agile environment, and recently your company has experienced phenomenal growth. To support expansion, the company increased hiring by 25% over the last quarter and added 5,000 more servers and network devices to its infrastructure. The company now has over 13,000 users, and you need a tool to scale the existing infrastructure and manage your large number of users and their thousands of files and directories. The company decided to adopt [Ansible][2] company-wide to manage [access control lists (ACLs)][3] and answer the call of effectively managing files and directories and permissions. + +Ansible can be used for a multitude of administration and maintenance tasks and, as a DevOps engineer or administrator, it's likely you've been tasked with using it to manage ACLs. + +### About managing ACLs + +ACLs allow regular users to share their files and directories selectively with other users and groups. With ACLs, a user can grant others the ability to read, write, and execute files and directories without leaving those filesystem elements open. + +ACLs are set and removed at the command line using the **setfacl** utility. The command is usually followed by the name of a file or directory. To set permissions, you would use the Linux command **setfacl -m d ⭕rx ** (e.g., **setfacl -m d ⭕rx Music/**). To view the current permissions on a directory, you would use the command **getfacl ** (e.g., **getfacl Music/** ). To remove an ACL from a file or directory, you would type the command, **# setfacl -x ** (to remove only the specified ACL from the file/directory) or **# setfacl -b ** (to remove all ACLs from the file/directory). + +Only the owner assigned to the file or directory can set ACLs. (It's important to understand this before you, as the admin, take on Ansible to manage your ACLs.) There are also default ACLs, which control directory access; if a file inside a directory has no ACL, then the default ACL is applied. + + +``` +sudo setfacl -m d⭕rx Music +getfacl Music/ +# file: Music/ +# owner: root +# group: root +user::rwx +group::--- +other::--- +default:user::rwx +default:group::--- +default:other::r-x +``` + +### Enter Ansible + +So how can Ansible, in all its wisdom, tackle the task of applying permissions to users, files, directories, and more? Ansible can play nicely with ACLs, just as it does with a lot of features, utilities, APIs, etc. Ansible has an out-of-the-box [ACL module][3] that allows you to create playbooks/roles around granting a user access to a file, removing ACLs for users on a specific file, setting default ACLs for users on files, or obtaining ACLs on particular files. + +Anytime you are administering ACLs, you should use the best practice of "least privilege," meaning you should give a user access only to what they need to perform their role or execute a task, and no more. Restraint and minimizing the attack surface are critical. The more access extended, the higher the risk of unauthorized access to company assets. + +Here's an example Ansible playbook: + +![Ansible playbook][4] + +As an admin, automating ACL management demands that your Ansible playbooks can scale across your infrastructure to increase speed, improve efficiency, and reduce the time it takes to achieve your goals. There will be times when you need to determine the ACL for a specific file. This is essentially the same as using **getfacl ** in Linux. If you want to determine the ACLs of many, specific files, start with a playbook that looks like this: + + +``` +\--- +\- hosts: all +tasks: +\- name: obtain the acl for a specific file +acl: +path: /etc/logrotate.d +user_nfsv4_acls: true +register: acl_info +``` + +You can use the following playbook to set permissions on files/directories: + +![Ansible playbook][5] + +This playbook grants user access to a file: + + +``` +\- hosts: +become: yes +gather_facts: no +tasks: +\- name: Grant user Shirley read access to a file +acl: +path: /etc/foo.conf +entity: shirley +etype: user +permissions: r +state: present +``` + +And this playbook grants user access to a directory: + + +``` +\--- +\- hosts: all +become: yes +gather_facts: no +tasks: +\- name: setting permissions on directory and user +acl: +path: /path/to/scripts/directory +entity: "{{ item }}" +etype: user +permissions: rwx +state: present +loop: +\- www-data +\- root +``` + +### Security realized? + +Applying ACLs to files and users is a practice you should take seriously in your role as a DevOps engineer. Security best practices and formal compliance often get little or no attention. When you allow access to files with sensitive data, you are always risking that the data will be tampered with, stolen, or deleted. Therefore, data protection must be a focal point in your security strategy. Ansible can be part of your security automation strategy, as demonstrated here, and your ACL application is as good a place to start as any. + +Automating your security practices will, of course, go beyond just managing ACLs; it might also involve [SELinux][6] configuration, cryptography, security, and compliance. Remember that Ansible also allows you to define your systems for security, whether it's locking down users and groups (e.g., managing ACLs), setting firewall rules, or applying custom security policies. + +Your security strategy should start with a baseline plan. As a DevOps engineer or admin, you should examine the current security strategy (or the lack thereof), then chart your plan for automating security in your environment. + +### Conclusion + +Using Ansible to manage your ACLs as part of your overall security automation strategy depends on the size of both the company you work for and the infrastructure you manage. Permissions, users, and files can quickly get out of control, potentially placing your security in peril and putting the company in a position you definitely don't want to it be. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/manage-access-control-lists-ansible + +作者:[Taz Brown ][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/heronthecli +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_container_block.png?itok=S8MbXEYw (Data container block with hexagons) +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://docs.ansible.com/ansible/latest/modules/acl_module.html +[4]: https://opensource.com/sites/default/files/images/acl.yml_.png (Ansible playbook) +[5]: https://opensource.com/sites/default/files/images/set_filedir_permissions.png (Ansible playbook) +[6]: https://opensource.com/article/18/8/cheat-sheet-selinux diff --git a/sources/tech/20190516 Create flexible web content with a headless management system.md b/sources/tech/20190516 Create flexible web content with a headless management system.md new file mode 100644 index 0000000000..df58e96d0d --- /dev/null +++ b/sources/tech/20190516 Create flexible web content with a headless management system.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create flexible web content with a headless management system) +[#]: via: (https://opensource.com/article/19/5/headless-cms) +[#]: author: (Sam Bocetta https://opensource.com/users/sambocetta) + +Create flexible web content with a headless management system +====== +Get the versatility and freedom to deliver content however you think is +best. +![Browser of things][1] + +In recent years, we’ve witnessed an explosion in the number of technological devices that deliver web-based content to users. Smartphones, tablets, smartwatches, and more—all with progressively advancing technical capabilities and support for an ever-widening list of operating systems and web browsers—swarm anew onto the market each year. + +What does this trend have to do with web development and headless versus traditional Content Management Systems (CMS)? Quite a lot. + +### CMS creates the internet + +A CMS is an application or set of computer programs used to manage digital content like images, videos, blog posts—essentially anything you would post on a website. An obvious example of a CMS is [WordPress][2]. + +The word "manage" is used broadly here. It can refer to creating, editing, or updating any kind of digital content on a website, as well as indexing the site to make it easily searchable. + +So, a CMS essentially separates the content displayed on a website from how that content is displayed. It also allows you, the website administrator, to set permissions on who can access, edit, modify, or otherwise manage that content. + +Suppose you want to post a new blog entry, update or correct something in an old post, write on your Facebook page, share a social media link to a video or article, or embed a video, music file, or pre-written set of text into a page on your website. If you have ever done anything like this, you have made use of CMS features. + +### Traditional CMS architecture: Benefits and flaws + +There are two major components that make up a CMS: the Content Management Application (CMA) and the Content Delivery Application (CDA). The CMA pertains to the front-end portion of the website. This is what allows authors or other content managers to edit and create content without help from a web developer. The CDA pertains to the back end portion of a website. By organizing and compiling content to make website content updates possible, it automates the function of a website administrator. + +Traditionally, these two pieces are joined into a single unit as a "coupled" CMS architecture. A **coupled CMS** uses a specific front-end delivery system (CMA) built into the application itself. The term "coupled" comes from the fact that the front-end framework—the templates and layout of the pages and how those pages respond to being opened in certain browsers—is coupled to the website’s content. In other words, in a coupled CMS architecture the Content Management Application (CMA) and Content Delivery Application (CDA) are inseparably merged. + +#### Benefits of the traditional CMS + +Coupled architecture does offer advantages, mainly in simplicity and ease of use for those who are not technically sophisticated. This fact explains why a platform like WordPress, which retains a traditional CMS setup, [remains so popular][3] for those who create websites or blogs. + +Further simplifying the web development process [are website builder applications][4], such as [Wix][5] and [Squarespace][6], which allow you to build drag-and-drop websites. The most popular of these builders use open source libraries but are themselves closed source. These sites allow almost anyone who can find the internet to put a website together without wading through the relatively short weeds of a CMS environment. While builder applications were [the object of derision][7] not so long ago amongst many in the open source community—mainly because they tended to give websites a generic and pre-packaged look and feel—they have grown increasingly functional and variegated. + +#### Security is an issue + +However, for all but the simplest web apps, a traditional CMS architecture results in inflexible technology. Modifying a static website or web app with a traditional CMS requires tremendous time and effort to produce updates, patches, and installations, preventing developers from keeping up with the growing number of devices and browsers. + +Furthermore, coupled CMSs have two built-in security flaws: + +**Risk #1** : Since content management and delivery are bound together, hackers who breach your website through the front end automatically gain access to the back-end database. This lack of separation between data and its presentation increases the likelihood that data will be stolen. Depending on the kind of user data stored on your website’s servers, a large-scale theft could be catastrophic. + +**Risk #2** : The risk of successful [Distributed Denial of Service][8] (DDoS) attacks increases without a separate system for delivering content to your website. DDoS attacks flood content delivery networks with so many traffic requests that they become overwhelmed and go offline. If your content delivery network is separated from your actual web servers, attackers will be less able to bring down your site. + +To avoid these problems, developers have introduced headless and decoupled CMSs. + +### Comparing headless and decoupled CMSs + +The "head" of a CMS is a catch-all term for the Content Delivery Application. Therefore, a CMS without one—and so with no way of delivering content to a user—is called "headless." + +This lack of an established delivery method gives headless CMSs enormous versatility. Without a CDA there is no pre-established delivery method, so developers can design separate frameworks as the need arises. The problem of constantly patching your website, web apps, and other code to guarantee compatibility disappears. + +Another option, a **decoupled CMS** , includes many of the same features and benefits as a headless CMS, but there is one crucial difference. Where a headless CMS leaves it entirely to the developer to deliver and present content to their users, a decoupled CMS offers pre-established delivery tools that developers can either take or leave. Decoupled CMSs thus offer both the simplicity of the traditional CMS and the versatility of the headless ones. + +In short, a decoupled CMS is sometimes called a **hybrid CMS ****since it's a hybrid of the coupled and headless designs. Decoupled CMSs are not a new concept. As far back as 2015, PHP core repository developer David Buchmann was [calling on devs][9] to decouple their CMSs to meet a wider set of challenges. + +### Security improvements with a headless CMS + +Perhaps the most important point to make about headless versus decoupled content management architectures, and how they both differ from traditional architecture, is the added security benefit. In both the headless and decoupled designs, content and user data are located on a separate back-end system protected by a firewall. The user can’t access the content management application itself. + +However, it's important to keep in mind that the major consequence of this change in architectures is that since the architecture is fragmented, developers have to fill in the gaps and design content delivery and presentation mechanisms on their own. This means that whether you opt to go headless or decoupled, your developer needs to understand security. While separating content management and content delivery gives hackers one fewer vector through which to attack, this isn’t a security benefit in itself. The burden will be on your devs to properly secure your resulting CDA. + +A firewall protecting the back end provides a [crucial layer of security][10]. Headless and decoupled architectures can distribute your content among multiple databases, so if you take advantage of this possibility you can lower the chance of successful DDoS attacks even further. Open source headless CMS can also benefit from the installation of a [Linux VPN][11] or Linux kernel firewall management tool like [iptables][12]. All of these options combine to provide the added security developers need to create no matter what kind of CDA or back end setup they choose. + +Benefits aside, keep in mind that headless CMS platforms are a fairly new tech. Before making the switch to headless or decoupled, consider whether the host you’re using can support your added security so that you can host your application behind network security systems to block attempts at unauthorized access. If they cannot, a host change might be in order. When evaluating new hosts, also consider any existing contracts or security and compliance restrictions in place (GDPR, CCPA, etc.) which could cause migration troubles. + +### Open source options + +As you can see, headless architecture offers designers the versatility and freedom to deliver content however they think best. This spirit of freedom fits naturally with the open source paradigm in software design, in which all source code is available to public view and may be taken and modified by anyone for any reason. + +There are a number of open source headless CMS platforms that allow developers to do just that: [Mura,][13] [dotCMS][14], and [Cockpit CMS][15] to name a few. For a deeper dive into the world of open source headless CMS platforms, [check out this article][16]. + +### Final thoughts + +For web designers and developers, the idea of a headless CMS marks a significant rethinking of how sites are built and delivered. Moving to this architecture is a great way to future-proof your website against changing preferences and whatever tricks future hackers may cook up, while at the same time creating a seamless user experience no matter what device or browser is used. You might also take a look at [this guide][17] for UX tips on designing your website in a way that meshes with headless and decoupled architectures. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/headless-cms + +作者:[Sam Bocetta][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/sambocetta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://wordpress.org/ +[3]: https://kinsta.com/wordpress-market-share/ +[4]: https://hostingcanada.org/website-builders/ +[5]: https://www.wix.com/ +[6]: https://www.squarespace.com +[7]: https://arstechnica.com/information-technology/2016/11/wordpress-and-wix-trade-shots-over-alleged-theft-of-open-source-code/ +[8]: https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/ +[9]: https://opensource.com/business/15/3/decoupling-your-cms +[10]: https://www.hostpapa.com/blog/security/why-your-small-business-needs-a-firewall/ +[11]: https://surfshark.com/download/linux +[12]: https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables/ +[13]: https://www.getmura.com/ +[14]: https://dotcms.com/ +[15]: https://getcockpit.com/ +[16]: https://www.cmswire.com/web-cms/13-headless-cmss-to-put-on-your-radar/ +[17]: https://medium.com/@mat_walker/tips-for-content-modelling-with-the-headless-cms-contentful-7e886a911962 diff --git a/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md b/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md new file mode 100644 index 0000000000..58a9459a41 --- /dev/null +++ b/sources/tech/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2) +[#]: via: (https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/) +[#]: author: (Shashidhar Soppin https://www.linuxtechi.com/author/shashidhar/) + +Monitor and Manage Docker Containers with Portainer.io (GUI tool) – Part-2 +====== + +As a continuation of Part-1, this part-2 has remaining features of Portainer covered and as explained below. + +### Monitoring docker container images + +``` +root@linuxtechi ~}$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +9ab9aa72f015 ubuntu "/bin/bash" 14 seconds ago Exited (0) 12 seconds ago suspicious_shannon +305369d3b2bb centos "/bin/bash" 24 seconds ago Exited (0) 22 seconds ago admiring_mestorf +9a669f3dc4f6 portainer/portainer "/portainer" 7 minutes ago Up 7 minutes 0.0.0.0:9000->9000/tcp trusting_keller +``` + +Including the portainer(which is a docker container image), all the exited and present running docker images are displayed. Below screenshot from Portainer GUI displays the same. + +[![Docker_status][1]][2] + +### Monitoring events + +Click on the “Events” option from the portainer webpage as shown below. + +Various events that are generated and created based on docker-container activity, are captured and displayed in this page + +[![Container-Events-Poratiner-GUI][3]][4] + +Now to check and validate how the “ **Events** ” section works. Create a new docker-container image redis as explained below, check the docker ps –a status at docker command-line. + +``` +root@linuxtechi ~}$ docker ps -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +cdbfbef59c31 redis "docker-entrypoint.s…" About a minute ago Up About a minute 6379/tcp angry_varahamihira +9ab9aa72f015 ubuntu "/bin/bash" 10 minutes ago Exited (0) 10 minutes ago suspicious_shannon +305369d3b2bb centos "/bin/bash" 11 minutes ago Exited (0) 11 minutes ago admiring_mestorf +9a669f3dc4f6 portainer/portainer "/portainer" 17 minutes ago Up 17 minutes 0.0.0.0:9000->9000/tcp trusting_keller +``` + +Click the “Event List” on the top to refresh the events list, + +[![events_updated][5]][6] + +Now the event’s page also updated with this change, + +### Host status + +Below is the screenshot of the portainer displaying the host status. This is a simple window showing-up. This shows the basic info like “CPU”, “hostname”, “OS info” etc of the host linux machine. Instead of logging- into the host command-line, this page provides very useful info on for quick glance. + +[![Host-names-Portainer][7]][8] + +### Dashboard in Portainer + +Until now we have seen various features of portainer based under “ **Local”** section. Now jump on to the “ **Dashboard** ” section of the selected Docker Container image. + +When “ **EndPoint** ” option is clicked in the GUI of Portainer, the following window appears, + +[![End_Point_Settings][9]][10] + +This Dashboard has many statuses and options, for a host container image. + +**1) Stacks:** Clicking on this option, provides status of any stacks if any. Since there are no stacks, this displays zero. + +**2) Images:** Clicking on this option provides host of container images that are available. This option will display all the live and exited container images + +[![Docker-Container-Images-Portainer][11]][12] + +For example create one more “ **Nginx”** container and refresh this list to see the updates. + +``` +root@linuxtechi ~}$ sudo docker run nginx +Unable to find image 'nginx:latest' locally +latest: Pulling from library/nginx +27833a3ba0a5: Pull complete +ea005e36e544: Pull complete +d172c7f0578d: Pull complete +Digest: sha256:e71b1bf4281f25533cf15e6e5f9be4dac74d2328152edf7ecde23abc54e16c1c +Status: Downloaded newer image for nginx:latest +``` + +The following is the image after refresh, + +[![Nginx_Image_creation][13]][14] + +Once the Nginx image is stopped/killed and docker container image will be moved to unused status. + +**Note** :-One can see all the image details here are very clear with memory usage, creation date and time. As compared to command-line option, maintaining and monitoring containers from here it will be very easy. + +**3) Networks:** this option is used for network operations. Like assigning IP address, creating subnets, providing IP address range, access control (admin and normal user) . The following window provides the details of various options possible. Based on your need these options can be explored further. + +[![Conatiner-Network-Portainer][15]][16] + +Once all the various networking parameters are entered, “ **create network** ” button is clicked for creating the network. + +**4) Container:** (click on container) This option will provide the container status. This list will provide details on live and not running container statuses. This output is similar to docker ps command option. + +[![Containers-Status-Portainer][17]][18] + +From this window only the containers can be stopped and started as need arises by checking the check box and selecting the above buttons. One example is provided as below, + +Example, Both “CentOS” and “Ubuntu” containers which are in stopped state, they are started now by selecting check boxes and hitting “Start” button. + +[![start_containers1][19]][20] + +[![start_containers2][21]][22] + +**Note:** Since both are Linux container images, they will not be started. Portainer tries to start and stops later. Try “Nginx” instead and you can see it coming to “running”status. + +[![start_containers3][23]][24] + +**5) Volume:** Described in Part-I of Portainer Article + +### Setting option in Portainer + +Until now we have seen various features of portainer based under “ **Local”** section. Now jump on to the “ **Setting”** section of the selected Docker Container image. + +When “Settings” option is clicked in the GUI of Portainer, the following further configuration options are available, + +**1) Extensions** : This is a simple Portainer CE subscription process. The details and uses can be seen from the attached window. This is mainly used for maintaining the license and subscription of the respective version. + +[![Extensions][25]][26] + +**2) Users:** This option is used for adding “users” with or without administrative privileges. Following example provides the same. + +Enter the selected user name “shashi” in this case and your choice of password and hit “ **Create User** ” button below. + +[![create_user_portainer][27]][28] + +[![create_user2_portainer][29]][30] + +[![Internal-user-Portainer][31]][32] + +Similarly the just now created user “shashi” can be removed by selecting the check box and hitting remove button. + +[![user_remove_portainer][33]][34] + +**3) Endpoints:** this option is used for Endpoint management. Endpoints can be added and removed as shown in the attached windows. + +[![Endpoint-Portainer-GUI][35]][36] + +The new endpoint “shashi” is created using the various default parameters as shown below, + +[![Endpoint2-Portainer-GUI][37]][38] + +Similarly this endpoint can be removed by clicking the check box and hitting remove button. + +**4) Registries:** this option is used for registry management. As docker hub has registry of various images, this feature can be used for similar purposes. + +[![Registry-Portainer-GUI][39]][40] + +With the default options the “shashi-registry” can be created. + +[![Registry2-Portainer-GUI][41]][42] + +Similarly this can be removed if not required. + +**5) Settings:** This option is used for the following various options, + + * Setting-up snapshot interval + * For using custom logo + * To create external templates + * Security features like- Disable and enable bin mounts for non-admins, Disable/enable privileges for non-admins, Enabling host management features + + + +Following screenshot shows some options enabled and disabled for demonstration purposes. Once all done hit on “Save Settings” button to save all these options. + +[![Portainer-GUI-Settings][43]][44] + +Now one more option pops-up on “Authentication settings” for LDAP, Internal or OAuth extension as shown below” + +[![Authentication-Portainer-GUI-Settings][45]][46] + +Based on what level of security features we want for our environment, respective option is chosen. + +That’s all from this article, I hope these Portainer GUI articles helps you to manage and monitor containers more efficiently. Please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/monitor-manage-docker-containers-portainer-io-part-2/ + +作者:[Shashidhar Soppin][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/shashidhar/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker_status-1024x423.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Docker_status.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Events-1024x404.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Events.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/events_updated-1024x414.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/events_updated.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Host_names-1024x408.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Host_names.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/05/End_Point_Settings-1024x471.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/05/End_Point_Settings.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Images-1024x398.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Images.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Nginx_Image_creation-1024x439.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Nginx_Image_creation.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Network-1024x463.jpg +[16]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Network.jpg +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Containers-1024x364.jpg +[18]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Containers.jpg +[19]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers1-1024x432.jpg +[20]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers1.jpg +[21]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers2-1024x307.jpg +[22]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers2.jpg +[23]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers3-1024x435.jpg +[24]: https://www.linuxtechi.com/wp-content/uploads/2019/05/start_containers3.jpg +[25]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Extensions-1024x421.jpg +[26]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Extensions.jpg +[27]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user-1024x350.jpg +[28]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user.jpg +[29]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user2-1024x372.jpg +[30]: https://www.linuxtechi.com/wp-content/uploads/2019/05/create_user2.jpg +[31]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Internal-user-Portainer-1024x257.jpg +[32]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Internal-user-Portainer.jpg +[33]: https://www.linuxtechi.com/wp-content/uploads/2019/05/user_remove-1024x318.jpg +[34]: https://www.linuxtechi.com/wp-content/uploads/2019/05/user_remove.jpg +[35]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint-1024x349.jpg +[36]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint.jpg +[37]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint2-1024x379.jpg +[38]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Endpoint2.jpg +[39]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry-1024x420.jpg +[40]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry.jpg +[41]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry2-1024x409.jpg +[42]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Registry2.jpg +[43]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-GUI-Settings-1024x418.jpg +[44]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Portainer-GUI-Settings.jpg +[45]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Authentication-Portainer-GUI-Settings-1024x344.jpg +[46]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Authentication-Portainer-GUI-Settings.jpg diff --git a/sources/tech/20190516 System76-s secret sauce for success.md b/sources/tech/20190516 System76-s secret sauce for success.md new file mode 100644 index 0000000000..9409de535f --- /dev/null +++ b/sources/tech/20190516 System76-s secret sauce for success.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (System76's secret sauce for success) +[#]: via: (https://opensource.com/article/19/5/system76-secret-sauce) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins/users/don-watkins) + +System76's secret sauce for success +====== +Linux computer maker's approach to community-informed software and +hardware development embodies the open source way. +![][1] + +In [_The Open Organization_][2], Jim Whitehurst says, "show passion for the purpose of your organization and constantly drive interest in it. People are drawn to and generally, want to follow passionate people." Carl Richell, the founder and CEO of Linux hardware maker [System76][3], pours that secret sauce to propel his company in the world of open hardware, Linux, and open source. + +Carl demonstrates quiet confidence and engages the team at System76 in a way that empowers their creative synergy. During a recent visit to System76's Denver factory, I could immediately tell that the employees love what they do, what they produce, and their interaction with each other and their customers, and Carl sets that example. They are as they [describe themselves][4]: a diverse team of creators, makers, and builders; a small company innovating the next big things; and a group of extremely hard-core nerds. + +### A revolutionary approach + +In 2005, Carl had a vision, which began as talk over some beers, to produce desktop and laptop computers that come installed with Linux. He's transformed that idea into a highly successful company founded on the [belief][5] that "the computer and operating system are the most powerful and versatile tools ever created." And by producing the best tools, System76 can inspire the curious to make their greatest discovery or complete their greatest project. + +![System 76 founder and CEO Carl Richell][6] + +Carl Richell's enthusiasm was obvious at System 76's [Thelio launch event][7]. + +System76 lives up to its name, which was inspired by the American Revolution of 1776. The company views itself as a leader in the open source revolution, granting people freedom and independence from proprietary hardware and software. + +But the revolution does not end there; it continues with the company's business practices and diverse environment that aims to close the gender gap in technology leadership. Eight of the company's 28 employees are women, including vice president of marketing Louisa Bisio, creative manager Kate Hazen, purchasing manager May Liu, head of technical support Emma Marshall, and manufacturing control and logistics manager Sarah Zinger. + +### Community-informed design + +The staff members' passion and ingenuity for making the Linux experience enjoyable for customers creates an outstanding culture. Because the company believes the Linux desktop deserves a dedicated PC manufacturer, in 2018, it brought manufacturing in-house. This allows System76's engineers to make design changes more quickly, based on their frequent interactions with Linux users to learn about their needs and wants. It also opens up its parts and process to the public, including publishing design files under GPL on [GitHub][8], consistent with its commitment to openness and open source. + +For example, when System76 decided to create its own version of Linux, [Pop!_OS][9], it hosted online meetings to discuss and learn what features and software its customers wanted. This decision to work closely with the community has been instrumental in making Pop!_OS successful. + +System76 again turned to the community when it began developing [Thelio][10], its new line of desktop computers. Marketing VP Louisa Bisio says, "Taking a similar approach to open hardware has been great. We started in-house design in 2016, prototyping different desktop designs. Then we moved from prototyping acrylic to sheet metal. Then the first few prototypes of Thelio were presented to our [Superfan][11] attendees in 2017, and their feedback was really important in adjusting the desktop designs and progressing Thelio iterations forward." + +Thelio is the product of research and development focusing on high-quality components and design. It features a unique cabling layout, innovative airflow within the computer case, and the Thelio Io open hardware SATA controller. Many of System76's customers use platforms like [CUDA][12] to do their work; to support them, System76 works backward and pulls out proprietary functionality, piece by piece, until everything is open. + +### Open roads ahead + +Manufacturing open laptops are on the long-range roadmap, but the company is actively working on an open motherboard and maintaining Pop!_OS and System76 drivers, which are open. This commitment to openness, customer-driven design, and culture give System 76 a unique place in computer manufacturing. All of this stems from founder Carl Richell and his philosophy "that technology should be open and accessible to everyone." [As Carl says][13], "open hardware benefits all of us. It's how we further advance technology and make it more available to everyone." + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/system76-secret-sauce + +作者:[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/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bubblehands_fromRHT_520_0612LL.png?itok=_iQ2dO3S +[2]: https://www.amazon.com/Open-Organization-Igniting-Passion-Performance/dp/1511392460 +[3]: https://system76.com/ +[4]: https://system76.com/about +[5]: https://system76.com/pop +[6]: https://opensource.com/sites/default/files/uploads/carl_richell.jpg (System 76 founder and CEO Carl Richell) +[7]: https://trevgstudios.smugmug.com/System76/121418-Thelio-Press-Event/i-w6XNmKS +[8]: https://github.com/system76 +[9]: https://opensource.com/article/18/1/behind-scenes-popos-linux +[10]: https://system76.com/desktops +[11]: https://system76.com/superfan +[12]: https://en.wikipedia.org/wiki/CUDA +[13]: https://opensource.com/article/19/4/system76-hardware diff --git a/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md new file mode 100644 index 0000000000..81d021f7d7 --- /dev/null +++ b/sources/tech/20190517 Announcing Enarx for running sensitive workloads.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Announcing Enarx for running sensitive workloads) +[#]: via: (https://opensource.com/article/19/5/enarx-security) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel/users/wgarry155) + +Announcing Enarx for running sensitive workloads +====== +Enarx leverages the capabilities of a TEE to change the trust model for +your application. +![cubes coming together to create a larger cube][1] + +Running software is something that most of us do without thinking about it. We run in "on premises"—our own machines—or we run it in the cloud - on somebody else's machines. We don't always think about what those differences mean, or about what assumptions we're making about the securtiy of the data that's being processed, or even of the software that's doing that processing. Specifically, when you run software (a "workload") on a system (a "host") on the cloud or on your own premises, there are lots and lots of layers. You often don't see those layers, but they're there. + +Here's an example of the layers that you might see in a standard cloud virtualisation architecture. The different colours represent different entities that "own" different layers or sets of layers. + +![Layers in a standard cloud virtualisation architecture][2] + +Here's a similar diagram depicting a standard cloud container architecture. As before, each different colour represents a different "owner" of a layer or set of layers. + +![Standard cloud container architecture][3] + +These owners may be of very different types, from hardware vendors to OEMs to cloud service providers (CSPs) to middleware vendors to operating system vendors to application vendors to you, the workload owner. And for each workload that you run, on each host, the exact list of layers is likely to be different. And even when they're the same, the versions of the layers instances may be different, whether it's a different BIOS version, a different bootloader, a different kernel version, or whatever else. + +Now, in many contexts, you might not worry about this, and your CSP goes out of its way to abstract these layers and their version details away from you. But this is a security article, for security people, and that means that anybody who's reading this probably does care. + +The reason we care is not just the different versions and the different layers, but the number of different things—and different entities—that we need to trust if we're going to be happy running any sort of sensitive workload on these types of stacks. I need to trust every single layer, and the owner of every single layer, not only to do what they say they will do, but also not to be compromised. This is a _big_ stretch when it comes to running my sensitive workloads. + +### What's Enarx? + +Enarx is a new project that is trying to address this problem of having to trust all of those layers. A few of us at Red Hat have been working on it for a few months now. My colleague Nathaniel McCallum demoed an early incarnation of it at [Red Hat Summit 2019][4] in Boston, and we're ready to start announcing it to the world. We have code, we have a demo, we have a GitHub repository, we have a logo: what more could a project want? Well, people—but we'll get to that. + +![Enarx logo][5] + +With Enarx, we made the decision that we wanted to allow people running workloads to be able to reduce the number of layers—and owners—that they need to trust to the absolute minimum. We plan to use trusted execution environments ("TEEs"—see "[Oh, how I love my TEE (or do I?)][6]") to provide an architecture that looks a little more like this: + +![Enarx architecture][7] + +In a world like this, you have to trust the CPU and firmware, and you need to trust some middleware—of which Enarx is part—but you don't need to trust all of the other layers, because we will leverage the capabilities of the TEE to ensure the integrity and confidentiality of your application. The Enarx project will provide attestation of the TEE, so that you know you're running on a true and trusted TEE, and will provide open source, auditable code to help you trust the layer directly beneath your application. + +The initial code is out there—working on AMD's SEV TEE at the momen—and enough of it works now that we're ready to tell you about it. + +Making sure that your application meets your own security requirements is down to you. :-) + +### How do I find out more? + +The easiest way to learn more is to visit the [Enarx GitHub][8]. + +We'll be adding more information there—it's currently just code—but bear with us: there are only a few of us on the project at the moment. A blog is on the list of things we'd like to have, but we wanted to get things started. + +We'd love to have people in the community getting involved in the project. It's currently quite low-level and requires quite a lot of knowledge to get running, but we'll work on that. You will need some specific hardware to make it work, of course. Oh, and if you're an early boot or a low-level KVM hacker, we're _particularly_ interested in hearing from you. + +I will, of course, respond to comments on this article. + +* * * + +_This article was originally published on[Alice, Eve, and Bob][9] and is reprinted with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/enarx-security + +作者:[Mike Bursell ][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/mikecamel/users/wgarry155 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://opensource.com/sites/default/files/uploads/classic-cloud-virt-arch-1.png (Layers in a standard cloud virtualisation architecture) +[3]: https://opensource.com/sites/default/files/uploads/cloud-container-arch.png (Standard cloud container architecture) +[4]: https://www.redhat.com/en/summit/2019 +[5]: https://opensource.com/sites/default/files/uploads/enarx.png (Enarx logo) +[6]: https://aliceevebob.com/2019/02/26/oh-how-i-love-my-tee-or-do-i/ +[7]: https://opensource.com/sites/default/files/uploads/reduced-arch.png (Enarx architecture) +[8]: https://github.com/enarx +[9]: https://aliceevebob.com/2019/05/07/announcing-enarx/ diff --git a/sources/tech/20190518 Best Linux Distributions for Beginners.md b/sources/tech/20190518 Best Linux Distributions for Beginners.md new file mode 100644 index 0000000000..1630f1bc85 --- /dev/null +++ b/sources/tech/20190518 Best Linux Distributions for Beginners.md @@ -0,0 +1,206 @@ +[#]: collector: (lujun9972) +[#]: translator: () +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best Linux Distributions for Beginners) +[#]: via: (https://itsfoss.com/best-linux-beginners/) +[#]: author: (Aquil Roshan https://itsfoss.com/author/aquil/) + +Best Linux Distributions for Beginners +====== + +_**Brief** : In this article, we will see the **best Linux distro for beginners**_. This will help new Linux users to pick their first distribution. + +Let’s face it, [Linux][1] can pose an overwhelming complexity to new users. But then, it’s not Linux itself that brings this complexity. Rather, it’s the “newness” factor that causes this. Not getting nostalgic, but remembering my first time with Linux, I didn’t even know what to expect. I liked it. But it was an upstream swim for me initially. + +Not knowing where to start can be a downer. Especially for someone who does not have the concept of something else running on their PC in place of Windows. + +Linux is more than an OS. It’s an idea where everybody grows together and there’s something for everybody. We have already covered: + + * [Best Linux distributions for Windows users][2] + * [Best lightweight Linux distros][3] + * [Best Linux distributions for hacking][4] + * [Best Linux distributions for gaming][5] + * [Best Linux distributions for privacy and anonymity][6] + * [Best Linux distributions that look like MacOS][7] + + + +In addition to that, there are distributions that cater to the needs of newcomers especially. So here are a few such Linux distros for beginners. You can watch it in a video and [subscribe to our YouTube channel][8] for more Linux related videos. + +### Best Linux Distros for Beginners + +Please remember that this list is no particular order. The main criteria for compiling this list is ease of installation, out of the box hardware software, ease of use and availability of software packages. + +#### 1\. Ubuntu + +If you’ve researched Linux on the internet, it’s highly probable that you have come across Ubuntu. Ubuntu is one of the leading Linux distributions. It is also the perfect path to begin your Linux journey. + +![][9] + +Ubuntu has been tagged as Linux for human beings. Now, this is because Ubuntu has put in a lot of effort on universal usability. Ubuntu does not require you to be technically sound for you to use it. It breaks the notion of Linux=Command line hassle. This is one of the major plus points that rocketed Ubuntu to where it is today. + +Ubuntu offers a very convenient installation procedure. The installer speaks plain English (or any major language you want). You can even try out Ubuntu before actually going through the installation procedure. The installer provides simple options to: + + * Install Ubuntu removing the older OS + * [Install Ubuntu alongside Windows][10] or any other existing OS (A choice is given at every startup to select the OS to boot). + * Configure partitions for users who know what they are doing. + + + +_Beginner tip: Select the second option if you are not sure about what to do._ + +Ubuntu’s user interface is called GNOME. It is as simple as well as productive as it gets. You can search anything from applications to files by pressing the Windows key. Is there any way you can make this simpler? + +There are no driver installation issues as Ubuntu comes with a hardware detector which detects, downloads and installs optimal drivers for your PC. Also, the installation comes with all the basic software like a music player, video player, an office suite and games for some time killing. + +Ubuntu has a great documentation and community support. [Ubuntu forums ][11]and [Ask Ubuntu][12] provide an appreciable quality support in almost all aspects regarding Ubuntu. It’s highly probable that any question you might have will already be answered. And the answers are beginner friendly. + +Do check out and download [Ubuntu][13] at the [official site.][13] + +#### 2\. Linux Mint Cinnamon + +For years, Linux Mint has been the **number one** Linux distribution on [Distrowatch][14]. Well deserved throne I must say. Linux mint is one of my personal favorites. It is elegant, graceful and provides a superior computing experience (out of the box). + +![][15] + +Linux Mint features the Cinnamon desktop environment. New Linux users who are still in the process of familiarizing themselves with Linux software will find Cinnamon very useful. All the software are very accessibly grouped under categories. Although this is nothing of a mind-blowing feature, to new users who do not know the names of Linux software, this is a huge bonus. + +[][16] + +Suggested read Installing Microsoft Visual Studio Code on Linux + +Linux Mint is fast. Runs fine on older computers. Linux Mint is built upon the rock-solid Ubuntu base. It uses the same software repository as Ubuntu. About the Ubuntu software repository, Ubuntu pushes software for general only use after extensive testing. This means users will not have to deal with unexpected crashes and glitches that some new software are prone to, which can be a real no-no for new Linux users. + +![][17] + +Windows 7 lovers who are really not into where Microsoft if heading with Windows 10 will find Linux Mint lovable. Linux Mint desktop is pretty similar to Windows 7 desktop. Similar toolbar, similar menu, similar tray icons are all set to make Windows users feel absolutely at home. + +Personally, I’m more likely to suggest Linux Mint to someone who is new to Linux world as Linux Mint does impress users enough for them to accept it. To me, Linux Mint should be the first among the list of Linux for beginners. + +Do check out [Linux Mint here][18]. Go for the Cinnamon version. + +#### 3\. Zorin OS + +A majority of computer users are Windows users. And when a [Windows user gets a Linux][2], there’s a fair amount of ‘unlearning process’ that user must go through. A huge amount of operations have been fixed in our muscle memory. For example, the mouse reaching to the lower left corner of the screen (Start) everytime you want to launch an application. So if we could find something that eases these issues on Linux, it’s half a battle won. Enter Zorin OS. + +![][19] + +Zorin OS is an Ubuntu-based, highly polished Linux distribution, entirely made for Windows refugees. Although pretty much every Linux distro is usable by everybody, some people might tend to be reluctant when the desktop looks too alien. Zorin OS dodges past this obstacle because of its similarities with Windows appearance wise. + +Package managers are something of a new concept to Linux newcomers. That’s why Zorin OS comes with a huge (I mean really huge) list of pre-installed software. Anything you need, there’s good chance it’s already installed on Zorin OS. As if that was not enough, [Wine and PlayOnLinux][20] come pre-installed so you can run your loved Windows software and [games][21] here too. + +![][22] + +Zorin OS comes with an amazing theme engine called the ‘Zorin look changer’. It offers some heavy customization options with presets to make your OS look like Windows 7, XP, 2000 or even a Mac for that matter. You’re going to feel home. + +![][23] + +These features make Zorin OS the _**best Linux distro for beginners**_ , isn’t it? Do check out the [Zorin OS website][24] to know more and download the OS. + +#### 4\. Elementary OS + +Since we have taken a look at Linux distros for Windows users, let’s swing by something for MacOS users too. Elementary OS very quickly rose to fame and now is always included in the list of top distros, all thanks to its aesthetic essence. Inspired by MacOS looks, Elementary OS is one of the most beautiful Linux distros. + +![][25] + +Elementary OS is another Ubuntu-based operating system which means the operating system itself is unquestionably stable. Elementary OS features the Pantheon desktop environment. You can immediately notice the resemblance to MacOS desktop. This is an advantage to MacOS users switching to Linux as they will much comfortable with the desktop and this really eases the process of coping to this change. + +![][26] + +The menu is simple and customizable according to user preferences. The operating system is zero intrusive so you can really focus on your work. It comes with a very small number of pre-installed software. So, any new user will not be repulsed by huge bloat. But hey, it’s got everything you need out of the box. For more software, Elementary OS provides a neat AppCenter. It is highly accessible and simple. Everything at one place. You can get all the software you want and perform upgrades in clicks. + +[][27] + +Suggested read How to Install and Use Slack in Linux + +Experience wise, [Elementary OS][28] is really a great piece of software. Definitely give [it a try.][28] + +#### 5\. Linux Mint Mate + +A good number of people who come to Linux are looking to revive older computers. With Windows 10, many computers that had decent specs just some years ago have become incompetent. A quick google will suggest you install Linux on such computers. In that way, you can keep them running up to the mark for the near future. Linux Mint Mate is a great Linux distro if you are looking for something to run your older computers. + +![][29] + +Linux Mint Mate is very light, resource efficient but still a polished distro. It can run smoothly on computers with less muscle power. The desktop environment does not come with bells and jingles. But in no way is it functionally inferior to any other desktop environments. The operating system is non-intrusive and allows you to have a productive computing experience without getting in your way. + +Again, the Linux Mint Mate is based on Ubuntu and has the advantage of huge base solid Ubuntu software repository. It comes with a minimum number of necessities pre-installed. Easy driver installation and setting management are made available. + +You can run Linux Mint Mate even if you have 512 MB RAM and 9 GB hard disk space (the more the merrier). + +The Mate desktop environment is really simple to use with no twists in the tale. This is really a huge plus point for Linux beginners. All the more reason to [try out Linux Mint Mate][30]. + +#### 6\. Manjaro Linux + +Ok. Any long time Linux user will say guiding a newcomer even in the general direction of Arch Linux is a sin. But hear me out. + +Arch is considered experts-only Linux because of it’s highly complex installation procedure. Manajro and Arch Linux have a common origin. But they differ extensively in everything else. + +![][31] + +Manajro Linux has an extremely beginner friendly installation procedure. A lot of things are automated like driver installation using ‘Hardware detection’. Manjaro hugely negates the hardware driver hassles that torments a lot of other Linux distros. And even if you face any issues, Manjaro has an amazing community support. + +Manjaro has its own software repository which maintains the latest of software. While providing up to date software to users is a priority, guaranteed stability is not at all compromised. This is one of the prime differences between Arch and Manjaro. Manjaro delays package releases to make sure they are absolutely stable and no regression will be caused. You can also access the Arch User Repository on Manjaro, so anything and everything you need, is always available. + +If you want to know more about Manjaro features, do read my colleague [John’s experience with Manjaro Linux and why he is hooked][32] to it. + +![][33] + +Manjaro Linux comes in XFCE, KDE, Gnome, Cinnamon and a host of more desktop environments. Do check out the [official website][34]. + +To install any of the above 6 operating systems, you need to create a bootable USB stick. If you are currently using Windows [use this guide to do so][35]. Mac OS users may [follow this guide][36]. + +**Your choice for the best Linux distro for beginners?** + +Linux might come with a learning curve, but that’s not something anybody ever regretted. Go ahead get an ISO and check out Linux. If you are already a Linux user, do share this article and help someone fall in love with Linux in this season of love. Cheers. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-linux-beginners/ + +作者:[Aquil Roshan][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/aquil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/what-is-linux +[2]: https://itsfoss.com/windows-like-linux-distributions/ +[3]: https://itsfoss.com/lightweight-linux-beginners/ +[4]: https://itsfoss.com/linux-hacking-penetration-testing/ +[5]: https://itsfoss.com/linux-gaming-distributions/ +[6]: https://itsfoss.com/privacy-focused-linux-distributions/ +[7]: https://itsfoss.com/macos-like-linux-distros/ +[8]: https://www.youtube.com/c/itsfoss +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/06/ubuntu-18-04-desktop.jpeg?resize=800%2C450&ssl=1 +[10]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[11]: https://ubuntuforums.org/ +[12]: http://askubuntu.com/ +[13]: https://www.ubuntu.com/ +[14]: https://distrowatch.com/ +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/02/LM_Home.jpg?ssl=1 +[16]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/LM_SS.jpg?ssl=1 +[18]: https://linuxmint.com/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/02/Zorin.jpg?ssl=1 +[20]: https://itsfoss.com/use-windows-applications-linux/ +[21]: https://itsfoss.com/linux-gaming-guide/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/Zorin-office.jpg?ssl=1 +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/02/OSX.jpg?ssl=1 +[24]: https://zorinos.com/ +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/02/Pantheon-Desktop.jpg?resize=800%2C500&ssl=1 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/02/Application-Menu.jpg?ssl=1 +[27]: https://itsfoss.com/slack-use-linux/ +[28]: https://elementary.io/ +[29]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/mate.jpg?ssl=1 +[30]: http://blog.linuxmint.com/?p=3182 +[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/02/manajro.jpg?ssl=1 +[32]: https://itsfoss.com/why-use-manjaro-linux/ +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/02/manjaro-kde.jpg?ssl=1 +[34]: https://manjaro.org/ +[35]: https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows +[36]: https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-macos diff --git a/sources/tech/20190519 The three Rs of remote work.md b/sources/tech/20190519 The three Rs of remote work.md new file mode 100644 index 0000000000..f40f8b652e --- /dev/null +++ b/sources/tech/20190519 The three Rs of remote work.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The three Rs of remote work) +[#]: via: (https://dave.cheney.net/2019/05/19/the-three-rs-of-remote-work) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +The three Rs of remote work +====== + +I started working remotely in 2012. Since then I’ve worked for big companies and small, organisations with outstanding remote working cultures, and others that probably would have difficulty spelling the word without predictive text. I broadly classify my experiences into three tiers; + +### Little r remote + +The first kind of remote work I call _little r_ remote. + +Your company has an office, but it’s not convenient or you don’t want to work from there. It could be the commute is too long, or its in the next town over, or perhaps a short plane flight away. Sometimes you might go into the office for a day or two a week, and should something serious arise you could join your co-workers onsite for an extended period of time. + +If you often hear people say they are going to work from home to get some work done, that’s little r remote. + +### Big R remote + +The next category I call _Big R_ remote. Big R remote differs mainly from little r remote by the tyranny of distance. It’s not impossible to visit your co-workers in person, but it is inconvenient. Meeting face to face requires a day’s flying. Passports and boarder crossings are frequently involved. The expense and distance necessitates week long sprints and commensurate periods of jetlag recuperation. + +Because of timezone differences meetings must be prearranged and periods of overlap closely guarded. Communication becomes less spontaneous and care must be taken to avoid committing to unsustainable working hours. + +### Gothic ℜ remote + +The final category is basically Big R remote working on hard mode. Everything that was hard about Big R remote, timezone, travel schedules, public holidays, daylight savings, video call latency, cultural and language barriers is multiplied for each remote worker. + +In person meetings are so rare that without a focus on written asynchronous communication progress can repeatedly stall for days, if not weeks, as miscommunication leads to disillusionment and loss of trust. + +In my experience, for knowledge workers, little r remote work offers many benefits over [the open office hell scape][1] du jour. Big R remote takes a serious commitment by all parties and if you are the first employee in that category you will bare most of the cost to making Big R remote work for you. + +Gothic ℜ remote working should probably be avoided unless all those involved have many years of working in that style _and_ the employer is committed to restructuring the company as a remote first organisation. It is not possible to succeed in a Gothic ℜ remote role without a culture of written communication and asynchronous decision making mandated, _and consistently enforced,_ by the leaders of the company. + +#### Related posts: + + 1. [How to dial remote SSL/TLS services in Go][2] + 2. [How does the go build command work ?][3] + 3. [Why Slack is inappropriate for open source communications][4] + 4. [The office coffee model of concurrent garbage collection][5] + + + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2019/05/19/the-three-rs-of-remote-work + +作者:[Dave Cheney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://dave.cheney.net/author/davecheney +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/davecheney/status/761693088666357760 +[2]: https://dave.cheney.net/2010/10/05/how-to-dial-remote-ssltls-services-in-go (How to dial remote SSL/TLS services in Go) +[3]: https://dave.cheney.net/2013/10/15/how-does-the-go-build-command-work (How does the go build command work ?) +[4]: https://dave.cheney.net/2017/04/11/why-slack-is-inappropriate-for-open-source-communications (Why Slack is inappropriate for open source communications) +[5]: https://dave.cheney.net/2018/12/28/the-office-coffee-model-of-concurrent-garbage-collection (The office coffee model of concurrent garbage collection) diff --git a/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md new file mode 100644 index 0000000000..c34effe6be --- /dev/null +++ b/sources/tech/20190520 Blockchain 2.0 - Explaining Distributed Computing And Distributed Applications -Part 11.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Explaining Distributed Computing And Distributed Applications [Part 11] +====== + +![Explaining Distributed Computing And Distributed Applications][1] + +### How DApps serve the purpose of [Blockchain 2.0][2] + +**Blockchain 1.0** was about introducing the “blockchain” into the list of modern buzzwords along with the advent of **bitcoin**. Multiple white papers detailing bitcoin’s underlying blockchain network specified the use of the blockchain for other uses as well. Although most of the said uses was around the basic concept of using the blockchain as a **decentralized medium** for storage, a use that stems from this property is utilizing it for carrying out **Distributed computing** on top of this layer. + +**DApps** or **Distributed Applications** are computer programs that are stored and run on a distributed storage system such as the [**Ethereum**][3] blockchain for instance. To understand how DApps function and how they’re different from traditional applications on your desktop or phone, we’ll need to delve into what distributed computing is. This post will explore some fundamental concepts of distributed computing and the role of blockchains in executing the said objective. Furthermore, well also look at a few applications or DApps, in blockchain lingo, to get a hang of things. + +### What is Distributed Computing? + +We’re assuming many readers are familiar with multi-threaded applications and multi-threading in general. Multi-threading is the reason why processor manufacturers are forever hell bent on increasing the core count on their products. Fundamentally speaking, some applications such as video rendering software suites are capable of dividing their work (in this case rendering effects and video styles) into multiple chunks and parallelly get them processed from a supporting computing system. This reduces the lead time on getting the work done and is generally more efficient in terms of time, money and energy usage. Applications such as some games however, cannot make use of this system since processing and responses need to be obtained real time based on user inputs rather than via planned execution. Nonetheless, the fact that more processing power may be exploited from existing hardware using these computing methods remains true and significant. + +Even supercomputers are basically a bunch of powerful CPUs all tied up together in a circuit to enable faster processing as mentioned above. The average core count on flagship CPUs from the lead manufacturers AMD and Intel have in fact gone up in the last few years, because increasing core count has recently been the only method to claim better processing and claim upgrades to their product lines. This information notwithstanding, the fact remains that distributed computing and related concepts of parallel computing are the only legitimate ways to improve processing capabilities in the near future. There are minor differences between distributed and parallel computing models as well, however that is beyond the scope off this post. + +Another method to get many computers executing programs simultaneously is to connect them through the internet and have a cloud-based program to be implemented in parts by all of the participating systems. This is the basic fundamental behind distributed applications. + +For a more detailed account and primer regarding what and how parallel computing works, interested readers may visit [this][4] webpage. For a more detailed study of the topic, for people who have a background in computer science, you may refer to [this][5] website and the accompanying book. + +### What are DApps or Distributed Applications + +Application that can make use of the capabilities offered by a distributed computing system is called a **distributed application**. The execution and structure of such an application’s back end needs to be carefully designed in order to be compatible with the system. + +The blockchain presents an opportunity to store data in a distributed system of participating nodes. Stepping up from this opportunity we can logically build systems and applications running on such a network (think about how you used to download files via the Torrent protocol). + +Such decentralized applications present a lot of benefits over conventional applications that typically run from a central server. Some highlights are: + + * DApps run on a network of such participating nodes and any user request is parsed through such network nodes to provide the user with the requested functionality. _**Program is executed on the network instead of a single computer or a server**_. + * DApps will have codified methods of filtering through requests and executing them so as to always be fair and transparent when users interact with it. To create a new block of data in the chain, the same has to be approved via a **consensus algorithm** by the participating nodes. This fundamental idea of peer to peer approval applies for DApps as well. This essentially means that DApps cannot by extension of this principle provide different outputs to the same query or input. All users will be given the same priority unless it is explicitly mentioned and all users will receive similar results from the DApp as well. This will prove to be important in developing better industry practices for insurance and finance companies for instance. A DApp that specializes in microlending, for instance, cannot differentiate and offer different interest rates for different borrowers other than their credit history. This also means that all users will eventually end up paying for their required operations uniformly depending on the computational complexity of the task they passed on to the application. For instance, combing through 10000 entries of data will cost proportionately more than combing through say 100. The payment or incentivisation system might be different for different applications and blockchain protocols though. + * Most DApps are by default redundant and fail safe. If you’re using a service which is run on a central server, a failure from the server end will freeze the application. Think of a service such as PayPal for instance. If the PayPal server in your immediate region fails due to some reason and somehow the central server cannot re route your request, your payment will not go through. However, even in case multiple participating nodes in the blockchain dies, you will still find the application live and running provided at least one node is live. This presents a use case for applications which are by definition supposed to be live all the time. Emergency services, insurance, communications etc., are some key areas where investors hope such DApps will bring in much needed reliability. + * DApps are usually cost-effective owing to them not requiring a central server to be maintained for their functionality. Once they become mainstream, the mean computing cost of running tasks on the same is also supposed to decrease. + * DApps will as mentioned exist till eternity at least until one participant is live on the chain. This essentially means that DApps cannot be censored or hacked into bowing and shutting down. + + + +The above list of features seems very few, however, combine that with all the other capabilities of the blockchain, the advancement of wireless network access, and, the increasing capabilities of millions of smartphones and here we have in our hands nothing less than a paradigm shift in how the apps that we rely on work. + +We will look deeper into how DApps function and how you can make your own DApps on the Ethereum blockchain in a proceeding post. To give you an idea of the DApp environment right now, we present 4 carefully chosen examples that are fairly advanced and popular. + +##### 1\. BITCOIN (or any Cryptocurrency) + +We’re very sure that readers did not expect BITCOIN to be one among a list of applications in this post. The point we’re trying to make here however, is that any cryptocurrency currently running on a blockchain backbone can be termed as a DApp. Cryptocurrencies are in fact the most popular DApp format out there and a revolutionary one at that too. + +##### 2\. [MELON][6] + +We’ve talked about how asset management can be an easier task utilizing blockchain and [**smart contracts**][7]. **Melon** is a company that aims to provide its users with usable relevant tools to manage and maximize their returns from the assets they own. They specialize in cryptographic assets as of now with plans to turn to real digitized assets in the future. + +##### 3\. [Request][8] + +**Request** is primarily a ledger system that handles financial transactions, invoicing, and taxation among other things. Working with other compatible databases and systems it is also capable of verifying payer data and statistics. Large corporations which typically have a significant number of defaulting customers will find it easier to handle their operations with a system such as this. + +##### 4\. [CryptoKitties][9] + +Known the world over as the video game that broke the Ethereum blockchain, **CryptoKitties** is a video game that runs on the Ethereum blockchain. The video game identifies each user individually by building your own digital profiles and gives you unique **virtual cats** in return. The game went viral and due to the sheer number of users it actually managed to slow down the Ethereum blockchain and its transaction capabilities. Transactions took longer than usual with users having to pay significantly extra money for simple transactions even. Concerns regarding scalability of the Ethereum blockchain have been raised by several stakeholders since then. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Distributed-Computing-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[4]: https://www.techopedia.com/definition/7/distributed-computing-system +[5]: https://www.distributed-systems.net/index.php/books/distributed-systems-3rd-edition-2017/ +[6]: https://melonport.com/ +[7]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[8]: https://request.network/en/use-cases/ +[9]: https://www.cryptokitties.co/ diff --git a/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md new file mode 100644 index 0000000000..4e9df8a0ff --- /dev/null +++ b/sources/tech/20190520 How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux?) +[#]: via: (https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +How To Map Oracle ASM Disk Against Physical Disk And LUNs In Linux? +====== + +You might already know about ASM, Device Mapper Multipathing (DM-Multipathing) if you are working quit long time as a Linux administrator. + +There are multiple ways to check these information. However, you will be getting part of the information when you use the default commands. + +It doesn’t show you all together in the single output. + +If you want to check all together in the single output then we need to write a small shell script to achieve this. + +We have added two shell script to get those information and you can use which one is suitable for you. + +Major and Minor numbers can be used to match the physical devices in Linux system. + +This tutorial helps you to find which ASM disk maps to which Linux partition or DM Device. + +If you want to **[manage Oracle ASM disks][1]** (such as start, enable, stop, list, query and etc) then navigate to following URL. + +### What Is ASMLib? + +ASMLib is an optional support library for the Automatic Storage Management feature of the Oracle Database. + +Automatic Storage Management (ASM) simplifies database administration and greatly reduces kernel resource usage (e.g. the number of open file descriptors). + +It eliminates the need for the DBA to directly manage potentially thousands of Oracle database files, requiring only the management of groups of disks allocated to the Oracle Database. + +ASMLib allows an Oracle Database using ASM more efficient and capable access to the disk groups it is using. + +### What Is Device Mapper Multipathing (DM-Multipathing)? + +Device Mapper Multipathing or DM-multipathing is a Linux host-side native multipath tool, which allows us to configure multiple I/O paths between server nodes and storage arrays into a single device by utilizing device-mapper. + +### Method-1 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using for loop to achieve the results. + +Also, we are not using any ASM related commands. + +``` +# vi asm_disk_mapping.sh + +#!/bin/bash + +ls -lh /dev/oracleasm/disks > /tmp/asmdisks1.txt + +for ASMdisk in `cat /tmp/asmdisks1.txt | tail -n +2 | awk '{print $10}'` + +do + +minor=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $6}') + +major=$(grep -i "$ASMdisk" /tmp/asmdisks1.txt | awk '{print $5}' | cut -d"," -f1) + +phy_disk=$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{print $10}') + +echo "ASM disk $ASMdisk is associated on $phy_disk [$major, $minor]" + +done +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### Method-2 : Shell Script To Map ASM Disks To Physical Devices? + +In this shell script we are using while loop to achieve the results. + +Also, we are using ASM related commands. + +``` +# vi asm_disk_mapping_1.sh + +#!/bin/bash + +/etc/init.d/oracleasm listdisks > /tmp/asmdisks.txt + +while read -r ASM_disk + +do + +major="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f1)" + +minor="$(/etc/init.d/oracleasm querydisk -d $ASM_disk | awk -F[ '{ print $2 }'| awk -F] '{ print $1 }' | cut -d"," -f2)" + +phy_disk="$(ls -l /dev/* | grep ^b | grep "$major, *$minor" | awk '{ print $10 }')" + +echo "ASM disk $ASM_disk is associated on $phy_disk [$major, $minor]" + +done < /tmp/asmdisks.txt +``` + +Set an executable permission to port_scan.sh file. + +``` +$ chmod +x asm_disk_mapping_1.sh +``` + +Finally run the script to achieve this. + +``` +# sh asm_disk_mapping_1.sh + +ASM disk MP4E6D_DATA01 is associated on /dev/dm-1 +3600a0123456789012345567890234q11 [253, 1] +ASM disk MP4E6E_DATA02 is associated on /dev/dm-2 +3600a0123456789012345567890234q12 [253, 2] +ASM disk MP4E6F_DATA03 is associated on /dev/dm-3 +3600a0123456789012345567890234q13 [253, 3] +ASM disk MP4E70_DATA04 is associated on /dev/dm-4 +3600a0123456789012345567890234q14 [253, 4] +ASM disk MP4E71_DATA05 is associated on /dev/dm-5 +3600a0123456789012345567890234q15 [253, 5] +ASM disk MP4E72_DATA06 is associated on /dev/dm-6 +3600a0123456789012345567890234q16 [253, 6] +ASM disk MP4E73_DATA07 is associated on /dev/dm-7 +3600a0123456789012345567890234q17 [253, 7] +``` + +### How To List Oracle ASM Disks? + +If you would like to list only Oracle ASM disk then use the below command to List available/created Oracle ASM disks in Linux. + +``` +# oracleasm listdisks + +ASM_Disk1 +ASM_Disk2 +ASM_Disk3 +ASM_Disk4 +ASM_Disk5 +ASM_Disk6 +ASM_Disk7 +``` + +### How To List Oracle ASM Disks Against Major And Minor Number? + +If you would like to map Oracle ASM disks against major and minor number then use the below commands to List available/created Oracle ASM disks in Linux. + +``` +# for ASMdisk in `oracleasm listdisks`; do /etc/init.d/oracleasm querydisk -d $ASMdisk; done + +Disk "ASM_Disk1" is a valid Disk on device [253, 1] +Disk "ASM_Disk2" is a valid Disk on device [253, 2] +Disk "ASM_Disk3" is a valid Disk on device [253, 3] +Disk "ASM_Disk4" is a valid Disk on device [253, 4] +Disk "ASM_Disk5" is a valid Disk on device [253, 5] +Disk "ASM_Disk6" is a valid Disk on device [253, 6] +Disk "ASM_Disk7" is a valid Disk on device [253, 7] +``` + +Alternatively, we can get the same results using the ls command. + +``` +# ls -lh /dev/oracleasm/disks + +total 0 +brw-rw---- 1 oracle oinstall 253, 1 May 19 14:44 ASM_Disk1 +brw-rw---- 1 oracle oinstall 253, 2 May 19 14:44 ASM_Disk2 +brw-rw---- 1 oracle oinstall 253, 3 May 19 14:44 ASM_Disk3 +brw-rw---- 1 oracle oinstall 253, 4 May 19 14:44 ASM_Disk4 +brw-rw---- 1 oracle oinstall 253, 5 May 19 14:44 ASM_Disk5 +brw-rw---- 1 oracle oinstall 253, 6 May 19 14:44 ASM_Disk6 +brw-rw---- 1 oracle oinstall 253, 7 May 19 14:44 ASM_Disk7 +``` + +### How To List Physical Disks Against LUNs? + +If you would like to map physical disks against LUNs then use the below command. + +``` +# multipath -ll | grep NETAPP + +3600a0123456789012345567890234q11 dm-1 NETAPP,LUN C-Mode +3600a0123456789012345567890234q12 dm-2 NETAPP,LUN C-Mode +3600a0123456789012345567890234q13 dm-3 NETAPP,LUN C-Mode +3600a0123456789012345567890234q14 dm-4 NETAPP,LUN C-Mode +3600a0123456789012345567890234q15 dm-5 NETAPP,LUN C-Mode +3600a0123456789012345567890234q16 dm-6 NETAPP,LUN C-Mode +3600a0123456789012345567890234q17 dm-7 NETAPP,LUN C-Mode +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/shell-script-map-oracle-asm-disks-physical-disk-lun-in-linux/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/start-stop-restart-enable-reload-oracleasm-service-linux-create-scan-list-query-rename-delete-configure-oracleasm-disk/ diff --git a/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md new file mode 100644 index 0000000000..4420b034e6 --- /dev/null +++ b/sources/tech/20190521 How to Disable IPv6 on Ubuntu Linux.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Disable IPv6 on Ubuntu Linux) +[#]: via: (https://itsfoss.com/disable-ipv6-ubuntu-linux/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +How to Disable IPv6 on Ubuntu Linux +====== + +Are you looking for a way to **disable IPv6** connections on your Ubuntu machine? In this article, I’ll teach you exactly how to do it and why you would consider this option. I’ll also show you how to **enable or re-enable IPv6** in case you change your mind. + +### What is IPv6 and why would you want to disable IPv6 on Ubuntu? + +**[Internet Protocol version 6][1]** [(][1] **[IPv6][1]**[)][1] is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. It was developed in 1998 to replace the **IPv4** protocol. + +**IPv6** aims to improve security and performance, while also making sure we don’t run out of addresses. It assigns unique addresses globally to every device, storing them in **128-bits** , compared to just 32-bits used by IPv4. + +![Disable IPv6 Ubuntu][2] + +Although the goal is for IPv4 to be replaced by IPv6, there is still a long way to go. Less than **30%** of the sites on the Internet makes IPv6 connectivity available to users (tracked by Google [here][3]). IPv6 can also cause [problems with some applications at time][4]. + +Since **VPNs** provide global services, the fact that IPv6 uses globally routed addresses (uniquely assigned) and that there (still) are ISPs that don’t offer IPv6 support shifts this feature lower down their priority list. This way, they can focus on what matters the most for VPN users: security. + +Another possible reason you might want to disable IPv6 on your system is not wanting to expose yourself to various threats. Although IPv6 itself is safer than IPv4, the risks I am referring to are of another nature. If you aren’t actively using IPv6 and its features, [having IPv6 enabled leaves you vulnerable to various attacks][5], offering the hacker another possible exploitable tool. + +On the same note, configuring basic network rules is not enough. You have to pay the same level of attention to tweaking your IPv6 configuration as you do for IPv4. This can prove to be quite a hassle to do (and also to maintain). With IPv6 comes a suite of problems different to those of IPv4 (many of which can be referenced online, given the age of this protocol), giving your system another layer of complexity. + +[][6] + +Suggested read How To Remove Drive Icons From Unity Launcher In Ubuntu 14.04 [Beginner Tips] + +### Disabling IPv6 on Ubuntu [For Advanced Users Only] + +In this section, I’ll be covering how you can disable IPv6 protocol on your Ubuntu machine. Open up a terminal ( **default:** CTRL+ALT+T) and let’s get to it! + +**Note:** _For most of the commands you are going to input in the terminal_ _you are going to need root privileges ( **sudo** )._ + +Warning! + +If you are a regular desktop Linux user and prefer a stable working system, please avoid this tutorial. This is for advanced users who know what they are doing and why they are doing so. + +#### 1\. Disable IPv6 using Sysctl + +First of all, you can **check** if you have IPv6 enabled with: + +``` +ip a +``` + +You should see an IPv6 address if it is enabled (the name of your internet card might be different): + +![IPv6 Address Ubuntu][7] + +You have see the sysctl command in the tutorial about [restarting network in Ubuntu][8]. We are going to use it here as well. To **disable IPv6** you only have to input 3 commands: + +``` +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 +sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 +sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 +``` + +You can check if it worked using: + +``` +ip a +``` + +You should see no IPv6 entry: + +![IPv6 Disabled Ubuntu][9] + +However, this only **temporarily disables IPv6**. The next time your system boots, IPv6 will be enabled again. + +One method to make this option persist is modifying **/etc/sysctl.conf**. I’ll be using vim to edit the file, but you can use any editor you like. Make sure you have **administrator rights** (use **sudo** ): + +![Sysctl Configuration][10] + +Add the following lines to the file: + +``` +net.ipv6.conf.all.disable_ipv6=1 +net.ipv6.conf.default.disable_ipv6=1 +net.ipv6.conf.lo.disable_ipv6=1 +``` + +For the settings to take effect use: + +``` +sudo sysctl -p +``` + +If IPv6 is still enabled after rebooting, you must create (with root privileges) the file **/etc/rc.local** and fill it with: + +``` +#!/bin/bash +# /etc/rc.local + +/etc/sysctl.d +/etc/init.d/procps restart + +exit 0 +``` + +Now use [chmod command][11] to make the file executable: + +``` +sudo chmod 755 /etc/rc.local +``` + +What this will do is manually read (during the boot time) the kernel parameters from your sysctl configuration file. + +[][12] + +Suggested read 3 Ways to Check Linux Kernel Version in Command Line + +#### 2\. Disable IPv6 using GRUB + +An alternative method is to configure **GRUB** to pass kernel parameters at boot time. You’ll have to edit **/etc/default/grub**. Once again, make sure you have administrator privileges: + +![GRUB Configuration][13] + +Now you need to modify **GRUB_CMDLINE_LINUX_DEFAULT** and **GRUB_CMDLINE_LINUX** to disable IPv6 on boot: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1" +GRUB_CMDLINE_LINUX="ipv6.disable=1" +``` + +Save the file and run: + +``` +sudo update-grub +``` + +The settings should now persist on reboot. + +### Re-enabling IPv6 on Ubuntu + +To re-enable IPv6, you’ll have to undo the changes you made. To enable IPv6 until reboot, enter: + +``` +sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 +sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0 +sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 +``` + +Otherwise, if you modified **/etc/sysctl.conf** you can either remove the lines you added or change them to: + +``` +net.ipv6.conf.all.disable_ipv6=0 +net.ipv6.conf.default.disable_ipv6=0 +net.ipv6.conf.lo.disable_ipv6=0 +``` + +You can optionally reload these values: + +``` +sudo sysctl -p +``` + +You should once again see a IPv6 address: + +![IPv6 Reenabled in Ubuntu][14] + +Optionally, you can remove **/etc/rc.local** : + +``` +sudo rm /etc/rc.local +``` + +If you modified the kernel parameters in **/etc/default/grub** , go ahead and delete the added options: + +``` +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" +GRUB_CMDLINE_LINUX="" +``` + +Now do: + +``` +sudo update-grub +``` + +**Wrapping Up** + +In this guide I provided you ways in which you can **disable IPv6** on Linux, as well as giving you an idea about what IPv6 is and why you would want to disable it. + +Did you find this article useful? Do you disable IPv6 connectivity? Let us know in the comment section! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/disable-ipv6-ubuntu-linux/ + +作者:[Sergiu][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/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/IPv6 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/disable_ipv6_ubuntu.png?fit=800%2C450&ssl=1 +[3]: https://www.google.com/intl/en/ipv6/statistics.html +[4]: https://whatismyipaddress.com/ipv6-issues +[5]: https://www.internetsociety.org/blog/2015/01/ipv6-security-myth-1-im-not-running-ipv6-so-i-dont-have-to-worry/ +[6]: https://itsfoss.com/remove-drive-icons-from-unity-launcher-in-ubuntu/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_address_ubuntu.png?fit=800%2C517&ssl=1 +[8]: https://itsfoss.com/restart-network-ubuntu/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_disabled_ubuntu.png?fit=800%2C442&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/sysctl_configuration.jpg?fit=800%2C554&ssl=1 +[11]: https://linuxhandbook.com/chmod-command/ +[12]: https://itsfoss.com/find-which-kernel-version-is-running-in-ubuntu/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/grub_configuration-1.jpg?fit=800%2C565&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/ipv6_address_ubuntu-1.png?fit=800%2C517&ssl=1 diff --git a/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md b/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md new file mode 100644 index 0000000000..3b9be98d2f --- /dev/null +++ b/sources/tech/20190521 I don-t know how CPUs work so I simulated one in code.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (I don't know how CPUs work so I simulated one in code) +[#]: via: (https://djhworld.github.io/post/2019/05/21/i-dont-know-how-cpus-work-so-i-simulated-one-in-code/) +[#]: author: (daniel harper https://djhworld.github.io) + +I don't know how CPUs work so I simulated one in code +====== + +![][1] + +A few months ago it dawned on me that I didn’t really understand how computers work under the hood. I still don’t understand how modern computers work. + +However, after making my way through [But How Do It Know?][2] by J. Clark Scott, a book which describes the bits of a simple 8-bit computer from the NAND gates, through to the registers, RAM, bits of the CPU, ALU and I/O, I got a hankering to implement it in code. + +While I’m not that interested in the physics of the circuitry, the book just about skims the surface of those waters and gives a neat overview of the wiring and how bits move around the system without the requisite electrical engineering knowledge. For me though I can’t get comfortable with book descriptions, I have to see things in action and learn from my inevitable mistakes, which led me to chart a course on the rough seas of writing a circuit in code and getting a bit weepy about it. + +The fruits of my voyage can be seen in [simple-computer][3]; a simple computer that’s simple and computes things. + +[![][4]][5] [![][6]][7] [![][8]][9] +Example programs + +It is quite a neat little thing, the CPU code is implemented [as a horrific splurge of gates turning on and off][10] but it works, I’ve [unit tested it][11], and we all know unit tests are irrefutable proof that something works. + +It handles [keyboard inputs][12], and renders text [to a display][13] using a painstakingly crafted set of glyphs for a professional font I’ve named “Daniel Code Pro”. The only cheat bit is to get the keyboard input and display output working I had to hook up go channels to speak to the outside world via [GLFW][14], but the rest of it is a simulated circuit. + +I even wrote a [crude assembler][15] which was eye opening to say the least. It’s not perfect. Actually it’s a bit crap, but it highlighted to me the problems that other people have already solved many, many years ago and I think I’m a better person for it. Or worse, depending who you ask. + +### But why you do that? + +> “I’ve seen thirteen year old children do this in Minecraft, come back to me when you’ve built a REAL CPU out of telegraph relays” + +My mental model of computing is stuck in beginner computer science textbooks, and the CPU that powers the [gameboy emulator I wrote back in 2013][16] is really nothing like the CPUs that are running today. Even saying that, the emulator is just a state machine, it doesn’t describe the stuff at the logic gate level. You can implement most of it using just a `switch` statement and storing the state of the registers. + +So I’m trying to get a better understanding of this stuff because I don’t know what L1/L2 caches are, I don’t know what pipelining means, I’m not entirely sure I understand the Meltdown and Spectre vulnerability papers. Someone told me they were optimising their code to make use of CPU caches, I don’t know how to verify that other than taking their word for it. I’m not really sure what all the x86 instructions mean. I don’t understand how people off-load work to a GPU or TPU. I don’t know what a TPU is. I don’t know how to make use of SIMD instructions. + +But all that is built on a foundation of knowledge you need to earn your stripes for, so I ain’t gonna get there without reading the map first. Which means getting back to basics and getting my hands dirty with something simple. The “Scott Computer” described in the book is simple. That’s the reason. + +### Great Scott! It’s alive! + +The Scott computer is an 8-bit processor attached to 256 bytes of RAM, all connected via an 8-bit system bus. It has 4 general purpose registers and can execute [17 machine instructions][17]. Someone built a visual simulator [for the web here][18], which is really cool, I dread to think how long it took to track all the wiring states! + +[![][19]][20] +A diagram outlining all the components that make up the Scott CPU +Copyright © 2009 - 2016 by Siegbert Filbinger and John Clark Scott. + +The book takes you on a journey from the humble NAND gate, onto a Bit of memory, onto a register and then keeps layering on components until you end up with something resembling the above. I really recommend reading it, even if you are already familiar with the concepts because it’s quite a good overview. I don’t recommend the Kindle version though because the diagrams are sometimes hard to zoom in and decipher on a screen. A perennial problem for the Kindle in my experience. + +The only thing that’s different about my computer is I upgraded it to 16-bit to have more memory to play with, as storing even just the glyphs for the [ASCII table][21] would have dwarfed most of the 8-bit machine described in the book, with not much room left for useful code. + +### My development journey + +During development it really was just a case of reading the text, scouring the diagrams and then attempting to translate that using a general purpose programming language code and definitely not using something that’s designed for integrated circuit development. The reason why I wrote it in Go, is well, I know a bit of Go. Naysayers might chime in and say, you blithering idiot! I can’t believe you didn’t spend all your time learning [VHDL][22] or [Verilog][23] or [LogSim][24] or whatever but I’d already written my bits and bytes and NANDs by that point, I was in too deep. Maybe I’ll learn them next and weep about my time wasted, but that’s my cross to bear. + +In the grand scheme of things most of the computer is just passing around a bunch of booleans, so any boolean friendly language will do the job. + +Applying a schema to those booleans is what helps you (the programmer) derive its meaning, and the biggest decision anyone needs to make is decide what [endianness][25] your system is going to use and make sure all the components transfer things to and from the bus in the right order. + +This was an absolute pain in the backside to implement. From the offset I opted for little endian but when testing the ALU my hair took a beating trying to work out why the numbers were coming out wrong. Many, many print statements took place on this one. + +Development did take a while, maybe about a month or two during some of my free time, but once the CPU was done and successfully able to execute 2 + 2 = 5, I was happy. + +Well, until the book discussed the I/O features, with designs for a simple keyboard and display interface so you can get things in and out of the machine. Well I’ve already gotten this far, no point in leaving it in a half finished state. I set myself a goal of being able to type something on a keyboard and render the letters on a display. + +### Peripherals + +The peripherals use the [adapter pattern][26] to act as a hardware interface between the CPU and the outside world. It’s probably not a huge leap to guess this was what the software design pattern took inspiration from. + +![][27] +How the I/O adapters connect to a GLFW window + +With this separation of concerns it was actually pretty simple to hook the other end of the keyboard and display to a window managed by GLFW. In fact I just pulled most of the code from my [emulator][28] and reshaped it a bit, using go channels to act as the signals in and out of the machine. + +### Bringing it to life + +![][29] + +This was probably the most tricky part, or at least the most cumbersome. Writing assembly with such a limited instruction set sucks. Writing assembly using a crude assembler I wrote sucks even more because you can’t shake your fist at someone other than yourself. + +The biggest problem was juggling the 4 registers and keeping track of them, pulling and putting stuff in memory as a temporary store. Whilst doing this I remembered the Gameboy CPU having a stack pointer register so you could push and pop state. Unfortunately this computer doesn’t have such a luxury, so I was mostly moving stuff in and out of memory on a bespoke basis. + +The only pseudo instruction I took the time to implement was `CALL` to help calling functions, this allows you to run a function and then return to the point after the function was called. Without that stack though you can only call one level deep. + +Also as the machine does not support interrupts, you have to implement awful polling code for functions like getting keyboard state. The book does discuss the steps needed to implement interrupts, but it would involve a lot more wiring. + +But anyway enough of the moaning, I ended up writing [four programs][30] and most of them make use of some shared code for drawing fonts, getting keyboard input etc. Not exactly operating system material but it did make me appreciate some of the services a simple operating system might provide. + +It wasn’t easy though, the trickiest part of the text-writer program was getting the maths right to work out when to go to a newline, or what happens when you hit the enter key. + +``` +main-getInput: + CALL ROUTINE-io-pollKeyboard + CALL ROUTINE-io-drawFontCharacter + JMP main-getInput +``` + +The main loop for the text-writer program + +I didn’t get round to implementing the backspace key either, or any of the modifier keys. Made me appreciate how much work must go in to making text editors and how tedious that probably is. + +### On reflection + +This was a fun and very rewarding project for me. In the midst of programming in the assembly language I’d largely forgotten about the NAND, AND and OR gates firing underneath. I’d ascended into the layers of abstraction above. + +While the CPU in the is very simple and a long way from what’s sitting in my laptop, I think this project has taught me a lot, namely: + + * How bits move around between all components using a bus + * How a simple ALU works + * What a simple Fetch-Decode-Execute cycle looks like + * That a machine without a stack pointer register + concept of a stack sucks + * That a machine without interrupts sucks + * What an assembler is and does + * How a peripherals communicate with a simple CPU + * How simple fonts work and an approach to rendering them on a display + * What a simple operating system might start to look like + + + +So what’s next? The book said that no-one has built a computer like this since 1952, meaning I’ve got 67 years of material to brush up on, so that should keep me occupied for a while. I see the [x86 manual is 4800 pages long][31], enough for some fun, light reading at bedtime. + +Maybe I’ll have a brief dalliance with operating system stuff, a flirtation with the C language, a regrettable evening attempting to [solder up a PiDP-11 kit][32] then probably call it quits. I dunno, we’ll see. + +With all seriousness though I think I’m going to start looking into RISC based stuff next, maybe RISC-V, but probably start with early RISC processors to get an understanding of the lineage. Modern CPUs have a lot more features like caches and stuff so I want to understand them as well. A lot of stuff out there to learn. + +Do I need to know any of this stuff in my day job? Probably helps, but not really, but I’m enjoying it, so whatever, thanks for reading xxxx + +-------------------------------------------------------------------------------- + +via: https://djhworld.github.io/post/2019/05/21/i-dont-know-how-cpus-work-so-i-simulated-one-in-code/ + +作者:[daniel harper][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://djhworld.github.io +[b]: https://github.com/lujun9972 +[1]: https://djhworld.github.io/img/simple-computer/text-writer.gif (Hello World) +[2]: http://buthowdoitknow.com/ +[3]: https://github.com/djhworld/simple-computer +[4]: https://djhworld.github.io/img/simple-computer/ascii1.png (ASCII) +[5]: https://djhworld.github.io/img/simple-computer/ascii.png +[6]: https://djhworld.github.io/img/simple-computer/brush1.png (brush) +[7]: https://djhworld.github.io/img/simple-computer/brush.png +[8]: https://djhworld.github.io/img/simple-computer/text-writer1.png (doing the typesin') +[9]: https://djhworld.github.io/img/simple-computer/text-writer.png +[10]: https://github.com/djhworld/simple-computer/blob/master/cpu/cpu.go#L763 +[11]: https://github.com/djhworld/simple-computer/blob/master/cpu/cpu_test.go +[12]: https://github.com/djhworld/simple-computer/blob/master/io/keyboard.go#L20 +[13]: https://github.com/djhworld/simple-computer/blob/master/io/display.go#L13 +[14]: https://github.com/djhworld/simple-computer/blob/master/cmd/simulator/glfw_io.go +[15]: https://github.com/djhworld/simple-computer/blob/master/asm/assembler.go +[16]: https://github.com/djhworld/gomeboycolor +[17]: https://github.com/djhworld/simple-computer#instructions +[18]: http://www.buthowdoitknow.com/but_how_do_it_know_cpu_model.html +[19]: https://djhworld.github.io/img/simple-computer/scott-cpu.png (The Scott CPU) +[20]: https://djhworld.github.io/img/simple-computer/scott-cpu.png +[21]: https://github.com/djhworld/simple-computer/blob/master/_programs/ascii.asm#L27 +[22]: https://en.wikipedia.org/wiki/VHDL +[23]: https://en.wikipedia.org/wiki/Verilog +[24]: http://www.cburch.com/logisim/ +[25]: https://en.wikipedia.org/wiki/Endianness +[26]: https://en.wikipedia.org/wiki/Adapter_pattern +[27]: https://djhworld.github.io/img/simple-computer/io.png (i couldn't be bothered to do the corners around the CPU for the system bus) +[28]: https://github.com/djhworld/gomeboycolor-glfw +[29]: https://djhworld.github.io/img/simple-computer/brush.gif (brush.bin) +[30]: https://github.com/djhworld/simple-computer/blob/master/_programs/README.md +[31]: https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf +[32]: https://obsolescence.wixsite.com/obsolescence/pidp-11 diff --git a/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md b/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md new file mode 100644 index 0000000000..8fab8bfcae --- /dev/null +++ b/sources/tech/20190522 Convert Markdown files to word processor docs using pandoc.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Convert Markdown files to word processor docs using pandoc) +[#]: via: (https://opensource.com/article/19/5/convert-markdown-to-word-pandoc) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt/users/jason-van-gumster/users/kikofernandez) + +Convert Markdown files to word processor docs using pandoc +====== +Living that plaintext life? Here's how to create the word processor +documents people ask for without having to work in a word processor +yourself. +![][1] + +If you live your life in [plaintext][2], there invariably comes a time when someone asks for a word processor document. I run into this issue frequently, especially at the Day JobTM. Although I've introduced one of the development teams I work with to a [Docs Like Code][3] workflow for writing and reviewing release notes, there are a small number of people who have no interest in GitHub or working with [Markdown][4]. They prefer documents formatted for a certain proprietary application. + +The good news is that you're not stuck copying and pasting unformatted text into a word processor document. Using **[pandoc][5]** , you can quickly give people what they want. Let's take a look at how to convert a document from Markdown to a word processor format in [Linux][6] using **pandoc.** ​​​​ + +Note that **pandoc** is also available for a wide variety of operating systems, ranging from two flavors of BSD ([NetBSD][7] and [FreeBSD][8]) to Chrome OS, MacOS, and Windows. + +### Converting basics + +To begin, [install **pandoc**][9] on your computer. Then, crack open a console terminal window and navigate to the directory containing the file that you want to convert. + +Type this command to create an ODT file (which you can open with a word processor like [LibreOffice Writer][10] or [AbiWord][11]): + +**pandoc -t odt filename.md -o filename.odt** + +Remember to replace **filename** with the file's actual name. And if you need to create a file for that other word processor (you know the one I mean), replace **odt** on the command line with **docx**. Here's what this article looks like when converted to an ODT file: + +![Basic conversion results with pandoc.][12] + +These results are serviceable, but a bit bland. Let's look at how to add a bit more style to the converted documents. + +### Converting with style + +**pandoc** has a nifty feature enabling you to specify a style template when converting a marked-up plaintext file to a word processor format. In this file, you can edit a small number of styles in the document, including those that control the look of paragraphs, headings, captions, titles and subtitles, a basic table, and hyperlinks. + +Let's look at the possibilities. + +#### Creating a template + +In order to style your documents, you can't just use _any_ template. You need to generate what **pandoc** calls a _reference_ template, which is the template it uses when converting text files to word processor documents. To create this file, type the following in a terminal window: + +**pandoc -o custom-reference.odt --print-default-data-file reference.odt** + +This command creates a file called **custom-reference.odt**. If you're using that other word processor, change the references to **odt** on the command line to **docx**. + +Open the template file in LibreOffice Writer, and then press **F11** to open LibreOffice Writer's **Styles** pane. Although the [pandoc manual][13] advises against making other changes to the file, I change the page size and add headers and footers when necessary. + +#### Using the template + +So, how do you use that template you just created? There are two ways to do this. + +The easiest way is to drop the template in your **/home** directory's **.pandoc** folder—you might have to create the folder first if it doesn't exist. When it's time to convert a document, **pandoc** uses this template file. See the next section on how to choose from multiple templates if you need more than one. + +The other way to use your template is to type this set of conversion options at the command line: + +**pandoc -t odt file-name.md --reference-doc=path-to-your-file/reference.odt -o file-name.odt** + +If you're wondering what a converted file looks like with a customized template, here's an example: + +![A document converted using a pandoc style template.][14] + +#### Choosing from multiple templates + +Many people only need one **pandoc** template. Some people, however, need more than one. + +At my day job, for example, I use several templates—one with a DRAFT watermark, one with a watermark stating FOR INTERNAL USE, and one for a document's final versions. Each type of document needs a different template. + +If you have similar needs, start the same way you do for a single template, by creating the file **custom-reference.odt**. Rename the resulting file—for example, to **custom-reference-draft.odt** —then open it in LibreOffice Writer and modify the styles. Repeat this process for each template you need. + +Next, copy the files into your **/home** directory. You can even put them in the **.pandoc** folder if you want to. + +To select a specific template at conversion time, you'll need to run this command in a terminal: + +**pandoc -t odt file-name.md --reference-doc=path-to-your-file/custom-template.odt -o file-name.odt** + +Change **custom-template.odt** to your template file's name. + +### Wrapping up + +To avoid having to remember a set of options I don't regularly use, I cobbled together some simple, very lame one-line scripts that encapsulate the options for each template. For example, I run the script **todraft.sh** to create a word processor document using the template with a DRAFT watermark. You might want to do the same. + +Here's an example of a script using the template containing a DRAFT watermark: + +`pandoc -t odt $1.md -o $1.odt --reference-doc=~/Documents/pandoc-templates/custom-reference-draft.odt` + +Using **pandoc** is a great way to provide documents in the format that people ask for, without having to give up the command line life. This tool doesn't just work with Markdown, either. What I've discussed in this article also allows you to create and convert documents between a wide variety of markup languages. See the **pandoc** site linked earlier for more details. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/convert-markdown-to-word-pandoc + +作者:[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/users/jason-van-gumster/users/kikofernandez +[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 +[2]: https://plaintextproject.online/ +[3]: https://www.docslikecode.com/ +[4]: https://en.wikipedia.org/wiki/Markdown +[5]: https://pandoc.org/ +[6]: /resources/linux +[7]: https://www.netbsd.org/ +[8]: https://www.freebsd.org/ +[9]: https://pandoc.org/installing.html +[10]: https://www.libreoffice.org/discover/writer/ +[11]: https://www.abisource.com/ +[12]: https://opensource.com/sites/default/files/uploads/pandoc-wp-basic-conversion_600_0.png (Basic conversion results with pandoc.) +[13]: https://pandoc.org/MANUAL.html +[14]: https://opensource.com/sites/default/files/uploads/pandoc-wp-conversion-with-tpl_600.png (A document converted using a pandoc style template.) diff --git a/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md b/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md new file mode 100644 index 0000000000..38c11508bf --- /dev/null +++ b/sources/tech/20190522 Damn- Antergos Linux has been Discontinued.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Damn! Antergos Linux has been Discontinued) +[#]: via: (https://itsfoss.com/antergos-linux-discontinued/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Damn! Antergos Linux has been Discontinued +====== + +_**Beginner-friendly Arch Linux based distribution Antergos has announced that the project is being discontinued.**_ + +Arch Linux has always been considered a no-go zone for the beginners. Antergos challenged this status quo and made Arch Linux accessible to everyone by providing easier installation method. People who wouldn’t dare [installing Arch Linux][1], opted for Antergos. + +![Antergos provided easy access to Arch with its easy to use GUI tools][2] + +The project started in 2012-13 and started gaining popularity around 2014. I used Antergos, liked it and covered it here on It’s FOSS and perhaps (slightly) contributed to its popularity. In last five years, Antergos was downloaded close to a million times. + +But for past year or so, I felt that this project was stagnating. Antergos hardly made any news. Neither the forum nor the social media handles were active. The community around Antergos grew thinner though a few dedicated users still remain. + +### The end of Antergos Linux project + +![][3] + +On May 21, 2019, Antergos [announced][4] its discontinuation. Lack of free time cited as the main reason behind this decision. + +> Today, we are announcing the end of this project. As many of you probably noticed over the past several months, we no longer have enough free time to properly maintain Antergos. We came to this decision because we believe that continuing to neglect the project would be a huge disservice to the community. +> +> Antergos Team + +Antergos developers also mentioned that since the project’s code still works, it’s an opportunity for interested developers to take what they find useful and start their own projects. + +#### What happens to Existing Antergos users? + +If you are an Antergos user, you don’t have to worry a lot. It’s not that your system will be unusable from today. Your system will continue to get updates directly from Arch Linux. + +Antergos team plans to release an update to remove the Antergos repositories from your system along with any Antergos-specific packages that no longer serve a purpose as the project is ending. After that any packages installed from the Antergos repo that are in the AUR will begin to receive updates from [AUR][5]. + +[][6] + +Suggested read Peppermint 8 Released. Download Now! + +The Antergos forum and wiki will be functional but only for some time. + +If you think using an ‘unmaintained’ project is not a good idea, you should switch your distribution. The most appropriate choice would be [Manjaro Linux][7]. + +Manjaro Linux started around the same time as Antergos. Both Antergos and Manjaro were sort of competitors as both of them tried to make Arch Linux accessible for everyone. + +Manjaro gained a huge userbase in the last few years and its community is thriving. If you want to remain in Arch domain but don’t want to install Arch Linux itself, Manjaro is the best choice for you. + +Just note that Manjaro Linux doesn’t provide all the updates immediately as Arch or Antergos. It is a rolling release but with stability in mind. So the updates are tested first. + +#### Inevitable fate for smaller distributions? + +_Here’s my opinion on the discontinuation on Antergos and other similar open source projects._ + +Antergos was a niche distribution. It had a smaller but dedicated userbase. The developers cited lack of free time as the main reason for their decision. However, I believe that lack of motivation plays a bigger role in such cases. + +What motivates the people behind a project? They start it mostly as a side project and if the project is good, they start gaining users. This growth of userbase drives their motivation to work on the project. + +If the userbase starts declining or gets stagnated, the motivation takes a hit. + +If the userbase keeps on growing, the motivation increases but only to a certain point. More users require more effort in various tasks around the project. Keeping the wiki and forum along with social media itself is a challenging part, leave aside the actual code development. The situation becomes overwhelming. + +When a project grows in considerable size, project owners have two choices. First choice is to form a community of volunteers and start delegating tasks that could be delegated. Having volunteers dedicated to project is not easy but it can surely be achieved as Debian and Manjaro have done it already. + +[][8] + +Suggested read Lightweight Distribution Linux Lite 4.0 Released With Brand New Look + +Second choice is to create some revenue generation channel around the project. The additional revenue may ‘justify’ those extra hours and in some cases, it could drive the developer to work full time on the project. [elementary OS][9] is trying to achieve something similar by developing an ecosystem of ‘payable apps’ in their software center. + +You may argue that money should not be a factor in Free and Open Source Software culture but the unfortunate truth is that money is always a factor, in every aspect of our life. I am not saying that a project should be purely driven by money but a project must be sustainable in every aspect. + +We have see how other smaller but moderately popular Linux distributions like Korora has been discontinued due to lack of free time. [Solus creator Ikey Doherty had to leave the project][10] to focus on his personal life. Developing and maintaining a successful open source project is not an easy task. + +That’s just my opinion. Please feel free to disagree with it and voice your opinion in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/antergos-linux-discontinued/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-arch-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/08/Installing_Antergos_Linux_7.png?ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/05/antergos-linux-dead.jpg?resize=800%2C450&ssl=1 +[4]: https://antergos.com/blog/antergos-linux-project-ends/ +[5]: https://itsfoss.com/best-aur-helpers/ +[6]: https://itsfoss.com/peppermint-8-released/ +[7]: https://manjaro.org/ +[8]: https://itsfoss.com/linux-lite-4/ +[9]: https://elementary.io/ +[10]: https://itsfoss.com/ikey-leaves-solus/ diff --git a/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md b/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md new file mode 100644 index 0000000000..3bb9e39184 --- /dev/null +++ b/sources/tech/20190522 How to Download and Use Ansible Galaxy Roles in Ansible Playbook.md @@ -0,0 +1,193 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Download and Use Ansible Galaxy Roles in Ansible Playbook) +[#]: via: (https://www.linuxtechi.com/use-ansible-galaxy-roles-ansible-playbook/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Download and Use Ansible Galaxy Roles in Ansible Playbook +====== + +**Ansible** is tool of choice these days if you must manage multiple devices, be it Linux, Windows, Mac, Network Devices, VMware and lot more. What makes Ansible popular is its agent less feature and granular control. If you have worked with python or have experience with **yaml** , you will feel at home with Ansible. To see how you can install [Ansible][1] click here. + + + +Ansible core modules will let you manage almost anything should you wish to write playbooks, however often there is someone who has already written a role for a problem you are trying to solve. Let’s take an example, you wish to manage NTP clients on the Linux machines, you have 2 choices either write a role which can be applied to the nodes or use **ansible-galaxy** to download an existing role someone has already written/tested for you. Ansible galaxy has roles for almost all the domains and these caters different problems. You can visit to get an idea on domains and popular roles it has. Each role published on galaxy repository is thoroughly tested and has been rated by the users, so you get an idea on how other people who have used it liked it. + +To keep moving with the NTP idea, here is how you can search and install an NTP role from galaxy. + +Firstly, lets run ansible-galaxy with the help flag to check what options does it give us + +``` +[root@linuxtechi ~]# ansible-galaxy --help +``` + +![ansible-galaxy-help][2] + +As you can see from the output above there are some interesting options been shown, since we are looking for a role to manage ntp clients lets try the search option to see how good it is finding what we are looking for. + +``` +[root@linuxtechi ~]# ansible-galaxy search ntp +``` + +Here is the truncated output of the command above. + +![ansible-galaxy-search][3] + +It found 341 matches based on our search, as you can see from the output above many of these roles are not even related to NTP which means our search needs some refinement however, it has managed to pull some NTP roles, lets dig deeper to see what these roles are. But before that let me tell you the naming convention being followed here. The name of a role is always preceded by the author name so that it is easy to segregate roles with the same name. So, if you have written an NTP role and have published it to galaxy repo, it does not get mixed up with someone else repo with the same name. + +With that out of the way, lets continue with our job of installing a NTP role for our Linux machines. Let’s try **bennojoy.ntp** for this example, but before using this we need to figure out couple of things, is this role compatible with the version of ansible I am running. Also, what is the license status of this role. To figure out these, let’s run below ansible-galaxy command, + +``` +[root@linuxtechi ~]# ansible-galaxy info bennojoy.ntp +``` + +![ansible-galaxy-info][4] + +ok so this says the minimum version is 1.4 and the license is BSD, lets download it + +``` +[root@linuxtechi ~]# ansible-galaxy install bennojoy.ntp +- downloading role 'ntp', owned by bennojoy +- downloading role from https://github.com/bennojoy/ntp/archive/master.tar.gz +- extracting bennojoy.ntp to /etc/ansible/roles/bennojoy.ntp +- bennojoy.ntp (master) was installed successfully +[root@linuxtechi ~]# ansible-galaxy list +- bennojoy.ntp, master +[root@linuxtechi ~]# +``` + +Let’s find the newly installed role. + +``` +[root@linuxtechi ~]# cd /etc/ansible/roles/bennojoy.ntp/ +[root@linuxtechi bennojoy.ntp]# ls -l +total 4 +drwxr-xr-x. 2 root root 21 May 21 22:38 defaults +drwxr-xr-x. 2 root root 21 May 21 22:38 handlers +drwxr-xr-x. 2 root root 48 May 21 22:38 meta +-rw-rw-r--. 1 root root 1328 Apr 20 2016 README.md +drwxr-xr-x. 2 root root 21 May 21 22:38 tasks +drwxr-xr-x. 2 root root 24 May 21 22:38 templates +drwxr-xr-x. 2 root root 55 May 21 22:38 vars +[root@linuxtechi bennojoy.ntp]# +``` + +I am going to run this newly downloaded role on my Elasticsearch CentOS node. Here is my hosts file + +``` +[root@linuxtechi ~]# cat hosts +[CentOS] +elastic7-01 ansible_host=192.168.1.15 ansibel_port=22 ansible_user=linuxtechi +[root@linuxtechi ~]# +``` + +Let’s try to ping the node using below ansible ping module, + +``` +[root@linuxtechi ~]# ansible -m ping -i hosts elastic7-01 +elastic7-01 | SUCCESS => { + "changed": false, + "ping": "pong" +} +[root@linuxtechi ~]# +``` + +Here is what the current ntp.conf looks like on elastic node. + +``` +[root@linuxtechi ~]# head -30 /etc/ntp.conf +``` + +![Current-ntp-conf][5] + +Since I am in India, lets add server **in.pool.ntp.org** to ntp.conf. I would have to edit the variables in default directory of the role. + +``` +[root@linuxtechi ~]# vi /etc/ansible/roles/bennojoy.ntp/defaults/main.yml +``` + +Change NTP server address in “ntp_server” parameter, after updating it should look like below. + +![Update-ansible-ntp-role][6] + +The last thing now is to create my playbook which would call this role. + +``` +[root@linuxtechi ~]# vi ntpsite.yaml +--- + - name: Configure NTP on CentOS/RHEL/Debian System + become: true + hosts: all + roles: + - {role: bennojoy.ntp} +``` + +save and exit the file + +We are ready to run this role now, use below command to run ntp playbook, + +``` +[root@linuxtechi ~]# ansible-playbook -i hosts ntpsite.yaml +``` + +Output of above ntp ansible playbook should be something like below, + +![ansible-playbook-output][7] + +Let’s check updated file now. go to elastic node and view the contents of ntp.conf file + +``` +[root@linuxtechi ~]# cat /etc/ntp.conf +#Ansible managed + +driftfile /var/lib/ntp/drift +server in.pool.ntp.org + +restrict -4 default kod notrap nomodify nopeer noquery +restrict -6 default kod notrap nomodify nopeer noquery +restrict 127.0.0.1 +[root@linuxtechi ~]# +``` + +Just in case you do not find a role fulfilling your requirement ansible-galaxy can help you create a directory structure for your custom roles. This helps your playbooks along with the variables, handlers, templates etc assembled in a standardized file structure. Let’s create our own role, its always a good practice to let ansible-galaxy create the structure for you. + +``` +[root@linuxtechi ~]# ansible-galaxy init pk.backup +- pk.backup was created successfully +[root@linuxtechi ~]# +``` + +Verify the structure of your role using the tree command, + +![createing-roles-ansible-galaxy][8] + +Let me quickly explain what each of these directories and files are for, each of these serves a purpose. + +The very first one is the **defaults** directory which contains the files containing variables with takes the lowest precedence, if the same variables are assigned in var directory it will be take precedence over default. The **handlers** directory hosts the handlers. The **file** and **templates** keep any files your role may need to copy and **jinja templates** to be used in playbooks respectively. The **tasks** directory is where your playbooks containing the tasks are kept. The var directory consists of all the files that hosts the variables used in role. The test directory consists of a sample inventory and test playbooks which can be used to test the role. The **meta directory** consists of any dependencies on other roles along with the authorship information. + +Finally, **README.md** file simply consists of some general information like description and minimum version of ansible this role is compatible with. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/use-ansible-galaxy-roles-ansible-playbook/ + +作者:[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/install-and-use-ansible-in-centos-7/ +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-help-1024x294.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-search-1024x552.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-galaxy-info-1024x557.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Current-ntp-conf.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/05/Update-ansible-ntp-role.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/05/ansible-playbook-output-1024x376.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/05/createing-roles-ansible-galaxy.jpg diff --git a/sources/tech/20190523 Hardware bootstrapping with Ansible.md b/sources/tech/20190523 Hardware bootstrapping with Ansible.md new file mode 100644 index 0000000000..94842453cc --- /dev/null +++ b/sources/tech/20190523 Hardware bootstrapping with Ansible.md @@ -0,0 +1,223 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Hardware bootstrapping with Ansible) +[#]: via: (https://opensource.com/article/19/5/hardware-bootstrapping-ansible) +[#]: author: (Mark Phillips https://opensource.com/users/markp/users/feeble/users/markp) + +Hardware bootstrapping with Ansible +====== + +![computer servers processing data][1] + +At a recent [Ansible London Meetup][2], I got chatting with somebody about automated hardware builds. _"It's all cloud now!"_ I hear you say. Ah, but for many large organisations it's not—they still have massive data centres full of hardware. Almost regularly somebody pops up on our internal mail list and asks, *"can Ansible do hardware provisioning?" *Well yes, you can provision hardware with Ansible… + +### Requirements + +Bootstrapping hardware is mostly about network services. Before we do any operating system (OS) installing then, we must set up some services. We will need: + + * DHCP + * PXE + * TFTP + * Operating system media + * Web server + + + +### Setup + +Besides the DHCP configuration, everything else in this article is handled by the Ansible plays included in [this repository][3]. + +#### DHCP server + +I'm writing here on the assumption you can control your DHCP configuration. If you don't have access to your DHCP server, you'll need to ask the owner to set two options. DHCP option 67 needs to be set to **pxelinux.0** and **next-server** (which is option 66—but you may not need to know that; often a DHCP server will have a field/option for 'next server') needs to be set to the IP address of your TFTP server. + +If you can own the DHCP server, I'd suggest using dnsmasq. It's small and simple. I will not cover configuring it here, but look at [the man page][4] and the **\--enable-tftp** option. + +#### TFTP + +The **next-server** setting for our DHCP server, above, will point to a machine serving [TFTP][5]. Here I've used a [CentOS Linux][6] virtual machine, as it only takes one package (syslinux-tftpboot) and a service to start to have TFTP up and running. We'll stick with the default path, **/var/lib/tftpboot**. + +#### PXE + +If you're not already familiar with PXE, you might like to take a quick look at [the Wikipedia page][7]. For this article I'll keep it short—we will serve some files over TFTP, which DHCP guides our hardware to. + +You'll want **images/pxeboot/{initrd.img,vmlinuz}** from the OS distribution media for pxeboot. These need to be copied to **/var/lib/tftpboot/pxeboot**. The referenced Ansible plays **do not do this step, **so you need to copy them over yourself. + +We'll also need to serve the OS installation files. There are two approaches to this: 1) install, via HTTP, from the internet or 2) install, again via HTTP, from a local server. For my testing, since I'm on a private LAN (and I guess you are too), the fastest installation method is the second. The easiest way to prepare this is to mount the DVD image and rsync the `images`, **`Packages` **and `repodata` directories to your webserver location. The referenced Ansible plays will install **httpd** but won't copy over these files, so don't forget to do that after running [the play][8]. For this article, we'll once again stick with defaults for simplicity—so files need to be copied to Apache's standard docroot, **/var/www/html**. + +#### Directories + +We should end up with directory structures like this: + +##### PXE/TFTP + + +``` +[root@c7 ~]# tree /var/lib/tftpboot/pxe{b*,l*cfg} +/var/lib/tftpboot/pxeboot +└── 6 +├── initrd.img +└── vmlinuz +``` + +##### httpd + + +``` +[root@c7 ~]# tree -d /var/www/html/ +/var/www/html/ +├── 6 -> centos/6 +├── 7 -> centos/7 +├── centos +│ ├── 6 +│ │ └── os +│ │ └── x86_64 +│ │ ├── images +│ │ │ └── pxeboot +│ │ ├── Packages +│ │ └── repodata +│ └── 7 +│ └── os +│ └── x86_64 +│ ├── images +│ │ └── pxeboot +│ ├── Packages +│ └── repodata +└── ks +``` + +You'll notice my web setup appears a little less simple than the words above! I've pasted my actual structure to give you some ideas. The hardware I'm using is really old, and even getting CentOS 7 to work was horrible (if you're interested, it's due to the lack of [cciss][9] drivers for the HP Smart Array controller—yes, [there is an answer][10], but it takes a lot of faffing to make work), so all examples are of CentOS 6. I also wanted a flexible setup that could install many versions. Here I've done that using symlinks—this arrangement will work just fine for RHEL too, for example. The basic structure is present though—note the images, Packages and repodata directories. + +These paths relate directly to [the PXE menu][11] file we'll serve up and [the kickstart file][12] too. + +#### If you don't have DHCP + +If you can't manage your own DHCP server or the owners of your infrastructure can't help, there is another option. In the past, I've used [iPXE][13] to create a boot image that I've loaded as virtual media. A lot of out-of-band/lights-out-management (LOM) interfaces on modern hardware support this functionality. You can make a custom embedded PXE menu in seconds with iPXE. I won't cover that here, but if it turns out to be a problem for you, then drop me a line [on Twitter][14] and I'll look at doing a follow-up blog post if enough people request it. + +### Installing hardware + +We've got our structure in place now, and we can [kickstart][15] a server. Before we do, we have to add some configuration to the TFTP setup to enable a given piece of hardware to pick up the PXE boot menu. + +It's here we come across a small chicken/egg problem. We need a host's MAC address to create a link to the specific piece of hardware we want to kickstart. If the hardware is already running and we can access it with Ansible, that's great—we have a way of finding out the boot interface MAC address via the setup module (see [the reinstall play][16]). If it's a new piece of tin, however, we need to get the MAC address and tell our setup what to do with it. This probably means some manual intervention—booting the server and looking at a screen or maybe getting the MAC from a manifest or such like. Whichever way you get hold of it, we can tell our play about it via the inventory. + +Let's put a custom variable into our simple INI format [inventory file][17], but run a play to set up TFTP… + + +``` +(pip)iMac:ansible-hw-bootstrap$ ansible-inventory --host hp.box +{ +"ilo_ip": "192.168.1.68", +"ilo_password": "administrator" +} +(pip)iMac:ansible-hw-bootstrap$ ansible-playbook plays/install.yml + +PLAY [kickstart] ******************************************************************************************************* + +TASK [Host inventory entry has a MAC address] ************************************************************************** +failed: [ks.box] (item=hp.box) => { +"assertion": "hostvars[item]['mac'] is defined", +"changed": false, +"evaluated_to": false, +"item": "hp.box", +"msg": "Assertion failed" +} + +PLAY RECAP ************************************************************************************************************* +ks.box : ok=0 changed=0 unreachable=0 failed=1 +``` + +Uh oh, play failed. It [contains a check][18] that the host we're about to install actually has a MAC address added. Let's fix that and run the play again… + + +``` +(pip)iMac:ansible-hw-bootstrap$ ansible-inventory --host hp.box +{ +"ilo_ip": "192.168.1.68", +"ilo_password": "administrator", +"mac": "00:AA:BB:CC:DD:EE" +} +(pip)iMac:ansible-hw-bootstrap$ ansible-playbook plays/install.yml + +PLAY [kickstart] ******************************************************************************************************* + +TASK [Host inventory entry has a MAC address] ************************************************************************** +ok: [ks.box] => (item=hp.box) => { +"changed": false, +"item": "hp.box", +"msg": "All assertions passed" +} + +TASK [Set PXE menu to install] ***************************************************************************************** +ok: [ks.box] => (item=hp.box) + +TASK [Reboot target host for PXE boot] ********************************************************************************* +skipping: [ks.box] => (item=hp.box) + +PLAY RECAP ************************************************************************************************************* +ks.box : ok=2 changed=0 unreachable=0 failed=0 +``` + +That worked! What did it do? Looking at the pxelinux.cfg directory under our TFTP root, we can see a symlink… + + +``` +[root@c7 pxelinux.cfg]# pwd +/var/lib/tftpboot/pxelinux.cfg +[root@c7 pxelinux.cfg]# l +total 12 +drwxr-xr-x. 2 root root 65 May 13 14:23 ./ +drwxr-xr-x. 4 root root 4096 May 2 22:13 ../ +-r--r--r--. 1 root root 515 May 2 12:22 00README +lrwxrwxrwx. 1 root root 7 May 13 14:12 01-00-aa-bb-cc-dd-ee -> install +-rw-r--r--. 1 root root 682 May 2 22:07 install +``` + +The **install** file is symlinked to a file named after our MAC address. This is the key, useful piece. It will ensure our hardware with MAC address **00-aa-bb-cc-dd-ee** is served a PXE menu when it boots from its network card. + +So let's boot our machine. + +Usefully, Ansible has some [remote management modules][19]. We're working with an HP server here, so we can use the [hpilo_boot][20] module to save us from having to interact directly with the LOM web interface. + +Let's run the reinstall play on a booted server… + +The neat thing about the **hpilo_boot** module, you'll notice, is it sets the boot medium to be the network. When the installation completes, the server restarts and boots from its hard drive. The eagle-eyed amongst you will have spotted the critical problem with this—what happens if the server boots to its network card again? It will pick up the PXE menu and promptly reinstall itself. I would suggest removing the symlink as a "belt and braces" step then. I will leave that as an exercise for you, dear reader. Hint: I would make the new server do a 'phone home' on boot, to somewhere, which runs a clean-up job. Since you wouldn't need the console open, as I had here to demonstrate what's going on in the background, a 'phone home' job would also give a nice indication that the process completed. Ansible, [naturally][21]. Good luck! + +If you've any thoughts or comments on this process, please let me know. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/hardware-bootstrapping-ansible + +作者:[Mark Phillips][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/markp/users/feeble/users/markp +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) +[2]: https://www.meetup.com/Ansible-London/ +[3]: https://github.com/phips/ansible-hw-bootstrap +[4]: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html +[5]: https://en.m.wikipedia.org/wiki/Trivial_File_Transfer_Protocol +[6]: https://www.centos.org +[7]: https://en.m.wikipedia.org/wiki/Preboot_Execution_Environment +[8]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/kickstart.yml +[9]: https://linux.die.net/man/4/cciss +[10]: https://serverfault.com/questions/611182/centos-7-x64-and-hp-proliant-dl360-g5-scsi-controller-compatibility +[11]: https://github.com/phips/ansible-hw-bootstrap/blob/master/roles/kickstart/templates/pxe_install.j2#L10 +[12]: https://github.com/phips/ansible-hw-bootstrap/blob/master/roles/kickstart/templates/local6.ks.j2#L3 +[13]: https://ipxe.org +[14]: https://twitter.com/thismarkp +[15]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/ch-kickstart2 +[16]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/reinstall.yml +[17]: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html +[18]: https://github.com/phips/ansible-hw-bootstrap/blob/master/plays/install.yml#L9 +[19]: https://docs.ansible.com/ansible/latest/modules/list_of_remote_management_modules.html +[20]: https://docs.ansible.com/ansible/latest/modules/hpilo_boot_module.html#hpilo-boot-module +[21]: https://github.com/phips/ansible-demos/tree/master/roles/phone_home diff --git a/sources/tech/20190523 Run your blog on GitHub Pages with Python.md b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md new file mode 100644 index 0000000000..1e3634a327 --- /dev/null +++ b/sources/tech/20190523 Run your blog on GitHub Pages with Python.md @@ -0,0 +1,235 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run your blog on GitHub Pages with Python) +[#]: via: (https://opensource.com/article/19/5/run-your-blog-github-pages-python) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani) + +Run your blog on GitHub Pages with Python +====== +Create a blog with Pelican, a Python-based blogging platform that works +well with GitHub. +![Raspberry Pi and Python][1] + +[GitHub][2] is a hugely popular web service for source code control that uses [Git][3] to synchronize local files with copies kept on GitHub's servers so you can easily share and back up your work. + +In addition to providing a user interface for code repositories, GitHub also enables users to [publish web pages][4] directly from a repository. The website generation package GitHub recommends is [Jekyll][5], written in Ruby. Since I'm a bigger fan of [Python][6], I prefer [Pelican][7], a Python-based blogging platform that works well with GitHub. + +Pelican and Jekyll both transform content written in [Markdown][8] or [reStructuredText][9] into HTML to generate static websites, and both generators support themes that allow unlimited customization. + +In this article, I'll describe how to install Pelican, set up your GitHub repository, run a quickstart helper, write some Markdown files, and publish your first page. I'll assume that you have a [GitHub account][10], are comfortable with [basic Git commands][11], and want to publish a blog using Pelican. + +### Install Pelican and create the repo + +First things first, Pelican (and **ghp-import** ) must be installed on your local machine. This is super easy with [pip][12], the Python package installation tool (you have pip right?): + + +``` +`$ pip install pelican ghp-import` +``` + +Next, open a browser and create a new repository on GitHub for your sweet new blog. Name it as follows (substituting your GitHub username for here and throughout this tutorial): + + +``` +`https://GitHub.com/username/username.github.io` +``` + +Leave it empty; we will fill it with compelling blog content in a moment. + +Using a command line (you command line right?), clone your empty Git repository to your local machine: + + +``` +$ git clone blog +$ cd blog +``` + +### That one weird trick… + +Here's a not-super-obvious trick about publishing web content on GitHub. For user pages (pages hosted in repos named _username.github.io_ ), the content is served from the **master** branch. + +I strongly prefer not to keep all the Pelican configuration files and raw Markdown files in **master** , rather just the web content. So I keep the Pelican configuration and the raw content in a separate branch I like to call **content**. (You can call it whatever you want, but the following instructions will call it **content**.) I like this structure since I can throw away all the files in **master** and re-populate it with the **content** branch. + + +``` +$ git checkout -b content +Switched to a new branch 'content' +``` + +### Configure Pelican + +Now it's time for content configuration. Pelican provides a great initialization tool called **pelican-quickstart** that will ask you a series of questions about your blog. + + +``` +$ pelican-quickstart +Welcome to pelican-quickstart v3.7.1. + +This script will help you create a new Pelican-based website. + +Please answer the following questions so this script can generate the files +needed by Pelican. + +> Where do you want to create your new web site? [.] +> What will be the title of this web site? Super blog +> Who will be the author of this web site? username +> What will be the default language of this web site? [en] +> Do you want to specify a URL prefix? e.g., (Y/n) n +> Do you want to enable article pagination? (Y/n) +> How many articles per page do you want? [10] +> What is your time zone? [Europe/Paris] US/Central +> Do you want to generate a Fabfile/Makefile to automate generation and publishing? (Y/n) y +> Do you want an auto-reload & simpleHTTP script to assist with theme and site development? (Y/n) y +> Do you want to upload your website using FTP? (y/N) n +> Do you want to upload your website using SSH? (y/N) n +> Do you want to upload your website using Dropbox? (y/N) n +> Do you want to upload your website using S3? (y/N) n +> Do you want to upload your website using Rackspace Cloud Files? (y/N) n +> Do you want to upload your website using GitHub Pages? (y/N) y +> Is this your personal page (username.github.io)? (y/N) y +Done. Your new project is available at /Users/username/blog +``` + +You can take the defaults on every question except: + + * Website title, which should be unique and special + * Website author, which can be a personal username or your full name + * Time zone, which may not be in Paris + * Upload to GitHub Pages, which is a "y" in our case + + + +After answering all the questions, Pelican leaves the following in the current directory: + + +``` +$ ls +Makefile content/ develop_server.sh* +fabfile.py output/ pelicanconf.py +publishconf.py +``` + +You can check out the [Pelican docs][13] to find out how to use those files, but we're all about getting things done _right now_. No, I haven't read the docs yet either. + +### Forge on + +Add all the Pelican-generated files to the **content** branch of the local Git repo, commit the changes, and push the local changes to the remote repo hosted on GitHub by entering: + + +``` +$ git add . +$ git commit -m 'initial pelican commit to content' +$ git push origin content +``` + +This isn't super exciting, but it will be handy if we need to revert edits to one of these files. + +### Finally getting somewhere + +OK, now you can get bloggy! All of your blog posts, photos, images, PDFs, etc., will live in the **content** directory, which is initially empty. To begin creating a first post and an About page with a photo, enter: + + +``` +$ cd content +$ mkdir pages images +$ cp /Users/username/SecretStash/HotPhotoOfMe.jpg images +$ touch first-post.md +$ touch pages/about.md +``` + +Next, open the empty file **first-post.md** in your favorite text editor and add the following: + + +``` +title: First Post on My Sweet New Blog +date: +author: Your Name Here + +# I am On My Way To Internet Fame and Fortune! + +This is my first post on my new blog. While not super informative it +should convey my sense of excitement and eagerness to engage with you, +the reader! +``` + +The first three lines contain metadata that Pelican uses to organize things. There are lots of different metadata you can put there; again, the docs are your best bet for learning more about the options. + +Now, open the empty file **pages/about.md** and add this text: + + +``` +title: About +date: + +![So Schmexy][my_sweet_photo] + +Hi, I am and I wrote this epic collection of Interweb +wisdom. In days of yore, much of this would have been deemed sorcery +and I would probably have been burned at the stake. + +😆 + +[my_sweet_photo]: {filename}/images/HotPhotoOfMe.jpg +``` + +You now have three new pieces of web content in your content directory. Of the content branch. That's a lot of content. + +### Publish + +Don't worry; the payoff is coming! + +All that's left to do is: + + * Run Pelican to generate the static HTML files in **output** : [code]`$ pelican content -o output -s publishconf.py` +``` +* Use **ghp-import** to add the contents of the **output** directory to the **master** branch: [code]`$ ghp-import -m "Generate Pelican site" --no-jekyll -b master output` +``` + * Push the local master branch to the remote repo: [code]`$ git push origin master` +``` + * Commit and push the new content to the **content** branch: [code] $ git add content +$ git commit -m 'added a first post, a photo and an about page' +$ git push origin content +``` + + + +### OMG, I did it! + +Now the exciting part is here, when you get to view what you've published for everyone to see! Open your browser and enter: + + +``` +`https://username.github.io` +``` + +Congratulations on your new blog, self-published on GitHub! You can follow this pattern whenever you want to add more pages or articles. Happy blogging. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/run-your-blog-github-pages-python + +作者:[Erik O'Shaughnessy][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/jnyjny/users/jasperzanjani/users/jasperzanjani/users/jasperzanjani/users/jnyjny/users/jasperzanjani +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Raspberry Pi and Python) +[2]: https://github.com/ +[3]: https://git-scm.com +[4]: https://help.github.com/en/categories/github-pages-basics +[5]: https://jekyllrb.com +[6]: https://python.org +[7]: https://blog.getpelican.com +[8]: https://guides.github.com/features/mastering-markdown +[9]: http://docutils.sourceforge.net/docs/user/rst/quickref.html +[10]: https://github.com/join?source=header-home +[11]: https://git-scm.com/docs +[12]: https://pip.pypa.io/en/stable/ +[13]: https://docs.getpelican.com diff --git a/sources/tech/20190523 Testing a Go-based S2I builder image.md b/sources/tech/20190523 Testing a Go-based S2I builder image.md new file mode 100644 index 0000000000..a6facd515d --- /dev/null +++ b/sources/tech/20190523 Testing a Go-based S2I builder image.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing a Go-based S2I builder image) +[#]: via: (https://opensource.com/article/19/5/source-image-golang-part-3) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Testing a Go-based S2I builder image +====== +In the third article in this series on Source-to-Image for Golang +applications, build your application image and take it out for a spin. +![gopher illustrations][1] + +In the first two articles in this series, we explored the general [requirements of a Source To Image (S2I) system][2] and [prepared an environment][3] specifically for a Go (Golang) application. Now let's give it a spin. + +### Building the builder image + +Once the Dockerfile and Source-to-Image (S2I) scripts are ready, the Golang builder image can be created with the **docker build** command: + + +``` +`docker build -t golang-builder .` +``` + +This will produce a builder image named **golang-builder** with the context of our current directory. + +### Building the application image + +The golang-builder image is not much use without an application to build. For this exercise, we will build a simple **hello-world** application. + +#### GoHelloWorld + +Let's meet our test app, [GoHelloWorld][4]. Download the latest [version of Go][5] if you want to follow along. There are two important (for this exercise) files in this repository: + + +``` +// goHelloWorld.go +package main + +import "fmt" + +func main() { +fmt.Println("Hello World!") +} +``` + +This is a very basic app, but it will work fine for testing the builder image. We also have a basic test for GoHelloWorld: + + +``` +// goHelloWorld_test.go +package main + +import "testing" + +func TestMain(t *testing.T) { +t.Log("Hello World!") +} +``` + +#### Build the application image + +Building the application image entails running the **s2i build** command with arguments for the repository containing the code to build (or **.** to build with code from the current directory), the name of the builder image to use, and the name of the resulting application image to create. + + +``` +`$ s2i build https://github.com/clcollins/goHelloWorld.git golang-builder go-hello-world` +``` + +To build from a local directory on a filesystem, replace the Git URL with a period to represent the current directory. For example: + + +``` +`$ s2i build . golang-builder go-hello-world` +``` + +_Note:_ If a Git repository is initialized in the current directory, S2I will fetch the code from the repository URL rather than using the local code. This results in local, uncommitted changes not being used when building the image (if you're unfamiliar with what I mean by "uncommitted changes," brush up on your [Git terminology over here][6]). Directories that are not Git-initialized repositories behave as expected. + +#### Run the application image + +Once the application image is built, it can be tested by running it with the **Docker** command. Source-to-Image has replaced the **CMD** in the image with the run script created earlier so it will execute the **/go/src/app/app** binary created during the build process: + + +``` +$ docker run go-hello-world +Hello World! +``` + +Success! We now have a compiled Go application inside a Docker image created by passing the contents of a Git repo to S2I and without needing a special Dockerfile for our application. + +The application image we just built includes not only the application, but also its source code, test code, the S2I scripts, Golang libraries, and _much of the Debian Linux distribution_ (because the Golang image is based on the Debian base image). The resulting image is not small: + + +``` +$ docker images | grep go-hello-world +go-hello-world latest 75a70c79a12f 4 minutes ago 789 MB +``` + +For applications written in languages that are interpreted at runtime and depend on linked libraries, like Ruby or Python, having all the source code and operating system are necessary to run. The build images will be pretty large as a result, but at least we know it will be able to run. With these languages, we could stop here with our S2I builds. + +There is the option, however, to more explicitly define the production requirements for the application. + +Since the resulting application image would be the same image that would run the production app, I want to assure the required ports, volumes, and environment variables are added to the Dockerfile for the builder image. By writing these in a declarative way, our app is closer to the [Twelve-Factor App][7] recommended practice. For example, if we were to use the builder image to create application images for a Ruby on Rails application running [Puma][8], we would want to open a port to access the webserver. We should add the line **PORT 3000** in the builder Dockerfile so it can be inherited by all the images generated from it. + +But for the Go app, we can do better. + +### Build a runtime image + +Since our builder image created a statically compiled Go binary with our application, we can create a final "runtime" image containing _only_ the binary and none of the other cruft. + +Once the application image is created, the compiled GoHelloWorld app can be extracted and put into a new, empty image using the save-artifacts script. + +#### Runtime files + +Only the application binary and a Dockerfile are required to create the runtime image. + +##### Application binary + +Inside of the application image, the save-artifacts script is written to stream a tar archive of the app binary to stdout. We can check the files included in the tar archive created by save-artifacts with the **-vt** flags for tar: + + +``` +$ docker run go-hello-world /usr/libexec/s2i/save-artifacts | tar -tvf - +-rwxr-xr-x 1001/root 1997502 2019-05-03 18:20 app +``` + +If this results in errors along the lines of "This does not appear to be a tar archive," the save-artifacts script is probably outputting other data in addition to the tar stream, as mentioned above. We must make sure to suppress all output other than the tar stream. + +If everything looks OK, we can use **save-artifacts** to copy the binary out of the application image: + + +``` +`$ docker run go-hello-world /usr/libexec/s2i/save-artifacts | tar -xf -` +``` + +This will copy the app file into the current directory, ready to be added to its own image. + +##### Dockerfile + +The Dockerfile is extremely simple, with only three lines. The **FROM scratch** source denotes that it uses an empty, blank parent image. The rest of the Dockerfile specifies copying the app binary into **/app** in the image and using that binary as the image **ENTRYPOINT** : + + +``` +FROM scratch +COPY app /app +ENTRYPOINT ["/app"] +``` + +Save this Dockerfile as **Dockerfile-runtime**. + +Why **ENTRYPOINT** and not **CMD**? We could do either, but since there is nothing else in the image (no filesystem, no shell), we couldn't run anything else anyway. + +#### Building the runtime image + +With the Dockerfile and binary ready to go, we can build the new runtime image: + + +``` +`$ docker build -f Dockerfile-runtime -t go-hello-world:slim .` +``` + +The new runtime image is considerably smaller—just 2MB! + + +``` +$ docker images | grep -e 'go-hello-world *slim' +go-hello-world slim 4bd091c43816 3 minutes ago 2 MB +``` + +We can test that it still works as expected with **docker run** : + + +``` +$ docker run go-hello-world:slim +Hello World! +``` + +### Bootstrapping s2i with s2i create + +While we hand-created all the S2I files in this example, the **s2i** command has a sub-command to help scaffold all the files we might need for a Source-to-Image build: **s2i create**. + +Using the **s2i create** command, we can generate a new project, creatively named **go-hello-world-2** in the **./ghw2** directory: + + +``` +$ s2i create go-hello-world-2 ./ghw2 +$ ls ./ghw2/ +Dockerfile Makefile README.md s2i test +``` + +The **create** sub-command creates a placeholder Dockerfile, a README.md with information about how to use Source-to-Image, some example S2I scripts, a basic test framework, and a Makefile. The Makefile is a great way to automate building and testing the Source-to-Image builder image. Out of the box, running **make** will build our image, and it can be extended to do more. For example, we could add steps to build a base application image, run tests, or generate a runtime Dockerfile. + +### Conclusion + +In this tutorial, we have learned how to use Source-to-Image to build a custom Golang builder image, create an application image using **s2i build** , and extract the application binary to create a super-slim runtime image. + +In a future extension to this series, I would like to look at how to use the builder image we created with [OKD][9] to automatically deploy our Golang apps with **buildConfigs** , **imageStreams** , and **deploymentConfigs**. Please let me know in the comments if you are interested in me continuing the series, and thanks for reading. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/source-image-golang-part-3 + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny (gopher illustrations) +[2]: https://opensource.com/article/19/5/source-image-golang-part-1 +[3]: https://opensource.com/article/19/5/source-image-golang-part-2 +[4]: https://github.com/clcollins/goHelloWorld.git +[5]: https://golang.org/doc/install +[6]: /article/19/2/git-terminology +[7]: https://12factor.net/ +[8]: http://puma.io/ +[9]: https://okd.io/ diff --git a/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md b/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md new file mode 100644 index 0000000000..06b8fd6de3 --- /dev/null +++ b/sources/tech/20190524 Choosing the right model for maintaining and enhancing your IoT project.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Choosing the right model for maintaining and enhancing your IoT project) +[#]: via: (https://opensource.com/article/19/5/model-choose-embedded-iot-development) +[#]: author: (Drew Moseley https://opensource.com/users/drewmoseley) + +Choosing the right model for maintaining and enhancing your IoT project +====== +Learn more about these two models: Centralized Golden Master and +Distributed Build System +![][1] + +In today's connected embedded device market, driven by the [Internet of things (IoT)][2], a large share of devices in development are based on Linux of one form or another. The prevalence of low-cost boards with ready-made Linux distributions is a key driver in this. Acquiring hardware, building your custom code, connecting the devices to other hardware peripherals and the internet as well as device management using commercial cloud providers has never been easier. A developer or development team can quickly prototype a new application and get the devices in the hands of potential users. This is a good thing and results in many interesting new applications, as well as many questionable ones. + +When planning a system design for beyond the prototyping phase, things get a little more complex. In this post, we want to consider mechanisms for developing and maintaining your base [operating system (OS) image][3]. There are many tools to help with this but we won't be discussing individual tools; of interest here is the underlying model for maintaining and enhancing this image and how it will make your life better or worse. + +There are two primary models for generating these images: + + 1. Centralized Golden Master + 2. Distributed Build System + + + +These categories mirror the driving models for [Source Code Management (SCM)][4] systems, and many of the arguments regarding centralized vs. distributed are applicable when discussing OS images. + +### Centralized Golden Master + +Hobbyist and maker projects primarily use the Centralized Golden Master method of creating and maintaining application images. This fact gives this model the benefit of speed and familiarity, allowing developers to quickly set up such a system and get it running. The speed comes from the fact that many device manufacturers provide canned images for their off-the-shelf hardware. For example, boards from such families as the [BeagleBone][5] and [Raspberry Pi][6] offer ready-to-use OS images and [flashing][7]. Relying on these images means having your system up and running in just a few mouse clicks. The familiarity is due to the fact that these images are generally based on a desktop distro many device developers have already used, such as [Debian][8]. Years of using Linux can then directly transfer to the embedded design, including the fact that the packaging utilities remain largely the same, and it is simple for designers to get the extra software packages they need. + +There are a few downsides of such an approach. The first is that the [golden master image][9] is generally a choke point, resulting in lost developer productivity after the prototyping stage since everyone must wait for their turn to access the latest image and make their changes. In the SCM realm, this practice is equivalent to a centralized system with individual [file locking][10]. Only the developer with the lock can work on any given file. + +![Development flow with the Centralized Golden Master model.][11] + +The second downside with this approach is image reproducibility. This issue is usually managed by manually logging into the target systems, installing packages using the native package manager, configuring applications and dot files, and then modifying the system configuration files in place. Once this process is completed, the disk is imaged using the **dd** utility, or an equivalent, and then distributed. + +Again, this approach creates a minefield of potential issues. For example, network-based package feeds may cease to exist, and the base software provided by the vendor image may change. Scripting can help mitigate these issues. However, these scripts tend to be fragile and break when changes are made to configuration file formats or the vendor's base software packages. + +The final issue that arises with this development model is reliance on third parties. If the hardware vendor's image changes don't work for your design, you may need to invest significant time to adapt. To make matters even more complicated, as mentioned before, the hardware vendors often based their images on an upstream project such as Debian or Ubuntu. This situation introduces even more third parties who can affect your design. + +### Distributed Build System + +This method of creating and maintaining an image for your application relies on the generation of target images separate from the target hardware. The developer workflow here is similar to standard software development using an SCM system; the image is fully buildable by tooling and each developer can work independently. Changes to the system are made via edits to metadata files (scripting, recipes, configuration files, etc) and then the tooling is rerun to generate an updated image. These metadata files are then managed using an SCM system. Individual developers can merge the latest changes into their working copies to produce their development images. In this case, no golden master image is needed and developers can avoid the associated bottleneck. + +Release images are then produced by a build system using standard SCM techniques to pull changes from all the developers. + +![Development flow with the Distributed Build System model.][12] + +Working in this fashion allows the size of your development team to increase without reducing productivity of individual developers. All engineers can work independently of the others. Additionally, this build setup ensures that your builds can be reproduced. Using standard SCM workflows can ensure that, at any future time, you can regenerate a specific build allowing for long term maintenance, even if upstream providers are no longer available. Similar to working with distributed SCM tools however, there is additional policy that needs to be in place to enable reproducible, release candidate images. Individual developers have their own copies of the source and can build their own test images but for a proper release engineering effort, development teams will need to establish merging and branching standards and ensure that all changes targeted for release eventually get merged into a well-defined branch. Many upstream projects already have well-defined processes for this kind of release strategy (for instance, using *-stable and *-next branches). + +The primary downside of this approach is the lack of familiarity. For example, adding a package to the image normally requires creating a recipe of some kind and then updating the definitions so that the package binaries are included in the image. This is very different from running apt while logged into a running system. The learning curve of these systems can be daunting but the results are more predictable and scalable and are likely a better choice when considering a design for a product that will be mass produced. + +Dedicated build systems such as [OpenEmbedded][13] and [Buildroot][14] use this model as do distro packaging tools such as [debootstrap][15] and [multistrap][16]. Newer tools such as [Isar][17], [debos][18], and [ELBE][19] also use this basic model. Choices abound, and it is worth the investment to learn one or more of these packages for your designs. The long term maintainability and reproducibility of these systems will reduce risk in your design by allowing you to generate reproducible builds, track all the source code, and remove your dependency on third-party providers continued existence. + +#### Conclusion + +To be clear, the distributed model does suffer some of the same issues as mentioned for the Golden Master Model; especially the reliance on third parties. This is a consequence of using systems designed by others and cannot be completely avoided unless you choose a completely roll-your-own approach which comes with a significant cost in development and maintenance. + +For prototyping and proof-of-concept level design, and a team of just a few developers, the Golden Master Model may well be the right choice given restrictions in time and budget that are present at this stage of development. For low volume, high touch designs, this may be an acceptable trade-off for production use. + +For general production use, the benefits in terms of team size scalability, image reproducibility and developer productivity greatly outweigh the learning curve and overhead of systems implementing the distributed model. Support from board and chip vendors is also widely available in these systems reducing the upfront costs of developing with them. For your next product, I strongly recommend starting the design with a serious consideration of the model being used to generate the base OS image. If you choose to prototype with the golden master model with the intention of migrating to the distributed model, make sure to build sufficient time in your schedule for this effort; the estimates will vary widely depending on the specific tooling you choose as well as the scope of the requirements and the out-of-the-box availability of software packages your code relies on. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/model-choose-embedded-iot-development + +作者:[Drew Moseley][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/drewmoseley +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=RPkPPtDe +[2]: https://en.wikipedia.org/wiki/Internet_of_things +[3]: https://en.wikipedia.org/wiki/System_image +[4]: https://en.wikipedia.org/wiki/Version_control +[5]: http://beagleboard.org/ +[6]: https://www.raspberrypi.org/ +[7]: https://en.wikipedia.org/wiki/Flash_memory +[8]: https://www.debian.org/ +[9]: https://en.wikipedia.org/wiki/Software_release_life_cycle#RTM +[10]: https://en.wikipedia.org/wiki/File_locking +[11]: https://opensource.com/sites/default/files/uploads/cgm1_500.png (Development flow with the Centralized Golden Master model.) +[12]: https://opensource.com/sites/default/files/uploads/cgm2_500.png (Development flow with the Distributed Build System model.) +[13]: https://www.openembedded.org/ +[14]: https://buildroot.org/ +[15]: https://wiki.debian.org/Debootstrap +[16]: https://wiki.debian.org/Multistrap +[17]: https://github.com/ilbers/isar +[18]: https://github.com/go-debos/debos +[19]: https://elbe-rfs.org/ diff --git a/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md b/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md new file mode 100644 index 0000000000..b281b6036b --- /dev/null +++ b/sources/tech/20190524 Dual booting Windows and Linux using UEFI.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Dual booting Windows and Linux using UEFI) +[#]: via: (https://opensource.com/article/19/5/dual-booting-windows-linux-uefi) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/ckrzen) + +Dual booting Windows and Linux using UEFI +====== +A quick rundown of setting up Linux and Windows to dual boot on the same +machine, using the Unified Extensible Firmware Interface (UEFI). +![Linux keys on the keyboard for a desktop computer][1] + +Rather than doing a step-by-step how-to guide to configuring your system to dual boot, I’ll highlight the important points. As an example, I will refer to my new laptop that I purchased a few months ago. I first installed [Ubuntu Linux][2] onto the entire hard drive, which destroyed the pre-installed [Windows 10][3] installation. After a few months, I decided to install a different Linux distribution, and so also decided to re-install Windows 10 alongside [Fedora Linux][4] in a dual boot configuration. I’ll highlight some essential facts to get started. + +### Firmware + +Dual booting is not just a matter of software. Or, it is, but it involves changing your firmware, which among other things tells your machine how to begin the boot process. Here are some firmware-related issues to keep in mind. + +#### UEFI vs. BIOS + +Before attempting to install, make sure your firmware configuration is optimal. Most computers sold today have a new type of firmware known as [Unified Extensible Firmware Interface (UEFI)][5], which has pretty much replaced the other firmware known as [Basic Input Output System (BIOS)][6], which is often included through the mode many providers call Legacy Boot. + +I had no need for BIOS, so I chose UEFI mode. + +#### Secure Boot + +One other important setting is Secure Boot. This feature detects whether the boot path has been tampered with, and stops unapproved operating systems from booting. For now, I disabled this option to ensure that I could install Fedora Linux. According to the Fedora Project Wiki [Features/Secure Boot ][7] Fedora Linux will work with it enabled. This may be different for other Linux distributions —I plan to revisit this setting in the future. + +In short, if you find that you cannot install your Linux OS with this setting active, disable Secure Boot and try again. + +### Partitioning the boot drive + +If you choose to dual boot and have both operating systems on the same drive, you have to break it into partitions. Even if you dual boot using two different drives, most Linux installations are best broken into a few basic partitions for a variety of reasons. Here are some options to consider. + +#### GPT vs MBR + +If you decide to manually partition your boot drive in advance, I recommend using the [GUID Partition Table (GPT)][8] rather than the older [Master Boot Record (MBR)][9]. Among the reasons for this change, there are two specific limitations of MBR that GPT doesn’t have: + + * MBR can hold up to 15 partitions, while GPT can hold up to 128. + * MBR only supports up to 2 terabytes, while GPT uses 64-bit addresses which allows it to support disks up to 8 million terabytes. + + + +If you have shopped for hard drives recently, then you know that many of today’s drives exceed the 2 terabyte limit. + +#### The EFI system partition + +If you are doing a fresh installation or using a new drive, there are probably no partitions to begin with. In this case, the OS installer will create the first one, which is the [EFI System Partition (ESP)][10]. If you choose to manually partition your drive using a tool such as [gdisk][11], you will need to create this partition with several parameters. Based on the existing ESP, I set the size to around 500MB and assigned it the ef00 (EFI System) partition type. The UEFI specification requires the format to be FAT32/msdos, most likely because it is supportable by a wide range of operating systems. + +![Partitions][12] + +### Operating System Installation + +Once you accomplish the first two tasks, you can install your operating systems. While I focus on Windows 10 and Fedora Linux here, the process is fairly similar when installing other combinations as well. + +#### Windows 10 + +I started the Windows 10 installation and created a 20 Gigabyte Windows partition. Since I had previously installed Linux on my laptop, the drive had an ESP, which I chose to keep. I deleted all existing Linux and swap partitions to start fresh, and then started my Windows installation. The Windows installer automatically created another small partition—16 Megabytes—called the [Microsoft Reserved Partition (MSR)][13]. Roughly 400 Gigabytes of unallocated space remained on the 512GB boot drive once this was finished. + +I then proceeded with and completed the Windows 10 installation process. I then rebooted into Windows to make sure it was working, created my user account, set up wi-fi, and completed other tasks that need to be done on a first-time OS installation. + +#### Fedora Linux + +I next moved to install Linux. I started the process, and when it reached the disk configuration steps, I made sure not to change the Windows NTFS and MSR partitions. I also did not change the EPS, but I did set its mount point to **/boot/efi**. I then created the usual ext4 formatted partitions, **/** (root), **/boot** , and **/home**. The last partition I created was Linux **swap**. + +As with Windows, I continued and completed the Linux installation, and then rebooted. To my delight, at boot time the [GRand][14] [Unified Boot Loader (GRUB)][14] menu provided the choice to select either Windows or Linux, which meant I did not have to do any additional configuration. I selected Linux and completed the usual steps such as creating my user account. + +### Conclusion + +Overall, the process was painless. In past years, there has been some difficulty navigating the changes from UEFI to BIOS, plus the introduction of features such as Secure Boot. I believe that we have now made it past these hurdles and can reliably set up multi-boot systems. + +I don’t miss the [Linux LOader (LILO)][15] anymore! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/dual-booting-windows-linux-uefi + +作者:[Alan Formy-Duval][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/alanfdoss/users/ckrzen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://www.ubuntu.com +[3]: https://www.microsoft.com/en-us/windows +[4]: https://getfedora.org +[5]: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface +[6]: https://en.wikipedia.org/wiki/BIOS +[7]: https://fedoraproject.org/wiki/Features/SecureBoot +[8]: https://en.wikipedia.org/wiki/GUID_Partition_Table +[9]: https://en.wikipedia.org/wiki/Master_boot_record +[10]: https://en.wikipedia.org/wiki/EFI_system_partition +[11]: https://sourceforge.net/projects/gptfdisk/ +[12]: /sites/default/files/u216961/gdisk_screenshot_s.png +[13]: https://en.wikipedia.org/wiki/Microsoft_Reserved_Partition +[14]: https://en.wikipedia.org/wiki/GNU_GRUB +[15]: https://en.wikipedia.org/wiki/LILO_(boot_loader) diff --git a/sources/tech/20190527 4 open source mobile apps for Nextcloud.md b/sources/tech/20190527 4 open source mobile apps for Nextcloud.md new file mode 100644 index 0000000000..c97817e3c1 --- /dev/null +++ b/sources/tech/20190527 4 open source mobile apps for Nextcloud.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 open source mobile apps for Nextcloud) +[#]: via: (https://opensource.com/article/19/5/mobile-apps-nextcloud) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +4 open source mobile apps for Nextcloud +====== +Increase Nextcloud's value by turning it into an on-the-go information +hub. +![][1] + +I've been using [Nextcloud][2] (and before that, ownCloud), an open source alternative to file syncing and storage services like Dropbox and Google Drive, for many years. It's been both reliable and useful, and it respects my privacy. + +While Nextcloud is great at both syncing and storage, it's much more than a place to dump your files. Thanks to applications that you can fold into Nextcloud, it becomes more of an information hub than a storage space. + +While I usually interact with Nextcloud using the desktop client or in a browser, I'm not always at my computer (or any computer that I trust). So it's important that I can work with Nextcloud using my [LineageOS][3]-powered smartphone or tablet. + +To do that, I use several open source apps that work with Nextcloud. Let's take a look at four of them. + +As you've probably guessed, this article looks at the Android version of those apps. I grabbed mine from [F-Droid][4], although you get them from other Android app markets. You might be able to get some or all of them from Apple's App Store if you're an iOS person. + +### Working with files and folders + +The obvious app to start with is the [Nextcloud sync client][5]. This little app links your phone or tablet to your Nextcloud account. + +![Nextcloud mobile app][6] + +Using the app, you can: + + * Create folders + * Upload one or more files + * Sync files between your device and server + * Rename or remove files + * Make files available offline + + + +You can also tap a file to view or edit it. If your device doesn't have an app that can open the file, then you're out of luck. You can still download it to your phone or tablet though. + +### Reading news feeds + +Remember all the whining that went on when Google pulled the plug on Google Reader in 2013? This despite Google giving users several months to find an alternative. And, yes, there are alternatives. One of them, believe it or not, is Nextcloud. + +Nextcloud has a built-in RSS reader. All you need to do to get started is upload an [OPML][7] file containing your feeds or manually add a site's RSS feed to Nextcloud. + +Going mobile is easy, too, with the Nextcloud [News Reader app][8]. + +![Nextcloud News app][9] + +Unless you configure the app to sync when you start it up, you'll need to swipe down from the top of the app to load updates to your feeds. Depending on how many feeds you have, and how many unread items are in those feeds, syncing takes anywhere from a few seconds to half a minute. + +From there, tap an item to read it in the News app. + +![Nextcloud News app][10] + +You can also add feeds or open what you're reading in your device's default web browser. + +### Reading and writing notes + +I don't use Nextcloud's [Notes][11] app all that often (I'm more of a [Standard Notes][12] person). That said, you might find the Notes app comes in handy. + +How? By giving you a lightweight way to take [plain text][13] notes on your mobile device. The Notes app syncs any notes you have in your Nextcloud account and displays them in chronological order—newest or last-edited notes first. + +![Nextcloud Notes app][14] + +Tap a note to read or edit it. You can also create a note by tapping the **+** button, then typing what you need to type. + +![Nextcloud Notes app][15] + +There's no formatting, although you can add markup (like Markdown) to the note. Once you're done editing, the app syncs your note with Nextcloud. + +### Accessing your bookmarks + +Nextcloud has a decent bookmarking tool, and its [Bookmarks][16] app makes it easy to work with the tool on your phone or tablet. + +![Nextcloud Bookmarks app][17] + +Like the Notes app, Bookmarks displays your bookmarks in chronological order, with the newest appearing first in the list. + +If you tagged your bookmarks in Nextcloud, you can swipe left in the app to see a list of those tags rather than a long list of bookmarks. Tap a tag to view the bookmarks under it. + +![Nextcloud Bookmarks app][18] + +From there, just tap a bookmark. It opens in your device's default browser. + +You can also add a bookmark within the app. To do that, tap the **+** menu and add the bookmark. + +![Nextcloud Bookmarks app][19] + +You can include: + + * The URL + * A title for the bookmark + * A description + * One or more tags + + + +### Is that all? + +Definitely not. There are apps for [Nextcloud Deck][20] (a personal kanban tool) and [Nextcloud Talk][21] (a voice and video chat app). There are also a number of third-party apps that work with Nextcloud. Just do a search for _Nextcloud_ or _ownCloud_ in your favorite app store to track them down. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/mobile-apps-nextcloud + +作者:[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/OSDC_BUS_cloudagenda_20140341_jehb.png?itok=1NGs3_n4 +[2]: https://nextcloud.com/ +[3]: https://lineageos.org/ +[4]: https://opensource.com/life/15/1/going-open-source-android-f-droid +[5]: https://f-droid.org/en/packages/com.nextcloud.client/ +[6]: https://opensource.com/sites/default/files/uploads/nextcloud-app.png (Nextcloud mobile app) +[7]: http://en.wikipedia.org/wiki/OPML +[8]: https://f-droid.org/en/packages/de.luhmer.owncloudnewsreader/ +[9]: https://opensource.com/sites/default/files/uploads/nextcloud-news.png (Nextcloud News app) +[10]: https://opensource.com/sites/default/files/uploads/nextcloud-news-reading.png (Nextcloud News app) +[11]: https://f-droid.org/en/packages/it.niedermann.owncloud.notes +[12]: https://opensource.com/article/18/12/taking-notes-standard-notes +[13]: https://plaintextproject.online +[14]: https://opensource.com/sites/default/files/uploads/nextcloud-notes.png (Nextcloud Notes app) +[15]: https://opensource.com/sites/default/files/uploads/nextcloud-notes-add.png (Nextcloud Notes app) +[16]: https://f-droid.org/en/packages/org.schabi.nxbookmarks/ +[17]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks.png (Nextcloud Bookmarks app) +[18]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks-tags.png (Nextcloud Bookmarks app) +[19]: https://opensource.com/sites/default/files/uploads/nextcloud-bookmarks-add.png (Nextcloud Bookmarks app) +[20]: https://f-droid.org/en/packages/it.niedermann.nextcloud.deck +[21]: https://f-droid.org/en/packages/com.nextcloud.talk2 diff --git a/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md b/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md new file mode 100644 index 0000000000..8ab4b5b0b8 --- /dev/null +++ b/sources/tech/20190527 Blockchain 2.0 - Introduction To Hyperledger Sawtooth -Part 12.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – Introduction To Hyperledger Sawtooth [Part 12]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – Introduction To Hyperledger Sawtooth [Part 12] +====== + +![Introduction To Hyperledger Sawtooth][1] + +After having discussed the [**Hyperledger Fabric**][2] project in detail on this blog, its time we moved on to the next project of interest at the Hyperledger camp. **Hyperledger Sawtooth** is Intel’s contribution to the [**Blockchain**][3] consortium mission to develop enterprise ready modular distributed ledgers and applications. Sawtooth is another attempt at creating an easy to roll out blockchain ledger for businesses keeping their resource constraints and security requirements in mind. While platforms such as [**Ethereum**][4] will in theory offer similar functionality when placed in capable hands, Sawtooth readily provides a lot of customizability and is built from the ground up for specific enterprise level use cases. + +The Hyperledger project page has an introductory video detailing the Sawtooth architecture and platform. We’re attaching it here for readers to get a quick round-up about the product. + +Moving to the intricacies of the Sawtooth project, there are **five primary and significant differences** between Sawtooth and its alternatives. The post from now and on will explore these differences and at the end will mention an example real world use case for Hyperledger Sawtooth in managing supply chains. + +### Distinction 1: The consensus algorithm – PoET + +This is perhaps amongst the most notable and significant changes that Sawtooth brings to the fore. While exploring all the different consensus algorithms that exist for blockchain platforms these days is out of the scope of this post, what is to be noted is that Sawtooth uses a **Proof Of Elapsed Time** (POET) based consensus algorithm. Such a system for validating transactions and blocks on the blockchain is considered to be resources efficient unlike other computation heavy systems which use the likes of **Proof of work** or **Proof of stake** algorithms. + +POET is designed to utilize the security and tamper proof features of modern processors with reference implementations utilizing **Intel’s trusted execution environment** (TEE) architecture on its modern CPUs. The fact that the execution of the validating program takes use of a TEE along with a **“lottery”** system that is implemented to choose the **validator** or **node** to fulfill the request makes the process of creating blocks on the Sawtooth architecture secure and resource efficient at the same time. + +The POET algorithm basically elects a validator randomly based on a stochastic process. The probability of a particular node being selected depends on a host of pointers one of which depends on the amount of computing resources the said node has contributed to the ledger so far. The chosen validator then proceeds to timestamp the said block of data and shares it with the permissioned nodes in the network so that there remains a reliable record of the blockchains immutability. This method of electing the “validator” node was developed by **Intel** and so far, has been shown to exhibit zero bias and or error in executing its function. + +### Distinction 2: A fully separated level of abstraction between the application level and core system + +As mentioned, the Sawtooth platform takes modularity to the next level. Here in the reference implementation that is shared by the [**Hyperledger project**][5] foundation, the core system that enables users to create a distributed ledger, and, the application run-time environment (the virtual environment where applications developed to run on the blockchain otherwise known as [**smart contracts**][6] or **chaincode** ) are separated by a full level of abstraction. This essentially means that developers can separately code applications in any programming language of their choice instead of having to conform to and follow platform specific languages. The Sawtooth platform provides support for the following contract languages out of the box: **Java** , **Python** , **C++** , **Go** , **JavaScript** and **Rust**. This distinction between the core system and application levels are obtained by defining a custom transaction family for each application that is developed on the platform. + +A transaction family contains the following: + + * **A transaction processor** : basically, your applications logic or business logic. + * **Data model** : a system that defines and handles data storage and processing at the system level. + * **Client-side handler** to handle the end user side of your application. + + + +Multiple low-level transaction families such as this may be defined in a permissioned blockchain and used in a modular fashion throughout the network. For instance, if a consortium of banks chose to implement it, they could come together and define common functionalities or rules for their applications and then plug and play the transaction families they need in their respective systems without having to develop everything on their own. + +### Distinction 3: SETH + +It is without doubt that a blockchain future would for sure have Ethereum as one of the key players. People at the Hyperledger foundation know this well. The **Hyperledger Burrow project** is in fact meant to address the existence of entities working on multiple platforms by providing a way for developers to use Ethereum blockchain specifications to build custom distributed applications using the **EVM** (Ethereum virtual machine). + +Basically speaking, Burrow lets you customize and deploy Ethereum based [**DApps**][7] (written in **solidity** ) in non-public blockchains (the kind developed for use at the Hyperledger foundation). The Burrow and Sawtooth projects teamed up and created **SETH**. **Sawtooth-Ethereum Integration project** (SETH) is meant to add Ethereum (solidity) smart contract functionality and compatibility to Sawtooth based distributed ledger networks. A much-less known agenda to SETH is the fact that applications (DApps) and smart contracts written for EVM can now be easily ported to Sawtooth. + +### Distinction 4: ACID principle and ability to batch process + +A rather path breaking feature of Sawtooth is its ability to batch transactions together and then package them into a block. The blocks and transactions will still be subject to the **ACID** principle ( **A** tomicity, **C** onsistency, **I** solation and **D** urability). The implication of these two facts are highlighted using an example as follows. + +Let’s say you have **6 transactions** to be packaged into **two blocks (4+2)**. Block A has 4 transactions which individually needs to succeed in order for the next block of 2 transactions to be timestamped and validated. Assuming they succeed, the next block of 2 transactions is processed and assuming even they are successful the entire package of 6 transactions are deemed successful and the overall business logic is deemed successful. For instance, assume you’re selling a car. Different transactions at the ends of the buyer (block A) and the seller (block B) will need be completed in order for the trade to be deemed valid. Ownership is transferred only if both the sides are successful in carrying out their individual transactions. + +Such a feature will improve accountability on individual ends by separating responsibilities and improve the recognizability of faults and errors by the same principle. The ACID principle is implemented by coding for a custom transaction processor and defining a transaction family that will store data in the said block structure. + +### Distinction 5: Parallel transaction execution + +Blockchain platforms usually follow a serial **first come first serve route** to executing transactions and follow a queueing system for the same. Sawtooth provides support for both **serial** and **parallel execution** of transactions. Parallel transaction processing offers significant performance gains for even faster transactions by reducing overall transaction latencies. More faster transactions will be processed along with slower and bigger transactions at the same time on the platform instead of transactions of all types to be kept waiting. + +The methodology followed to implement the parallel transaction paradigm efficiently takes care of the double spending problems and errors due to multiple changes being made to the same state by defining a custom scheduler for the network which can identity processes and their predecessors. + +Real world use case: Supply Chain Management using Sawtooth applied with IoT + +The Sawtooth **official website** lists seafood traceability as an example use case for the Sawtooth platform. The basic template is applicable for almost all supply chain related use cases. + +![][8] + +Figure 1 From the Hyperledger Sawtooth Official Website + +Traditional supply chain management solutions in this space work majorly through manual record keeping which leaves room for massive frauds, errors, and significant quality control issues. IoT has been cited as a solution to overcome such issues with supply chains in day to day use. Inexpensive GPS enabled RFID-tags can be attached to fresh catch or produce as the case may be and can be scanned for updating at the individual processing centres automatically. Buyers or middle men can verify and or track the information easily using a client on their mobile device to know the route their dinner has taken before arriving on their plates. + +While tracking seafood seems to be a first world problem in countries like India, the change an IoT enabled system can bring to public delivery systems in developing countries can be a welcome change. The application is available for demo at this **[link][9]** and users are encouraged to fiddle with it and adopt it to suit their needs. + +**Reference:** + + * [**The Official Hyperledger Sawtooth Docs**][10] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Hyperledger-Sawtooth-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-fabric/ +[3]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[4]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[5]: https://www.ostechnix.com/blockchain-2-0-an-introduction-to-hyperledger-project-hlp/ +[6]: https://www.ostechnix.com/blockchain-2-0-explaining-smart-contracts-and-its-types/ +[7]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[8]: http://www.ostechnix.com/wp-content/uploads/2019/05/Sawtooth.png +[9]: https://sawtooth.hyperledger.org/examples/seafood.html +[10]: https://sawtooth.hyperledger.org/docs/core/releases/1.0/contents.html diff --git a/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md new file mode 100644 index 0000000000..a717d05ed8 --- /dev/null +++ b/sources/tech/20190527 How To Enable Or Disable SSH Access For A Particular User Or Group In Linux.md @@ -0,0 +1,300 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Enable Or Disable SSH Access For A Particular User Or Group In Linux?) +[#]: via: (https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/) +[#]: author: (2daygeek http://www.2daygeek.com/author/2daygeek/) + +How To Enable Or Disable SSH Access For A Particular User Or Group In Linux? +====== + +As per your organization standard policy, you may need to allow only the list of users that are allowed to access the Linux system. + +Or you may need to allow only few groups, which are allowed to access the Linux system. + +How to achieve this? What is the best way? How to achieve this in a simple way? + +Yes, there are many ways are available to perform this. + +However, we need to go with simple and easy method. + +If so, it can be done by making the necessary changes in `/etc/ssh/sshd_config` file. + +In this article we will show you, how to perform this in details. + +Why are we doing this? due to security reason. Navigate to the following URL to know more about **[openSSH][1]** usage. + +### What Is SSH? + +openssh stands for OpenBSD Secure Shell. Secure Shell (ssh) is a free open source networking tool which allow us to access remote system over an unsecured network using Secure Shell (SSH) protocol. + +It’s a client-server architecture. It handles user authentication, encryption, transferring files between computers and tunneling. + +These can be accomplished via traditional tools such as telnet or rcp, these are insecure and use transfer password in cleartext format while performing any action. + +### How To Allow A User To Access SSH In Linux? + +We can allow/enable the ssh access for a particular user or list of the users using the following method. + +If you would like to allow more than one user then you have to add the users with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to allow ssh access for `user3`. + +``` +# echo "AllowUsers user3" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i allowusers +AllowUsers user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Simple open a new terminal or session and try to access the Linux system with different user. Yes, `user2` isn’t allowed for SSH login and will be getting an error message as shown below. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:00:35 CentOS7 sshd[4900]: User user2 from 192.168.1.6 not allowed because not listed in AllowUsers +Mar 29 02:00:35 CentOS7 sshd[4900]: input_userauth_request: invalid user user2 [preauth] +Mar 29 02:00:40 CentOS7 unix_chkpwd[4902]: password check failed for user (user2) +Mar 29 02:00:40 CentOS7 sshd[4900]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user2 +Mar 29 02:00:43 CentOS7 sshd[4900]: Failed password for invalid user user2 from 192.168.1.6 port 42568 ssh2 +``` + +At the same time `user3` is allowed to login into the system because it’s in allowed users list. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:01:13 CentOS7 sshd[4939]: Accepted password for user3 from 192.168.1.6 port 42590 ssh2 +Mar 29 02:01:13 CentOS7 sshd[4939]: pam_unix(sshd:session): session opened for user user3 by (uid=0) +``` + +### How To Deny Users To Access SSH In Linux? + +We can deny/disable the ssh access for a particular user or list of the users using the following method. + +If you would like to disable more than one user then you have to add the users with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `user1`. + +``` +# echo "DenyUsers user1" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i denyusers +DenyUsers user1 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Simple open a new terminal or session and try to access the Linux system with Deny user. Yes, `user1` is in denyusers list. So, you will be getting an error message as shown below when you are try to login. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 01:53:42 CentOS7 sshd[4753]: User user1 from 192.168.1.6 not allowed because listed in DenyUsers +Mar 29 01:53:42 CentOS7 sshd[4753]: input_userauth_request: invalid user user1 [preauth] +Mar 29 01:53:46 CentOS7 unix_chkpwd[4755]: password check failed for user (user1) +Mar 29 01:53:46 CentOS7 sshd[4753]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 01:53:48 CentOS7 sshd[4753]: Failed password for invalid user user1 from 192.168.1.6 port 42522 ssh2 +``` + +### How To Allow Groups To Access SSH In Linux? + +We can allow/enable the ssh access for a particular group or groups using the following method. + +If you would like to allow more than one group then you have to add the groups with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. In this example, we are going to disable ssh access for `2g-admin` group. + +``` +# echo "AllowGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# cat /etc/ssh/sshd_config | grep -i allowgroups +AllowGroups 2g-admin +``` + +Run the following command to know the list of the users are belongs to this group. + +``` +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Yes, `user3` is allowed to login into the system because user3 is belongs to `2g-admin` group. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:10:21 CentOS7 sshd[5165]: Accepted password for user1 from 192.168.1.6 port 42640 ssh2 +Mar 29 02:10:22 CentOS7 sshd[5165]: pam_unix(sshd:session): session opened for user user1 by (uid=0) +``` + +Yes, `user2` is allowed to login into the system because user2 is belongs to `2g-admin` group. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:10:38 CentOS7 sshd[5225]: Accepted password for user2 from 192.168.1.6 port 42642 ssh2 +Mar 29 02:10:38 CentOS7 sshd[5225]: pam_unix(sshd:session): session opened for user user2 by (uid=0) +``` + +When you are try to login into the system with other users which are not part of this group then you will be getting an error message as shown below. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:12:36 CentOS7 sshd[5306]: User ladmin from 192.168.1.6 not allowed because none of user's groups are listed in AllowGroups +Mar 29 02:12:36 CentOS7 sshd[5306]: input_userauth_request: invalid user ladmin [preauth] +Mar 29 02:12:56 CentOS7 unix_chkpwd[5310]: password check failed for user (ladmin) +Mar 29 02:12:56 CentOS7 sshd[5306]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=ladmin +Mar 29 02:12:58 CentOS7 sshd[5306]: Failed password for invalid user ladmin from 192.168.1.6 port 42674 ssh2 +``` + +### How To Deny Group To Access SSH In Linux? + +We can deny/disable the ssh access for a particular group or groups using the following method. + +If you would like to disable more than one group then you need to add the group with space in the same line. + +To do so, just append the following value into `/etc/ssh/sshd_config` file. + +``` +# echo "DenyGroups 2g-admin" >> /etc/ssh/sshd_config +``` + +You can double check this by running the following command. + +``` +# # cat /etc/ssh/sshd_config | grep -i denygroups +DenyGroups 2g-admin + +# getent group 2g-admin +2g-admin:x:1005:user1,user2,user3 +``` + +That’s it. Just bounce the ssh service and see the magic. + +``` +# systemctl restart sshd + +# service restart sshd +``` + +Yes `user3` isn’t allowed to login into the system because it’s not part of `2g-admin` group. It’s in Denygroups. + +``` +# ssh [email protected] +[email protected]'s password: +Permission denied, please try again. +``` + +Output: + +``` +Mar 29 02:17:32 CentOS7 sshd[5400]: User user1 from 192.168.1.6 not allowed because a group is listed in DenyGroups +Mar 29 02:17:32 CentOS7 sshd[5400]: input_userauth_request: invalid user user1 [preauth] +Mar 29 02:17:38 CentOS7 unix_chkpwd[5402]: password check failed for user (user1) +Mar 29 02:17:38 CentOS7 sshd[5400]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.6 user=user1 +Mar 29 02:17:41 CentOS7 sshd[5400]: Failed password for invalid user user1 from 192.168.1.6 port 42710 ssh2 +``` + +Anyone can login into the system except `2g-admin` group. Hence, `ladmin` user is allowed to login into the system. + +``` +# ssh [email protected] +[email protected]'s password: +[[email protected] ~]$ +``` + +Output: + +``` +Mar 29 02:19:13 CentOS7 sshd[5432]: Accepted password for ladmin from 192.168.1.6 port 42716 ssh2 +Mar 29 02:19:13 CentOS7 sshd[5432]: pam_unix(sshd:session): session opened for user ladmin by (uid=0) +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/allow-deny-enable-disable-ssh-access-user-group-in-linux/ + +作者:[2daygeek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.2daygeek.com/author/2daygeek/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/ssh-tutorials/ diff --git a/sources/tech/20190528 A Quick Look at Elvish Shell.md b/sources/tech/20190528 A Quick Look at Elvish Shell.md new file mode 100644 index 0000000000..82927332a7 --- /dev/null +++ b/sources/tech/20190528 A Quick Look at Elvish Shell.md @@ -0,0 +1,107 @@ +Translating by name1e5s +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A Quick Look at Elvish Shell) +[#]: via: (https://itsfoss.com/elvish-shell/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +A Quick Look at Elvish Shell +====== + +Everyone who comes to this site has some knowledge (no matter how slight) of the Bash shell that comes default of so many systems. There have been several attempts to create shells that solve some of the shortcomings of Bash that have appeared over the years. One such shell is Elvish, which we will look at today. + +### What is Elvish Shell? + +![Pipelines In Elvish][1] + +[Elvish][2] is more than just a shell. It is [also][3] “an expressive programming language”. It has a number of interesting features including: + + * Written in Go + * Built-in file manager, inspired by the [Ranger file manager][4] (`Ctrl + N`) + * Searchable command history (`Ctrl + R`) + * History of directories visited (`Ctrl + L`) + * Powerful pipelines that support structured data, such as lists, maps, and functions + * Includes a “standard set of control structures: conditional control with `if`, loops with `for` and `while`, and exception handling with `try`“ + * Support for [third-party modules via a package manager to extend Elvish][5] + * Licensed under the BSD 2-Clause license + + + +“Why is it named Elvish?” I hear you shout. Well, according to [their website][6], they chose their current name because: + +> In roguelikes, items made by the elves have a reputation of high quality. These are usually called elven items, but “elvish” was chosen because it ends with “sh”, a long tradition of Unix shells. It also rhymes with fish, one of the shells that influenced the philosophy of Elvish. + +### How to Install Elvish Shell + +Elvish is available in several mainstream distributions. + +Note that the software is very young. The most recent version is 0.12. According to the project’s [GitHub page][3]: “Despite its pre-1.0 status, it is already suitable for most daily interactive use.” + +![Elvish Control Structures][7] + +#### Debian and Ubuntu + +Elvish packages were introduced into Debian Buster and Ubuntu 17.10. Unfortunately, those packages are out of date and you will need to use a [PPA][8] to install the latest version. You will need to use the following commands: + +``` +sudo add-apt-repository ppa:zhsj/elvish +sudo apt update +sudo apt install elvish +``` + +#### Fedora + +Elvish is not available in the main Fedora repos. You will need to add the [FZUG Repository][9] to install Evlish. To do so, you will need to use these commands: + +``` +sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repol +sudo dnf install elvish +``` + +#### Arch + +Elvish is available in the [Arch User Repository][10]. + +I believe you know [how to change shell in Linux][11] so after installing you can switch to Elvish to use it. + +### Final Thoughts on Elvish Shell + +Personally, I have no reason to install Elvish on any of my systems. I can get most of its features by installing a couple of small command line programs or using already installed programs. + +For example, the search past commands feature already exists in Bash and it works pretty well. If you want to improve your ability to search past commands, I would recommend installing [fzf][12] instead. Fzf uses fuzzy search, so you don’t need to remember the exact command you are looking for. Fzf also allows you to preview and open files. + +I do think that the fact that Elvish is also a programming language is neat, but I’ll stick with Bash shell scripting until Elvish matures a little more. + +Have you every used Elvish? Do you think it would be worthwhile to install Elvish? What is your favorite Bash replacement? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][13]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/elvish-shell/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/pipelines-in-elvish.png?fit=800%2C421&ssl=1 +[2]: https://elv.sh/ +[3]: https://github.com/elves/elvish +[4]: https://ranger.github.io/ +[5]: https://github.com/elves/awesome-elvish +[6]: https://elv.sh/ref/name.html +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Elvish-control-structures.png?fit=800%2C425&ssl=1 +[8]: https://launchpad.net/%7Ezhsj/+archive/ubuntu/elvish +[9]: https://github.com/FZUG/repo/wiki/Add-FZUG-Repository +[10]: https://aur.archlinux.org/packages/elvish/ +[11]: https://linuxhandbook.com/change-shell-linux/ +[12]: https://github.com/junegunn/fzf +[13]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md b/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md new file mode 100644 index 0000000000..ad431547da --- /dev/null +++ b/sources/tech/20190529 Packit - packaging in Fedora with minimal effort.md @@ -0,0 +1,244 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Packit – packaging in Fedora with minimal effort) +[#]: via: (https://fedoramagazine.org/packit-packaging-in-fedora-with-minimal-effort/) +[#]: author: (Petr Hracek https://fedoramagazine.org/author/phracek/) + +Packit – packaging in Fedora with minimal effort +====== + +![][1] + +### What is packit + +Packit ([https://packit.dev/)][2] is a CLI tool that helps you auto-maintain your upstream projects into the Fedora operating system. But what does it really mean? + +As a developer, you might want to update your package in Fedora. If you’ve done it in the past, you know it’s no easy task. If you haven’t let me reiterate: it’s no easy task. + +And this is exactly where packit can help: once you have your package in Fedora, you can maintain your SPEC file upstream and, with just one additional configuration file, packit will help you update your package in Fedora when you update your source code upstream. + +Furthermore, packit can synchronize downstream changes to a SPEC file back into the upstream repository. This could be useful if the SPEC file of your package is changed in Fedora repositories and you would like to synchronize it into your upstream project. + +Packit also provides a way to build an SRPM package based on an upstream repository checkout, which can be used for building RPM packages in COPR. + +Last but not least, packit provides a status command. This command provides information about upstream and downstream repositories, like pull requests, release and more others. + +Packit provides also another two commands: _build_ and _create-update_. + +The command _packit build_ performs a production build of your project in Fedora build system – koji. You can Fedora version you want to build against using an option _–dist-git-branch_. The command _packit create-updates_ creates a Bodhi update for the specific branch using the option — _dist-git-branch_. + +### Installation + +You can install packit on Fedora using dnf: + +``` +sudo dnf install -y packit +``` + +### Configuration + +For demonstration use case, I have selected the upstream repository of **colin** ([https://github.com/user-cont/colin)][3]. Colin is a tool to check generic rules and best-practices for containers, dockerfiles, and container images. + +First of all, clone **colin** git repository: + +``` +$ git clone https://github.com/user-cont/colin.git +$ cd colin +``` + +Packit expects to run in the root of your git repository. + +Packit ([https://github.com/packit-service/packit/)][4] needs information about your project, which has to be stored in the upstream repository in the _.packit.yaml_ file (). + +See colin’s packit configuration file: + +``` +$ cat .packit.yaml +specfile_path: colin.spec +synced_files: + -.packit.yaml + - colin.spec +upstream_project_name: colin +downstream_package_name: colin +``` + +What do the values mean? + + * _specfile_path_ – a relative path to a spec file within the upstream repository (mandatory) + * _synced_files_ – a list of relative paths to files in the upstream repo which are meant to be copied to dist-git during an update + * _upstream_project_name_ – name of the upstream repository (e.g. in PyPI); this is used in %prep section + * _downstream_package_name_ – name of the package in Fedora (mandatory) + + + +For more information see the packit configuration documentation () + +### What can packit do? + +Prerequisite for using packit is that you are in a working directory of a git checkout of your upstream project. + +Before running any packit command, you need to do several actions. These actions are mandatory for filing a PR into the upstream or downstream repositories and to have access into the Fedora dist-git repositories. + +Export GitHub token taken from : + +``` +$ export GITHUB_TOKEN= +``` + +Obtain your Kerberos ticket needed for Fedora Account System (FAS) : + +``` +$ kinit @FEDORAPROJECT.ORG +``` + +Export your Pagure API keys taken from : + +``` +$ export PAGURE_USER_TOKEN= +``` + +Packit also needs a fork token to create a pull request. The token is taken from + +Do it by running: + +``` +$ export PAGURE_FORK_TOKEN= +``` + +Or store these tokens in the **~/.config/packit.yaml** file: + +``` +$ cat ~/.config/packit.yaml + +github_token: +pagure_user_token: +pagure_fork_token: +``` + +#### Propose a new upstream release in Fedora + +The command for this first use case is called _**propose-update**_ (). The command creates a new pull request in Fedora dist-git repository using a selected or the latest upstream release. + +``` +$ packit propose-update + +INFO: Running 'anitya' versioneer +Version in upstream registries is '0.3.1'. +Version in spec file is '0.3.0'. +WARNING Version in spec file is outdated +Picking version of the latest release from the upstream registry. +Checking out upstream version 0.3.1 +Using 'master' dist-git branch +Copying /home/vagrant/colin/colin.spec to /tmp/tmptfwr123c/colin.spec. +Archive colin-0.3.0.tar.gz found in lookaside cache (skipping upload). +INFO: Downloading file from URL https://files.pythonhosted.org/packages/source/c/colin/colin-0.3.0.tar.gz +100%[=============================>] 3.18M eta 00:00:00 +Downloaded archive: '/tmp/tmptfwr123c/colin-0.3.0.tar.gz' +About to upload to lookaside cache +won't be doing kinit, no credentials provided +PR created: https://src.fedoraproject.org/rpms/colin/pull-request/14 +``` + +Once the command finishes, you can see a PR in the Fedora Pagure instance which is based on the latest upstream release. Once you review it, it can be merged. + +![][5] + +#### Sync downstream changes back to the upstream repository + +Another use case is to sync downstream changes into the upstream project repository. + +The command for this purpose is called _**sync-from-downstream**_ (). Files synced into the upstream repository are mentioned in the _packit.yaml_ configuration file under the _synced_files_ value. + +``` +$ packit sync-from-downstream + +upstream active branch master +using "master" dist-git branch +Copying /tmp/tmplvxqtvbb/colin.spec to /home/vagrant/colin/colin.spec. +Creating remote fork-ssh with URL git@github.com:phracek/colin.git. +Pushing to remote fork-ssh using branch master-downstream-sync. +PR created: https://github.com/user-cont/colin/pull/229 +``` + +As soon as packit finishes, you can see the latest changes taken from the Fedora dist-git repository in the upstream repository. This can be useful, e.g. when Release Engineering performs mass-rebuilds and they update your SPEC file in the Fedora dist-git repository. + +![][6] + +#### Get the status of your upstream project + +If you are a developer, you may want to get all the information about the latest releases, tags, pull requests, etc. from the upstream and the downstream repository. Packit provides the _**status**_ command for this purpose. + +``` +$ packit status +Downstream PRs: + ID Title URL +---- -------------------------------- --------------------------------------------------------- + 14 Update to upstream release 0.3.1 https://src.fedoraproject.org//rpms/colin/pull-request/14 + 12 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/12 + 11 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/11 + 8 Upstream pr: 226 https://src.fedoraproject.org//rpms/colin/pull-request/8 + +Dist-git versions: +f27: 0.2.0 +f28: 0.2.0 +f29: 0.2.0 +f30: 0.2.0 +master: 0.2.0 + +GitHub upstream releases: +0.3.1 +0.3.0 +0.2.1 +0.2.0 +0.1.0 + +Latest builds: +f27: colin-0.2.0-1.fc27 +f28: colin-0.3.1-1.fc28 +f29: colin-0.3.1-1.fc29 +f30: colin-0.3.1-2.fc30 + +Latest bodhi updates: +Update Karma status +------------------ ------- -------- +colin-0.3.1-1.fc29 1 stable +colin-0.3.1-1.fc28 1 stable +colin-0.3.0-2.fc28 0 obsolete +``` + +#### Create an SRPM + +The last packit use case is to generate an SRPM package based on a git checkout of your upstream project. The packit command for SRPM generation is _**srpm**_. + +``` +$ packit srpm +Version in spec file is '0.3.1.37.g00bb80e'. +SRPM: /home/phracek/work/colin/colin-0.3.1.37.g00bb80e-1.fc29.src.rpm +``` + +### Packit as a service + +In the summer, the people behind packit would like to introduce packit as a service (). In this case, the packit GitHub application will be installed into the upstream repository and packit will perform all the actions automatically, based on the events it receives from GitHub or fedmsg. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/packit-packaging-in-fedora-with-minimal-effort/ + +作者:[Petr Hracek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/phracek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/05/packit3-816x345.png +[2]: https://packit.dev/ +[3]: https://github.com/user-cont/colin +[4]: https://github.com/packit-service/packit/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/05/colin_pr-1024x781.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/05/colin_upstream_pr-1-1024x677.png diff --git a/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md b/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md new file mode 100644 index 0000000000..713d117cb3 --- /dev/null +++ b/sources/tech/20190530 Creating a Source-to-Image build pipeline in OKD.md @@ -0,0 +1,484 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Creating a Source-to-Image build pipeline in OKD) +[#]: via: (https://opensource.com/article/19/5/creating-source-image-build-pipeline-okd) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +Creating a Source-to-Image build pipeline in OKD +====== +S2I is an ideal way to build and compile Go applications in a repeatable +way, and it just gets better when paired with OKD BuildConfigs. +![][1] + +In the first three articles in this series, we explored the general [requirements][2] of a Source-to-Image (S2I) system and [prepared][3] and [tested][4] an environment specifically for a Go (Golang) application. This S2I build is perfect for local development or maintaining a builder image with a code pipeline, but if you have access to an [OKD][5] or OpenShift cluster (or [Minishift][6]), you can set up the entire workflow using OKD BuildConfigs, not only to build and maintain the builder image but also to use the builder image to create the application image and subsequent runtime image automatically. This way, the images can be rebuilt automatically when downstream images change and can trigger OKD deploymentConfigs to redeploy applications running from these images. + +### Step 1: Build the builder image in OKD + +As in local S2I usage, the first step is to create the builder image to build the GoHelloWorld test application that we can reuse to compile other Go-based applications. This first build step will be a Docker build, just like before, that pulls the Dockerfile and S2I scripts from a Git repository to build the image. Therefore, those files must be committed and available in a public Git repo (or you can use the companion [GitHub repo][7] for this article). + +_Note:_ OKD BuildConfigs do not require that source Git repos are public. To use a private repo, you must set up deploy keys and link the keys to a builder service account. This is not difficult, but for simplicity's sake, this exercise will use a public repository. + +#### Create an image stream for the builder image + +The BuildConfig will create a builder image for us to compile the GoHelloWorld app, but first, we need a place to store the image. In OKD, that place is an image stream. + +An [image stream][8] and its tags are like a manifest or list of related images and image tags. It serves as an abstraction layer that allows you to reference an image, even if the image changes. Think of it as a collection of aliases that reference specific images and, as images are updated, automatically points to the new image version. The image stream is nothing except these aliases—just metadata about real images stored in a registry. + +An image stream can be created with the **oc create imagestream ** command, or it can be created from a YAML file with **oc create -f **. Either way, a brand-new image stream is a small placeholder object that is empty until it is populated with image references, either manually (who wants to do things manually?) or with a BuildConfig. + +Our golang-builder image stream looks like this: + + +``` +# imageStream-golang-builder.yaml +\--- +apiVersion: image.openshift.io/v1 +kind: ImageStream +metadata: +generation: 1 +name: golang-builder +spec: +lookupPolicy: +local: false +``` + +Other than a name, and a (mostly) empty spec, there is nothing really there. + +_Note:_ The **lookupPolicy** has to do with allowing Kubernetes-native components to resolve image stream references since image streams are OKD-native and not a part of the Kubernetes core. This topic is out of scope for this article, but you can read more about how it works in OKD's documentation [Using Image Streams with Kubernetes Resources][9]. + +Create an image stream for the builder image and its progeny. + + +``` +$ oc create -f imageStream-golangBuilder.yaml + +# Check the ImageStream +$ oc get imagestream golang-builder +NAME DOCKER REPO TAGS UPDATED +imagestream.image.openshift.io/golang-builder docker-registry.default.svc:5000/golang-builder/golang-builder +``` + +Note that the newly created image stream has no tags and has never been updated. + +#### Create a BuildConfig for the builder image + +In OKD, a [BuildConfig][10] describes how to build container images from a specific source and triggers for when they build. Don't be thrown off by the language—just as you might say you build and re-build the same image from a Dockerfile, but in reality, you have built multiple images, a BuildConfig builds and rebuilds the same image, but in reality, it creates multiple images. (And suddenly the reason for image streams becomes much clearer!) + +Our builder image BuildConfig describes how to build and re-build our builder image(s). The BuildConfig's core is made up of four important parts: + + 1. Build source + 2. Build strategy + 3. Build output + 4. Build triggers + + + +The _build source_ (predictably) describes where the thing that runs the build comes from. The builds described by the golang-builder BuildConfig will use the Dockerfile and S2I scripts we created previously and, using the Git-type build source, clone a Git repository to get the files to do the builds. + + +``` +source: +type: Git +git: +ref: master +uri: +``` + +The _build strategy_ describes what the build will do with the source files from the build source. The golang-builder BuildConfig mimics the **docker build** we used previously to build our local builder image by using the Docker-type build strategy. + + +``` +strategy: +type: Docker +dockerStrategy: {} +``` + +The **dockerStrategy** build type tells OKD to build a Docker image from the Dockerfile contained in the source specified by the build source. + +The _build output_ tells the BuildConfig what to do with the resulting image. In this case, we specify the image stream we created above and a tag to give to the image. As with our local build, we're tagging it with **golang-builder:1.12** as a reference to the Go version inherited from the parent image. + + +``` +output: +to: +kind: ImageStreamTag +name: golang-builder:1.12 +``` + +Finally, the BuildConfig defines a set of _build triggers_ —events that will cause the image to be rebuilt automatically. For this BuildConfig, a change to the BuildConfig configuration or an update to the upstream image (golang:1.12) will trigger a new build. + + +``` +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Using the [builder image BuildConfig][11] from the GitHub repo as a reference (or just using that file), create a BuildConfig YAML file and use it to create the BuildConfig. + + +``` +$ oc create -f buildConfig-golang-builder.yaml + +# Check the BuildConfig +$ oc get bc golang-builder +NAME TYPE FROM LATEST +golang-builder Docker Git@master 1 +``` + +Because the BuildConfig included the "ImageChange" trigger, it immediately kicks off a new build. You can check that the build was created with the **oc get builds** command. + + +``` +# Check the Builds +$ oc get builds +NAME TYPE FROM STATUS STARTED DURATION +golang-builder-1 Docker Git@8eff001 Complete About a minute ago 13s +``` + +While the build is running and after it has completed, you can view its logs with **oc logs -f ** and see the Docker build output as you would locally. + + +``` +$ oc logs -f golang-builder-1-build +Step 1/11 : FROM docker.io/golang:1.12 +\---> 7ced090ee82e +Step 2/11 : LABEL maintainer "Chris Collins <[collins.christopher@gmail.com][12]>" +\---> 7ad989b765e4 +Step 3/11 : ENV CGO_ENABLED 0 GOOS linux GOCACHE /tmp STI_SCRIPTS_PATH /usr/libexec/s2i SOURCE_DIR /go/src/app +\---> 2cee2ce6757d + +<...> +``` + +If you did not include any build triggers (or did not have them in the right place), your build may not start automatically. You can manually kick off a new build with the **oc start-build** command. + + +``` +$ oc start-build golang-builder + +# Or, if you want to automatically tail the build log +$ oc start-build golang-builder --follow +``` + +When the build completes, the resulting image is tagged and pushed to the integrated image registry and the image stream is updated with the new image's information. Check the image stream with the **oc get imagestream** command to see that the new tag exists. + + +``` +$ oc get imagestream golang-builder +NAME DOCKER REPO TAGS UPDATED +golang-builder docker-registry.default.svc:5000/golang-builder/golang-builder 1.12 33 seconds ago +``` + +### Step 2: Build the application image in OKD + +Now that we have a builder image for our Golang applications created and stored within OKD, we can use this builder image to compile all of our Go apps. First on the block is the example GoHelloWorld app from our [local build example][4]. GoHelloWorld is a simple Go app that just outputs **Hello World!** when it's run. + +Just as we did in the local example with the **s2i build** command, we can tell OKD to use our builder image and S2I to build the application image for GoHelloWorld, compiling the Go binary from the source code in the [GoHelloWorld GitHub repository][13]. This can be done with a BuildConfig with a **sourceStrategy** build. + +#### Create an image stream for the application image + +First things first, we need to create an image stream to manage the image created by the BuildConfig. The image stream is just like the golang-builder image stream, just with a different name. Create it with **oc create is** or using a YAML file from the [GitHub repo][7]. + + +``` +$ oc create -f imageStream-goHelloWorld-appimage.yaml +imagestream.image.openshift.io/go-hello-world-appimage created +``` + +#### Create a BuildConfig for the application image + +Just as we did with the builder image BuildConfig, this BuildConfig will use the Git source option to clone our source code from the GoHelloWorld repository. + + +``` +source: +type: Git +git: +uri: +``` + +Instead of using a DockerStrategy build to create an image from a Dockerfile, this BuildConfig will use the sourceStrategy definition to build the image using S2I. + + +``` +strategy: +type: Source +sourceStrategy: +from: +kind: ImageStreamTag +name: golang-builder:1.12 +``` + +Note the **from:** hash in sourceStrategy. This tells OKD to use the **golang-builder:1.12** image we created previously for the S2I build. + +The BuildConfig will output to the new **appimage** image stream we created, and we'll include config- and image-change triggers to kick off new builds automatically if anything updates. + + +``` +output: +to: +kind: ImageStreamTag +name: go-hello-world-appimage:1.0 +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Once again, create a BuildConfig or use the one from the GitHub repo. + + +``` +`$ oc create -f buildConfig-goHelloWorld-appimage.yaml` +``` + +The new build shows up alongside the golang-builder build and, because image-change triggers are specified, the build starts immediately. + + +``` +$ oc get builds +NAME TYPE FROM STATUS STARTED DURATION +golang-builder-1 Docker Git@8eff001 Complete 8 minutes ago 13s +go-hello-world-appimage-1 Source Git@99699a6 Running 44 seconds ago +``` + +If you want to watch the build logs, use the **oc logs -f** command. Once the application image build completes, it is pushed to the image stream we specified, then the new image stream tag is created. + + +``` +$ oc get is go-hello-world-appimage +NAME DOCKER REPO TAGS UPDATED +go-hello-world-appimage docker-registry.default.svc:5000/golang-builder/go-hello-world-appimage 1.0 10 minutes ago +``` + +Success! The GoHelloWorld app was cloned from source into a new image and compiled and tested using our S2I scripts. We can use the image as-is but, as with our local S2I builds, we can do better and create an image with just the new Go binary in it. + +### Step 3: Build the runtime image in OKD + +Now that the application image has been created with a compiled Go binary for the GoHelloWorld app, we can use something called chain builds to mimic when we extracted the binary from our local application image and created a new runtime image with just the binary in it. + +#### Create an image stream for the runtime image + +Once again, the first step is to create an image stream image for the new runtime image. + + +``` +# Create the ImageStream +$ oc create -f imageStream-goHelloWorld.yaml +imagestream.image.openshift.io/go-hello-world created + +# Get the ImageStream +$ oc get imagestream go-hello-world +NAME DOCKER REPO TAGS UPDATED +go-hello-world docker-registry.default.svc:5000/golang-builder/go-hello-world +``` + +#### Chain builds + +Chain builds are when one or more BuildConfigs are used to compile software or assemble artifacts for an application, and those artifacts are saved and used by a subsequent BuildConfig to generate a runtime image without re-compiling the code. + +![Chain Build workflow][14] + +Chain build workflow + +#### Create a BuildConfig for the runtime image + +The runtime BuildConfig uses the DockerStrategy build to build the image from a Dockerfile—the same thing we did with the builder image BuildConfig. This time, however, the source is not a Git source, but a Dockerfile source. + +What is the Dockerfile source? It's an inline Dockerfile! Instead of cloning a repo with a Dockerfile in it and building that, we specify the Dockerfile in the BuildConfig. This is especially appropriate with our runtime Dockerfile because it's just three lines long. + + +``` +source: +type: Dockerfile +dockerfile: |- +FROM scratch +COPY app /app +ENTRYPOINT ["/app"] +images: +\- from: +kind: ImageStreamTag +name: go-hello-world-appimage:1.0 +paths: +\- sourcePath: /go/src/app/app +destinationDir: "." +``` + +Note that the Dockerfile in the Dockerfile source definition above is the same as the Dockerfile we used in the [third article][4] in this series when we built the slim GoHelloWorld image locally using the binary we extracted with the S2I **save-artifacts** script. + +Something else to note: **scratch** is a reserved word in Dockerfiles. Unlike other **FROM** statements, it does not define an _actual_ image, but rather that the first layer of this image will be nothing. It is defined with **kind: DockerImage** but does not have a registry or group/namespace/project string. Learn more about this behavior in this excellent [container best practices][15] reference. + +The **images** section of the Dockerfile source describes the source of the artifact(s) to be used in the build; in this case, from the appimage generated earlier. The **paths** subsection describes where to get the binary (i.e., in the **/go/src/app** directory of the app image, get the **app** binary) and where to save it (i.e., in the current working directory of the build itself: **"."** ). This allows the **COPY app /app** to grab the binary from the current working directory and add it to **/app** in the runtime image. + +_Note:_ **paths** is an array of source and the destination path _pairs_. Each entry in the list consists of a source and destination. In the example above, there is just one entry because there is just a single binary to copy. + +The Docker strategy is then used to build the inline Dockerfile. + + +``` +strategy: +type: Docker +dockerStrategy: {} +``` + +Once again, it is output to the image stream created earlier and includes build triggers to automatically kick off new builds. + + +``` +output: +to: +kind: ImageStreamTag +name: go-hello-world:1.0 +triggers: +\- type: ConfigChange +\- imageChange: +type: ImageChange +``` + +Create a BuildConfig YAML or use the runtime BuildConfig from the GitHub repo. + + +``` +$ oc create -f buildConfig-goHelloWorld.yaml +buildconfig.build.openshift.io/go-hello-world created +``` + +If you watch the logs, you'll notice the first step is **FROM scratch** , which confirms we're adding the compiled binary to a blank image. + + +``` +$ oc logs -f pod/go-hello-world-1-build +Step 1/5 : FROM scratch +\---> +Step 2/5 : COPY app /app +\---> 9e70e6c710f8 +Removing intermediate container 4d0bd9cef0a7 +Step 3/5 : ENTRYPOINT /app +\---> Running in 7a2dfeba28ca +\---> d697577910fc + +<...> +``` + +Once the build is completed, check the image stream tag to validate that the new image was pushed to the registry and image stream was updated. + + +``` +$ oc get imagestream go-hello-world +NAME DOCKER REPO TAGS UPDATED +go-hello-world docker-registry.default.svc:5000/golang-builder/go-hello-world 1.0 4 minutes ago +``` + +Make a note of the **DOCKER REPO** string for the image. It will be used in the next section to run the image. + +### Did we create a tiny, binary-only image? + +Finally, let's validate that we did, indeed, build a tiny image with just the binary. + +Check out the image details. First, get the image's name from the image stream. + + +``` +$ oc describe imagestream go-hello-world +Name: go-hello-world +Namespace: golang-builder +Created: 42 minutes ago +Labels: +Annotations: +Docker Pull Spec: docker-registry.default.svc:5000/golang-builder/go-hello-world +Image Lookup: local=false +Unique Images: 1 +Tags: 1 + +1.0 +no spec tag + +* docker-registry.default.svc:5000/golang-builder/go-hello-world@sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +13 minutes ago +``` + +The image is listed at the bottom, described with the SHA hash (e.g., **sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053** ; yours will be different). + +Get the details of the image using the hash. + + +``` +$ oc describe image sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Docker Image: docker-registry.default.svc:5000/golang-builder/go-hello-world@sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Name: sha256:eb11e0147a2917312f5e0e9da71109f0cb80760e945fdc1e2db6424b91bc9053 +Created: 15 minutes ago +Annotations: image.openshift.io/dockerLayersOrder=ascending +image.openshift.io/manifestBlobStored=true +openshift.io/image.managed=true +Image Size: 1.026MB +Image Created: 15 minutes ago +Author: +Arch: amd64 +Entrypoint: /app +Working Dir: +User: +Exposes Ports: +Docker Labels: io.openshift.build.name=go-hello-world-1 +io.openshift.build.namespace=golang-builder +Environment: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +OPENSHIFT_BUILD_NAME=go-hello-world-1 +OPENSHIFT_BUILD_NAMESPACE=golang-builder +``` + +Notice the image size, 1.026MB, is exactly as we want. The image is a scratch image with just the binary inside it! + +### Run a pod with the runtime image + +Using the runtime image we just created, let's create a pod on-demand and run it and validate that it still works. + +This almost never happens in Kubernetes/OKD, but we will run a pod, just a pod, by itself. + + +``` +$ oc run -it go-hello-world --image=docker-registry.default.svc:5000/golang-builder/go-hello-world:1.0 --restart=Never +Hello World! +``` + +Everything is working as expected—the image runs and outputs "Hello World!" just as it did in the previous, local S2I builds. + +By creating this workflow in OKD, we can use the golang-builder S2I image for any Go application. This builder image is in place and built for any other applications, and it will auto-update and rebuild itself anytime the upstream golang:1.12 image changes. + +New apps can be built automatically using the S2I build by creating a chain build strategy in OKD with an appimage BuildConfig to compile the source and the runtime BuildConfig to create the final image. Using the build triggers, any change to the source code in the Git repo will trigger a rebuild through the entire pipeline, rebuilding the appimage and the runtime image automatically. + +This is a great way to maintain updated images for any application. Paired with an OKD deploymentConfig with an image build trigger, long-running applications (e.g., webapps) will be automatically redeployed when new code is committed. + +Source-to-Image is an ideal way to develop builder images to build and compile Go applications in a repeatable way, and it just gets better when paired with OKD BuildConfigs. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/5/creating-source-image-build-pipeline-okd + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/blocks_building.png?itok=eMOT-ire +[2]: https://opensource.com/article/19/5/source-image-golang-part-1 +[3]: https://opensource.com/article/19/5/source-image-golang-part-2 +[4]: https://opensource.com/article/19/5/source-image-golang-part-3 +[5]: https://www.okd.io/ +[6]: https://github.com/minishift/minishift +[7]: https://github.com/clcollins/golang-s2i.git +[8]: https://docs.okd.io/latest/architecture/core_concepts/builds_and_image_streams.html#image-streams +[9]: https://docs.okd.io/latest/dev_guide/managing_images.html#using-is-with-k8s +[10]: https://docs.okd.io/latest/dev_guide/builds/index.html#defining-a-buildconfig +[11]: https://github.com/clcollins/golang-s2i/blob/master/okd/buildConfig-golang-builder.yaml +[12]: mailto:collins.christopher@gmail.com +[13]: https://github.com/clcollins/goHelloWorld.git +[14]: https://opensource.com/sites/default/files/uploads/chainingbuilds.png (Chain Build workflow) +[15]: http://docs.projectatomic.io/container-best-practices/#_from_scratch diff --git a/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md b/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md new file mode 100644 index 0000000000..e3a533b3b2 --- /dev/null +++ b/sources/tech/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md @@ -0,0 +1,200 @@ +[#]: 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:// + +[![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 "" > /usr/share/nginx/html/info.php +[root@linuxtechi ~]# +``` + +Type the following URL in the web browser, + +http:///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 diff --git a/sources/tech/20190603 How many browser tabs do you usually have open.md b/sources/tech/20190603 How many browser tabs do you usually have open.md new file mode 100644 index 0000000000..7777477029 --- /dev/null +++ b/sources/tech/20190603 How many browser tabs do you usually have open.md @@ -0,0 +1,44 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How many browser tabs do you usually have open?) +[#]: via: (https://opensource.com/article/19/6/how-many-browser-tabs) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett/users/sarahwall/users/ksonney/users/jwhitehurst) + +How many browser tabs do you usually have open? +====== +Plus, get a few tips for browser productivity. +![Browser of things][1] + +Here's a potentially loaded question: How many browser tabs do you usually have open at one time? Do you have multiple windows, each with multiple tabs? Or are you a minimalist, and only have a couple of tabs open at once. Another option is to move a 20-tabbed browser window to a different monitor so that it is out of the way while working on a particular task. Does your approach differ between work, personal, and mobile browsers? Is your browser strategy related to your [productivity habits][2]? + +### 4 tips for browser productivity + + 1. Know your browser shortcuts to save clicks. Whether you use Firefox or Chrome, there are plenty of keyboard shortcuts to help make switching between tabs and performing certain functions a breeze. For example, Chrome makes it easy to open up a blank Google document. Use the shortcut **"Ctrl + t"** to open a new tab, then type **"doc.new"**. The same can be done for spreadsheets, slides, and forms. + 2. Organize your most frequent tasks with bookmark folders. When it's time to start a particular task, simply open all of the bookmarks in the folder **(Ctrl + click)** to check it off your list quickly. + 3. Get the right browser extensions for you. There are thousands of browser extensions out there all claiming to improve productivity. Before you install, make sure you're not just adding more distractions to your screen. + 4. Reduce screen time by using a timer. It doesn't matter if you use an old-fashioned egg timer or a fancy browser extension. To prevent eye strain, implement the 20/20/20 rule. Every 20 minutes, take a 20-second break from your screen and look at something 20 feet away. + + + +Take our poll to share how many browser tabs you like to have open at once. Be sure to tell us about your favorite browser tricks in the comments. + +There are two components of productivity—doing the right things and doing those things efficiently... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-many-browser-tabs + +作者:[Lauren Pritchett][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/lauren-pritchett/users/sarahwall/users/ksonney/users/jwhitehurst +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things) +[2]: https://enterprisersproject.com/article/2019/1/5-time-wasting-habits-break-new-year diff --git a/sources/tech/20190603 How to stream music with GNOME Internet Radio.md b/sources/tech/20190603 How to stream music with GNOME Internet Radio.md new file mode 100644 index 0000000000..fc21d82d0b --- /dev/null +++ b/sources/tech/20190603 How to stream music with GNOME Internet Radio.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to stream music with GNOME Internet Radio) +[#]: via: (https://opensource.com/article/19/6/gnome-internet-radio) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss/users/r3bl) + +How to stream music with GNOME Internet Radio +====== +If you're looking for a simple, straightforward interface that gets your +streams playing, try GNOME's Internet Radio plugin. +![video editing dashboard][1] + +Internet radio is a great way to listen to stations from all over the world. Like many developers, I like to turn on a station as I code. You can listen to internet radio with a media player for the terminal like [MPlayer][2] or [mpv][3], which is what I use to listen via the Linux command line. However, if you prefer using a graphical user interface (GUI), you may want to try [GNOME Internet Radio][4], a nifty plugin for the GNOME desktop. You can find it in the package manager. + +![GNOME Internet Radio plugin][5] + +Listening to internet radio with a graphical desktop operating system generally requires you to launch an application such as [Audacious][6] or [Rhythmbox][7]. They have nice interfaces, plenty of options, and cool audio visualizers. But if you want a simple, straightforward interface that gets your streams playing, GNOME Internet Radio is for you. + +After installing it, a small icon appears in your toolbar, which is where you do all your configuration and management. + +![GNOME Internet Radio icons][8] + +The first thing I did was go to the Settings menu. I enabled the following two options: show title notifications and show volume adjustment. + +![GNOME Internet Radio Settings][9] + +GNOME Internet Radio includes a few pre-configured stations, and it is really easy to add others. Just click the ( **+** ) sign. You'll need to enter a channel name, which can be anything you prefer (including the station name), and the station address. For example, I like to listen to Synthetic FM. I enter the name, e.g., "Synthetic FM," and the stream address, i.e., . + +Then click the star next to the stream to add it to your menu. + +However you listen to music and whatever genre you choose, it is obvious—coders need their music! The GNOME Internet Radio plugin makes it simple to get your favorite internet radio station queued up. + +In honor of the Gnome desktop's 18th birthday on August 15, we've rounded up 18 reasons to toast... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/gnome-internet-radio + +作者:[Alan Formy-Duval][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/alanfdoss/users/r3bl +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/article/18/12/linux-toy-mplayer +[3]: https://mpv.io/ +[4]: https://extensions.gnome.org/extension/836/internet-radio/ +[5]: https://opensource.com/sites/default/files/uploads/packagemanager_s.png (GNOME Internet Radio plugin) +[6]: https://audacious-media-player.org/ +[7]: https://help.gnome.org/users/rhythmbox/stable/ +[8]: https://opensource.com/sites/default/files/uploads/titlebaricons.png (GNOME Internet Radio icons) +[9]: https://opensource.com/sites/default/files/uploads/gnomeinternetradio_settings.png (GNOME Internet Radio Settings) diff --git a/sources/tech/20190604 Aging in the open- How this community changed us.md b/sources/tech/20190604 Aging in the open- How this community changed us.md new file mode 100644 index 0000000000..a03d49eca2 --- /dev/null +++ b/sources/tech/20190604 Aging in the open- How this community changed us.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Aging in the open: How this community changed us) +[#]: via: (https://opensource.com/open-organization/19/6/four-year-celebration) +[#]: author: (Bryan Behrenshausen https://opensource.com/users/bbehrens) + +Aging in the open: How this community changed us +====== +Our community dedicated to exploring open organizational culture and +design turns four years old this week. +![Browser window with birthday hats and a cake][1] + +A community will always surprise you. + +That's not an easy statement for someone like me to digest. I'm not one for surprises. I revel in predictability. I thrive on consistency. + +A passionate and dedicated community offers few of these comforts. Participating in something like [the open organization community at Opensource.com][2]—which [turns four years old this week][3]—means acquiescing to dynamism, to constant change. Every day brings novelty. Every correspondence is packed with possibility. Every interaction reveals undisclosed pathways. + +To [a certain type of person][4] (me again), it can be downright terrifying. + +But that unrelenting and genuine surprise is the [very source of a community's richness][5], its sheer abundance. If a community is the nucleus of all those reactions that catalyze innovations and breakthroughs, then unpredictability and serendipity are its fuel. I've learned to appreciate it—more accurately, perhaps, to stand in awe of it. Four years ago, when the Opensource.com team heeded [Jim Whitehurst's call][6] to build a space for others to "share your thoughts and opinions… on how you think we can all lead and work better in the future" (see the final page of _The Open Organization_ ), we had little more than a mandate, a platform, and a vision. We'd be an open organization [committed to studying, learning from, and propagating open organizations][7]. The rest was a surprise—or rather, a series of surprises: + + * [Hundreds of articles, reviews, guides, and tutorials][2] on infusing open principles into organizations of all sizes across industries + * [A book series][8] spanning five volumes (with [another currently in production][9]) + * A detailed, comprehensive, community-maintained [definition of the "open organization" concept][10] + * A [robust maturity model][11] for anyone seeking to understand how that definition might (or might not) support their own work + + + +All of that—everything you see there, [and more][12]—is the work of a community that never stopped conversing, never ceased creating, never failed to outsmart itself. No one could have predicted it. No one could have [planned for it][13]. We simply do our best to keep up with it. + +And after four years the work continues, more focused and impassioned than ever. Remaining involved with this bunch of writers, educators, consultants, coaches, leaders, and mentors—all united by their belief that openness is the surest source of hope for organizations struggling to address the challenges of our age—has made me appreciate the power of the utterly surprising. I'm even getting a little more comfortable with it. + +That's been its gift to me. But the gifts it has given each of its participants have been equally special. + +As we celebrate four years of challenges, collaboration, and camaraderie this week, let's recount those surprising gifts by hearing from some of the members: + +* * * + +Four years of the open organization community—congratulations to all! + +My first thought was to look at the five most-read articles over the past four years. Here they are: + + * [5 laws every aspiring DevOps engineer should know][14] + * [What value do you bring to your company?][15] + * [8 answers to management questions from an open point of view][16] + * [What to do when you're feeling underutilized][17] + * [What's the point of DevOps?][18] + + + +All great articles. And then I started to think: Of all the great content over the past four years, which articles have impacted me the most? + +I remembered reading several great articles about meetings and how to make them more effective. So I typed "opensource.com meetings" into my search engine, and these two wonderful articles were at the top of the results list: + + * [The secret to better one-on-one meetings][19] + * [Time to rethink your team's approach to meetings][20] + + + +Articles like that have inspired my favorite open organization management principle, which I've tried to apply and has made a huge difference: All meetings are optional. + +**—Jeff Mackanic, senior director, Marketing, Red Hat** + +* * * + +Being a member of the "open community" has reminded me of the power of getting things done via values and shared purpose without command and control—something that seems more important than ever in today's fragmented and often abusive management world, and at a time when truth and transparency themselves are under attack. + +Four years is a long journey for this kind of initiative—but there's still so much to learn and understand about what makes "open" work and what it will take to accelerate the embrace of its principles more widely through different domains of work and society. Congratulations on all you, your colleagues, partners, and other members of the community have done thus far! + +**—Brook Manville, Principal, Brook Manville LLC, author of _A Company of Citizens_ and co-author of _The Harvard Business Review Leader's Handbook_** + +* * * + +The Open Organization Ambassador program has, in the last four years, become an inspired community of experts. We have defined what it means to be a truly open organization. We've written books, guides, articles, and other resources for learning about, understanding, and implementing open principles. We've done this while bringing open principles to other communities, and we've done this together. + +For me, personally and professionally, the togetherness is the best part of this endeavor. I have learned so much from my colleagues. I'm absolutely ecstatic to be one of the idealists and activists in this community—committed to making our workplaces more equitable and open. + +**—Laura Hilliger, co-founder, We Are Open Co-Op, and[Open Organization Ambassador][21]** + +* * * + +Finding the open organization community opened me up to knowing that there are others out there who thought as I did. I wasn't alone. My ideas on leadership and the workplace were not crazy. This sense of belonging increased once I joined the Ambassador team. Our monthly meetings are never long enough. I don't like when we have to hang up because each session is full of laughter, sharpening each other, idea exchange, and joy. Humans seek community. We search for people who share values and ideals as we do but who also push back and help us expand. This is the gift of the open organization community—expansion, growth, and lifelong friendships. Thank you to all of those who contribute their time, intellect, content, and whole self to this awesome think tank that is changing the shape of how we organize to solve problems! + +**—Jen Kelchner, founder and Chief Change Architect, LDR21, and[Open Organization Ambassador][21]** + +* * * + +Happy fourth birthday, open organization community! Thank you for being an ever-present reminder in my life that being open is better than being closed, that listening is more fruitful than telling, and that together we can achieve more. + +**—Michael Doyle, professional coach and[Open Organization Ambassador][21]** + +* * * + +Wow, what a journey it's been exploring the world of open organizations. We're seeing more interest now than ever before. It's amazing to see what this community has done and I'm excited to see what the future holds for open organizations and open leadership. + +**—Jason Hibbets, senior community architect, Red Hat** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/19/6/four-year-celebration + +作者:[Bryan Behrenshausen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bbehrens +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/happy_birthday_anniversary_celebrate_hats_cake.jpg?itok=Zfsv6DE_ (Browser window with birthday hats and a cake) +[2]: https://opensource.com/open-organization +[3]: https://opensource.com/open-organization/15/5/introducing-open-organization +[4]: https://opensource.com/open-organization/18/11/design-communities-personality-types +[5]: https://opensource.com/open-organization/18/1/why-build-community-1 +[6]: https://www.redhat.com/en/explore/the-open-organization-book +[7]: https://opensource.com/open-organization/resources/ambassadors-program +[8]: https://opensource.com/open-organization/resources/book-series +[9]: https://opensource.com/open-organization/19/5/educators-guide-project +[10]: https://opensource.com/open-organization/resources/open-org-definition +[11]: https://opensource.com/open-organization/resources/open-org-maturity-model +[12]: https://opensource.com/open-organization/resources +[13]: https://opensource.com/open-organization/19/2/3-misconceptions-agile +[14]: https://opensource.com/open-organization/17/5/5-devops-laws +[15]: https://opensource.com/open-organization/15/7/what-value-do-you-bring-your-company +[16]: https://opensource.com/open-organization/16/5/open-questions-and-answers-about-open-management +[17]: https://opensource.com/open-organization/17/4/feeling-underutilized +[18]: https://opensource.com/open-organization/17/5/what-is-the-point-of-DevOps +[19]: https://opensource.com/open-organization/18/5/open-one-on-one-meetings-guide +[20]: https://opensource.com/open-organization/18/3/open-approaches-meetings +[21]: https://opensource.com/open-organization/resources/meet-ambassadors diff --git a/sources/tech/20190604 Create a CentOS homelab in an hour.md b/sources/tech/20190604 Create a CentOS homelab in an hour.md new file mode 100644 index 0000000000..039af752db --- /dev/null +++ b/sources/tech/20190604 Create a CentOS homelab in an hour.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create a CentOS homelab in an hour) +[#]: via: (https://opensource.com/article/19/6/create-centos-homelab-hour) +[#]: author: (Bob Murphy https://opensource.com/users/murph) + +Create a CentOS homelab in an hour +====== +Set up a self-sustained set of basic Linux servers with nothing more +than a system with virtualization software, a CentOS ISO, and about an +hour of your time. +![metrics and data shown on a computer screen][1] + +When working on new Linux skills (or, as I was, studying for a Linux certification), it is helpful to have a few virtual machines (VMs) available on your laptop so you can do some learning on the go. + +But what happens if you are working somewhere without a good internet connection and you want to work on a web server? What about using other software that you don't already have installed? If you were depending on downloading it from the distribution's repositories, you may be out of luck. With a bit of preparation, you can set up a [homelab][2] that will allow you to install anything you need wherever you are, with or without a network connection. + +The requirements are: + + * A downloaded ISO file of the Linux distribution you intend to use (for example, CentOS, Red Hat, etc.) + * A host computer with virtualization. I use [Fedora][3] with [KVM][4] and [virt-manager][5], but any Linux will work similarly. You could even use Windows or Mac with virtualization, with some difference in implementation + * About an hour of time + + + +### 1\. Create a VM for your repo host + +Use virt-manager to create a VM with modest specs; 1GB RAM, one CPU, and 16GB of disk space are plenty. + +Install [CentOS 7][6] on the VM. + +![Installing a CentOS homelab][7] + +Select your language and continue. + +Click _Installation Destination_ , select your local disk, mark the _Automatically Configure Partitioning_ checkbox, and click *Done *in the upper-left corner. + +Under _Software Selection_ , select _Infrastructure Server_ , mark the _FTP Server_ checkbox, and click _Done_. + +![Installing a CentOS homelab][8] + +Select _Network and Host Name_ , enable Ethernet in the upper-right, then click _Done_ in the upper-left corner. + +Click _Begin Installation_ to start installing the OS. + +You must create a root password, then you can create a user with a password as it installs. + +### 2\. Start the FTP service + +The next step is to start and set the FTP service to run and allow it through the firewall. + +Log in with your root password, then start the FTP server: + + +``` +`systemctl start vsftpd` +``` + +Enable it to work on every start: + + +``` +`systemctl enable vsftpd` +``` + +Set the port as allowed through the firewall: + + +``` +`firewall-cmd --add-service=ftp --perm` +``` + +Enable this change immediately: + + +``` +`firewall-cmd --reload` +``` + +Get your IP address: + + +``` +`ip a` +``` + +(it's probably **eth0** ). You'll need it in a minute. + +### 3\. Copy the files for your local repository + +Mount the CD you installed from to your VM through your virtualization software. + +Create a directory for the CD to be mounted to temporarily: + + +``` +`mkdir /root/temp` +``` + +Mount the install CD: + + +``` +`mount /dev/cdrom /root/temp` +``` + +Copy all the files to the FTP server directory: + + +``` +`rsync -avhP /root/temp/ /var/ftp/pub/` +``` + +### 4\. Point the server to the local repository + +Red Hat-based systems use files that end in **.repo** to identify where to get updates and new software. Those files can be found at + + +``` +`cd /etc/yum.repos.d` +``` + +You need to get rid of the repo files that point your server to look to the CentOS repositories on the internet. I prefer to copy them to root's home directory to get them out of the way: + + +``` +`mv * ~` +``` + +Then create a new repo file to point to your server. Use your favorite text editor to create a file named **network.repo** with the following lines (substituting the IP address you got in step 2 for _< your IP>_), then save it: + + +``` +[network] +name=network +baseurl=/pub +gpgcheck=0 +``` + +When that's done, we can test it out with the following: + + +``` +`yum clean all; yum install ftp` +``` + +If your FTP client installs as expected from the "network" repository, your local repo is set up! + +![Installing a CentOS homelab][9] + +### 5\. Install a new VM with the repository you set up + +Go back to the virtual machine manager, and create another VM—but this time, select _Network Install_ with a URL of: + + +``` +`ftp://192.168.122./pub` +``` + +If you're using a different host OS or virtualization manager, install your VM similarly as before, and skip to the next section. + +### 6\. Set the new VM to use your existing network repository + +You can copy the repo file from your existing server to use here. + +As in the first server example, enter: + + +``` +cd /etc/yum.repos.d +mv * ~ +``` + +Then: + + +``` +`scp root@192.168.122.:/etc/yum.repos.d/network.repo /etc/yum.repos.d` +``` + +Now you should be ready to work with your new VM and get all your software from your local repository. + +Test this again: + + +``` +`yum clean all; yum install screen` +``` + +This will install your software from your local repo server. + +This setup, which gives you independence from the network with the ability to install software, can create a much more dependable environment for expanding your skills on the road. + +* * * + +_Bob Murphy will present this topic as well as an introduction to[GNU Screen][10] at [Southeast Linux Fest][11], June 15-16 in Charlotte, N.C._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/create-centos-homelab-hour + +作者:[Bob Murphy][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/murph +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/article/19/3/home-lab +[3]: https://getfedora.org/ +[4]: https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine +[5]: https://virt-manager.org/ +[6]: https://www.centos.org/download/ +[7]: https://opensource.com/sites/default/files/uploads/homelab-3b_0.png (Installing a CentOS homelab) +[8]: https://opensource.com/sites/default/files/uploads/homelab-5b.png (Installing a CentOS homelab) +[9]: https://opensource.com/sites/default/files/uploads/homelab-14b.png (Installing a CentOS homelab) +[10]: https://opensource.com/article/17/3/introduction-gnu-screen +[11]: https://southeastlinuxfest.org/ diff --git a/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md b/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md new file mode 100644 index 0000000000..97414f530f --- /dev/null +++ b/sources/tech/20190604 ExamSnap Guide- 6 Excellent Resources for Microsoft 98-366- Networking Fundamentals Exam.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ExamSnap Guide: 6 Excellent Resources for Microsoft 98-366: Networking Fundamentals Exam) +[#]: via: (https://www.2daygeek.com/examsnap-guide-6-excellent-resources-for-microsoft-98-366-networking-fundamentals-exam/) +[#]: author: (2daygeek http://www.2daygeek.com/author/2daygeek/) + +ExamSnap Guide: 6 Excellent Resources for Microsoft 98-366: Networking Fundamentals Exam +====== + +The Microsoft 98-366 exam is almost similar to the CompTIA Network+ certification test when it comes to its content. + +It is also known as Networking Fundamentals, and its purpose is to assess your knowledge of switches, routers, OSI models, wide area and local area networks, wireless networking, and IP addressing. + +Those who pass the exam earn the MTA (Microsoft Technology Associate) certificate. This certifications an ideal entry-level credential to help you begin your IT career. + +### 6 Resources for Microsoft MTA 98-366 Exam + +Using approved training materials is the best method to prepare for your certification exam. Most candidates are fond of shortcuts and often use PDFs and brain dumps to prepare for the test. + +It is important to note that these materials need additional study methods. They will not help you gain better knowledge that is meant to make you perform better at work. + +When you take your time to master the course contents of a certification exam, you are not only getting ready for the test but also developing your skills, expertise, and knowledge in the topics covered there. + + * **[ExamSnap][1]** + + + +Another important point to note is that you shouldn’t rely only on brain dumps. Microsoft can withhold or withdraw your certification if it is discovered that you have cheated. + +This may also result in the situation when a person is not allowed to earn the credentials any more. Thus, use only verified platforms such as Examsnap. + +Most people tend to believe that there is no way they can get discovered. However, you need to know that Microsoft has been offering professional certification exams for years and they know what they are doing. + +Now when we have established the importance of using legal materials to prepare for your certification exam, we need to highlight the top resources you can use to prepare for the Microsoft 98-366 test. + +### 1\. Microsoft Video Academy + +The MVA (Microsoft Video Academy) provides you with introductory lessons on the 98-366 certification exam.This is not sufficient for your study although it is a great way to begin your preparation for the test. The materials in the video do not cover everything you need to know before taking the exam. + +In fact, it is introductory series that is meant to lay down the foundation for your study. You will have to explore other materials for you to get an in-depth knowledge of the topics. + +These videos are available without payment, so you can easily access them and use whenever you want. + + * [Microsoft Certification Overview][2] + + + +### 2\. Examsnap + +If you have been looking for material that can help you prepare for the Microsoft Networking Fundamentals exam, look no further because you will know about Examsnap now. + +It is an online platform that provides you with exam dumps and video series of various certification courses. All you need to do is to register on the website and pay a fee for you to be able to access various tools that will help you prepare for the test. + +Examsnap will enable you to pass your exams with confidence by providing you with the most accurate and comprehensive preparation materials on the Internet. The platform also has training courses to help you improve your study. + +Before making any payment on the site, you can complete the trial course to establish whether the site is suitable for your exam preparation needs. + +### 3\. Exam 98-366: MTA Networking Fundamentals + +This is a study resource that is a book. It provides you with a comprehensive approach to the various topics. It is important for you to note that this study guide is critical to your success. + +It offers you more detailed material than the introductory lectures by the MVA. It is advisable that you do not focus on the sample questions in each part when using this book. + +You should not concentrate on the sample questions because they are not so informative. You can make up for this shortcoming by checking out other practice test options. Overall, this book is a top resource that will contribute greatly to your certification exam success. + +### 4\. Measure-Up + +Measure-Up is the official Microsoft practice test provider whereby you can access different materials. You can get a lab and hands-on practice with networking software tools, which are very beneficial for your preparation. The site also has study questions that you can purchase. + +### 5\. U-Certify + +The U-Certify platform is a reputable organization that offers video courses that are considered to be more understandable than those offered by the MVA. In addition to video courses, the site presents flashcards at the end of the videos. + +You can also access a series of practice tests, which contain several hundreds of study questions on the platform. There are more contents in videos and tests that you can access the moment you subscribe. Depending on what you are looking for, you can choose to buy the tests or the videos. + +### 6\. Networking Essentials – Wiki + +There are several posts that are linked to the Networking Essentials page on Wiki, and you can be sure that these articles are greatly detailed with information that will be helpful for your exam preparation. + +It is important to note that they are not meant to be studied as the only resource materials. You should only use them as additional means for the purpose of getting more information on specific topics but not as an individual study tool. + +### Conclusion + +You may not be able to access all the top resources available. However, you can access some of them. In addition to the resources mentioned, there are also some others that are very good. Visit the Microsoft official website to get the list of reliable resource platforms you can use. Study and be well-prepared for the 98-366 certification exam! + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/examsnap-guide-6-excellent-resources-for-microsoft-98-366-networking-fundamentals-exam/ + +作者:[2daygeek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://www.2daygeek.com/author/2daygeek/ +[b]: https://github.com/lujun9972 +[1]: https://www.examsnap.com/ +[2]: https://www.microsoft.com/en-us/learning/certification-overview.aspx diff --git a/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md b/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md new file mode 100644 index 0000000000..ebe841dbcb --- /dev/null +++ b/sources/tech/20190604 Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems?) +[#]: via: (https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Four Ways To Install Security Updates On Red Hat (RHEL) And CentOS Systems? +====== + +Patching of the Linux server is one of important and routine task of Linux admin. + +Keeping the system with latest patch level is must. It protects your system against unnecessary attack. + +There are three kind of erratas available in the RHEL/CentOS repository, these are Security, Bug Fix and Product Enhancement. + +Now, you have two options to handle this. + +Either install only security updates or all the errata packages. + +We have already written an article in the past **[to check available security updates?][1]**. + +Also, **[check the installed security updates on your system][2]** using this link. + +You can navigate to the above link, if you would like to verify available security updates before installing them. + +In this article, we will show your, how to install security updates in multiple ways on RHEL and CentOS system. + +### 1) How To Install Entire Errata Updates In Red Hat And CentOS System? + +Run the following command to download and apply all available security updates on your system. + +Make a note, this command will install the last available version of any package with at least one security errata. + +Also, install non-security erratas if they provide a more updated version of the package. + +``` +# yum update --security + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +RHEL7-Server-DVD | 4.3 kB 00:00:00 +rhel-7-server-rpms | 2.0 kB 00:00:00 +--> 1:grub2-tools-extra-2.02-0.76.el7.1.x86_64 from rhel-7-server-rpms removed (updateinfo) +--> nss-pem-1.0.3-5.el7_6.1.x86_64 from rhel-7-server-rpms removed (updateinfo) +. +35 package(s) needed (+0 related) for security, out of 115 available +Resolving Dependencies +--> Running transaction check +---> Package NetworkManager.x86_64 1:1.12.0-6.el7 will be updated +---> Package NetworkManager.x86_64 1:1.12.0-10.el7_6 will be an update +``` + +Once you ran the above command, it will check all the available updates and its dependency satisfaction. + +``` +--> Finished Dependency Resolution +--> Running transaction check +---> Package kernel.x86_64 0:3.10.0-514.26.1.el7 will be erased +---> Package kernel-devel.x86_64 0:3.10.0-514.26.1.el7 will be erased +--> Finished Dependency Resolution + +Dependencies Resolved +===================================================================================================================================================================== +Package Arch Version Repository Size +===================================================================================================================================================================== +Installing: +kernel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 48 M +kernel-devel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 17 M +Updating: +NetworkManager x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms 1.7 M +NetworkManager-adsl x86_64 1:1.12.0-10.el7_6 rhel-7-server-rpms 157 k +. +Removing: +kernel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 148 M +kernel-devel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 34 M +``` + +If these dependencies were satisfied, which finally gives you a total summary about it. + +The transaction summary shows, how many packages will be getting Installed, upgraded and removed from the system. + +``` +Transaction Summary +===================================================================================================================================================================== +Install 2 Packages +Upgrade 33 Packages +Remove 2 Packages + +Total download size: 124 M +Is this ok [y/d/N]: +``` + +### How To Install Only Security Updates In Red Hat And CentOS System? + +Run the following command to install only the packages that have a security errata. + +``` +# yum update-minimal --security + +Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlock +rhel-7-server-rpms | 2.0 kB 00:00:00 +Resolving Dependencies +--> Running transaction check +---> Package NetworkManager.x86_64 1:1.12.0-6.el7 will be updated +---> Package NetworkManager.x86_64 1:1.12.0-8.el7_6 will be an update +. +--> Finished Dependency Resolution +--> Running transaction check +---> Package kernel.x86_64 0:3.10.0-514.26.1.el7 will be erased +---> Package kernel-devel.x86_64 0:3.10.0-514.26.1.el7 will be erased +--> Finished Dependency Resolution + +Dependencies Resolved +===================================================================================================================================================================== +Package Arch Version Repository Size +===================================================================================================================================================================== +Installing: +kernel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 48 M +kernel-devel x86_64 3.10.0-957.10.1.el7 rhel-7-server-rpms 17 M +Updating: +NetworkManager x86_64 1:1.12.0-8.el7_6 rhel-7-server-rpms 1.7 M +NetworkManager-adsl x86_64 1:1.12.0-8.el7_6 rhel-7-server-rpms 157 k +. +Removing: +kernel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 148 M +kernel-devel x86_64 3.10.0-514.26.1.el7 @rhel-7-server-rpms 34 M + +Transaction Summary +===================================================================================================================================================================== +Install 2 Packages +Upgrade 33 Packages +Remove 2 Packages + +Total download size: 124 M +Is this ok [y/d/N]: +``` + +### How To Install Security Update Using CVE reference In Red Hat And CentOS System? + +If you would like to install a security update using a CVE reference, run the following command. + +``` +# yum update --cve + +# yum update --cve CVE-2008-0947 +``` + +### How To Install Security Update Using Specific Advisory In Red Hat And CentOS System? + +Run the following command, if you want to apply only a specific advisory. + +``` +# yum update --advisory= + +# yum update --advisory=RHSA-2014:0159 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-security-updates-on-redhat-rhel-centos-system/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-list-view-find-available-security-updates-on-redhat-rhel-centos-system/ +[2]: https://www.2daygeek.com/check-installed-security-updates-on-redhat-rhel-and-centos-system/ diff --git a/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md b/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md new file mode 100644 index 0000000000..f1cb86573b --- /dev/null +++ b/sources/tech/20190604 Linux Shell Script To Monitor CPU Utilization And Send Email.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Shell Script To Monitor CPU Utilization And Send Email) +[#]: via: (https://www.2daygeek.com/linux-shell-script-to-monitor-cpu-utilization-usage-and-send-email/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Linux Shell Script To Monitor CPU Utilization And Send Email +====== + +There are many opensource monitoring tools are available to monitor Linux systems performance. + +It will send an email alert when the system reaches the given threshold limit. + +It monitors everything such as CPU utilization, Memory utilization, swap utilization, disk space utilization and much more. + +If you only have few systems and want to monitor them then writing a small shell script can achieve this. + +In this tutorial we have added two shell script to monitor CPU utilization on Linux system. + +When the system reaches the given threshold then it will trigger a mail to corresponding email id. + +### Method-1 : Linux Shell Script To Monitor CPU Utilization And Send an Email + +If you want to only get CPU utilization percentage through mail when the system reaches the given threshold, use the following script. + +This is very simple and straightforward and one line script. + +It will trigger an email when your system reaches `80%` CPU utilization. + +``` +*/5 * * * * /usr/bin/cat /proc/loadavg | awk '{print $1}' | awk '{ if($1 > 80) printf("Current CPU Utilization is: %.2f%\n"), $0;}' | mail -s "High CPU Alert" [email protected] +``` + +**Note:** You need to change the email id instead of ours. Also, you can change the CPU utilization threshold value as per your requirement. + +**Output:** You will be getting an email alert similar to below. + +``` +Current CPU Utilization is: 80.40% +``` + +We had added many useful shell scripts in the past. If you want to check those, navigate to the below link. + + * **[How to automate day to day activities using shell scripts?][1]** + + + +### Method-2 : Linux Shell Script To Monitor CPU Utilization And Send an Email + +If you want to get more information about the CPU utilization in the mail alert. + +Then use the following script, which includes top CPU utilization process details based on the top Command and ps Command. + +This will inconstantly gives you an idea what is going on your system. + +It will trigger an email when your system reaches `80%` CPU utilization. + +**Note:** You need to change the email id instead of ours. Also, you can change the CPU utilization threshold value as per your requirement. + +``` +# vi /opt/scripts/cpu-alert.sh + +#!/bin/bash +cpuuse=$(cat /proc/loadavg | awk '{print $1}') + +if [ "$cpuuse" > 80 ]; then + +SUBJECT="ATTENTION: CPU Load Is High on $(hostname) at $(date)" + +MESSAGE="/tmp/Mail.out" + +TO="[email protected]" + + echo "CPU Current Usage is: $cpuuse%" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "Top CPU Process Using top command" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "$(top -bn1 | head -20)" >> $MESSAGE + + echo "" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "Top CPU Process Using ps command" >> $MESSAGE + + echo "+------------------------------------------------------------------+" >> $MESSAGE + + echo "$(ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10)" >> $MESSAGE + + mail -s "$SUBJECT" "$TO" < $MESSAGE + + rm /tmp/Mail.out + + fi +``` + +Finally add a **[cronjob][2]** to automate this. It will run every 5 minutes. + +``` +# crontab -e +*/10 * * * * /bin/bash /opt/scripts/cpu-alert.sh +``` + +**Note:** You will be getting an email alert 5 mins later since the script has scheduled to run every 5 minutes (But it's not exactly 5 mins and it depends the timing). + +Say for example. If your system reaches the limit at 8.25 then you will get an email alert in another 5 mins. Hope it's clear now. + +**Output:** You will be getting an email alert similar to below. + +``` +CPU Current Usage is: 80.51% + ++------------------------------------------------------------------+ +Top CPU Process Using top command ++------------------------------------------------------------------+ +top - 13:23:01 up 1:43, 1 user, load average: 2.58, 2.58, 1.51 +Tasks: 306 total, 3 running, 303 sleeping, 0 stopped, 0 zombie +%Cpu0 : 6.2 us, 6.2 sy, 0.0 ni, 87.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu1 : 18.8 us, 0.0 sy, 0.0 ni, 81.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu2 : 50.0 us, 37.5 sy, 0.0 ni, 12.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu3 : 5.9 us, 5.9 sy, 0.0 ni, 88.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu4 : 0.0 us, 5.9 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu5 : 29.4 us, 23.5 sy, 0.0 ni, 47.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu6 : 0.0 us, 5.9 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +%Cpu7 : 5.9 us, 0.0 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st +KiB Mem : 16248588 total, 223436 free, 5816924 used, 10208228 buff/cache +KiB Swap: 17873388 total, 17871340 free, 2048 used. 7440884 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 8867 daygeek 20 2743884 440420 360952 R 100.0 2.7 1:07.25 /usr/lib/virtualbox/VirtualBoxVM --comment CentOS7 --startvm 002f47b8-2af2-48f5-be1d-67b67e03514c --no-startvm-errormsgbox + 9119 daygeek 20 36136 784 R 46.7 0.0 0:00.07 /usr/bin/CROND -n + 1057 daygeek 20 889808 487692 461692 S 13.3 3.0 4:21.12 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 + 3098 daygeek 20 1929012 351412 120532 S 13.3 2.2 16:42.51 /usr/lib/firefox/firefox -contentproc -childID 6 -isForBrowser -prefsLen 9236 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /us+ + 1 root 20 188820 10144 7708 S 6.7 0.1 0:06.92 /sbin/init + 818 gdm 20 199836 25120 15876 S 6.7 0.2 0:01.85 /usr/lib/Xorg vt1 -displayfd 3 -auth /run/user/120/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -verbose 3 + 1170 daygeek 9 -11 2676516 16516 12520 S 6.7 0.1 1:28.30 /usr/bin/pulseaudio --daemonize=no + 8271 root 20 I 6.7 0:00.21 [kworker/u16:4-i915] + 9117 daygeek 20 13528 4036 3144 R 6.7 0.0 0:00.01 top -bn1 + ++------------------------------------------------------------------+ +Top CPU Process Using ps command ++------------------------------------------------------------------+ +%CPU PID USER COMMAND + 8.8 8522 daygeek /usr/lib/virtualbox/VirtualBox +86.2 8867 daygeek /usr/lib/virtualbox/VirtualBoxVM --comment CentOS7 --startvm 002f47b8-2af2-48f5-be1d-67b67e03514c --no-startvm-errormsgbox +76.1 8921 daygeek /usr/lib/virtualbox/VirtualBoxVM --comment Ubuntu-18.04 --startvm e8c32dbb-8b01-41b0-977a-bf28b9db1117 --no-startvm-errormsgbox + 5.5 8080 daygeek /usr/bin/nautilus --gapplication-service + 4.7 4575 daygeek /usr/lib/firefox/firefox -contentproc -childID 12 -isForBrowser -prefsLen 9375 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 3511 daygeek /usr/lib/firefox/firefox -contentproc -childID 8 -isForBrowser -prefsLen 9308 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 3190 daygeek /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 9237 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.4 1612 daygeek /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 184485 -parentBuildID 20190521202118 -greomni /usr/lib/firefox/omni.ja -appomni /usr/lib/firefox/browser/omni.ja -appdir /usr/lib/firefox/browser 1525 true tab + 4.2 3565 daygeek /usr/bin/../lib/notepadqq/notepadqq-bin +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-shell-script-to-monitor-cpu-utilization-usage-and-send-email/ + +作者:[Magesh Maruthamuthu][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.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/shell-script/ +[2]: https://www.2daygeek.com/crontab-cronjob-to-schedule-jobs-in-linux/ diff --git a/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md b/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md new file mode 100644 index 0000000000..441415925f --- /dev/null +++ b/sources/tech/20190605 Tweaking the look of Fedora Workstation with themes.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tweaking the look of Fedora Workstation with themes) +[#]: via: (https://fedoramagazine.org/tweaking-the-look-of-fedora-workstation-with-themes/) +[#]: author: (Ryan Lerch https://fedoramagazine.org/author/ryanlerch/) + +Tweaking the look of Fedora Workstation with themes +====== + +![][1] + +Changing the theme of a desktop environment is a common way to customize your daily experience with Fedora Workstation. This article discusses the 4 different types of visual themes you can change and how to change to a new theme. Additionally, this article will cover how to install new themes from both the Fedora repositories and 3rd party theme sources. + +### Theme Types + +When changing the theme of Fedora Workstation, there are 4 different themes that can be changed independently of each other. This allows a user to mix and match the theme types to customize their desktop in a multitude of combinations. The 4 theme types are the **Application** (GTK) theme, the **shell** theme, the **icon** theme, and the **cursor** theme. + +#### Application (GTK) themes + +As the name suggests, Application themes change the styling of the applications that are displayed on a user’s desktop. Application themes control the style of the window borders and the window titlebar. Additionally, they also control the style of the widgets in the windows — like dropdowns, text inputs, and buttons. One point to note is that an application theme does not change the icons that are displayed in an application — this is achieved using the icon theme. + +![Two application windows with two different application themes. The default Adwaita theme on the left, the Adapta theme on the right.][2] + +Application themes are also known as GTK themes, as GTK ( **G** IMP **T** ool **k** it) is the underlying technology that is used to render the windows and user interface widgets in those windows on Fedora Workstation. + +#### Shell Themes + +Shell themes change the appearance of the GNOME Shell. The GNOME Shell is the technology that displays the top bar (and the associated widgets like drop downs), as well as the overview screen and the applications list it contains. + +![Comparison of two Shell themes, with the Fedora Workstation default on top, and the Adapta shell theme on the bottom.][3] + +#### Icon Themes + +As the name suggests, icon themes change the icons used in the desktop. Changing the icon theme will change the icons displayed both in the Shell, and in applications. + +![Comparison of two icon themes, with the Fedora 30 Workstation default Adwaita on the left, and the Yaru icon theme on the right][4] + +One important item to note with icon themes is that all icon themes will not have customized icons for all application icons. Consequently, changing the icon theme will not change all the icons in the applications list in the overview. + +![Comparison of two icon themes, with the Fedora 30 Workstation default Adwaita on the top, and the Yaru icon theme on the bottom][5] + +#### Cursor Theme + +The cursor theme allows a user to change how the mouse pointer is displayed. Most cursor themes change all the common cursors, including the pointer, drag handles and the loading cursor. + +![Comparison of multiple cursors of two different cursor themes. Fedora 30 default is on the left, the Breeze Snow theme on the right.][6] + +### Changing the themes + +Changing themes on Fedora Workstation is a simple process. To change all 4 types of themes, use the **Tweaks** application. Tweaks is a tool used to change a range of different options in Fedora Workstation. It is not installed by default, and is installed using the Software application: + +![][7] + +Alternatively, install Tweaks from the command line with the command: + +``` +sudo dnf install gnome-tweak-tool +``` + +In addition to Tweaks, to change the Shell theme, the **User Themes** GNOME Shell Extension needs to be installed and enabled. [Check out this post for more details on installing extensions][8]. + +Next, launch Tweaks, and switch to the Appearance pane. The Themes section in the Appearance pane allows the changing of the multiple theme types. Simply choose the theme from the dropdown, and the new theme will apply automatically. + +![][9] + +### Installing themes + +Armed with the knowledge of the types of themes, and how to change themes, it is time to install some themes. Broadly speaking, there are two ways to install new themes to your Fedora Workstation — installing theme packages from the Fedora repositories, or manually installing a theme. One point to note when installing themes, is that you may need to close and re-open the Tweaks application to make a newly installed theme appear in the dropdowns. + +#### Installing from the Fedora repositories + +The Fedora repositories contain a small selection of additional themes that once installed are available to we chosen in Tweaks. Theme packages are not available in the Software application, and have to be searched for and installed via the command line. Most theme packages have a consistent naming structure, so listing available themes is pretty easy. + +To find Application (GTK) themes use the command: + +``` +dnf search gtk | grep theme +``` + +To find Shell themes: + +``` +dnf search shell-theme +``` + +Icon themes: + +``` +dnf search icon-theme +``` + +Cursor themes: + +``` +dnf search cursor-theme +``` + +Once you have found a theme to install, install the theme using dnf. For example: + +``` +sudo dnf install numix-gtk-theme +``` + +#### Installing themes manually + +For a wider range of themes, there are a plethora of places on the internet to find new themes to use on Fedora Workstation. Two popular places to find themes are [OpenDesktop][10] and [GNOMELook][11]. + +Typically when downloading themes from these sites, the themes are encapsulated in an archive like a tar.gz or zip file. In most cases, to install these themes, simply extract the contents into the correct directory, and the theme will appear in Tweaks. Note too, that themes can be installed either globally (must be done using sudo) so all users on the system can use them, or can be installed just for the current user. + +For Application (GTK) themes, and GNOME Shell themes, extract the archive to the **.themes/** directory in your home directory. To install for all users, extract to **/usr/share/themes/** + +For Icon and Cursor themes, extract the archive to the **.icons/** directory in your home directory. To install for all users, extract to **/usr/share/icons/** + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/tweaking-the-look-of-fedora-workstation-with-themes/ + +作者:[Ryan Lerch][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/ryanlerch/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/06/themes.png-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2019/06/application-theme-1024x514.jpg +[3]: https://fedoramagazine.org/wp-content/uploads/2019/06/overview-theme-1024x649.jpg +[4]: https://fedoramagazine.org/wp-content/uploads/2019/06/icon-theme-application-1024x441.jpg +[5]: https://fedoramagazine.org/wp-content/uploads/2019/06/overview-icons-1024x637.jpg +[6]: https://fedoramagazine.org/wp-content/uploads/2019/06/cursortheme-1024x467.jpg +[7]: https://fedoramagazine.org/wp-content/uploads/2019/06/tweaks-in-software-1024x725.png +[8]: https://fedoramagazine.org/install-extensions-via-software-application/ +[9]: https://fedoramagazine.org/wp-content/uploads/2019/06/tweaks-choose-themes.png +[10]: https://www.opendesktop.org/ +[11]: https://www.gnome-look.org/ diff --git a/sources/tech/20190606 Examples of blameless culture outside of DevOps.md b/sources/tech/20190606 Examples of blameless culture outside of DevOps.md new file mode 100644 index 0000000000..b78722f3ef --- /dev/null +++ b/sources/tech/20190606 Examples of blameless culture outside of DevOps.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Examples of blameless culture outside of DevOps) +[#]: via: (https://opensource.com/article/19/6/everyday-blameless) +[#]: author: (Patrick Housley https://opensource.com/users/patrickhousley) + +Examples of blameless culture outside of DevOps +====== +Is blameless culture just a matter of postmortems and top-down change? +Or are there things individuals can do to promote it? +![people in different locations who are part of the same team][1] + +A blameless culture is not a new concept in the technology industry. In fact, in 2012, [John Allspaw][2] wrote about how [Etsy uses blameless postmortems][3] to dive to the heart of problems when they arise. Other technology giants, like Google, have also worked hard to implement a blameless culture. But what is a blameless culture? Is it just a matter of postmortems? Does it take a culture change to make blameless a reality? And what about flagrant misconduct? + +### Exploring blameless culture + +In 2009, [Mike Rother][4] wrote an [award-winning book][5] on the culture of Toyota, in which he broke down how the automaker became so successful in the 20th century when most other car manufacturers were either stagnant or losing ground. Books on Toyota were nothing new, but how Mike approached Toyota's success was unique. Instead of focusing on the processes and procedures Toyota implements, he explains in exquisite detail the company's culture, including its focus on blameless failure and continuous improvement. + +Mike explains that Toyota, in the face of failure, focuses on the system where the failure occurred instead of who is at fault. Furthermore, the company treats failure as a learning opportunity, not a chance to chastise the operator. This is the very definition of a blameless culture and one that the technology field can still learn much from. + +### It's not a culture shift + +It shouldn't take an executive initiative to attain blamelessness. It's not so much the company's culture that we need to change, but our attitudes towards fault and failure. Sure, the company's culture should change, but, even in a blameless culture, some people still have the undying urge to point fingers and call others out for their shortcomings. + +I was once contracted to work with a company on developing and improving its digital footprint. This company employed its own developers, and, as you might imagine, there was tension at times. If a bug was found in production, the search began immediately for the person responsible. I think it's just human nature to want to find someone to blame. But there is a better way, and it will take practice. + +### Blamelessness at the microscale + +When I talk about implementing blamelessness, I'm not talking about doing it at the scale of companies and organizations. That's too large for most of us. Instead, focus your attention on the smallest scale: the code commit, review, and pull request. Focus on your actions and the actions of your peers and those you lead. You may find that you have the biggest impact in this area. + +How often do you or one of your peers get a bug report, dig in to find out what is wrong, and stop once you determine who made the breaking change? Do you immediately assume that a pull request or code commit needs to be reverted? Do you contact that individual and tell them what they broke and which commit it was? If this is happening within your team, you're the furthest from blamelessness you could be. But it can be remedied. + +Obviously, when you find a bug, you need to understand what broke, where, and who did it. But don't stop there. Attempt to fix the issue. The chances are high that patching the code will be a faster resolution than trying to figure out which code to back out. Too many times, I have seen people try to back out code only to find that they broke something else. + +If you're not confident that you can fix the issue, politely ask the individual who made the breaking change to assist. Yes, assist! My mom always said, "you can catch more flies with honey than vinegar." You will typically get a more positive response if you ask people for help instead of pointing out what they broke. + +Finally, once you have a fix, make sure to ask the individual who caused the bug to review your change. This isn't about rubbing it in their face. Remember that failure represents a learning opportunity, and the person who created the failure will learn if they have a chance to review the fix you created. Furthermore, that individual may have unique details and reasoning that suggests your change may fix the immediate issue but may not solve the original problem. + +### Catch flagrant misconduct and abuse sooner + +A blameless culture doesn't provide blanket protection if someone is knowingly attempting to do wrong. That also doesn't mean the system is not faulty. Remember how Toyota focuses on the system where failure occurs? If an individual can knowingly create havoc within the software they are working on, they should be held accountable—but so should the system. + +When reviewing failure, no matter how small, always ask, "How could we have caught this sooner?" Chances are you could improve some part of your software development lifecycle (SDLC) to make failures less likely to happen. Maybe you need to add more tests. Or run your tests more often. Whatever the solution, remember that fixing the bug is only part of a complete fix. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/everyday-blameless + +作者:[Patrick Housley][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/patrickhousley +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team) +[2]: https://twitter.com/allspaw +[3]: https://codeascraft.com/2012/05/22/blameless-postmortems/ +[4]: http://www-personal.umich.edu/~mrother/Homepage.html +[5]: https://en.wikipedia.org/wiki/Toyota_Kata diff --git a/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md b/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md new file mode 100644 index 0000000000..766393dc3f --- /dev/null +++ b/sources/tech/20190606 Why hypothesis-driven development is key to DevOps.md @@ -0,0 +1,152 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why hypothesis-driven development is key to DevOps) +[#]: via: (https://opensource.com/article/19/6/why-hypothesis-driven-development-devops) +[#]: author: (Brent Aaron Reed https://opensource.com/users/brentaaronreed/users/wpschaub) + +Why hypothesis-driven development is key to DevOps +====== +A hypothesis-driven development mindset harvests the core value of +feature flags: experimentation in production. +![gears and lightbulb to represent innovation][1] + +The definition of DevOps, offered by [Donovan Brown][2] * _is_ "The union of **people** , **process** , and **products** to enable continuous delivery of **value** to our customers.*" It accentuates the importance of continuous delivery of value. Let's discuss how experimentation is at the heart of modern development practices. + +![][3] + +### Reflecting on the past + +Before we get into hypothesis-driven development, let's quickly review how we deliver value using waterfall, agile, deployment rings, and feature flags. + +In the days of _**waterfall**_ , we had predictable and process-driven delivery. However, we only delivered value towards the end of the development lifecycle, often failing late as the solution drifted from the original requirements, or our killer features were outdated by the time we finally shipped. + +![][4] + +Here, we have one release X and eight features, which are all deployed and exposed to the patiently waiting user. We are continuously delivering value—but with a typical release cadence of six months to two years, _the value of the features declines as the world continues to move on_. It worked well enough when there was time to plan and a lower expectation to react to more immediate needs. + +The introduction of _**agile**_ allowed us to create and respond to change so we could continuously deliver working software, sense, learn, and respond. + +![][5] + +Now, we have three releases: X.1, X.2, and X.3. After the X.1 release, we improved feature 3 based on feedback and re-deployed it in release X.3. This is a simple example of delivering features more often, focused on working software, and responding to user feedback. _We are on the path of continuous delivery, focused on our key stakeholders: our users._ + +Using _**deployment rings**_ and/or _**feature flags**_ , we can decouple release deployment and feature exposure, down to the individual user, to control the exposure—the blast radius—of features. We can conduct experiments; progressively expose, test, enable, and hide features; fine-tune releases, and continuously pivot on learnings and feedback. + +When we add feature flags to the previous workflow, we can toggle features to be ON (enabled and exposed) or OFF (hidden). + +![][6] + +Here, feature flags for features 2, 4, and 8 are OFF, which results in the user being exposed to fewer of the features. All features have been deployed but are not exposed (yet). _We can fine-tune the features (value) of each release after deploying to production._ + +_**Ring-based deployment**_ limits the impact (blast) on users while we gradually deploy and evaluate one or more features through observation. Rings allow us to deploy features progressively and have multiple releases (v1, v1.1, and v1.2) running in parallel. + +![Ring-based deployment][7] + +Exposing features in the canary and early-adopter rings enables us to evaluate features without the risk of an all-or-nothing big-bang deployment. + +_**Feature flags**_ decouple release deployment and feature exposure. You "flip the flag" to expose a new feature, perform an emergency rollback by resetting the flag, use rules to hide features, and allow users to toggle preview features. + +![Toggling feature flags on/off][8] + +When you combine deployment rings and feature flags, you can progressively deploy a release through rings and use feature flags to fine-tune the deployed release. + +> See [deploying new releases: Feature flags or rings][9], [what's the cost of feature flags][10], and [breaking down walls between people, process, and products][11] for discussions on feature flags, deployment rings, and related topics. + +### Adding hypothesis-driven development to the mix + +_**Hypothesis-driven development**_ is based on a series of experiments to validate or disprove a hypothesis in a [complex problem domain][12] where we have unknown-unknowns. We want to find viable ideas or fail fast. Instead of developing a monolithic solution and performing a big-bang release, we iterate through hypotheses, evaluating how features perform and, most importantly, how and if customers use them. + +> **Template:** _**We believe**_ {customer/business segment} _**wants**_ {product/feature/service} _**because**_ {value proposition}. +> +> **Example:** _**We believe**_ that users _**want**_ to be able to select different themes _**because**_ it will result in improved user satisfaction. We expect 50% or more users to select a non-default theme and to see a 5% increase in user engagement. + +Every experiment must be based on a hypothesis, have a measurable conclusion, and contribute to feature and overall product learning. For each experiment, consider these steps: + + * Observe your user + * Define a hypothesis and an experiment to assess the hypothesis + * Define clear success criteria (e.g., a 5% increase in user engagement) + * Run the experiment + * Evaluate the results and either accept or reject the hypothesis + * Repeat + + + +Let's have another look at our sample release with eight hypothetical features. + +![][13] + +When we deploy each feature, we can observe user behavior and feedback, and prove or disprove the hypothesis that motivated the deployment. As you can see, the experiment fails for features 2 and 6, allowing us to fail-fast and remove them from the solution. _**We do not want to carry waste that is not delivering value or delighting our users!**_ The experiment for feature 3 is inconclusive, so we adapt the feature, repeat the experiment, and perform A/B testing in Release X.2. Based on observations, we identify the variant feature 3.2 as the winner and re-deploy in release X.3. _**We only expose the features that passed the experiment and satisfy the users.**_ + +### Hypothesis-driven development lights up progressive exposure + +When we combine hypothesis-driven development with progressive exposure strategies, we can vertically slice our solution, incrementally delivering on our long-term vision. With each slice, we progressively expose experiments, enable features that delight our users and hide those that did not make the cut. + +But there is more. When we embrace hypothesis-driven development, we can learn how technology works together, or not, and what our customers need and want. We also complement the test-driven development (TDD) principle. TDD encourages us to write the test first (hypothesis), then confirm our features are correct (experiment), and succeed or fail the test (evaluate). _**It is all about quality and delighting our users** , as outlined in principles 1, 3, and 7_ of the [Agile Manifesto][14]: + + * Our highest priority is to satisfy the customers through early and continuous delivery of value. + * Deliver software often, from a couple of weeks to a couple of months, with a preference to the shorter timescale. + * Working software is the primary measure of progress. + + + +More importantly, we introduce a new mindset that breaks down the walls between development, business, and operations to view, design, develop, deliver, and observe our solution in an iterative series of experiments, adopting features based on scientific analysis, user behavior, and feedback in production. We can evolve our solutions in thin slices through observation and learning in production, a luxury that other engineering disciplines, such as aerospace or civil engineering, can only dream of. + +The good news is that hypothesis-driven development supports the empirical process theory and its three pillars: **Transparency** , **Inspection** , and **Adaption**. + +![][15] + +But there is more. Based on lean principles, we must pivot or persevere after we measure and inspect the feedback. Using feature toggles in conjunction with hypothesis-driven development, we get the best of both worlds, as well as the ability to use A|B testing to make decisions on feedback, such as likes/dislikes and value/waste. + +### Remember: + +Hypothesis-driven development: + + * Is about a series of experiments to confirm or disprove a hypothesis. Identify value! + * Delivers a measurable conclusion and enables continued learning. + * Enables continuous feedback from the key stakeholder—the user—to understand the unknown-unknowns! + * Enables us to understand the evolving landscape into which we progressively expose value. + + + +Progressive exposure: + + * Is not an excuse to hide non-production-ready code. _**Always ship quality!**_ + * Is about deploying a release of features through rings in production. _**Limit blast radius!**_ + * Is about enabling or disabling features in production. _**Fine-tune release values!**_ + * Relies on circuit breakers to protect the infrastructure from implications of progressive exposure. _**Observe, sense, act!**_ + + + +What have you learned about progressive exposure strategies and hypothesis-driven development? We look forward to your candid feedback. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/why-hypothesis-driven-development-devops + +作者:[Brent Aaron Reed][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/brentaaronreed/users/wpschaub +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: http://donovanbrown.com/post/what-is-devops +[3]: https://opensource.com/sites/default/files/hypo-1_copy.png +[4]: https://opensource.com/sites/default/files/uploads/hyp0-2-trans.png +[5]: https://opensource.com/sites/default/files/uploads/hypo-3-trans.png +[6]: https://opensource.com/sites/default/files/uploads/hypo-4_0.png +[7]: https://opensource.com/sites/default/files/uploads/hypo-6-trans.png +[8]: https://opensource.com/sites/default/files/uploads/hypo-7-trans.png +[9]: https://opensource.com/article/18/2/feature-flags-ring-deployment-model +[10]: https://opensource.com/article/18/7/does-progressive-exposure-really-come-cost +[11]: https://opensource.com/article/19/3/breaking-down-walls-between-people-process-and-products +[12]: https://en.wikipedia.org/wiki/Cynefin_framework +[13]: https://opensource.com/sites/default/files/uploads/hypo-5-trans.png +[14]: https://agilemanifesto.org/principles.html +[15]: https://opensource.com/sites/default/files/uploads/adapt-transparent-inspect.png diff --git a/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md b/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md new file mode 100644 index 0000000000..7d28e67ea4 --- /dev/null +++ b/sources/tech/20190607 An Introduction to Kubernetes Secrets and ConfigMaps.md @@ -0,0 +1,608 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Introduction to Kubernetes Secrets and ConfigMaps) +[#]: via: (https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps) +[#]: author: (Chris Collins https://opensource.com/users/clcollins) + +An Introduction to Kubernetes Secrets and ConfigMaps +====== +Kubernetes Secrets and ConfigMaps separate the configuration of +individual container instances from the container image, reducing +overhead and adding flexibility. +![Kubernetes][1] + +Kubernetes has two types of objects that can inject configuration data into a container when it starts up: Secrets and ConfigMaps. Secrets and ConfigMaps behave similarly in [Kubernetes][2], both in how they are created and because they can be exposed inside a container as mounted files or volumes or environment variables. + +To explore Secrets and ConfigMaps, consider the following scenario: + +> You're running the [official MariaDB container image][3] in Kubernetes and must do some configuration to get the container to run. The image requires an environment variable to be set for **MYSQL_ROOT_PASSWORD** , **MYSQL_ALLOW_EMPTY_PASSWORD** , or **MYSQL_RANDOM_ROOT_PASSWORD** to initialize the database. It also allows for extensions to the MySQL configuration file **my.cnf** by placing custom config files in **/etc/mysql/conf.d**. + +You could build a custom image, setting the environment variables and copying the configuration files into it to create a bespoke container image. However, it is considered a best practice to create and use generic images and add configuration to the containers created from them, instead. This is a perfect use-case for ConfigMaps and Secrets. The **MYSQL_ROOT_PASSWORD** can be set in a Secret and added to the container as an environment variable, and the configuration files can be stored in a ConfigMap and mounted into the container as a file on startup. + +Let's try it out! + +### But first: A quick note about Kubectl + +Make sure that your version of the **kubectl** client command is the same or newer than the Kubernetes cluster version in use. + +An error along the lines of: + + +``` +`error: SchemaError(io.k8s.api.admissionregistration.v1beta1.ServiceReference): invalid object doesn't have additional properties` +``` + +may mean the client version is too old and needs to be upgraded. The [Kubernetes Documentation for Installing Kubectl][4] has instructions for installing the latest client on various platforms. + +If you're using Docker for Mac, it also installs its own version of **kubectl** , and that may be the issue. You can install a current client with **brew install** , replacing the symlink to the client shipped by Docker: + + +``` +$ rm /usr/local/bin/kubectl +$ brew link --overwrite kubernetes-cli +``` + +The newer **kubectl** client should continue to work with Docker's Kubernetes version. + +### Secrets + +Secrets are a Kubernetes object intended for storing a small amount of sensitive data. It is worth noting that Secrets are stored base64-encoded within Kubernetes, so they are not wildly secure. Make sure to have appropriate [role-based access controls][5] (RBAC) to protect access to Secrets. Even so, extremely sensitive Secrets data should probably be stored using something like [HashiCorp Vault][6]. For the root password of a MariaDB database, however, base64 encoding is just fine. + +#### Create a Secret manually + +To create the Secret containing the **MYSQL_ROOT_PASSWORD** , choose a password and convert it to base64: + + +``` +# The root password will be "KubernetesRocks!" +$ echo -n 'KubernetesRocks!' | base64 +S3ViZXJuZXRlc1JvY2tzIQ== +``` + +Make a note of the encoded string. You need it to create the YAML file for the Secret: + + +``` +apiVersion: v1 +kind: Secret +metadata: +name: mariadb-root-password +type: Opaque +data: +password: S3ViZXJuZXRlc1JvY2tzIQ== +``` + +Save that file as **mysql-secret.yaml** and create the Secret in Kubernetes with the **kubectl apply** command: + + +``` +$ kubectl apply -f mysql-secret.yaml +secret/mariadb-root-password created +``` + +#### View the newly created Secret + +Now that you've created the Secret, use **kubectl describe** to see it: + + +``` +$ kubectl describe secret mariadb-root-password +Name: mariadb-root-password +Namespace: secrets-and-configmaps +Labels: +Annotations: +Type: Opaque + +Data +==== +password: 16 bytes +``` + +Note that the **Data** field contains the key you set in the YAML: **password**. The value assigned to that key is the password you created, but it is not shown in the output. Instead, the value's size is shown in its place, in this case, 16 bytes. + +You can also use the **kubectl edit secret ** command to view and edit the Secret. If you edit the Secret, you'll see something like this: + + +``` +# Please edit the object below. Lines beginning with a '#' will be ignored, +# and an empty file will abort the edit. If an error occurs while saving this file will be +# reopened with the relevant failures. +# +apiVersion: v1 +data: +password: S3ViZXJuZXRlc1JvY2tzIQ== +kind: Secret +metadata: +annotations: +kubectl.kubernetes.io/last-applied-configuration: | +{"apiVersion":"v1","data":{"password":"S3ViZXJuZXRlc1JvY2tzIQ=="},"kind":"Secret","metadata":{"annotations":{},"name":"mariadb-root-password","namespace":"secrets-and-configmaps"},"type":"Opaque"} +creationTimestamp: 2019-05-29T12:06:09Z +name: mariadb-root-password +namespace: secrets-and-configmaps +resourceVersion: "85154772" +selfLink: /api/v1/namespaces/secrets-and-configmaps/secrets/mariadb-root-password +uid: 2542dadb-820a-11e9-ae24-005056a1db05 +type: Opaque +``` + +Again, the **data** field with the **password** key is visible, and this time you can see the base64-encoded Secret. + +#### Decode the Secret + +Let's say you need to view the Secret in plain text, for example, to verify that the Secret was created with the correct content. You can do this by decoding it. + +It is easy to decode the Secret by extracting the value and piping it to base64. In this case, you will use the output format **-o jsonpath= ** to extract only the Secret value using a JSONPath template. + + +``` +# Returns the base64 encoded secret string +$ kubectl get secret mariadb-root-password -o jsonpath='{.data.password}' +S3ViZXJuZXRlc1JvY2tzIQ== + +# Pipe it to `base64 --decode -` to decode: +$ kubectl get secret mariadb-root-password -o jsonpath='{.data.password}' | base64 --decode - +KubernetesRocks! +``` + +#### Another way to create Secrets + +You can also create Secrets directly using the **kubectl create secret** command. The MariaDB image permits setting up a regular database user with a password by setting the **MYSQL_USER** and **MYSQL_PASSWORD** environment variables. A Secret can hold more than one key/value pair, so you can create a single Secret to hold both strings. As a bonus, by using **kubectl create secret** , you can let Kubernetes mess with base64 so that you don't have to. + + +``` +$ kubectl create secret generic mariadb-user-creds \ +\--from-literal=MYSQL_USER=kubeuser\ +\--from-literal=MYSQL_PASSWORD=kube-still-rocks +secret/mariadb-user-creds created +``` + +Note the **\--from-literal** , which sets the key name and the value all in one. You can pass as many **\--from-literal** arguments as you need to create one or more key/value pairs in the Secret. + +Validate that the username and password were created and stored correctly with the **kubectl get secrets** command: + + +``` +# Get the username +$ kubectl get secret mariadb-user-creds -o jsonpath='{.data.MYSQL_USER}' | base64 --decode - +kubeuser + +# Get the password +$ kubectl get secret mariadb-user-creds -o jsonpath='{.data.MYSQL_PASSWORD}' | base64 --decode - +kube-still-rocks +``` + +### ConfigMaps + +ConfigMaps are similar to Secrets. They can be created and shared in the containers in the same ways. The only big difference between them is the base64-encoding obfuscation. ConfigMaps are intended for non-sensitive data—configuration data—like config files and environment variables and are a great way to create customized running services from generic container images. + +#### Create a ConfigMap + +ConfigMaps can be created in the same ways as Secrets. You can write a YAML representation of the ConfigMap manually and load it into Kubernetes, or you can use the **kubectl create configmap** command to create it from the command line. The following example creates a ConfigMap using the latter method but, instead of passing literal strings (as with **\--from-literal= =** in the Secret above), it creates a ConfigMap from an existing file—a MySQL config intended for **/etc/mysql/conf.d** in the container. This config file overrides the **max_allowed_packet** setting that MariaDB sets to 16M by default. + +First, create a file named **max_allowed_packet.cnf** with the following content: + + +``` +[mysqld] +max_allowed_packet = 64M +``` + +This will override the default setting in the **my.cnf** file and set **max_allowed_packet** to 64M. + +Once the file is created, you can create a ConfigMap named **mariadb-config** using the **kubectl create configmap** command that contains the file: + + +``` +$ kubectl create configmap mariadb-config --from-file=max_allowed_packet.cnf +configmap/mariadb-config created +``` + +Just like Secrets, ConfigMaps store one or more key/value pairs in their Data hash of the object. By default, using **\--from-file= ** (as above) will store the contents of the file as the value, and the name of the file will be stored as the key. This is convenient from an organization viewpoint. However, the key name can be explicitly set, too. For example, if you used **\--from-file=max-packet=max_allowed_packet.cnf** when you created the ConfigMap, the key would be **max-packet** rather than the file name. If you had multiple files to store in the ConfigMap, you could add each of them with an additional **\--from-file= ** argument. + +#### View the new ConfigMap and read the data + +As mentioned, ConfigMaps are not meant to store sensitive data, so the data is not encoded when the ConfigMap is created. This makes it easy to view and validate the data and edit it directly. + +First, validate that the ConfigMap was, indeed, created: + + +``` +$ kubectl get configmap mariadb-config +NAME DATA AGE +mariadb-config 1 9m +``` + +The contents of the ConfigMap can be viewed with the **kubectl describe** command. Note that the full contents of the file are visible and that the key name is, in fact, the file name, **max_allowed_packet.cnf**. + + +``` +$ kubectl describe cm mariadb-config +Name: mariadb-config +Namespace: secrets-and-configmaps +Labels: +Annotations: + +Data +==== +max_allowed_packet.cnf: +\---- +[mysqld] +max_allowed_packet = 64M + +Events: +``` + +A ConfigMap can be edited live within Kubernetes with the **kubectl edit** command. Doing so will open a buffer with the default editor showing the contents of the ConfigMap as YAML. When changes are saved, they will immediately be live in Kubernetes. While not really the _best_ practice, it can be handy for testing things in development. + +Say you want a **max_allowed_packet** value of 32M instead of the default 16M or the 64M in the **max_allowed_packet.cnf** file. Use **kubectl edit configmap mariadb-config** to edit the value: + + +``` +$ kubectl edit configmap mariadb-config + +# Please edit the object below. Lines beginning with a '#' will be ignored, +# and an empty file will abort the edit. If an error occurs while saving this file will be +# reopened with the relevant failures. +# +apiVersion: v1 + +data: +max_allowed_packet.cnf: | +[mysqld] +max_allowed_packet = 32M +kind: ConfigMap +metadata: +creationTimestamp: 2019-05-30T12:02:22Z +name: mariadb-config +namespace: secrets-and-configmaps +resourceVersion: "85609912" +selfLink: /api/v1/namespaces/secrets-and-configmaps/configmaps/mariadb-config +uid: c83ccfae-82d2-11e9-832f-005056a1102f +``` + +After saving the change, verify the data has been updated: + + +``` +# Note the '.' in max_allowed_packet.cnf needs to be escaped +$ kubectl get configmap mariadb-config -o "jsonpath={.data['max_allowed_packet\\.cnf']}" + +[mysqld] +max_allowed_packet = 32M +``` + +### Using Secrets and ConfigMaps + +Secrets and ConfigMaps can be mounted as environment variables or as files within a container. For the MariaDB container, you will need to mount the Secrets as environment variables and the ConfigMap as a file. First, though, you need to write a Deployment for MariaDB so that you have something to work with. Create a file named **mariadb-deployment.yaml** with the following: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: mariadb +name: mariadb-deployment +spec: +replicas: 1 +selector: +matchLabels: +app: mariadb +template: +metadata: +labels: +app: mariadb +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +``` + +This is a bare-bones Kubernetes Deployment of the official MariaDB 10.4 image from Docker Hub. Now, add your Secrets and ConfigMap. + +#### Add the Secrets to the Deployment as environment variables + +You have two Secrets that need to be added to the Deployment: + + 1. **mariadb-root-password** (with one key/value pair) + 2. **mariadb-user-creds** (with two key/value pairs) + + + +For the **mariadb-root-password** Secret, specify the Secret and the key you want by adding an **env** list/array to the container spec in the Deployment and setting the environment variable value to the value of the key in your Secret. In this case, the list contains only a single entry, for the variable **MYSQL_ROOT_PASSWORD**. + + +``` +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +``` + +Note that the name of the object is the name of the environment variable that is added to the container. The **valueFrom** field defines **secretKeyRef** as the source from which the environment variable will be set; i.e., it will use the value from the **password** key in the **mariadb-root-password** Secret you set earlier. + +Add this section to the definition for the **mariadb** container in the **mariadb-deployment.yaml** file. It should look something like this: + + +``` +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +``` + +In this way, you have explicitly set the variable to the value of a specific key from your Secret. This method can also be used with ConfigMaps by using **configMapRef** instead of **secretKeyRef**. + +You can also set environment variables from _all_ key/value pairs in a Secret or ConfigMap to automatically use the key name as the environment variable name and the key's value as the environment variable's value. By using **envFrom** rather than **env** in the container spec, you can set the **MYSQL_USER** and **MYSQL_PASSWORD** from the **mariadb-user-creds** Secret you created earlier, all in one go: + + +``` +envFrom: +\- secretRef: +name: mariadb-user-creds +``` + +**envFrom** is a list of sources for Kubernetes to take environment variables. Use **secretRef** again, this time to specify **mariadb-user-creds** as the source of the environment variables. That's it! All the keys and values in the Secret will be added as environment variables in the container. + +The container spec should now look like this: + + +``` +spec: +containers: +\- name: mariadb +image: docker.io/mariadb:10.4 +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +envFrom: +\- secretRef: +name: mariadb-user-creds +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +``` + +_Note:_ You could have just added the **mysql-root-password** Secret to the **envFrom** list and let it be parsed as well, as long as the **password** key was named **MYSQL_ROOT_PASSWORD** instead. There is no way to manually specify the environment variable name with **envFrom** as with **env**. + +#### Add the max_allowed_packet.cnf file to the Deployment as a volumeMount + +As mentioned, both **env** and **envFrom** can be used to share ConfigMap key/value pairs with a container as well. However, in the case of the **mariadb-config** ConfigMap, your entire file is stored as the value to your key, and the file needs to exist in the container's filesystem for MariaDB to be able to use it. Luckily, both Secrets and ConfigMaps can be the source of Kubernetes "volumes" and mounted into the containers instead of using a filesystem or block device as the volume to be mounted. + +The **mariadb-deployment.yaml** already has a volume and volumeMount specified, an **emptyDir** (effectively a temporary or ephemeral) volume mounted to **/var/lib/mysql** to store the MariaDB data: + + +``` +<...> + +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 + +<...> + +volumes: +\- emptyDir: {} +name: mariadb-volume-1 + +<...> +``` + +_Note:_ This is not a production configuration. When the Pod restarts, the data in the **emptyDir** volume is lost. This is primarily used for development or when the contents of the volume don't need to be persistent. + +You can add your ConfigMap as a source by adding it to the volume list and then adding a volumeMount for it to the container definition: + + +``` +<...> + +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +\- mountPath: /etc/mysql/conf.d +name: mariadb-config + +<...> + +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +\- configMap: +name: mariadb-config +items: +\- key: max_allowed_packet.cnf +path: max_allowed_packet.cnf +name: mariadb-config-volume + +<...> +``` + +The **volumeMount** is pretty self-explanatory—create a volume mount for the **mariadb-config-volume** (specified in the **volumes** list below it) to the path **/etc/mysql/conf.d**. + +Then, in the **volumes** list, **configMap** tells Kubernetes to use the **mariadb-config** ConfigMap, taking the contents of the key **max_allowed_packet.cnf** and mounting it to the path **max_allowed_packed.cnf**. The name of the volume is **mariadb-config-volume** , which was referenced in the **volumeMounts** above. + +_Note:_ The **path** from the **configMap** is the name of a file that will contain the contents of the key's value. In this case, your key was a file name, too, but it doesn't have to be. Note also that **items** is a list, so multiple keys can be referenced and their values mounted as files. These files will all be created in the **mountPath** of the **volumeMount** specified above: **/etc/mysql/conf.d**. + +### Create a MariaDB instance from the Deployment + +At this point, you should have enough to create a MariaDB instance. You have two Secrets, one holding the **MYSQL_ROOT_PASSWORD** and another storing the **MYSQL_USER** , and the **MYSQL_PASSWORD** environment variables to be added to the container. You also have a ConfigMap holding the contents of a MySQL config file that overrides the **max_allowed_packed** value from its default setting. + +You also have a **mariadb-deployment.yaml** file that describes a Kubernetes deployment of a Pod with a MariaDB container and adds the Secrets as environment variables and the ConfigMap as a volume-mounted file in the container. It should look like this: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +labels: +app: mariadb +name: mariadb-deployment +spec: +replicas: 1 +selector: +matchLabels: +app: mariadb +template: +metadata: +labels: +app: mariadb +spec: +containers: +\- image: docker.io/mariadb:10.4 +name: mariadb +env: +\- name: MYSQL_ROOT_PASSWORD +valueFrom: +secretKeyRef: +name: mariadb-root-password +key: password +envFrom: +\- secretRef: +name: mariadb-user-creds +ports: +\- containerPort: 3306 +protocol: TCP +volumeMounts: +\- mountPath: /var/lib/mysql +name: mariadb-volume-1 +\- mountPath: /etc/mysql/conf.d +name: mariadb-config-volume +volumes: +\- emptyDir: {} +name: mariadb-volume-1 +\- configMap: +name: mariadb-config +items: +\- key: max_allowed_packet.cnf +path: max_allowed_packet.cnf +name: mariadb-config-volume +``` + +#### Create the MariaDB instance + +Create a new MariaDB instance from the YAML file with the **kubectl create** command: + + +``` +$ kubectl create -f mariadb-deployment.yaml +deployment.apps/mariadb-deployment created +``` + +Once the deployment has been created, use the **kubectl get** command to view the running MariaDB pod: + + +``` +$ kubectl get pods +NAME READY STATUS RESTARTS AGE +mariadb-deployment-5465c6655c-7jfqm 1/1 Running 0 3m +``` + +Make a note of the Pod name (in this example, it's **mariadb-deployment-5465c6655c-7jfqm** ). Note that the Pod name will differ from this example. + +#### Verify the instance is using the Secrets and ConfigMap + +Use the **kubectl exec** command (with your Pod name) to validate that the Secrets and ConfigMaps are in use. For example, check that the environment variables are exposed in the container: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm env |grep MYSQL +MYSQL_PASSWORD=kube-still-rocks +MYSQL_USER=kubeuser +MYSQL_ROOT_PASSWORD=KubernetesRocks! +``` + +Success! All three environment variables—the one using the **env** setup to specify the Secret, and two using **envFrom** to mount all the values from the Secret—are available in the container for MariaDB to use. + +Spot check that the **max_allowed_packet.cnf** file was created in **/etc/mysql/conf.d** and that it contains the expected content: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm ls /etc/mysql/conf.d +max_allowed_packet.cnf + +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm cat /etc/mysql/conf.d/max_allowed_packet.cnf +[mysqld] +max_allowed_packet = 32M +``` + +Finally, validate that MariaDB used the environment variable to set the root user password and read the **max_allowed_packet.cnf** file to set the **max_allowed_packet** configuration variable. Use the **kubectl exec** command again, this time to get a shell inside the running container and use it to run some **mysql** commands: + + +``` +$ kubectl exec -it mariadb-deployment-5465c6655c-7jfqm / +bin/sh + +# Check that the root password was set correctly +$ mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e 'show databases;' ++--------------------+ +| Database | ++--------------------+ +| information_schema | +| mysql | +| performance_schema | ++--------------------+ + +# Check that the max_allowed_packet.cnf was parsed +$ mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "SHOW VARIABLES LIKE 'max_allowed_packet';" ++--------------------+----------+ +| Variable_name | Value | ++--------------------+----------+ +| max_allowed_packet | 33554432 | ++--------------------+----------+ +``` + +### Advantages of Secrets and ConfigMaps + +This exercise explained how to create Kubernetes Secrets and ConfigMaps and how to use those Secrets and ConfigMaps by adding them as environment variables or files inside of a running container instance. This makes it easy to keep the configuration of individual instances of containers separate from the container image. By separating the configuration data, overhead is reduced to maintaining only a single image for a specific type of instance while retaining the flexibility to create instances with a wide variety of configurations. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps + +作者:[Chris Collins][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/clcollins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes.png?itok=PqDGb6W7 (Kubernetes) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://hub.docker.com/_/mariadb +[4]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[5]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ +[6]: https://www.vaultproject.io/ diff --git a/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md b/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md new file mode 100644 index 0000000000..a44ceeb105 --- /dev/null +++ b/sources/tech/20190610 Blockchain 2.0 - EOS.IO Is Building Infrastructure For Developing DApps -Part 13.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Blockchain 2.0 – EOS.IO Is Building Infrastructure For Developing DApps [Part 13]) +[#]: via: (https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Blockchain 2.0 – EOS.IO Is Building Infrastructure For Developing DApps [Part 13] +====== + +![Building infrastructure for Developing DApps][1] + +When a blockchain startup makes over **$4 billion** through an ICO without having a product or service to show for it, that is newsworthy. It becomes clear at this point that people invested these billions on this project because it seemed to promise a lot. This post will seek to demystify this mystical and seemingly powerful platform. + +**EOS.IO** is a [**blockchain**][2] platform that aims to develop standardized infrastructure including an application protocol and operating system for developing DApps ([ **distributed applications**][3]). **Block.one** the lead developer and investor in the project envisions **EOS.IO as the world’s’ first distributed operating system** providing a developing environment for decentralized applications. The system is meant to mirror a real computer by simulating hardware such as its CPUs, GPUs, and even RAM, apart from the obvious storage solutions courtesy of the blockchain database system. + +### Who is block.one? + +Block.one is the company behind EOS.IO. They developed the platform from the ground up based on a white paper published on GitHub. Block.one also spearheaded the yearlong “continuous” ICO that eventually made them a whopping $4 billion. They have one of the best teams of backers and advisors any company in the blockchain space can hope for with partnerships from **Bitmain** , **Louis Bacon** and **Alan Howard** among others. Not to mention **Peter Thiel** being one of the lead investors in the company. The expectations from their purported platform the EOS.IO and their crypto VC fund **EOS.VC** are high indeed. + +### What is EOS.IO? + +It is difficult to arrive at a short description for EOS.IO. The platform aims to position itself as a world wide computer with virtually simulated resources, hence creating a virtual environment for distributed applications to be built and run. The team behind EOS.IO aims achieve the following by directly quoting [**Ethereum**][4] as competition. + + * Increase transaction throughput to millions per second, + + * Reduce transaction costs to insignificant sums or remove them altogether. + + + + +Though EOS.IO is not anywhere near solving any of these problems, the platform has a few capabilities that make it noteworthy as an alternative to Ethereum for DApp enthusiasts and developers. + + 1. **Scalability** : EOS.IO uses a different consensus algorithm for handling blocks called **DPoS**. We’ve described it briefly below. The DPoS system basically allows the system to handle far more requests at better speeds than Ethereum is capable of with its **PoW** algorithm. The claim is that because they’ll be able to handle such massive throughputs they’ll be able to afford transactions at insignificant or even zero charges if need be. + 2. **Governance capabilities** : The consensus algorithm allows EOS.IO to dynamically understand malicious user (or node) behaviour to penalize or deactivate the user. The elected delegate feature of the delegated proof of stake system also ensures faster amendments to the rules that govern the network and its users. + 3. **Parallel processing** : Touted to another major feature. This will basically allow programs on the EOS.IO blockchain to utilize multiple computers or processors or even computing resources such as GPUs to parallelly processes large chunks of data and blocks. This is not yet seen in a roll out ready form. (This however is not a unique feature of EOS.IO. [**Hyperledger Sawtooth**][5] and Burrow for instance support the same at the moment). + 4. **Self-sufficiency** : The system has a built-in grievance system along with well defined incentive and penal systems for providing feedback for acceptable and non-acceptable behaviour. This means that the platform has a governance system without actually having a central governing body. + + + +All or at least most of the selling points of the system is based on the consensus algorithm it follows, DPoS. We explore more about the same below. + +### What is the delegated Proof of Stake (DPoS) consensus algorithm? + +As far as blockchains are concerned consensus algorithms are what gives them the strength and the selling point they need. However, as a general rule of thumb, as the “openness” and immutability of the ledger increases so does the computational power that is required to run it. For instance, if a blockchain intends to be secure against intrusion, be safe and immutable with respect to data, while being accessible to a lot of users, it will use up a lot of computing power in creating and maintaining itself. Think of it as a number lock. A 6-digit pin code is safer than a 3-digit pin code, but the latter will be easier and faster to open, now consider a million of these locks but with limited manpower to open them, and you get the scale at which blockchains operate and how much these consensus algorithms matter. + +In fact, this is a major area where competing platforms differ from each other. Hyperledger Sawtooth uses a proof of elapsed time algorithm (PoET), while ethereum uses a slightly modified proof of work (PoW) algorithm. Each of these have their own pros and cons which we will cover in a detailed post later on. However, for now, to be noted is that EOS.IO uses a delegated proof of stake mechanism for attesting and validating blocks under it. This has the following implications for users. + +Only one node can actively change the status of data written on the blockchain. In the case of a DPoS based system, this validator node is selected as part of a delegation by all the token holders of the blockchain. Every token holder gets to vote and have a say in who should be a validator. The weight the vote carries is usually proportional to the number of tokens the user carries. This is seen as a democratic way to ensure centralized accountability in terms of running the network. Furthermore, the validator is given additional monetary incentives to keep the network running smoothly and without friction. In case a validator or delegate member who is elected appears to be malicious, the system automatically votes out the said node member. + +DPoS system is efficient as it requires fewer computing resources to cast a vote and select a leader to validate. Further, it incentivizes good behaviour and penalizes bad ones leading to self-correction and maintenance of the blockchain. **The average transaction time for PoW vs DPoS is 10 minutes vs 10 seconds**. The downside to this paradigm being centralized operations, weighted voting systems, lack of redundancy, and possible malicious behaviour from the validator. + +To understand the difference between PoW and DPoS, imagine this: Let’s say your network has 100 participants out of which 10 are capable of handling validator duties and you need to choose one to do the same. In PoW, you give each of them a tough problem to solve to know who’s the fastest and smartest. You give the validator position to the winner and reward them for the same. In the DPoS system, the rest of the members vote for the person they think should hold the position. This is a simple matter of choosing based on arithmetic performance data based on the past. The node with the most votes win, and if the winner tries to do something fishy, the same electorate votes him out for the next transaction. + +### So does Ethereum lose out? + +While EOS.IO has miles to go before it even steps into the same ballpark as Ethereum with respect to the market cap and user base, EOS.IO targets specific shortfalls with Ethereum and solves them. We conclude this post by summarising some findings based on a 2017 [**paper**][6] written and published by **Ian Grigg**. + + 1. The consensus algorithm used in the Ethereum (proof of work) platform uses far more computing resources and time to process transactions. This is true even for small block sizes. This limits its scaling potential and throughput. A meagre 15 transactions per second globally is no match for the over 2000 that payments network Visa manages. If the platform is to be adopted on a global scale based on a large scale roll out this is not acceptable. + + 2. The reliance on proprietary languages, tool kits and protocols (including **Solidity** for instance) limits developer capability. Interoperability between platforms is also severely hurt due to this fact. + + 3. This is rather subjective, however, the fact that Ethereum foundation refuses to acknowledge even the need for governance on the platform instead choosing to intervene on an ad-hoc manner when things turn sour on the network is not seen by many industry watchers as a sustainable model to be emulated in the future. + + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/blockchain-2-0-eos-io-is-building-infrastructure-for-developing-dapps/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/05/Developing-DApps-720x340.png +[2]: https://www.ostechnix.com/blockchain-2-0-an-introduction/ +[3]: https://www.ostechnix.com/blockchain-2-0-explaining-distributed-computing-and-distributed-applications/ +[4]: https://www.ostechnix.com/blockchain-2-0-what-is-ethereum/ +[5]: https://www.ostechnix.com/blockchain-2-0-introduction-to-hyperledger-sawtooth/ +[6]: http://iang.org/papers/EOS_An_Introduction.pdf diff --git a/sources/tech/20190610 Constant Time.md b/sources/tech/20190610 Constant Time.md new file mode 100644 index 0000000000..f19207fb58 --- /dev/null +++ b/sources/tech/20190610 Constant Time.md @@ -0,0 +1,281 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Constant Time) +[#]: via: (https://dave.cheney.net/2019/06/10/constant-time) +[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney) + +Constant Time +====== + +This essay is a derived from my [dotGo 2019 presentation][1] about my favourite feature in Go. + +* * * + +Many years ago Rob Pike remarked, + +> “Numbers are just numbers, you’ll never see `0x80ULL` in a `.go` source file”. + +—Rob Pike, [The Go Programming Language][2] + +Beyond this pithy observation lies the fascinating world of Go’s constants. Something that is perhaps taken for granted because, as Rob noted, is Go numbers–constants–just work. +In this post I intend to show you a few things that perhaps you didn’t know about Go’s `const` keyword. + +## What’s so great about constants? + +To kick things off, why are constants good? Three things spring to mind: + + * _Immutability_. Constants are one of the few ways we have in Go to express immutability to the compiler. + * _Clarity_. Constants give us a way to extract magic numbers from our code, giving them names and semantic meaning. + * _Performance_. The ability to express to the compiler that something will not change is key as it unlocks optimisations such as constant folding, constant propagation, branch and dead code elimination. + + + +But these are generic use cases for constants, they apply to any language. Let’s talk about some of the properties of Go’s constants. + +### A Challenge + +To introduce the power of Go’s constants let’s try a little challenge: declare a _constant_ whose value is the number of bits in the natural machine word. + +We can’t use `unsafe.SizeOf` as it is not a constant expression. We could use a build tag and laboriously record the natural word size of each Go platform, or we could do something like this: + +``` +const uintSize = 32 << (^uint(0) >> 32 & 1) +``` + +There are many versions of this expression in Go codebases. They all work roughly the same way. If we’re on a 64 bit platform then the exclusive or of the number zero–all zero bits–is a number with all bits set, sixty four of them to be exact. + +``` +1111111111111111111111111111111111111111111111111111111111111111 +``` + +If we shift that value thirty two bits to the right, we get another value with thirty two ones in it. + +``` +0000000000000000000000000000000011111111111111111111111111111111 +``` + +Anding that with a number with one bit in the final position give us, the same thing, `1`, + +``` +0000000000000000000000000000000011111111111111111111111111111111 & 1 = 1 +``` + +Finally we shift the number thirty two one place to the right, giving us 641. + +``` +32 << 1 = 64 +``` + +This expression is an example of a _constant expression_. All of these operations happen at compile time and the result of the expression is itself a constant. If you look in the in runtime package, in particular the garbage collector, you’ll see how constant expressions are used to set up complex invariants based on the word size of the machine the code is compiled on. + +So, this is a neat party trick, but most compilers will do this kind of constant folding at compile time for you. Let’s step it up a notch. + +## Constants are values + +In Go, constants are values and each value has a type. In Go, user defined types can declare their own methods. Thus, a constant value can have a method set. If you’re surprised by this, let me show you an example that you probably use every day. + +``` +const timeout = 500 * time.Millisecond +fmt.Println("The timeout is", timeout) // 500ms +``` + +In the example the untyped literal constant `500` is multiplied by `time.Millisecond`, itself a constant of type `time.Duration`. The rule for assignments in Go are, unless otherwise declared, the type on the left hand side of the assignment operator is inferred from the type on the right.`500` is an untyped constant so it is converted to a `time.Duration` then multiplied with the constant `time.Millisecond`. + +Thus `timeout` is a constant of type `time.Duration` which holds the value `500000000`. +Why then does `fmt.Println` print `500ms`, not `500000000`? + +The answer is `time.Duration` has a `String` method. Thus any `time.Duration` value, even a constant, knows how to pretty print itself. + +Now we know that constant values are typed, and because types can declare methods, we can derive that _constant values can fulfil interfaces_. In fact we just saw an example of this. `fmt.Println` doesn’t assert that a value has a `String` method, it asserts the value implements the `Stringer` interface. + +Let’s talk a little about how we can use this property to make our Go code better, and to do that I’m going to take a brief digression into the Singleton pattern. + +## Singletons + +I’m generally not a fan of the singleton pattern, in Go or any language. Singletons complicate testing and create unnecessary coupling between packages. I feel the singleton pattern is often used _not_ to create a singular instance of a thing, but instead to create a place to coordinate registration. `net/http.DefaultServeMux` is a good example of this pattern. + +``` +package http + +// DefaultServeMux is the default ServeMux used by Serve. +var DefaultServeMux = &defaultServeMux + +var defaultServeMux ServeMux +``` + +There is nothing singular about `http.defaultServerMux`, nothing prevents you from creating another `ServeMux`. In fact the `http` package provides a helper that will create as many `ServeMux`‘s as you want. + +``` +// NewServeMux allocates and returns a new ServeMux. +func NewServeMux() *ServeMux { return new(ServeMux) } +``` + +`http.DefaultServeMux` is not a singleton. Never the less there is a case for things which are truely singletons because they can only represent a single thing. A good example of this are the file descriptors of a process; 0, 1, and 2 which represent stdin, stdout, and stderr respectively. + +It doesn’t matter what names you give them, `1` is always stdout, and there can only ever be one file descriptor `1`. Thus these two operations are identical: + +``` +fmt.Fprintf(os.Stdout, "Hello dotGo\n") +syscall.Write(1, []byte("Hello dotGo\n")) +``` + +So let’s look at how the `os` package defines `Stdin`, `Stdout`, and `Stderr`: + +``` +package os + +var ( + Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin") + Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout") + Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr") +) +``` + +There are a few problems with this declaration. Firstly their type is `*os.File` not the respective `io.Reader` or `io.Writer` interfaces. People have long complained that this makes replacing them with alternatives problematic. However the notion of replacing these variables is precisely the point of this digression. Can you safely change the value of `os.Stdout` once your program is running without causing a data race? + +I argue that, in the general case, you cannot. In general, if something is unsafe to do, as programmers we shouldn’t let our users think that it is safe, [lest they begin to depend on that behaviour][3]. + +Could we change the definition of `os.Stdout` and friends so that they retain the observable behaviour of reading and writing, but remain immutable? It turns out, we can do this easily with constants. + +``` +type readfd int + +func (r readfd) Read(buf []byte) (int, error) { + return syscall.Read(int(r), buf) +} + +type writefd int + +func (w writefd) Write(buf []byte) (int, error) { + return syscall.Write(int(w), buf) +} + +const ( + Stdin = readfd(0) + Stdout = writefd(1) + Stderr = writefd(2) +) + +func main() { + fmt.Fprintf(Stdout, "Hello world") +} +``` + +In fact this change causes only one compilation failure in the standard library.2 + +## Sentinel error values + +Another case of things which look like constants but really aren’t, are sentinel error values. `io.EOF`, `sql.ErrNoRows`, `crypto/x509.ErrUnsupportedAlgorithm`, and so on are all examples of sentinel error values. They all fall into a category of _expected_ errors, and because they are expected, you’re expected to check for them. + +To compare the error you have with the one you were expecting, you need to import the package that defines that error. Because, by definition, sentinel errors are exported public variables, any code that imports, for example, the `io` package could change the value of `io.EOF`. + +``` +package nelson + +import "io" + +func init() { + io.EOF = nil // haha! +} +``` + +I’ll say that again. If I know the name of `io.EOF` I can import the package that declares it, which I must if I want to compare it to my error, and thus I could change `io.EOF`‘s value. Historically convention and a bit of dumb luck discourages people from writing code that does this, but technically there is nothing to prevent you from doing so. + +Replacing `io.EOF` is probably going to be detected almost immediately. But replacing a less frequently used sentinel error may cause some interesting side effects: + +``` +package innocent + +import "crypto/rsa" + +func init() { + rsa.ErrVerification = nil // 🤔 +} +``` + +If you were hoping the race detector will spot this subterfuge, I suggest you talk to the folks writing testing frameworks who replace `os.Stdout` without it triggering the race detector. + +## Fungibility + +I want to digress for a moment to talk about _the_ most important property of constants. Constants aren’t just immutable, its not enough that we cannot overwrite their declaration, +Constants are _fungible_. This is a tremendously important property that doesn’t get nearly enough attention. + +Fungible means identical. Money is a great example of fungibility. If you were to lend me 10 bucks, and I later pay you back, the fact that you gave me a 10 dollar note and I returned to you 10 one dollar bills, with respect to its operation as a financial instrument, is irrelevant. Things which are fungible are by definition equal and equality is a powerful property we can leverage for our programs. + +``` +var myEOF = errors.New("EOF") // io/io.go line 38 +fmt.Println(myEOF == io.EOF) // false +``` + +Putting aside the effect of malicious actors in your code base the key design challenge with sentinel errors is they behave like _singletons_ , not _constants_. Even if we follow the exact procedure used by the `io` package to create our own EOF value, `myEOF` and `io.EOF` are not equal. `myEOF` and `io.EOF` are not fungible, they cannot be interchanged. Programs can spot the difference. + +When you combine the lack of immutability, the lack of fungibility, the lack of equality, you have a set of weird behaviours stemming from the fact that sentinel error values in Go are not constant expressions. But what if they were? + +## Constant errors + +Ideally a sentinel error value should behave as a constant. It should be immutable and fungible. Let’s recap how the built in `error` interface works in Go. + +``` +type error interface { + Error() string +} +``` + +Any type with an `Error() string` method fulfils the `error` interface. This includes user defined types, it includes types derived from primitives like string, and it includes constant strings. With that background, consider this error implementation: + +``` +type Error string + +func (e Error) Error() string { + return string(e) +} +``` + +We can use this error type as a constant expression: + +``` +const err = Error("EOF") +``` + +Unlike `errors.errorString`, which is a struct, a compact struct literal initialiser is not a constant expression and cannot be used. + +``` +const err2 = errors.errorString{"EOF"} // doesn't compile +``` + +As constants of this `Error` type are not variables, they are immutable. + +``` +const err = Error("EOF") +err = Error("not EOF") // doesn't compile +``` + +Additionally, two constant strings are always equal if their contents are equal: + +``` +const str1 = "EOF" +const str2 = "EOF" +fmt.Println(str1 == str2) // true +``` + +which means two constants of a type derived from string with the same contents are also equal. + +``` +type Error string + +const err1 = Error("EOF") +const err2 = Error("EOF") + fmt.Println(err1 == err2) // true``` + +``` +Said another way, equal constant `Error` values are the same, in the way that the literal constant `1` is the same as every other literal constant `1`. + +Now we have all the pieces we need to make sentinel errors, like `io.EOF`, and `rsa.ErrVerfication`, immutable, fungible, constant expressions. +``` + + % git diff + diff --git a/src/io/io.go b/src/io/io.go + inde \ No newline at end of file diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..d9ed871a10 --- /dev/null +++ b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Tmux Command Examples To Manage Multiple Terminal Sessions +====== + +![tmux command examples][1] + +We’ve already learned to use [**GNU Screen**][2] to manage multiple Terminal sessions. Today, we will see yet another well-known command-line utility named **“Tmux”** to manage Terminal sessions. Similar to GNU Screen, Tmux is also a Terminal multiplexer that allows us to create number of terminal sessions and run more than one programs or processes at the same time inside a single Terminal window. Tmux is free, open source and cross-platform program that supports Linux, OpenBSD, FreeBSD, NetBSD and Mac OS X. In this guide, we will discuss most-commonly used Tmux commands in Linux. + +### Installing Tmux in Linux + +Tmux is available in the official repositories of most Linux distributions. + +On Arch Linux and its variants, run the following command to install it. + +``` +$ sudo pacman -S tmux +``` + +On Debian, Ubuntu, Linux Mint: + +``` +$ sudo apt-get install tmux +``` + +On Fedora: + +``` +$ sudo dnf install tmux +``` + +On RHEL and CentOS: + +``` +$ sudo yum install tmux +``` + +On SUSE/openSUSE: + +``` +$ sudo zypper install tmux +``` + +Well, we have just installed Tmux. Let us go ahead and see some examples to learn how to use Tmux. + +### Tmux Command Examples To Manage Multiple Terminal Sessions + +The default prefix shortcut to all commands in Tmux is **Ctrl+b**. Just remember this keyboard shortcut when using Tmux. + +* * * + +**Note:** The default prefix to all **Screen** commands is **Ctrl+a**. + +* * * + +##### Creating Tmux sessions + +To create a new Tmux session and attach to it, run the following command from the Terminal: + +``` +tmux +``` + +Or, + +``` +tmux new +``` + +Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. + +![][3] + +New Tmux session + +It is very handy to verify whether you’re inside a Tmux session or not. + +##### Detaching from Tmux sessions + +To detach from a current Tmux session, just press **Ctrl+b** and **d**. You don’t need to press this both Keyboard shortcut at a time. First press “Ctrl+b” and then press “d”. + +Once you’re detached from a session, you will see an output something like below. + +``` +[detached (from session 0)] +``` + +##### Creating named sessions + +If you use multiple sessions, you might get confused which programs are running on which sessions. In such cases, you can just create named sessions. For example if you wanted to perform some activities related to web server in a session, just create the Tmux session with a custom name, for example **“webserver”** (or any name of your choice). + +``` +tmux new -s webserver +``` + +Here is the new named Tmux session. + +![][4] + +Tmux session with a custom name + +As you can see in the above screenshot, the name of the Tmux session is **webserver**. This way you can easily identify which program is running on which session. + +To detach, simply press **Ctrl+b** and **d**. + +##### List Tmux sessions + +To view the list of open Tmux sessions, run: + +``` +tmux ls +``` + +Sample output: + +![][5] + +List Tmux sessions + +As you can see, I have two open Tmux sessions. + +##### Creating detached sessions + +Sometimes, you might want to simply create a session and don’t want to attach to it automatically. + +To create a new detached session named **“ostechnix”** , run: + +``` +tmux new -s ostechnix -d +``` + +The above command will create a new Tmux session called “ostechnix”, but won’t attach to it. + +You can verify if the session is created using “tmux ls” command: + +![][6] + +Create detached Tmux sessions + +##### Attaching to Tmux sessions + +You can attach to the last created session by running this command: + +``` +tmux attach +``` + +Or, + +``` +tmux a +``` + +If you want to attach to any specific named session, for example “ostechnix”, run: + +``` +tmux attach -t ostechnix +``` + +Or, shortly: + +``` +tmux a -t ostechnix +``` + +##### Kill Tmux sessions + +When you’re done and no longer required a Tmux session, you can kill it at any time with command: + +``` +tmux kill-session -t ostechnix +``` + +To kill when attached, press **Ctrl+b** and **x**. Hit “y” to kill the session. + +You can verify if the session is closed with “tmux ls” command. + +To Kill Tmux server along with all Tmux sessions, run: + +``` +tmux kill-server +``` + +Be careful! This will terminate all Tmux sessions even if there are any running jobs inside the sessions without any warning. + +When there were no running Tmux sessions, you will see the following output: + +``` +$ tmux ls +no server running on /tmp/tmux-1000/default +``` + +##### Split Tmux Session Windows + +Tmux has an option to split a single Tmux session window into multiple smaller windows called **Tmux panes**. This way we can run different programs on each pane and interact with all of them simultaneously. Each pane can be resized, moved and closed without affecting the other panes. We can split a Tmux window either horizontally or vertically or both at once. + +**Split panes horizontally** + +To split a pane horizontally, press **Ctrl+b** and **”** (single quotation mark). + +![][7] + +Split Tmux pane horizontally + +Use the same key combination to split the panes further. + +**Split panes vertically** + +To split a pane vertically, press **Ctrl+b** and **%**. + +![][8] + +Split Tmux panes vertically + +**Split panes horizontally and vertically** + +We can also split a pane horizontally and vertically at the same time. Take a look at the following screenshot. + +![][9] + +Split Tmux panes + +First, I did a horizontal split by pressing **Ctrl+b “** and then split the lower pane vertically by pressing **Ctrl+b %**. + +As you see in the above screenshot, I am running three different programs on each pane. + +**Switch between panes** + +To switch between panes, press **Ctrl+b** and **Arrow keys (Left, Right, Up, Down)**. + +**Send commands to all panes** + +In the previous example, we run three different commands on each pane. However, it is also possible to run send the same commands to all panes at once. + +To do so, press **Ctrl+b** and type the following command and hit ENTER: + +``` +:setw synchronize-panes +``` + +Now type any command on any pane. You will see that the same command is reflected on all panes. + +**Swap panes** + +To swap panes, press **Ctrl+b** and **o**. + +**Show pane numbers** + +Press **Ctrl+b** and **q** to show pane numbers. + +**Kill panes** + +To kill a pane, simply type **exit** and ENTER key. Alternatively, press **Ctrl+b** and **x**. You will see a confirmation message. Just press **“y”** to close the pane. + +![][10] + +Kill Tmux panes + +At this stage, you will get a basic idea of Tmux and how to use it to manage multiple Terminal sessions. For more details, refer man pages. + +``` +$ man tmux +``` + +Both GNU Screen and Tmux utilities can be very helpful when managing servers remotely via SSH. Learn Screen and Tmux commands thoroughly to manage your remote servers like a pro. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-720x340.png +[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png +[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png +[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png +[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png +[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png +[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png +[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png +[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png diff --git a/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md b/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md new file mode 100644 index 0000000000..7bdf5361ab --- /dev/null +++ b/sources/tech/20190611 Cisco software to make networks smarter, safer, more manageable.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cisco software to make networks smarter, safer, more manageable) +[#]: via: (https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.html) +[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/) + +Cisco software to make networks smarter, safer, more manageable +====== +Cisco software announced at Cisco Live embraces AI to help customers set consistent network and security policies across their domains and improve intent-based networking. +![bigstock][1] + +SAN DIEGO—Cisco injected a number of new technologies into its key networking control-point software that makes it easier to stretch networking from the data center to the cloud while making the whole environment smarter and easier to manage. + +At the company’s annual Cisco Live customer event here it rolled out software that lets customers more easily meld typically siloed domains across the enterprise and cloud to the wide area network. The software enables what Cisco calls multidomain integration that lets customers set policies to apply uniform access controls to users, devices and applications regardless of where they connect to the network, the company said. + +**More about SD-WAN** + + * [How to buy SD-WAN technology: Key questions to consider when selecting a supplier][2] + * [How to pick an off-site data-backup method][3] + * [SD-Branch: What it is and why you’ll need it][4] + * [What are the options for security SD-WAN?][5] + + + +The company also unveiled Cisco AI Network Analytics, a software package that uses [AI and machine learning techniques][6] to learn network traffic and security patterns that can help customers spot and fix problems proactively across the enterprise. + +All of the new software runs on Cisco’s DNA Center platform which is rapidly becoming an ever-more crucial component to the company’s intent-based networking plans. DNA Center has always been important since its introduction two years ago as it features automation capabilities, assurance setting, fabric provisioning and policy-based segmentation for enterprise networks. + +Beyond device management and configuration, Cisco DNA Center gives IT teams the ability to control access through policies using Software-Defined Access (SD-Access), automatically provision through Cisco DNA Automation, virtualize devices through Cisco Network Functions Virtualization (NFV), and lower security risks through segmentation and Encrypted Traffic Analysis. But experts say these software enhancements take it to a new level. + +“You can call it the rise of DNA Center and it’s important because it lets customers manage and control their entire network from one place – similar to what VMware does with its vCenter,” said Zeus Kerravala, founder and principal analyst with ZK Research. vCenter is VMware’s centralized platform for controlling its vSphere virtualized environments. + +“Cisco will likely roll more and more functionality into DNA Center in the future making it stronger,” Kerravala said. + +**[[Become a Microsoft Office 365 administrator in record time with this quick start course from PluralSight.][7] ]** + +Together the new software and DNA Center will help customers set consistent policies across their domains and collaborate with others for the benefit of the entire network. Customers can define a policy once, apply it everywhere, and monitor it systematically to ensure it is realizing its business intent, said Prashanth Shenoy, Cisco vice president of marketing for Enterprise Network and Mobility. It will help customers segment their networks to reduce congestion, improve security and compliance and contain network problems, he said. + +“In the campus, Cisco’s SD-Access solution uses this technology to group users and devices within the segments it creates according to their access privileges. Similarly, Cisco ACI creates groups of similar applications in the data center,” Shenoy said. “When integrated, SD-Access and ACI exchange their groupings and provide each other an awareness into their access policies. With this knowledge, each of the domains can map user groups with applications, jointly enforce policies, and block unauthorized access to applications.” + +In the Cisco world it basically means there now can be a unification of its central domain network controllers and they can work together and let customers drive policies across domains. + +Cisco also said that security capabilities can be spread across domains. + +Cisco Advanced Malware Protection (AMP) prevents breaches, monitors malicious behavior and detects and removes malware. Security constructs built into Cisco SD-WAN, and the recently announced SD-WAN onRamp for CoLocation, provide a full security stack that applies protection consistently from user to branch to clouds. Cisco Stealthwatch and Stealthwatch Cloud detect threats across the private network, public clouds, and in encrypted traffic. + +Analysts said Cisco’s latest efforts are an attempt to simplify what are fast becoming complex networks with tons of new devices and applications to support. + +Cisco’s initial efforts were product specific, but its latest announcements cross products and domains, said Lee Doyle principal analyst with Doyle Research. “Cisco is making a strong push to make its networks easier to use, manage and program.” + +That same strategy is behind the new AI Analytics program. + +“Trying to manually analyze and troubleshoot the traffic flowing through thousands of APs, switches and routers is a near impossible task, even for the most sophisticated NetOps team. In a wireless environment, onboarding and interference errors can crop up randomly and intermittently, making it even more difficult to determine probable causes,” said Anand Oswal, senior vice president, engineering for Cisco’s Enterprise Networking Business. + +Cisco has been integrating AI/ML into many operational and security components, with Cisco DNA Center the focal point for insights and actions, Oswal wrote in a [blog][8] about the AI announcement. AI Network Analytics collects massive amounts of network data from Cisco DNA Centers at participating customer sites, encrypts and anonymizes the data to ensure privacy, and collates all of it into the Cisco Worldwide Data Platform. In this cloud, the aggregated data is analyzed with deep machine learning to reveal patterns and anomalies such as: + + * Highly personalized network baselines with multiple levels of granularity that define “normal” for a given network, site, building and SSID. + + * Sudden changes in onboarding times for Wi-Fi devices, by individual APs, floor, building, campus +``` + +``` + and branch. + + * Simultaneous connectivity failures with numerous clients at a specific location + + * Changes in SaaS and Cloud application performance via SD-WAN direct internet connections or [Cloud OnRamps][9]. + + * Pattern-matching capabilities of ML will be used to spot anomalies in network behavior that might otherwise be missed. + + + + +“The intelligence of its large base of customers can help Cisco to derive important insights about how users can better manage their networks and solve problems and the power of MI/AI technology will continue to improve over time,” Doyle said. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3401523/cisco-software-to-make-networks-smarter-safer-more-manageable.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://images.idgesg.net/images/article/2018/11/intelligentnetwork-100780636-large.jpg +[2]: https://www.networkworld.com/article/3323407/sd-wan/how-to-buy-sd-wan-technology-key-questions-to-consider-when-selecting-a-supplier.html +[3]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[4]: https://www.networkworld.com/article/3250664/lan-wan/sd-branch-what-it-is-and-why-youll-need-it.html +[5]: https://www.networkworld.com/article/3285728/sd-wan/what-are-the-options-for-securing-sd-wan.html?nsdr=true +[6]: https://www.networkworld.com/article/3400382/cisco-will-use-aiml-to-boost-intent-based-networking.html +[7]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fadministering-office-365-quick-start +[8]: https://blogs.cisco.com/analytics-automation/cisco-ai-network-analytics-making-networks-smarter-simpler-and-more-secure +[9]: https://www.networkworld.com/article/3393232/cisco-boosts-sd-wan-with-multicloud-to-branch-access-system.html +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world diff --git a/sources/tech/20190611 How To Find Linux System Details Using inxi.md b/sources/tech/20190611 How To Find Linux System Details Using inxi.md new file mode 100644 index 0000000000..4fc24fd137 --- /dev/null +++ b/sources/tech/20190611 How To Find Linux System Details Using inxi.md @@ -0,0 +1,608 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Find Linux System Details Using inxi) +[#]: via: (https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Find Linux System Details Using inxi +====== + +![find Linux system details using inxi][1] + +**Inxi** is a free, open source, and full featured command line system information tool. It shows system hardware, CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and a wide variety of other useful information. Be it a hard disk or CPU, mother board or the complete detail of the entire system, inxi will display it more accurately in seconds. Since it is CLI tool, you can use it in Desktop or server edition. Inxi is available in the default repositories of most Linux distributions and some BSD systems. + +### Install inxi + +**On Arch Linux and derivatives:** + +To install inxi in Arch Linux or its derivatives like Antergos, and Manajaro Linux, run: + +``` +$ sudo pacman -S inxi +``` + +Just in case if Inxi is not available in the default repositories, try to install it from AUR (It varies year to year) using any AUR helper programs. + +Using [**Yay**][2]: + +``` +$ yay -S inxi +``` + +**On Debian / Ubuntu and derivatives:** + +``` +$ sudo apt-get install inxi +``` + +**On Fedora / RHEL / CentOS / Scientific Linux:** + +inxi is available in the Fedora default repositories. So, just run the following command to install it straight away. + +``` +$ sudo dnf install inxi +``` + +In RHEL and its clones like CentOS and Scientific Linux, you need to add the EPEL repository and then install inxi. + +To install EPEL repository, just run: + +``` +$ sudo yum install epel-release +``` + +After installing EPEL repository, install inxi using command: + +``` +$ sudo yum install inxi +``` + +**On SUSE/openSUSE:** + +``` +$ sudo zypper install inxi +``` + +### Find Linux System Details Using inxi + +inxi will require some additional programs to operate properly. They will be installed along with inxi. However, in case if they are not installed automatically, you need to find and install them. + +To list all required programs, run: + +``` +$ inxi --recommends +``` + +If you see any missing programs, then install them before start using inxi. + +Now, let us see how to use it to reveal the Linux system details. inxi usage is pretty simple and straight forward. + +Open up your Terminal and run the following command to print a short summary of CPU, memory, hard drive and kernel information: + +``` +$ inxi +``` + +**Sample output:** + +``` +CPU: Dual Core Intel Core i3-2350M (-MT MCP-) speed/min/max: 798/800/2300 MHz +Kernel: 5.1.2-arch1-1-ARCH x86_64 Up: 1h 31m Mem: 2800.5/7884.2 MiB (35.5%) +Storage: 465.76 GiB (80.8% used) Procs: 163 Shell: bash 5.0.7 inxi: 3.0.34 +``` + +![][3] + +Find Linux System Details Using inxi + +As you can see, Inxi displays the following details of my Arch Linux desktop: + + 1. CPU type, + 2. CPU speed, + 3. Kernel details, + 4. Uptime, + 5. Memory details (Total and used memory), + 6. Hard disk size along with current usage, + 7. Procs, + 8. Default shell details, + 9. Inxi version. + + + +To display full summary, use **“-F”** switch as shown below. + +``` +$ inxi -F +``` + +**Sample output:** + +``` +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 01HXXJ v: A05 serial: BIOS: Dell v: A05 date: 08/03/2012 +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + IF: enp5s0 state: down mac: 45:c8:gh:89:b6:45 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + IF: wlp9s0 state: up mac: c3:11:96:22:87:3g + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +Sensors: System Temperatures: cpu: 58.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3445 +Info: Processes: 169 Uptime: 1h 38m Memory: 7.70 GiB used: 2.94 GiB (38.2%) Shell: bash inxi: 3.0.34 +``` + +Inxi used on IRC automatically filters out your network device MAC address, WAN and LAN IP, your /home username directory in partitions, and a few other items in order to maintain basic privacy and security. You can also trigger this filtering with the **-z** option like below. + +``` +$ inxi -Fz +``` + +To override the IRC filter, use the **-Z** option. + +``` +$ inxi -FZ +``` + +This can be useful in debugging network connection issues online in a private chat, for example. Please be very careful while using -Z option. It will display your MAC addresses. You shouldn’t share the results got with -Z option in public forums. + +##### Displaying device-specific details + +When running inxi without any options, you will get basic details of your system, such as CPU, Memory, Kernel, Uptime, harddisk etc. + +You can, of course, narrow down the result to show specific device details using various options. Inxi has numerous options (both uppercase and lowercase). + +First, we will see example commands for all uppercase options in alphabetical order. Some commands may require root/sudo privileges to get actual data. + +####### **Uppercase options** + +**1\. Display Audio/Sound card details** + +To show your audio and sound card(s) information with sound card driver, use **-A** option. + +``` +$ inxi -A +Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel + Sound Server: ALSA v: k5.1.2-arch1-1-ARCH +``` + +**2\. Display Battery details** + +To show battery details of your system with current charge and condition, use **-B** option. + +``` +$ inxi -B +Battery: ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) +``` + +**3\. Display CPU details** + +To show complete CPU details including no of cores, CPU model, CPU cache, CPU clock speed, CPU min/max speed etc., use **-C** option. + +``` +$ inxi -C +CPU: Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB + Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 +``` + +**4\. Display hard disk details** + +To show information about your hard drive, such as Disk type, vendor, device ID, model, disk size, total disk space, used percentage etc., use **-D** option. + +``` +$ inxi -D +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB +``` + +**5\. Disply Graphics details** + +To show details about the graphics card, including details of grahics card, driver, vendor, display server, resolution etc., use **-G** option. + +``` +$ inxi -G +Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel + Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz + Message: Unable to show advanced data. Required tool glxinfo missing. +``` + +**6\. Display details about processes, uptime, memory, inxi version** + +To show information about no of processes, total uptime, total memory with used memory, Shell details and inxi version etc., use **-I** option. + +``` +$ inxi -I +Info: Processes: 170 Uptime: 5h 47m Memory: 7.70 GiB used: 3.27 GiB (42.4%) Shell: bash inxi: 3.0.34 +``` + +**7\. Display Motherboard details** + +To show information about your machine details, manufacturer, motherboard, BIOS, use **-M** option. + +``` +$ inxi -M +Machine: Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: + Mobo: Dell model: 034ygt v: A018 serial: BIOS: Dell v: A001 date: 09/04/2015 +``` + +**8\. Display network card details** + +To show information about your network card, including vendor, card driver and no of network interfaces etc., use **-N** option. + +``` +$ inxi -N +Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 + Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k + Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb +``` + +If you want to show the advanced details of the network cards, such as MAC address, speed and state of nic, use **-n** option. + +``` +$ inxi -n +``` + +Please careful sharing this details on public forum. + +**9\. Display Partition details** + +To display basic partition information, use **-P** option. + +``` +$ inxi -P +Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 + ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 + ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 +``` + +To show full partition information including mount points, use **-p** option. + +``` +$ inxi -p +``` + +**10\. Display RAID details** + +To show RAID info, use **-R** option. + +``` +$ inxi -R +``` + +**11\. Display system details** + +To show Linux system information such as hostname, kernel, DE, OS version etc., use **-S** option. + +``` +$ inxi -S +System: Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux +``` + +**12\. Displaying weather details** + +Inixi is not just for finding hardware details. It is useful for getting other stuffs too. + +For example, you can display the weather details of a given location. To do so, run inxi with **-W** option like below. + +``` +$ inxi -W 95623,us +Weather: Temperature: 21.1 C (70 F) Conditions: Scattered clouds Current Time: Tue 11 Jun 2019 04:34:35 AM PDT + Source: WeatherBit.io +``` + +Please note that you should use only ASCII letters in city/state/country names to get valid results. + +####### Lowercase options + +**1\. Display basic system details** + +To show only the basic summary of your system details, use **-b** option. + +``` +$ inxi -b +``` + +Alternatively, you can use this command: + +Both servers the same purpose. + +``` +$ inxi -v 2 +``` + +**2\. Set color scheme** + +We can set different color schemes for inxi output using **-c** option. Yu can set color scheme number from **0** to **42**. If no scheme number is supplied, **0** is assumed. + +Here is inxi output with and without **-c** option. + +![][4] + +inxi output without color scheme + +As you can see, when we run inxi with -c option, the color scheme is disabled. The -c option is useful to turnoff colored output when redirecting clean output without escape codes to a text file. + +Similarly, we can use other color scheme values. + +``` +$ inxi -c10 + +$ inxi -c42 +``` + +**3\. Display optical drive details** + +We can show the optical drive data details along with local hard drive details using **-d** option. + +``` +$ inxi -d +Drives: Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) + ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB + Optical-1: /dev/sr0 vendor: PLDS model: DVD+-RW DS-8A8SH dev-links: cdrom + Features: speed: 24 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram +``` + +**4\. Display all CPU flags** + +To show all CPU flags used, run: + +``` +$ inxi -f +``` + +**5\. Display IP details** + +To show WAN and local ip address along network card details such as device vendor, driver, mac, state etc., use **-i** option. + +``` +$ inxi -i +``` + +**6\. Display partition labels** + +If you have set labels for the partitions, you can view them using **-l** option. + +``` +$ inxi -l +``` + +You can also view the labels of all partitions along with mountpoints using command: + +``` +$ inxi -pl +``` + +**7\. Display Memory details** + +We can display memory details such as total size of installed RAM, how much memory is used, no of available DIMM slots, total size of supported RAM, how much RAM is currently installed in each slots etc., using **-m** option. + +``` +$ sudo inxi -m +[sudo] password for sk: +Memory: RAM: total: 7.70 GiB used: 2.26 GiB (29.3%) + Array-1: capacity: 16 GiB slots: 2 EC: None + Device-1: DIMM_A size: 4 GiB speed: 1067 MT/s + Device-2: DIMM_B size: 4 GiB speed: 1067 MT/s +``` + +**8\. Display unmounted partition details** + +To show unmounted partition details, use **-o** option. + +``` +$ inxi -o +``` + +If there were no unmounted partitions in your system, you will see an output something like below. + +``` +Unmounted: Message: No unmounted partitions found. +``` + +**9\. Display list of repositories** + +To display the the list of repositories in your system, use **-r** option. + +``` +$ inxi -r +``` + +**Sample output:** + +``` +Repos: Active apt sources in file: /etc/apt/sources.list +deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted +deb http://in.archive.ubuntu.com/ubuntu/ xenial universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe +deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse +deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse +deb http://security.ubuntu.com/ubuntu xenial-security main restricted +deb http://security.ubuntu.com/ubuntu xenial-security universe +deb http://security.ubuntu.com/ubuntu xenial-security multiverse +``` + +* * * + +**Suggested read:** + + * [**How To Find The List Of Installed Repositories From Commandline In Linux**][5] + + + +* * * + +**10\. Show system temperature, fan speed details** + +Inxi is capable to find motherboard/CPU/GPU temperatures and fan speed. + +``` +$ inxi -s +Sensors: System Temperatures: cpu: 60.0 C mobo: N/A + Fan Speeds (RPM): cpu: 3456 +``` + +Please note that Inxi requires sensors to find the system temperature. Make sure **lm_sensors** is installed and correctly configured in your system. For more details about lm_sensors, check the following guide. + + * [**How To View CPU Temperature On Linux**][6] + + + +**11\. Display details about processes** + +To show the list processes top 5 processes which are consuming most CPU and Memory, simply run: + +``` +$ inxi -t +Processes: CPU top: 5 + 1: cpu: 14.3% command: firefox pid: 15989 + 2: cpu: 10.5% command: firefox pid: 13487 + 3: cpu: 7.1% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 3.0% command: firefox pid: 14954 + System RAM: total: 7.70 GiB used: 2.99 GiB (38.8%) + Memory top: 5 + 1: mem: 1115.8 MiB (14.1%) command: firefox pid: 15989 + 2: mem: 606.6 MiB (7.6%) command: firefox pid: 13487 + 3: mem: 339.3 MiB (4.3%) command: firefox pid: 13630 + 4: mem: 303.1 MiB (3.8%) command: firefox pid: 18617 + 5: mem: 260.1 MiB (3.2%) command: firefox pid: 15062 +``` + +We can also sort this output by either CPU usage or Memory usage. + +For instance, to find the which top 5 processes are consuming most memory, use the following command: + +``` +$ inxi -t m +Processes: System RAM: total: 7.70 GiB used: 2.73 GiB (35.4%) + Memory top: 5 + 1: mem: 966.1 MiB (12.2%) command: firefox pid: 15989 + 2: mem: 468.2 MiB (5.9%) command: firefox pid: 13487 + 3: mem: 347.9 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 306.7 MiB (3.8%) command: firefox pid: 13630 + 5: mem: 247.2 MiB (3.1%) command: firefox pid: 15062 +``` + +To sort the top 5 processes based on CPU usage, run: + +``` +$ inxi -t c +Processes: CPU top: 5 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 +``` + +Bydefault, Inxi will display the top 5 processes. You can change the number of processes, for example 10, like below. + +``` +$ inxi -t cm10 +Processes: CPU top: 10 + 1: cpu: 14.9% command: firefox pid: 15989 + 2: cpu: 10.6% command: firefox pid: 13487 + 3: cpu: 7.0% command: firefox pid: 15062 + 4: cpu: 3.1% command: xorg pid: 13493 + 5: cpu: 2.9% command: firefox pid: 14954 + 6: cpu: 2.8% command: firefox pid: 13630 + 7: cpu: 1.8% command: firefox pid: 18325 + 8: cpu: 1.4% command: firefox pid: 18617 + 9: cpu: 1.3% command: firefox pid: 13708 + 10: cpu: 0.8% command: firefox pid: 14427 + System RAM: total: 7.70 GiB used: 2.92 GiB (37.9%) + Memory top: 10 + 1: mem: 1160.9 MiB (14.7%) command: firefox pid: 15989 + 2: mem: 475.1 MiB (6.0%) command: firefox pid: 13487 + 3: mem: 353.4 MiB (4.4%) command: firefox pid: 13708 + 4: mem: 308.0 MiB (3.9%) command: firefox pid: 13630 + 5: mem: 269.6 MiB (3.4%) command: firefox pid: 15062 + 6: mem: 249.3 MiB (3.1%) command: firefox pid: 14427 + 7: mem: 238.5 MiB (3.0%) command: firefox pid: 14954 + 8: mem: 208.2 MiB (2.6%) command: firefox pid: 18325 + 9: mem: 194.0 MiB (2.4%) command: firefox pid: 18617 + 10: mem: 143.6 MiB (1.8%) command: firefox pid: 23960 +``` + +The above command will display the top 10 processes that consumes the most CPU and Memory. + +To display only top10 based on memory usage, run: + +``` +$ inxi -t m10 +``` + +**12\. Display partition UUID details** + +To show partition UUIDs ( **U** niversally **U** nique **Id** entifier), use **-u** option. + +``` +$ inxi -u +``` + +There are much more options are yet to be covered. But, these are just enough to get almost all details of your Linux box. + +For more details and options, refer the man page. + +``` +$ man inxi +``` + +* * * + +**Related read:** + + * **[Neofetch – Display your Linux system’s information][7]** + + + +* * * + +The primary purpose of Inxi tool is to use in IRC or forum support. If you are looking for any help via a forum or website where someone is asking the specification of your system, just run this command, and copy/paste the output. + +**Resources:** + + * [**Inxi GitHub Repository**][8] + * [**Inxi home page**][9] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-find-your-system-details-using-inxi/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2016/08/inxi-520x245-1-720x340.png +[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[3]: http://www.ostechnix.com/wp-content/uploads/2016/08/Find-Linux-System-Details-Using-inxi.png +[4]: http://www.ostechnix.com/wp-content/uploads/2016/08/inxi-output-without-color-scheme.png +[5]: https://www.ostechnix.com/find-list-installed-repositories-commandline-linux/ +[6]: https://www.ostechnix.com/view-cpu-temperature-linux/ +[7]: http://www.ostechnix.com/neofetch-display-linux-systems-information/ +[8]: https://github.com/smxi/inxi +[9]: http://smxi.org/docs/inxi.htm diff --git a/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md b/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md new file mode 100644 index 0000000000..79d0b9e1a5 --- /dev/null +++ b/sources/tech/20190611 Step by Step Zorin OS 15 Installation Guide with Screenshots.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Step by Step Zorin OS 15 Installation Guide with Screenshots) +[#]: via: (https://www.linuxtechi.com/zorin-os-15-installation-guide-screenshots/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +Step by Step Zorin OS 15 Installation Guide with Screenshots +====== + +Good News for all the Zorin users out there! Zorin has launched its latest version (Zorin OS 15) of its Ubuntu based Linux distro. This version is based on Ubuntu 18.04.2, since its launch in July 2009, it is estimated that this popular distribution has reached more than 17 million downloads. Zorin is renowned for creating a distribution for beginner level users and the all new Zorin OS 15 comes packed with a lot of goodies that surely will make Zorin OS lovers happy. Let’s see some of the major enhancements made in the latest version. + +### New Features of Zorin OS 15 + +Zorin OS has always amazed users with different set of features when every version is released Zorin OS 15 is no exception as it comes with a lot of new features as outlined below: + +**Enhanced User Experience** + +The moment you look at the Zorin OS 15, you will ask whether it is a Linux distro because it looks more like a Windows OS. According to Zorin, it wanted Windows users to get ported to Linux in a more user-friendly manner. And it features a Windows like Start menu, quick app launchers, a traditional task bar section, system tray etc. + +**Zorin Connect** + +Another major highlight of Zorin OS 15 is the ability to integrate your Android Smartphones seamlessly with your desktop using the Zorin Connect application. With your phone connected, you can share music, videos and other files between your phone and desktop. You can even use your phone as a mouse to control the desktop. You can also easily control the media playback in your desktop from your phone itself. Quickly reply to all your messages and notifications sent to your phone from your desktop. + +**New GTK Theme** + +Zorin OS 15 ships with an all new GTK Theme that has been exclusively built for this distro and the theme is available in 6 different colors along with the hugely popular dark theme. Another highlight is that the OS automatically detects the time of the day and changes the desktop theme accordingly. Say for example, during sunset it switches to a dark theme whereas in the morning it switches to bright theme automatically. + +**Other New Features:** + +Zorin OS 15 comes packed with a lot of new features including: + + * Compatible with Thunderbolt 3.0 devices + * Supports color emojis + * Comes with an upgraded Linux Kernel 4.18 + * Customized settings available for application menu and task bar + * System font changed to Inter + * Supports renaming bulk files + + + +### Minimum system requirements for Zorin OS 15 (Core): + + * Dual Core 64-bit (1GHZ) + * 2 GB RAM + * 10 GB free disk space + * Internet Connection Optional + * Display (800×600) + + + +### Step by Step Guide to Install Zorin OS 15 (Core) + +Before you start installing Zorin OS 15, ensure you have a copy of the Zorin OS 15 downloaded in your system. If not download then refer official website of [Zorin OS 15][1]. Remember this Linux distribution is available in 4 versions including: + + * Ultimate (Paid Version) + * Core (Free Version) + * Lite (Free Version) + * Education (Free Version) + + + +Note: In this article I will demonstrate Zorin OS 15 Core Installation Steps + +### Step 1) Create Zorin OS 15 Bootable USB Disk + +Once you have downloaded Zorin OS 15, copy the ISO into an USB disk and create a bootable disk. Change our system settings to boot using an USB disk and restart your system. Once you restart your system, you will see the screen as shown below. Click “ **Install or Try Zorin OS** ” + + + +### Step 2) Choose Install Zorin OS + +In the next screen, you will be shown option to whether install Zorin OS 15 or to try Zorin OS. Click “ **Install Zorin OS** ” to continue the installation process. + + + +### Step 3) Choose Keyboard Layout + +Next step is to choose your keyboard layout. By default, English (US) is selected and if you want to choose a different language, then choose it and click “ **Continue** ” + + + +### Step 4) Download Updates and Other Software + +In the next screen, you will be asked whether you need to download updates while you are installing Zorin OS and install other 3rd party applications. In case your system is connected to internet then you can select both of these options, but by doing so your installation time increases considerably, or if you don’t want to install updates and third party software during the installation then untick both these options and click “Continue” + + + +### Step 5) Choose Zorin OS 15 Installation Method + +If you are new to Linux and want fresh installation and don’t want to customize partitions, then better choose option “ **Erase disk and install Zorin OS** ” + +If you want to create customize partitions for Zorin OS then choose “ **Something else** “, In this tutorial I will demonstrate how to create customize partition scheme for Zorin OS 15 installation, + +So, choose “ **Something else** ” option and then click on Continue + + + + + +As we can see we have around 42 GB disk available for Zorin OS, We will be creating following partitions, + + * /boot = 2 GB (ext4 file system) + * /home = 20 GB (ext4 file system) + * / = 10 GB (ext4 file system) + * /var = 7 GB (ext4 file system) + * Swap = 2 GB (ext4 file system) + + + +To start creating partitions, first click on “ **New Partition Table** ” and it will show it is going to create empty partition table, click on continue + + + +In the next screen we will see that we have now 42 GB free space on disk (/dev/sda), so let’s create our first partition as /boot, + +Select the free space, then click on + symbol and then specify the partition size as 2048 MB, file system type as ext4 and mount point as /boot, + + + +Click on OK + +Now create our next partition /home of size 20 GB (20480 MB), + + + +Similarly create our next two partition / and /var of size 10 and 7 GB respectively, + + + + + +Let’s create our last partition as swap of size 2 GB + + + +Click on OK + +Choose “ **Install Now** ” option in next window, + + + +In next window, choose “Continue” to write changes to disk and to proceed with installation + + + +### Step 6) Choose Your Preferred Location + +In the next screen, you will be asked to choose your location and click “Continue” + + + +### Step 7) Provide User Credentials + +In the next screen, you’ll be asked to enter the user credentials including your name, computer name, + +Username and password. Once you are done, click “Continue” to proceed with the installation process. + + + +### Step 8) Installing Zorin OS 15 + +Once you click continue, you can see that the Zorin OS 15 starts installing and it may take some time to complete the installation process. + + + +### Step 9) Restart your system after Successful Installation + +Once the installation process is completed, it will ask to restart your computer. Hit “ **Restart Now** ” + + + +### Step 10) Login to Zorin OS 15 + +Once the system restarts, you will be asked to login into the system using the login credentials provided earlier. + +Note: Don’t forget to change the boot medium from bios so that system boots up with disk. + + + +### Step 11) Zorin OS 15 Welcome Screen + +Once your login is successful, you can see the Zorin OS 15 welcome screen. Now you can start exploring all the incredible features of Zorin OS 15. + + + +That’s all from this tutorial, please do share feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/zorin-os-15-installation-guide-screenshots/ + +作者:[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://zorinos.com/download/ diff --git a/sources/tech/20190611 What is a Linux user.md b/sources/tech/20190611 What is a Linux user.md new file mode 100644 index 0000000000..c7d52b521c --- /dev/null +++ b/sources/tech/20190611 What is a Linux user.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: (qfzy1233 ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is a Linux user?) +[#]: via: (https://opensource.com/article/19/6/what-linux-user) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva/users/petercheer/users/ansilva/users/greg-p/users/ansilva/users/ansilva/users/bcotton/users/ansilva/users/seth/users/ansilva/users/don-watkins/users/ansilva/users/seth) + +What is a Linux user? +====== +The definition of who is a "Linux user" has grown to be a bigger tent, +and it's a great change. +![][1] + +> _Editor's note: this article was updated on Jun 11, 2019, at 1:15:19 PM to more accurately reflect the author's perspective on an open and inclusive community of practice in the Linux community._ + +In only two years, the Linux kernel will be 30 years old. Think about that! Where were you in 1991? Were you even born? I was 13! Between 1991 and 1993 a few Linux distributions were created, and at least three of them—Slackware, Debian, and Red Hat–provided the [backbone][2] the Linux movement was built on. + +Getting a copy of a Linux distribution and installing and configuring it on a desktop or server was very different back then than today. It was hard! It was frustrating! It was an accomplishment if you got it running! We had to fight with incompatible hardware, configuration jumpers on devices, BIOS issues, and many other things. Even if the hardware was compatible, many times, you still had to compile the kernel, modules, and drivers to get them to work on your system. + +If you were around during those days, you are probably nodding your head. Some readers might even call them the "good old days," because choosing to use Linux meant you had to learn about operating systems, computer architecture, system administration, networking, and even programming, just to keep the OS functioning. I am not one of them though: Linux being a regular part of everyone's technology experience is one of the most amazing changes in our industry! + +Almost 30 years later, Linux has gone far beyond the desktop and server. You will find Linux in automobiles, airplanes, appliances, smartphones… virtually everywhere! You can even purchase laptops, desktops, and servers with Linux preinstalled. If you consider cloud computing, where corporations and even individuals can deploy Linux virtual machines with the click of a button, it's clear how widespread the availability of Linux has become. + +With all that in mind, my question for you is: **How do you define a "Linux user" today?** + +If you buy your parent or grandparent a Linux laptop from System76 or Dell, log them into their social media and email, and tell them to click "update system" every so often, they are now a Linux user. If you did the same with a Windows or MacOS machine, they would be Windows or MacOS users. It's incredible to me that, unlike the '90s, Linux is now a place for anyone and everyone to compute. + +In many ways, this is due to the web browser becoming the "killer app" on the desktop computer. Now, many users don't care what operating system they are using as long as they can get to their app or service. + +How many people do you know who use their phone, desktop, or laptop regularly but can't manage files, directories, and drivers on their systems? How many can't install a binary that isn't attached to an "app store" of some sort? How about compiling an application from scratch?! For me, it's almost no one. That's the beauty of open source software maturing along with an ecosystem that cares about accessibility. + +Today's Linux user is not required to know, study, or even look up information as the Linux user of the '90s or early 2000s did, and that's not a bad thing. The old imagery of Linux being exclusively for bearded men is long gone, and I say good riddance. + +There will always be room for a Linux user who is interested, curious, _fascinated_ about computers, operating systems, and the idea of creating, using, and collaborating on free software. There is just as much room for creative open source contributors on Windows and MacOS these days as well. Today, being a Linux user is being anyone with a Linux system. And that's a wonderful thing. + +### The change to what it means to be a Linux user + +When I started with Linux, being a user meant knowing how to the operating system functioned in every way, shape, and form. Linux has matured in a way that allows the definition of "Linux users" to encompass a much broader world of possibility and the people who inhabit it. It may be obvious to say, but it is important to say clearly: anyone who uses Linux is an equal Linux user. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-linux-user + +作者:[Anderson Silva][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/ansilva/users/petercheer/users/ansilva/users/greg-p/users/ansilva/users/ansilva/users/bcotton/users/ansilva/users/seth/users/ansilva/users/don-watkins/users/ansilva/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_penguin_green.png?itok=ENdVzW22 +[2]: https://en.wikipedia.org/wiki/Linux_distribution#/media/File:Linux_Distribution_Timeline.svg diff --git a/sources/tech/20190612 How to write a loop in Bash.md b/sources/tech/20190612 How to write a loop in Bash.md new file mode 100644 index 0000000000..f63bff9cd3 --- /dev/null +++ b/sources/tech/20190612 How to write a loop in Bash.md @@ -0,0 +1,282 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a loop in Bash) +[#]: via: (https://opensource.com/article/19/6/how-write-loop-bash) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth) + +How to write a loop in Bash +====== +Automatically perform a set of actions on multiple files with for loops +and find commands. +![bash logo on green background][1] + +A common reason people want to learn the Unix shell is to unlock the power of batch processing. If you want to perform some set of actions on many files, one of the ways to do that is by constructing a command that iterates over those files. In programming terminology, this is called _execution control,_ and one of the most common examples of it is the **for** loop. + +A **for** loop is a recipe detailing what actions you want your computer to take _for_ each data object (such as a file) you specify. + +### The classic for loop + +An easy loop to try is one that analyzes a collection of files. This probably isn't a useful loop on its own, but it's a safe way to prove to yourself that you have the ability to handle each file in a directory individually. First, create a simple test environment by creating a directory and placing some copies of some files into it. Any file will do initially, but later examples require graphic files (such as JPEG, PNG, or similar). You can create the folder and copy files into it using a file manager or in the terminal: + + +``` +$ mkdir example +$ cp ~/Pictures/vacation/*.{png,jpg} example +``` + +Change directory to your new folder, then list the files in it to confirm that your test environment is what you expect: + + +``` +$ cd example +$ ls -1 +cat.jpg +design_maori.png +otago.jpg +waterfall.png +``` + +The syntax to loop through each file individually in a loop is: create a variable ( **f** for file, for example). Then define the data set you want the variable to cycle through. In this case, cycle through all files in the current directory using the ***** wildcard character (the ***** wildcard matches _everything_ ). Then terminate this introductory clause with a semicolon ( **;** ). + + +``` +`$ for f in * ;` +``` + +Depending on your preference, you can choose to press **Return** here. The shell won't try to execute the loop until it is syntactically complete. + +Next, define what you want to happen with each iteration of the loop. For simplicity, use the **file** command to get a little bit of data about each file, represented by the **f** variable (but prepended with a **$** to tell the shell to swap out the value of the variable for whatever the variable currently contains): + + +``` +`do file $f ;` +``` + +Terminate the clause with another semi-colon and close the loop: + + +``` +`done` +``` + +Press **Return** to start the shell cycling through _everything_ in the current directory. The **for** loop assigns each file, one by one, to the variable **f** and runs your command: + + +``` +$ for f in * ; do +> file $f ; +> done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +You can also write it this way: + + +``` +$ for f in *; do file $f; done +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +Both the multi-line and single-line formats are the same to your shell and produce the exact same results. + +### A practical example + +Here's a practical example of how a loop can be useful for everyday computing. Assume you have a collection of vacation photos you want to send to friends. Your photo files are huge, making them too large to email and inconvenient to upload to your [photo-sharing service][2]. You want to create smaller web-versions of your photos, but you have 100 photos and don't want to spend the time reducing each photo, one by one. + +First, install the **ImageMagick** command using your package manager on Linux, BSD, or Mac. For instance, on Fedora and RHEL: + + +``` +`$ sudo dnf install ImageMagick` +``` + +On Ubuntu or Debian: + + +``` +`$ sudo apt install ImageMagick` +``` + +On BSD, use **ports** or [pkgsrc][3]. On Mac, use [Homebrew][4] or [MacPorts][5]. + +Once you install ImageMagick, you have a set of new commands to operate on photos. + +Create a destination directory for the files you're about to create: + + +``` +`$ mkdir tmp` +``` + +To reduce each photo to 33% of its original size, try this loop: + + +``` +`$ for f in * ; do convert $f -scale 33% tmp/$f ; done` +``` + +Then look in the **tmp** folder to see your scaled photos. + +You can use any number of commands within a loop, so if you need to perform complex actions on a batch of files, you can place your whole workflow between the **do** and **done** statements of a **for** loop. For example, suppose you want to copy each processed photo straight to a shared photo directory on your web host and remove the photo file from your local system: + + +``` +$ for f in * ; do +convert $f -scale 33% tmp/$f +scp -i seth_web tmp/$f [seth@example.com][6]:~/public_html +trash tmp/$f ; +done +``` + +For each file processed by the **for** loop, your computer automatically runs three commands. This means if you process just 10 photos this way, you save yourself 30 commands and probably at least as many minutes. + +### Limiting your loop + +A loop doesn't always have to look at every file. You might want to process only the JPEG files in your example directory: + + +``` +$ for f in *.jpg ; do convert $f -scale 33% tmp/$f ; done +$ ls -m tmp +cat.jpg, otago.jpg +``` + +Or, instead of processing files, you may need to repeat an action a specific number of times. A **for** loop's variable is defined by whatever data you provide it, so you can create a loop that iterates over numbers instead of files: + + +``` +$ for n in {0..4}; do echo $n ; done +0 +1 +2 +3 +4 +``` + +### More looping + +You now know enough to create your own loops. Until you're comfortable with looping, use them on _copies_ of the files you want to process and, as often as possible, use commands with built-in safeguards to prevent you from clobbering your data and making irreparable mistakes, like accidentally renaming an entire directory of files to the same name, each overwriting the other. + +For advanced **for** loop topics, read on. + +### Not all shells are Bash + +The **for** keyword is built into the Bash shell. Many similar shells use the same keyword and syntax, but some shells, like [tcsh][7], use a different keyword, like **foreach** , instead. + +In tcsh, the syntax is similar in spirit but more strict than Bash. In the following code sample, do not type the string **foreach?** in lines 2 and 3. It is a secondary prompt alerting you that you are still in the process of building your loop. + + +``` +$ foreach f (*) +foreach? file $f +foreach? end +cat.jpg: JPEG image data, EXIF standard 2.2 +design_maori.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +otago.jpg: JPEG image data, EXIF standard 2.2 +waterfall.png: PNG image data, 4608 x 2592, 8-bit/color RGB, non-interlaced +``` + +In tcsh, both **foreach** and **end** must appear alone on separate lines, so you cannot create a **for** loop on one line as you can with Bash and similar shells. + +### For loops with the find command + +In theory, you could find a shell that doesn't provide a **for** loop function, or you may just prefer to use a different command with added features. + +The **find** command is another way to implement the functionality of a **for** loop, as it offers several ways to define the scope of which files to include in your loop as well as options for [Parallel][8] processing. + +The **find** command is meant to help you find files on your hard drives. Its syntax is simple: you provide the path of the location you want to search, and **find** finds all files and directories: + + +``` +$ find . +. +./cat.jpg +./design_maori.png +./otago.jpg +./waterfall.png +``` + +You can filter the search results by adding some portion of the name: + + +``` +$ find . -name "*jpg" +./cat.jpg +./otago.jpg +``` + +The great thing about **find** is that each file it finds can be fed into a loop using the **-exec** flag. For instance, to scale down only the PNG photos in your example directory: + + +``` +$ find . -name "*png" -exec convert {} -scale 33% tmp/{} \; +$ ls -m tmp +design_maori.png, waterfall.png +``` + +In the **-exec** clause, the bracket characters **{}** stand in for whatever item **find** is processing (in other words, any file ending in PNG that has been located, one at a time). The **-exec** clause must be terminated with a semicolon, but Bash usually tries to use the semicolon for itself. You "escape" the semicolon with a backslash ( **\;** ) so that **find** knows to treat that semicolon as its terminating character. + +The **find** command is very good at what it does, and it can be too good sometimes. For instance, if you reuse it to find PNG files for another photo process, you will get a few errors: + + +``` +$ find . -name "*png" -exec convert {} -flip -flop tmp/{} \; +convert: unable to open image `tmp/./tmp/design_maori.png': +No such file or directory @ error/blob.c/OpenBlob/2643. +... +``` + +It seems that **find** has located all the PNG files—not only the ones in your current directory ( **.** ) but also those that you processed before and placed in your **tmp** subdirectory. In some cases, you may want **find** to search the current directory plus all other directories within it (and all directories in _those_ ). It can be a powerful recursive processing tool, especially in complex file structures (like directories of music artists containing directories of albums filled with music files), but you can limit this with the **-maxdepth** option. + +To find only PNG files in the current directory (excluding subdirectories): + + +``` +`$ find . -maxdepth 1 -name "*png"` +``` + +To find and process files in the current directory plus an additional level of subdirectories, increment the maximum depth by 1: + + +``` +`$ find . -maxdepth 2 -name "*png"` +``` + +Its default is to descend into all subdirectories. + +### Looping for fun and profit + +The more you use loops, the more time and effort you save, and the bigger the tasks you can tackle. You're just one user, but with a well-thought-out loop, you can make your computer do the hard work. + +You can and should treat looping like any other command, keeping it close at hand for when you need to repeat a single action or two on several files. However, it's also a legitimate gateway to serious programming, so if you have to accomplish a complex task on any number of files, take a moment out of your day to plan out your workflow. If you can achieve your goal on one file, then wrapping that repeatable process in a **for** loop is relatively simple, and the only "programming" required is an understanding of how variables work and enough organization to separate unprocessed from processed files. With a little practice, you can move from a Linux user to a Linux user who knows how to write a loop, so get out there and make your computer work for you! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-write-loop-bash + +作者:[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/users/goncasousa/users/howtopamm/users/howtopamm/users/seth/users/wavesailor/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: http://nextcloud.com +[3]: http://pkgsrc.org +[4]: http://brew.sh +[5]: https://www.macports.org +[6]: mailto:seth@example.com +[7]: https://en.wikipedia.org/wiki/Tcsh +[8]: https://opensource.com/article/18/5/gnu-parallel diff --git a/sources/tech/20190612 The bits and bytes of PKI.md b/sources/tech/20190612 The bits and bytes of PKI.md new file mode 100644 index 0000000000..3cf9bd9c41 --- /dev/null +++ b/sources/tech/20190612 The bits and bytes of PKI.md @@ -0,0 +1,284 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The bits and bytes of PKI) +[#]: via: (https://opensource.com/article/19/6/bits-and-bytes-pki) +[#]: author: (Alex Wood https://opensource.com/users/awood) + +The bits and bytes of PKI +====== +Take a look under the public key infrastructure's hood to get a better +understanding of its format. +![Computer keyboard typing][1] + +In two previous articles— _[An introduction to cryptography and public key infrastructure][2]_ and _[How do private keys work in PKI and cryptography?][3]_ —I discussed cryptography and public key infrastructure (PKI) in a general way. I talked about how digital bundles called _certificates_ store public keys and identifying information. These bundles contain a lot of complexity, and it's useful to have a basic understanding of the format for when you need to look under the hood. + +### Abstract art + +Keys, certificate signing requests, certificates, and other PKI artifacts define themselves in a data description language called [Abstract Syntax Notation One][4] (ASN.1). ASN.1 defines a series of simple data types (integers, strings, dates, etc.) along with some structured types (sequences, sets). By using those types as building blocks, we can create surprisingly complex data formats. + +ASN.1 contains plenty of pitfalls for the unwary, however. For example, it has two different ways of representing dates: GeneralizedTime ([ISO 8601][5] format) and UTCTime (which uses a two-digit year). Strings introduce even more confusion. We have IA5String for ASCII strings and UTF8String for Unicode strings. ASN.1 also defines several other string types, from the exotic [T61String][6] and [TeletexString][7] to the more innocuous sounding—but probably not what you wanted—PrintableString (only a small subset of ASCII) and UniversalString (encoded in [UTF-32][8]). If you're writing or reading ASN.1 data, I recommend referencing the [specification][9]. + +ASN.1 has another data type worth special mention: the object identifier (OID). OIDs are a series of integers. Commonly they are shown with periods delimiting them. Each integer represents a node in what is basically a "tree of things." For example, [1.3.6.1.4.1.2312][10] is the OID for my employer, Red Hat, where "1" is the node for the International Organization for Standardization (ISO), "3" is for ISO-identified organizations, "6" is for the US Department of Defense (which, for historical reasons, is the parent to the next node), "1" is for the internet, "4" is for private organizations, "1" is for enterprises, and finally "2312," which is Red Hat's own. + +More commonly, OIDs are regularly used to identify specific algorithms in PKI objects. If you have a digital signature, it's not much use if you don't know what type of signature it is. The signature algorithm "sha256WithRSAEncryption" has the OID "1.2.840.113549.1.1.11," for example. + +### ASN.1 at work + +Suppose we own a factory that produces flying brooms, and we need to store some data about every broom. Our brooms have a model name, a serial number, and a series of inspections that have been made to ensure flight-worthiness. We could store this information using ASN.1 like so: + + +``` +BroomInfo ::= SEQUENCE { +model UTF8String, +serialNumber INTEGER, +inspections SEQUENCE OF InspectionInfo +} + +InspectionInfo ::= SEQUENCE { +inspectorName UTF8String, +inspectionDate GeneralizedTime +} +``` + +The example above defines the model name as a UTF8-encoded string, the serial number as an integer, and our inspections as a series of InspectionInfo items. Then we see that each InspectionInfo item comprises two pieces of data: the inspector's name and the time of the inspection. + +An actual instance of BroomInfo data would look something like this in ASN.1's value assignment syntax: + + +``` +broom BroomInfo ::= { +model "Nimbus 2000", +serialNumber 1066, +inspections { +{ +inspectorName "Harry", +inspectionDate "201901011200Z" +} +{ +inspectorName "Hagrid", +inspectionDate "201902011200Z" +} +} +} +``` + +Don't worry too much about the particulars of the syntax; for the average developer, having a basic grasp of how the pieces fit together is sufficient. + +Now let's look at a real example from [RFC 8017][11] that I have abbreviated somewhat for clarity: + + +``` +RSAPrivateKey ::= SEQUENCE { +version Version, +modulus INTEGER, -- n +publicExponent INTEGER, -- e +privateExponent INTEGER, -- d +prime1 INTEGER, -- p +prime2 INTEGER, -- q +exponent1 INTEGER, -- d mod (p-1) +exponent2 INTEGER, -- d mod (q-1) +coefficient INTEGER, -- (inverse of q) mod p +otherPrimeInfos OtherPrimeInfos OPTIONAL +} + +Version ::= INTEGER { two-prime(0), multi(1) } +(CONSTRAINED BY +{-- version must be multi if otherPrimeInfos present --}) + +OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo + +OtherPrimeInfo ::= SEQUENCE { +prime INTEGER, -- ri +exponent INTEGER, -- di +coefficient INTEGER -- ti +} +``` + +The ASN.1 above defines the PKCS #1 format used to store RSA keys. Looking at this, we can see the RSAPrivateKey sequence starts with a version type (either 0 or 1) followed by a bunch of integers and then an optional type called OtherPrimeInfos. The OtherPrimeInfos sequence contains one or more pieces of OtherPrimeInfo. And each OtherPrimeInfo is just a sequence of integers. + +Let's look at an actual instance by asking OpenSSL to generate an RSA key and then pipe it into [asn1parse][12], which will print it out in a more human-friendly format. (By the way, the **genrsa** command I'm using here has been superseded by **genpkey** ; we'll see why a little later.) + + +``` +% openssl genrsa 4096 2> /dev/null | openssl asn1parse +0:d=0 hl=4 l=2344 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=4 l= 513 prim: INTEGER :B80B0C2443... +524:d=1 hl=2 l= 3 prim: INTEGER :010001 +529:d=1 hl=4 l= 512 prim: INTEGER :59C609C626... +1045:d=1 hl=4 l= 257 prim: INTEGER :E8FC43002D... +1306:d=1 hl=4 l= 257 prim: INTEGER :CA39222DD2... +1567:d=1 hl=4 l= 256 prim: INTEGER :25F6CD181F... +1827:d=1 hl=4 l= 256 prim: INTEGER :38CCE374CB... +2087:d=1 hl=4 l= 257 prim: INTEGER :C80430E810... +``` + +Recall that RSA uses a modulus, _n_ ; a public exponent, _e_ ; and a private exponent, _d_. Now let's look at the sequence. First, we see the version set to 0 for a two-prime RSA key (what **genrsa** generates), an integer for the modulus, _n_ , and then 0x010001 for the public exponent, _e_. If we convert to decimal, we'll see our public exponent is 65537, a number [commonly][13] used as an RSA public exponent. Following the public exponent, we see the integer for the private exponent, _e_ , and then some other integers that are used to speed up decryption and signing. Explaining how this optimization works is beyond the scope of this article, but if you like math, there's a [good video on the subject][14]. + +What about that other stuff on the left side of the output? What does "h=4" and "l=513" mean? We'll cover that shortly. + +### DERangement + +We've seen the "abstract" part of Abstract Syntax Notation One, but how does this data get encoded and stored? For that, we turn to a binary format called Distinguished Encoding Rules (DER) defined in the [X.690][15] specification. DER is a stricter version of its parent, Basic Encoding Rules (BER), in that for any given data, there is only one way to encode it. If we're going to be digitally signing data, it makes things a lot easier if there is only one possible encoding that needs to be signed instead of dozens of functionally equivalent representations. + +DER uses a [tag-length-value][16] (TLV) structure. The encoding of a piece of data begins with an identifier octet defining the data's type. ("Octet" is used rather than "byte" since the standard is very old and some early architectures didn't use 8 bits for a byte.) Next are the octets that encode the length of the data, and finally, there is the data. The data can be another TLV series. The left side of the **asn1parse** output makes a little more sense now. The first number indicates the absolute offset from the beginning. The "d=" tells us the depth of that item in the structure. The first line is a sequence, which we descend into on the next line (the depth _d_ goes from 0 to 1) whereupon **asn1parse** begins enumerating all the elements in that sequence. The "hl=" is the header length (the sum of the identifier and length octets), and the "l=" tells us the length of that particular piece of data. + +How is header length determined? It's the sum of the identifier byte and the bytes encoding the length. In our example, the top sequence is 2344 octets long. If it were less than 128 octets, the length would be encoded in a single octet in the "short form": bit 8 would be a zero and bits 7 to 1 would hold the length value ( **2 7-1=127**). A value of 2344 needs more space, so the "long" form is used. The first octet has bit 8 set to one, and bits 7 to 1 contain the length of the length. In our case, a value of 2344 can be encoded in two octets (0x0928). Combined with the first "length of the length" octet, we have three octets total. Add the one identifier octet, and that gives us our total header length of four. + +As a side exercise, let's consider the largest value we could possibly encode. We've seen that we have up to 127 octets to encode a length. At 8 bits per octet, we have a total of 1008 bits to use, so we can hold a number equal to **2 1008-1**. That would equate to a content length of **2.743062*10 279** yottabytes, staggeringly more than the estimated **10 80** atoms in the observable universe. If you're interested in all the details, I recommend reading "[A Layman's Guide to a Subset of ASN.1, BER, and DER][17]." + +What about "cons" and "prim"? Those indicate whether the value is encoded with "constructed" or "primitive" encoding. Primitive encoding is used for simple types like "INTEGER" or "BOOLEAN," while constructed encoding is used for structured types like "SEQUENCE" or "SET." The actual difference between the two encoding methods is whether bit 6 in the identifier octet is a zero or one. If it's a one, the parser knows that the content octets are also DER-encoded and it can descend. + +### PEM pals + +While useful in a lot of cases, a binary format won't pass muster if we need to display the data as text. Before the [MIME][18] standard existed, attachment support was spotty. Commonly, if you wanted to attach data, you put it in the body of the email, and since SMTP only supported ASCII, that meant converting your binary data (like the DER of your public key, for example) into ASCII characters. + +Thus, the PEM format emerged. PEM stands for "Privacy-Enhanced Email" and was an early standard for transmitting and storing PKI data. The standard never caught on, but the format it defined for storage did. PEM-encoded objects are just DER objects that are [base64][19]-encoded and wrapped at 64 characters per line. To describe the type of object, a header and footer surround the base64 string. You'll see **\-----BEGIN CERTIFICATE-----** or **\-----BEGIN PRIVATE KEY-----** , for example. + +Often you'll see files with the ".pem" extension. I don't find this suffix useful. The file could contain a certificate, a key, a certificate signing request, or several other possibilities. Imagine going to a sushi restaurant and seeing a menu that described every item as "fish and rice"! Instead, I prefer more informative extensions like ".crt", ".key", and ".csr". + +### The PKCS zoo + +Earlier, I showed an example of a PKCS #1-formatted RSA key. As you might expect, formats for storing certificates and signing requests also exist in various IETF RFCs. For example, PKCS #8 can be used to store private keys for many different algorithms (including RSA!). Here's some of the ASN.1 from [RFC 5208][20] for PKCS #8. (RFC 5208 has been obsoleted by RFC 5958, but I feel that the ASN.1 in RFC 5208 is easier to understand.) + + +``` +PrivateKeyInfo ::= SEQUENCE { +version Version, +privateKeyAlgorithm PrivateKeyAlgorithmIdentifier, +privateKey PrivateKey, +attributes [0] IMPLICIT Attributes OPTIONAL } + +Version ::= INTEGER + +PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier + +PrivateKey ::= OCTET STRING + +Attributes ::= SET OF Attribute +``` + +If you store your RSA private key in a PKCS #8, the PrivateKey element will actually be a DER-encoded PKCS #1! Let's prove it. Remember earlier when I used **genrsa** to generate a PKCS #1? OpenSSL can generate a PKCS #8 with the **genpkey** command, and you can specify RSA as the algorithm to use. + + +``` +% openssl genpkey -algorithm RSA | openssl asn1parse +0:d=0 hl=4 l= 629 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=2 l= 13 cons: SEQUENCE +9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption +20:d=2 hl=2 l= 0 prim: NULL +22:d=1 hl=4 l= 607 prim: OCTET STRING [HEX DUMP]:3082025B... +``` + +You may have spotted the "OBJECT" in the output and guessed that was related to OIDs. You'd be correct. The OID "1.2.840.113549.1.1.1" is assigned to RSA encryption. OpenSSL has a built-in list of common OIDs and translates them into a human-readable form for you. + + +``` +% openssl genpkey -algorithm RSA | openssl asn1parse -strparse 22 +0:d=0 hl=4 l= 604 cons: SEQUENCE +4:d=1 hl=2 l= 1 prim: INTEGER :00 +7:d=1 hl=3 l= 129 prim: INTEGER :CA6720E706... +139:d=1 hl=2 l= 3 prim: INTEGER :010001 +144:d=1 hl=3 l= 128 prim: INTEGER :05D0BEBE44... +275:d=1 hl=2 l= 65 prim: INTEGER :F215DC6B77... +342:d=1 hl=2 l= 65 prim: INTEGER :D6095CED7E... +409:d=1 hl=2 l= 64 prim: INTEGER :402C7562F3... +475:d=1 hl=2 l= 64 prim: INTEGER :06D0097B2D... +541:d=1 hl=2 l= 65 prim: INTEGER :AB266E8E51... +``` + +In the second command, I've told **asn1parse** via the **-strparse** argument to move to octet 22 and begin parsing the content's octets there as an ASN.1 object. We can clearly see that the PKCS #8's PrivateKey looks just like the PKCS #1 that we examined earlier. + +You should favor using the **genpkey** command. PKCS #8 has some features that PKCS #1 does not: PKCS #8 can store private keys for multiple different algorithms (PKCS #1 is RSA-specific), and it provides a mechanism to encrypt the private key using a passphrase and a symmetric cipher. + +Encrypted PKCS #8 objects use a different ASN.1 syntax that I'm not going to dive into, but let's take a look at an actual example and see if anything stands out. Encrypting a private key with **genpkey** requires that you specify the symmetric encryption algorithm to use. I'll use AES-256-CBC for this example and a password of "hello" (the "pass:" prefix is the way of telling OpenSSL that the password is coming in from the command line). + + +``` +% openssl genpkey -algorithm RSA -aes-256-cbc -pass pass:hello | openssl asn1parse +0:d=0 hl=4 l= 733 cons: SEQUENCE +4:d=1 hl=2 l= 87 cons: SEQUENCE +6:d=2 hl=2 l= 9 prim: OBJECT :PBES2 +17:d=2 hl=2 l= 74 cons: SEQUENCE +19:d=3 hl=2 l= 41 cons: SEQUENCE +21:d=4 hl=2 l= 9 prim: OBJECT :PBKDF2 +32:d=4 hl=2 l= 28 cons: SEQUENCE +34:d=5 hl=2 l= 8 prim: OCTET STRING [HEX DUMP]:17E6FE554E85810A +44:d=5 hl=2 l= 2 prim: INTEGER :0800 +48:d=5 hl=2 l= 12 cons: SEQUENCE +50:d=6 hl=2 l= 8 prim: OBJECT :hmacWithSHA256 +60:d=6 hl=2 l= 0 prim: NULL +62:d=3 hl=2 l= 29 cons: SEQUENCE +64:d=4 hl=2 l= 9 prim: OBJECT :aes-256-cbc +75:d=4 hl=2 l= 16 prim: OCTET STRING [HEX DUMP]:91E9536C39... +93:d=1 hl=4 l= 640 prim: OCTET STRING [HEX DUMP]:98007B264F... + +% openssl genpkey -algorithm RSA -aes-256-cbc -pass pass:hello | head -n 1 +\-----BEGIN ENCRYPTED PRIVATE KEY----- +``` + +There are a couple of interesting items here. We see our encryption algorithm is recorded with an OID starting at octet 64. There's an OID for "PBES2" (Password-Based Encryption Scheme 2), which defines a standard process for encryption and decryption, and an OID for "PBKDF2" (Password-Based Key Derivation Function 2), which defines a standard process for creating encryption keys from passwords. Helpfully, OpenSSL uses the header "ENCRYPTED PRIVATE KEY" in the PEM output. + +OpenSSL will let you encrypt a PKCS #1, but it's done in a non-standard way via a series of headers inserted into the PEM: + + +``` +% openssl genrsa -aes256 -passout pass:hello 4096 +\-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,5B2C64DC05B7C0471A278C76562FD776 +... +``` + +### In conclusion + +There's a final PKCS format you need to know about: [PKCS #12][21]. The PKCS #12 format allows for storing multiple objects all in one file. If you have a certificate and its corresponding key or a chain of certificates, you can store them together in one PKCS #12 file. Individual entries in the file can be protected with password-based encryption. + +Beyond the PKCS formats, there are other storage methods such as the Java-specific JKS format and the NSS library from Mozilla, which uses file-based databases (SQLite or Berkeley DB, depending on the version). Luckily, the PKCS formats are a lingua franca that can serve as a start or reference if you need to deal with other formats. + +If this all seems confusing, that's because it is. Unfortunately, the PKI ecosystem has a lot of sharp edges between tools that generate enigmatic error messages (looking at you, OpenSSL) and standards that have grown and evolved over the past 35 years. Having a basic understanding of how PKI objects are stored is critical if you're doing any application development that will be accessed over SSL/TLS. + +I hope this article has shed a little light on the subject and might save you from spending fruitless hours in the PKI wilderness. + +* * * + +_The author would like to thank Hubert Kario for providing a technical review._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/bits-and-bytes-pki + +作者:[Alex Wood][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/awood +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboaord_enter_writing_documentation.jpg?itok=kKrnXc5h (Computer keyboard typing) +[2]: https://opensource.com/article/18/5/cryptography-pki +[3]: https://opensource.com/article/18/7/private-keys +[4]: https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One +[5]: https://en.wikipedia.org/wiki/ISO_8601 +[6]: https://en.wikipedia.org/wiki/ITU_T.61 +[7]: https://en.wikipedia.org/wiki/Teletex +[8]: https://en.wikipedia.org/wiki/UTF-32 +[9]: https://www.itu.int/itu-t/recommendations/rec.aspx?rec=X.680 +[10]: https://www.alvestrand.no/objectid/1.3.6.1.4.1.2312.html +[11]: https://tools.ietf.org/html/rfc8017 +[12]: https://linux.die.net/man/1/asn1parse +[13]: https://www.johndcook.com/blog/2018/12/12/rsa-exponent/ +[14]: https://www.youtube.com/watch?v=NcPdiPrY_g8 +[15]: https://en.wikipedia.org/wiki/X.690 +[16]: https://en.wikipedia.org/wiki/Type-length-value +[17]: http://luca.ntop.org/Teaching/Appunti/asn1.html +[18]: https://www.theguardian.com/technology/2012/mar/26/ather-of-the-email-attachment +[19]: https://en.wikipedia.org/wiki/Base64 +[20]: https://tools.ietf.org/html/rfc5208 +[21]: https://tools.ietf.org/html/rfc7292 diff --git a/sources/tech/20190612 Why --1-, -7-, -11--.map(parseInt) returns -1, NaN, 3- in Javascript.md b/sources/tech/20190612 Why --1-, -7-, -11--.map(parseInt) returns -1, NaN, 3- in Javascript.md new file mode 100644 index 0000000000..4e892a4610 --- /dev/null +++ b/sources/tech/20190612 Why --1-, -7-, -11--.map(parseInt) returns -1, NaN, 3- in Javascript.md @@ -0,0 +1,205 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in Javascript) +[#]: via: (https://medium.com/dailyjs/parseint-mystery-7c4368ef7b21) +[#]: author: (Eric Tong https://medium.com/@erictongs) + +Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in Javascript +====== +![][1]![][2]??? + +**Javascript is weird.** Don’t believe me? Try converting an array of strings into integers using map and parseInt. Fire up your console (F12 on Chrome), paste in the following, and press enter (or run the pen below). + +``` +['1', '7', '11'].map(parseInt); +``` + +Instead of giving us an array of integers `[1, 7, 11]`, we end up with `[1, NaN, 3]`. What? To find out what on earth is going on, we’ll first have to talk about some Javascript concepts. If you’d like a TLDR, I’ve included a quick summary at the end of this story. + +### Truthiness & Falsiness + +Here’s a simple if-else statement in Javascript: + +``` +if (true) { + // this always runs +} else { + // this never runs +} +``` + +In this case, the condition of the if-else statement is true, so the if-block is always executed and the else-block is ignored. This is a trivial example because true is a boolean. What if we put a non-boolean as the condition? + +``` +if ("hello world") { + // will this run? + console.log("Condition is truthy"); +} else { + // or this? + console.log("Condition is falsy"); +} +``` + +Try running this code in your developer’s console (F12 on Chrome). You should find that the if-block runs. This is because the string object `"hello world"` is truthy. + +Every Javascript object is either **truthy** or **falsy**. When placed in a boolean context, such as an if-else statement, objects are treated as true or false based on their truthiness. So which objects are truthy and which are falsy? Here’s a simple rule to follow: + +**All values are truthy except for:** `false` **,** `0` **,** `""` **(empty string),** `null` **,** `undefined` **, and** `NaN` **.** + +Confusingly, this means that the string `"false"`, the string `"0"`, an empty object `{}`, and an empty array `[]` are all truthy. You can double check this by passing an object into the Boolean function (e.g. `Boolean("0");`). + +For our purposes, it is enough to remember that `0` is falsy. + +### Radix + +``` +0 1 2 3 4 5 6 7 8 9 10 +``` + +When we count from zero to nine, we have different symbols for each of the numbers (0–9). However, once we reach ten, we need two different symbols (1 and 0) to represent the number. This is because our decimal counting system has a radix (or base) of ten. + +Radix is the smallest number which can only be represented by more than one symbol. **Different counting systems have different radixes, and so, the same digits can refer to different numbers in counting systems.** + +``` +DECIMAL BINARY HEXADECIMAL +RADIX=10 RADIX=2 RADIX=16 +0 0 0 +1 1 1 +2 10 + 2 +3 +11 3 +4 100 4 +5 101 5 +6 110 6 +7 111 7 +8 1000 8 +9 1001 9 +10 1010 A +11 1011 B +12 1100 C +13 1101 D +14 1110 E +15 1111 F +16 10000 10 +17 10001 +11 +``` + +For example, looking at the table above, we see that the same digits 11 can mean different numbers in different counting systems. If the radix is 2, then it refers to the number 3. If the radix is 16, then it refers to the number 17. + +You may have noticed that in our example, parseInt returned 3 when the input is 11, which corresponds to the Binary column in the table above. + +### Function arguments + +Functions in Javascript can be called with any number of arguments, even if they do not equal the number of declared function parameters. Missing arguments are treated as undefined and extra arguments are ignored (but stored in the array-like [arguments object][3]). + +``` +function foo(x, y) { + console.log(x); + console.log(y); +} +foo(1, 2); // logs 1, 2 +foo(1); // logs 1, undefined +foo(1, 2, 3); // logs 1, 2 +``` + +### map() + +We’re almost there! + +Map is a method in the Array prototype that returns a new array of the results of passing each element of the original array into a function. For example, the following code multiplies each element in the array by 3: + +``` +function multiplyBy3(x) { + return x * 3; +} +const result = [1, 2, 3, 4, 5].map(multiplyBy3);console.log(result); // logs [3, 6, 9, 12, 15]; +``` + +Now, let’s say I want to log each element using `map()` (with no return statements). I should be able to pass `console.log` as an argument into `map()`… right? + +``` +[1, 2, 3, 4, 5].map(console.log); +``` + +![][4]![][5] + +Something very strange is going on. Instead of logging just the value, each `console.log` call also logged the index and full array. + +``` +[1, 2, 3, 4, 5].map(console.log);// The above is equivalent to[1, 2, 3, 4, 5].map( + (val, index, array) => console.log(val, index, array) +); +// and not equivalent to[1, 2, 3, 4, 5].map( + val => console.log(val) +); +``` + +When a function is passed into `map()`, for each iteration, **three arguments are passed into the function** : `currentValue`, `currentIndex`, and the full `array`. That is why three entries are logged for each iteration. + +We now have all the pieces we need to solve this mystery. + +### Bringing it together + +ParseInt takes two arguments: `string` and `radix`. If the radix provided is falsy, then by default, radix is set to 10. + +``` +parseInt('11'); => 11 +parseInt('11', 2); => 3 +parseInt('11', 16); => 17 +parseInt('11', undefined); => 11 (radix is falsy) +parseInt('11', 0); => 11 (radix is falsy) +``` + +Now let’s run our example step-by-step. + +``` +['1', '7', '11'].map(parseInt); => [1, NaN, 3]// First iteration: val = '1', index = 0, array = ['1', '7', '11']parseInt('1', 0, ['1', '7', '11']); => 1 +``` + +Since 0 is falsy, the radix is set to the default value 10. `parseInt()` only takes two arguments, so the third argument `['1', '7', '11']` is ignored. The string `'1'` in radix 10 refers to the number 1. + +``` +// Second iteration: val = '7', index = 1, array = ['1', '7', '11']parseInt('7', 1, ['1', '7', '11']); => NaN +``` + +In a radix 1 system, the symbol `'7'` does not exist. As with the first iteration, the last argument is ignored. So, `parseInt()` returns `NaN`. + +``` +// Third iteration: val = '11', index = 2, array = ['1', '7', '11']parseInt('11', 2, ['1', '7', '11']); => 3 +``` + +In a radix 2 (binary) system, the symbol `'11'` refers to the number 3. The last argument is ignored. + +### Summary (TLDR) + +`['1', '7', '11'].map(parseInt)` doesn’t work as intended because `map` passes three arguments into `parseInt()` on each iteration. The second argument `index` is passed into parseInt as a `radix` parameter. So, each string in the array is parsed using a different radix. `'7'` is parsed as radix 1, which is `NaN`, `'11'` is parsed as radix 2, which is 3. `'1'` is parsed as the default radix 10, because its index 0 is falsy. + +And so, the following code will work as intended: + +``` +['1', '7', '11'].map(numStr => parseInt(numStr)); +``` + +-------------------------------------------------------------------------------- + +via: https://medium.com/dailyjs/parseint-mystery-7c4368ef7b21 + +作者:[Eric Tong][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://medium.com/@erictongs +[b]: https://github.com/lujun9972 +[1]: https://miro.medium.com/max/60/1*uq5ZTlw6HLRRqbHaPYYL0g.png?q=20 +[2]: https://miro.medium.com/max/1400/1*uq5ZTlw6HLRRqbHaPYYL0g.png +[3]: https://javascriptweblog.wordpress.com/2011/01/18/javascripts-arguments-object-and-beyond/ +[4]: https://miro.medium.com/max/60/1*rbrCQ_aNOft_OjayDtL6xg.png?q=20 +[5]: https://miro.medium.com/max/1400/1*rbrCQ_aNOft_OjayDtL6xg.png diff --git a/sources/tech/20190612 Why use GraphQL.md b/sources/tech/20190612 Why use GraphQL.md new file mode 100644 index 0000000000..f9210b02e4 --- /dev/null +++ b/sources/tech/20190612 Why use GraphQL.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: (Flowsnow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why use GraphQL?) +[#]: via: (https://opensource.com/article/19/6/why-use-graphql) +[#]: author: (Zach Lendon https://opensource.com/users/zachlendon/users/goncasousa/users/patrickhousley) + +Why use GraphQL? +====== +Here's why GraphQL is gaining ground on standard REST API technology. +![][1] + +[GraphQL][2], as I wrote [previously][3], is a next-generation API technology that is transforming both how client applications communicate with backend systems and how backend systems are designed. + +As a result of the support that began with the organization that founded it, Facebook, and continues with the backing of other technology giants such as Github, Twitter, and AirBnB, GraphQL's place as a linchpin technology for application systems seems secure; both now and long into the future. + +### GraphQL's ascent + +The rise in importance of mobile application performance and organizational agility has provided booster rockets for GraphQL's ascent to the top of modern enterprise architectures. + +Given that [REST][4] is a wildly popular architectural style that already allows mechanisms for data interaction, what advantages does this new technology provide over [REST][4]? The ‘QL’ in GraphQL stands for query language, and that is a great place to start. + +The ease at which different client applications within an organization can query only the data they need with GraphQL usurps alternative REST approaches and delivers real-world application performance boosts. With traditional [REST][4] API endpoints, client applications interrogate a server resource, and receive a response containing all the data that matches the request. If a successful response from a [REST][4] API endpoint returns 35 fields, the client application receives 35 fields + +### Fetching problems + +[REST][4] APIs traditionally provide no clean way for client applications to retrieve or update only the data they care about. This is often described as the “over-fetching” problem. With the prevalence of mobile applications in people’s day to day lives, the over-fetching problem has real world consequences. Every request a mobile application needs to make, every byte it has to send and receive, has an increasingly negative performance impact for end users. Users with slower data connections are particularly affected by suboptimal API design choices. Customers who experience poor performance using mobile applications are more likely to not purchase products and use services. Inefficient API designs cost companies money. + +“Over-fetching” isn’t alone - it has a partner in crime - “under-fetching”. Endpoints that, by default, return only a portion of the data a client actually needs require clients to make additional calls to satisfy their data needs - which requires additional HTTP requests. Because of the over and under fetching problems and their impact on client application performance, an API technology that facilitates efficient fetching has a chance to catch fire in the marketplace - and GraphQL has boldly jumped in and filled that void. + +### REST's response + +[REST][4] API designers, not willing to go down without a fight, have attempted to counter the mobile application performance problem through a mix of: + + * “include” and “exclude” query parameters, allowing client applications to specify which fields they want through a potentially long query format. + * “Composite” services, which combine multiple endpoints in a way that allow client applications to be more efficient in the number of requests they make and the data they receive. + + + +While these patterns are a valiant attempt by the [REST][4] API community to address challenges mobile clients face, they fall short in a few key regards, namely: + + * Include and exclude query key/value pairs quickly get messy, in particular for deeper object graphs that require a nested dot notation syntax (or similar) to target data to include and exclude. Additionally, debugging issues with the query string in this model often requires manually breaking up a URL. + * Server implementations for include and exclude queries are often custom, as there is no standard way for server-based applications to handle the use of include and exclude queries, just as there is no standard way for include and exclude queries to be defined. + * The rise of composite services creates more tightly coupled back-end and front-end systems, requiring increasing coordination to deliver projects and turning once agile projects back to waterfall. This coordination and coupling has the painful side effect of slowing organizational agility. Additionally, composite services are by definition, not RESTful. + + + +### GraphQL's genesis + +For Facebook, GraphQL’s genesis was a response to pain felt and experiences learned from an HTML5-based version of their flagship mobile application back in 2011-2012. Understanding that improved performance was paramount, Facebook engineers realized that they needed a new API design to ensure peak performance. Likely taking the above [REST][4] limitations into consideration, and with needing to support different needs of a number of API clients, one can begin to understand the early seeds of what led co-creators Lee Byron and Dan Schaeffer, Facebook employees at the time, to create what has become known as GraphQL. + +With what is often a single GraphQL endpoint, through the GraphQL query language, client applications are able to reduce, often significantly, the number of network calls they need to make, and ensure that they only are retrieving the data they need. In many ways, this harkens back to earlier models of web programming, where client application code would directly query back-end systems - some might remember writing SQL queries with JSTL on JSPs 10-15 years ago for example! + +The biggest difference now is with GraphQL, we have a specification that is implemented across a variety of client and server languages and libraries. And with GraphQL being an API technology, we have decoupled the back-end and front-end application systems by introducing an intermediary GraphQL application layer that provides a mechanism to access organizational data in a manner that aligns with an organization’s business domain(s). + +Beyond solving technical challenges experienced by software engineering teams, GraphQL has also been a boost to organizational agility, in particular in the enterprise. GraphQL-enabled organizational agility increases are commonly attributable to the following: + + * Rather than creating new endpoints when 1 or more new fields are needed by clients, GraphQL API designers and developers are able to include those fields in existing graph implementations, exposing new capabilities in a fashion that requires less development effort and less change across application systems. + * By encouraging API design teams to focus more on defining their object graph and be less focused on what client applications are delivering, the speed at which front-end and back-end software teams deliver solutions for customers has increasingly decoupled. + + + +### Considerations before adoption + +Despite GraphQL’s compelling benefits, GraphQL is not without its implementation challenges. A few examples include: + + * Caching mechanisms around [REST][4] APIs are much more mature. + * The patterns used to build APIs using [REST][4] are much more well established. + * While engineers may be more attracted to newer technologies like GraphQL, the talent pool in the marketplace is much broader for building [REST][4]-based solutions vs. GraphQL. + + + +### Conclusion + +By providing both a boost to performance and organizational agility, GraphQL's adoption by companies has skyrocketed in the past few years. It does, however, have some maturing to do in comparison to the RESTful ecosystem of API design. + +One of the great benefits of GraphQL is that it’s not designed as a wholesale replacement for alternative API solutions. Instead, GraphQL can be implemented to complement or enhance existing APIs. As a result, companies are encouraged to explore incrementally adopting GraphQL where it makes the most sense for them - where they find it has the greatest positive impact on application performance and organizational agility. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/why-use-graphql + +作者:[Zach Lendon][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/zachlendon/users/goncasousa/users/patrickhousley +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_graph_stats_blue.png?itok=OKCc_60D +[2]: https://graphql.org/ +[3]: https://opensource.com/article/19/6/what-is-graphql +[4]: https://en.wikipedia.org/wiki/Representational_state_transfer diff --git a/sources/tech/20190613 Continuous integration testing for the Linux kernel.md b/sources/tech/20190613 Continuous integration testing for the Linux kernel.md new file mode 100644 index 0000000000..d837cd9e67 --- /dev/null +++ b/sources/tech/20190613 Continuous integration testing for the Linux kernel.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: (LazyWolfLin) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Continuous integration testing for the Linux kernel) +[#]: via: (https://opensource.com/article/19/6/continuous-kernel-integration-linux) +[#]: author: (Major Hayden https://opensource.com/users/mhayden) + +Continuous integration testing for the Linux kernel +====== +How this team works to prevent bugs from being merged into the Linux +kernel. +![Linux kernel source code \(C\) in Visual Studio Code][1] + +With 14,000 changesets per release from over 1,700 different developers, it's clear that the Linux kernel moves quickly, and brings plenty of complexity. Kernel bugs range from small annoyances to larger problems, such as system crashes and data loss. + +As the call for continuous integration (CI) grows for more and more projects, the [Continuous Kernel Integration (CKI)][2] team forges ahead with a single mission: prevent bugs from being merged into the kernel. + +### Linux testing problems + +Many Linux distributions test the Linux kernel when needed. This testing often occurs around release time, or when users find a bug. + +Unrelated issues sometimes appear, and maintainers scramble to find which patch in a changeset full of tens of thousands of patches caused the new, unrelated bug. Diagnosing the bug may require specialized hardware, a series of triggers, and specialized knowledge of that portion of the kernel. + +#### CI and Linux + +Most modern software repositories have some sort of automated CI testing that tests commits before they find their way into the repository. This automated testing allows the maintainers to find software quality issues, along with most bugs, by reviewing the CI report. Simpler projects, such as a Python library, come with tons of tools to make this process easier. + +Linux must be configured and compiled prior to any testing. Doing so takes time and compute resources. In addition, that kernel must boot in a virtual machine or on a bare metal machine for testing. Getting access to certain system architectures requires additional expense or very slow emulation. From there, someone must identify a set of tests which trigger the bug or verify the fix. + +#### How the CKI team works + +The CKI team at Red Hat currently follows changes from several internal kernels, as well as upstream kernels such as the [stable kernel tree][3]. We watch for two critical events in each repository: + + 1. When maintainers merge pull requests or patches, and the resulting commits in the repository change. + + 2. When developers propose changes for merging via patchwork or the stable patch queue. + + + + +As these events occur, automation springs into action and [GitLab CI pipelines][4] begin the testing process. Once the pipeline runs [linting][5] scripts, merges any patches, and compiles the kernel for multiple architectures, the real testing begins. We compile kernels in under six minutes for four architectures and submit feedback to the stable mailing list usually in two hours or less. Over 100,000 kernel tests run each month and over 11,000 GitLab pipelines have completed (since January 2019). + +Each kernel is booted on its native architecture, which includes: + +● [aarch64][6]: 64-bit [ARM][7], such as the [Cavium (now Marvell) ThunderX][8]. + +● [ppc64/ppc64le][9]: Big and little endian [IBM POWER][10] systems. + +● [s390x][11]: [IBM Zseries][12] mainframes. + +● [x86_64][13]: [Intel][14] and [AMD][15] workstations, laptops, and servers. + +Multiple tests run on these kernels, including the [Linux Test Project (LTP)][16], which contains a myriad of tests using a common test harness. My CKI team open-sourced over 44 tests with more on the way. + +### Get involved + +The upstream kernel testing effort grows day-by-day. Many companies provide test output for various kernels, including [Google][17], Intel, [Linaro][18], and [Sony][19]. Each effort is focused on bringing value to the upstream kernel as well as each company’s customer base. + +If you or your company want to join the effort, please come to the [Linux Plumbers Conference 2019][20] in Lisbon, Portugal. Join us at the Kernel CI hackfest during the two days after the conference, and drive the future of rapid kernel testing. + +For more details, [review the slides][21] from my Texas Linux Fest 2019 talk. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/continuous-kernel-integration-linux + +作者:[Major Hayden][a] +选题:[lujun9972][b] +译者:[LazyWolfLin](https://github.com/LazyWolfLin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mhayden +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_kernel_clang_vscode.jpg?itok=fozZ4zrr (Linux kernel source code (C) in Visual Studio Code) +[2]: https://cki-project.org/ +[3]: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html +[4]: https://docs.gitlab.com/ee/ci/pipelines.html +[5]: https://en.wikipedia.org/wiki/Lint_(software) +[6]: https://en.wikipedia.org/wiki/ARM_architecture +[7]: https://www.arm.com/ +[8]: https://www.marvell.com/server-processors/thunderx-arm-processors/ +[9]: https://en.wikipedia.org/wiki/Ppc64 +[10]: https://www.ibm.com/it-infrastructure/power +[11]: https://en.wikipedia.org/wiki/Linux_on_z_Systems +[12]: https://www.ibm.com/it-infrastructure/z +[13]: https://en.wikipedia.org/wiki/X86-64 +[14]: https://www.intel.com/ +[15]: https://www.amd.com/ +[16]: https://github.com/linux-test-project/ltp +[17]: https://www.google.com/ +[18]: https://www.linaro.org/ +[19]: https://www.sony.com/ +[20]: https://www.linuxplumbersconf.org/ +[21]: https://docs.google.com/presentation/d/1T0JaRA0wtDU0aTWTyASwwy_ugtzjUcw_ZDmC5KFzw-A/edit?usp=sharing diff --git a/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md b/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md new file mode 100644 index 0000000000..ade27106f3 --- /dev/null +++ b/sources/tech/20190614 A data-centric approach to patching systems with Ansible.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A data-centric approach to patching systems with Ansible) +[#]: via: (https://opensource.com/article/19/6/patching-systems-ansible) +[#]: author: (Mark Phillips https://opensource.com/users/markp/users/markp) + +A data-centric approach to patching systems with Ansible +====== +Use data and variables in Ansible to control selective patching. +![metrics and data shown on a computer screen][1] + +When you're patching Linux machines these days, I could forgive you for asking, "How hard can it be?" Sure, a **yum update -y** will sort it for you in a flash. + +![Animation of updating Linux][2] + +But for those of us working with more than a handful of machines, it's not that simple. Sometimes an update can create unintended consequences across many machines, and you're left wondering how to put things back the way they were. Or you might think, "Should I have applied the critical patch on its own and saved myself a lot of pain?" + +Faced with these sorts of challenges in the past led me to build a way to cherry-pick the updates needed and automate their application. + +### A flexible idea + +Here's an overview of the process: + +![Overview of the Ansible patch process][3] + +This system doesn't permit machines to have direct access to vendor patches. Instead, they're selectively subscribed to repositories. Repositories contain only the patches that are required––although I'd encourage you to give this careful consideration so you don't end up with a proliferation (another management overhead you'll not thank yourself for creating). + +Now patching a machine comes down to 1) The repositories it's subscribed to and 2) Getting the "thumbs up" to patch. By using variables to control both subscription and permission to patch, we don't need to tamper with the logic (the plays); we only need to alter the data. + +Here is an [example Ansible role][4] that fulfills both requirements. It manages repository subscriptions and has a simple variable that controls running the patch command. + + +``` +\--- +# tasks file for patching + +\- name: Include OS version specific differences +include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + +\- name: Ensure Yum repositories are configured +template: +src: template.repo.j2 +dest: "/etc/yum.repos.d/{{ item.label }}.repo" +owner: root +group: root +mode: 0644 +when: patching_repos is defined +loop: "{{ patching_repos }}" +notify: patching-clean-metadata + +\- meta: flush_handlers + +\- name: Ensure OS shipped yum repo configs are absent +file: +path: "/etc/yum.repos.d/{{ patching_default_repo_def }}" +state: absent + +# add flexibility of repos here +\- name: Patch this host +shell: 'yum update -y' +args: +warn: false +when: patchme|bool +register: result +changed_when: "'No packages marked for update' not in result.stdout" +``` + +### Scenarios + +In our fictitious, large, globally dispersed environment (of four hosts), we have: + + * Two web servers + * Two database servers + * An application comprising one of each server type + + + +OK, so this number of machines isn't "enterprise-scale," but remove the counts and imagine the environment as multiple, tiered, geographically dispersed applications. We want to patch elements of the stack across server types, application stacks, geographies, or the whole estate. + +![Example patch groups][5] + +Using only changes to variables, can we achieve that flexibility? Sort of. Ansible's [default behavior][6] for hashes is to overwrite. In our example, the **patching_repos** variable for the **db1** and **web1** hosts are overwritten because of their later occurrence in our inventory. Hmm, a bit of a pickle. There are two ways to manage this: + + 1. Multiple inventory files + 2. [Change the variable behavior][7] + + + +I chose number one because it maintains clarity. Once you start merging variables, it's hard to find where a hash appears and how it's put together. Using the default behavior maintains clarity, and it's the method I'd encourage you to stick with for your own sanity. + +### Get on with it then + +Let's run the play, focusing only on the database servers. + +Did you notice the final step— **Patch this host** —says **skipping**? That's because we didn't set [the controlling variable][8] to do the patching. What we have done is set up the repository subscriptions to be ready. + +So let's run the play again, limiting it to the web servers and tell it to do the patching. I ran this example with verbose output so you can see the yum updates happening. + +Patching an application stack requires another inventory file, as mentioned above. Let's rerun the play. + +Patching hosts in the European geography is the same scenario as the application stack, so another inventory file is required. + +Now that all the repository subscriptions are configured, let's just patch the whole estate. Note the **app1** and **emea** groups don't need the inventory here––they were only being used to separate the repository definition and setup. Now, **yum update -y** patches everything. If you didn't want to capture those repositories, they could be configured as **enabled=0**. + +### Conclusion + +The flexibility comes from how we group our hosts. Because of default hash behavior, we need to think about overlaps—the easiest way, to my mind at least, is with separate inventories. + +With regard to repository setup, I'm sure you've already said to yourself, "Ah, but the cherry-picking isn't that simple!" There is additional overhead in this model to download patches, test that they work together, and bundle them with dependencies in a repository. With complementary tools, you could automate the process, and in a large-scale environment, you'd have to. + +Part of me is drawn to just applying full patch sets as a simpler and easier way to go; skip the cherry-picking part and apply a full set of patches to a "standard build." I've seen this approach applied to both Unix and Windows estates with enforced quarterly updates. + +I’d be interested in hearing your experiences of patching regimes, and the approach proposed here, in the comments below or [via Twitter][9]. + +Many companies still have massive data centres full of hardware. Here's how Ansible can help. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/patching-systems-ansible + +作者:[Mark Phillips][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/markp/users/markp +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://opensource.com/sites/default/files/uploads/quick_update.gif (Animation of updating Linux) +[3]: https://opensource.com/sites/default/files/uploads/patch_process.png (Overview of the Ansible patch process) +[4]: https://github.com/phips/ansible-patching/blob/master/roles/patching/tasks/main.yml +[5]: https://opensource.com/sites/default/files/uploads/patch_groups.png (Example patch groups) +[6]: https://docs.ansible.com/ansible/2.3/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable +[7]: https://docs.ansible.com/ansible/2.3/intro_configuration.html#sts=hash_behaviour +[8]: https://github.com/phips/ansible-patching/blob/master/roles/patching/defaults/main.yml#L4 +[9]: https://twitter.com/thismarkp diff --git a/sources/tech/20190614 Learning by teaching, and speaking, in open source.md b/sources/tech/20190614 Learning by teaching, and speaking, in open source.md new file mode 100644 index 0000000000..b2bd11f7b4 --- /dev/null +++ b/sources/tech/20190614 Learning by teaching, and speaking, in open source.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learning by teaching, and speaking, in open source) +[#]: via: (https://opensource.com/article/19/6/conference-proposal-tips) +[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) + +Learning by teaching, and speaking, in open source +====== +Want to speak at an open source conference? Here are a few tips to get +started. +![photo of microphone][1] + +_"Everything good, everything magical happens between the months of June and August."_ + +When Jenny Han wrote these words, I doubt she had the open source community in mind. Yet, for our group of dispersed nomads, the summer brings a wave of conferences that allow us to connect in person. + +From [OSCON][2] in Portland to [Drupal GovCon][3] in Bethesda, and [Open Source Summit North America][4] in San Diego, there’s no shortage of ways to match faces with Twitter avatars. After months of working on open source projects via Slack and Google Hangouts, the face time that these summer conferences offer is invaluable. + +The knowledge attendees gain at open source conferences serves as the spark for new contributions. And speaking from experience, the best way to gain value from these conferences is for you to _speak_ at them. + +But, does the thought of speaking give you chills? Hear me out before closing your browser. + +Last August, I arrived at the Vancouver Convention Centre to give a lightning talk and speak on a panel at [Open Source Summit North America 2018][5]. It’s no exaggeration to say that this conference—and applying to speak at it—transformed my career. Nine months later, I’ve: + + * Become a Community Moderator for Opensource.com + * Spoken at two additional open source conferences ([All Things Open][6] and [DrupalCon North America][7]) + * Made my first GitHub pull request + * Taken "Intro to Python" and written my first lines of code in [React][8] + * Taken the first steps towards writing a book proposal + + + +I don’t discount how much time, effort, and money are [involved in conference speaking][9]. Regardless, I can say with certainty that nothing else has grown my career so drastically. In the process, I met strangers who quickly became friends and unofficial mentors. Their feedback, advice, and connections have helped me grow in ways that I hadn’t envisioned this time last year. + +Had I not boarded that flight to Canada, I would not be where I am today. + +So, have I convinced you to take the first step? It’s easier than you think. If you want to [apply to speak at an open source conference][10] but are stuck on what to discuss, ask yourself this question: **What do I want to learn?** + +You don’t have to be an expert on the topics that you pitch. You don’t have to know everything about JavaScript, [ML][11], or Linux to [write conference proposals][12] on these topics. + +Here’s what you _do_ need: A willingness to do the work of teaching yourself these topics. And like any self-directed task, you’ll be most willing to do this work if you're invested in the subject. + +As summer conference season draws closer, soak up all the knowledge you can. Then, ask yourself what you want to learn more about, and apply to speak about those subjects at fall/winter open source events. + +After all, one of the most effective ways to learn is by [teaching a topic to someone else][13]. So, what will the open source community learn from you? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/conference-proposal-tips + +作者:[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/microphone_speak.png?itok=wW6elbl5 (photo of microphone) +[2]: https://conferences.oreilly.com/oscon/oscon-or +[3]: https://www.drupalgovcon.org +[4]: https://events.linuxfoundation.org/events/open-source-summit-north-america-2019/ +[5]: https://events.linuxfoundation.org/events/open-source-summit-north-america-2018/ +[6]: https://allthingsopen.org +[7]: https://lab.getapp.com/bias-in-ai-drupalcon-debrief/ +[8]: https://reactjs.org +[9]: https://twitter.com/venikunche/status/1130868572098572291 +[10]: https://opensource.com/article/19/1/public-speaking-resolutions +[11]: https://en.wikipedia.org/wiki/ML_(programming_language) +[12]: https://dev.to/aspittel/public-speaking-as-a-developer-2ihj +[13]: https://opensource.com/article/19/5/learn-python-teaching diff --git a/sources/tech/20190614 What is a Java constructor.md b/sources/tech/20190614 What is a Java constructor.md new file mode 100644 index 0000000000..66cd30110d --- /dev/null +++ b/sources/tech/20190614 What is a Java constructor.md @@ -0,0 +1,158 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is a Java constructor?) +[#]: via: (https://opensource.com/article/19/6/what-java-constructor) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/ashleykoree) + +What is a Java constructor? +====== +Constructors are powerful components of programming. Use them to unlock +the full potential of Java. +![][1] + +Java is (disputably) the undisputed heavyweight in open source, cross-platform programming. While there are many [great][2] [cross-platform][2] [frameworks][3], few are as unified and direct as [Java][4]. + +Of course, Java is also a pretty complex language with subtleties and conventions all its own. One of the most common questions about Java relates to **constructors** : What are they and what are they used for? + +Put succinctly: a constructor is an action performed upon the creation of a new **object** in Java. When your Java application creates an instance of a class you have written, it checks for a constructor. If a constructor exists, Java runs the code in the constructor while creating the instance. That's a lot of technical terms crammed into a few sentences, but it becomes clearer when you see it in action, so make sure you have [Java installed][5] and get ready for a demo. + +### Life without constructors + +If you're writing Java code, you're already using constructors, even though you may not know it. All classes in Java have a constructor because even if you haven't created one, Java does it for you when the code is compiled. For the sake of demonstration, though, ignore the hidden constructor that Java provides (because a default constructor adds no extra features), and take a look at life without an explicit constructor. + +Suppose you're writing a simple Java dice-roller application because you want to produce a pseudo-random number for a game. + +First, you might create your dice class to represent a physical die. Knowing that you play a lot of [Dungeons and Dragons][6], you decide to create a 20-sided die. In this sample code, the variable **dice** is the integer 20, representing the maximum possible die roll (a 20-sided die cannot roll more than 20). The variable **roll** is a placeholder for what will eventually be a random number, and **rand** serves as the random seed. + + +``` +import java.util.Random; + +public class DiceRoller { +private int dice = 20; +private int roll; +private [Random][7] rand = new [Random][7](); +``` + +Next, create a function in the **DiceRoller** class to execute the steps the computer must take to emulate a die roll: Take an integer from **rand** and assign it to the **roll** variable, add 1 to account for the fact that Java starts counting at 0 but a 20-sided die has no 0 value, then print the results. + + +``` +public void Roller() { +roll = rand.nextInt(dice); +roll += 1; +[System][8].out.println (roll); +} +``` + +Finally, spawn an instance of the **DiceRoller** class and invoke its primary function, **Roller** : + + +``` +// main loop +public static void main ([String][9][] args) { +[System][8].out.printf("You rolled a "); + +DiceRoller App = new DiceRoller(); +App.Roller(); +} +} +``` + +As long as you have a Java development environment installed (such as [OpenJDK][10]), you can run your application from a terminal: + + +``` +$ java dice.java +You rolled a 12 +``` + +In this example, there is no explicit constructor. It's a perfectly valid and legal Java application, but it's a little limited. For instance, if you set your game of Dungeons and Dragons aside for the evening to play some Yahtzee, you would need 6-sided dice. In this simple example, it wouldn't be that much trouble to change the code, but that's not a realistic option in complex code. One way you could solve this problem is with a constructor. + +### Constructors in action + +The **DiceRoller** class in this example project represents a virtual dice factory: When it's called, it creates a virtual die that is then "rolled." However, by writing a custom constructor, you can make your Dice Roller application ask what kind of die you'd like to emulate. + +Most of the code is the same, with the exception of a constructor accepting some number of sides. This number doesn't exist yet, but it will be created later. + + +``` +import java.util.Random; + +public class DiceRoller { +private int dice; +private int roll; +private [Random][7] rand = new [Random][7](); + +// constructor +public DiceRoller(int sides) { +dice = sides; +} +``` + +The function emulating a roll remains unchanged: + + +``` +public void Roller() { +roll = rand.nextInt(dice); +roll += 1; +[System][8].out.println (roll); +} +``` + +The main block of code feeds whatever arguments you provide when running the application. Were this a complex application, you would parse the arguments carefully and check for unexpected results, but for this sample, the only precaution taken is converting the argument string to an integer type: + + +``` +public static void main ([String][9][] args) { +[System][8].out.printf("You rolled a "); +DiceRoller App = new DiceRoller( [Integer][11].parseInt(args[0]) ); +App.Roller(); +} +} +``` + +Launch the application and provide the number of sides you want your die to have: + + +``` +$ java dice.java 20 +You rolled a 10 +$ java dice.java 6 +You rolled a 2 +$ java dice.java 100 +You rolled a 44 +``` + +The constructor has accepted your input, so when the class instance is created, it is created with the **sides** variable set to whatever number the user dictates. + +Constructors are powerful components of programming. Practice using them to unlock the full potential of Java. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/what-java-constructor + +作者:[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/users/ashleykoree +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/17/4/pyqt-versus-wxpython +[4]: https://opensource.com/resources/java +[5]: https://openjdk.java.net/install/index.html +[6]: https://opensource.com/article/19/5/free-rpg-day +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+random +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[10]: https://openjdk.java.net/ +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer diff --git a/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md b/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md new file mode 100644 index 0000000000..0ce1a510ac --- /dev/null +++ b/sources/tech/20190617 How To Check Linux Package Version Before Installing It.md @@ -0,0 +1,281 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Check Linux Package Version Before Installing It) +[#]: via: (https://www.ostechnix.com/how-to-check-linux-package-version-before-installing-it/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +How To Check Linux Package Version Before Installing It +====== + +![Check Linux Package Version][1] + +Most of you will know how to [**find the version of an installed package**][2] in Linux. But, what would you do to find the packages’ version which are not installed in the first place? No problem! This guide describes how to check Linux package version before installing it in Debian and its derivatives like Ubuntu. This small tip might be helpful for those wondering what version they would get before installing a package. + +### Check Linux Package Version Before Installing It + +There are many ways to find a package’s version even if it is not installed already in DEB-based systems. Here I have given a few methods. + +##### Method 1 – Using Apt + +The quick and dirty way to check a package version, simply run: + +``` +$ apt show +``` + +**Example:** + +``` +$ apt show vim +``` + +**Sample output:** + +``` +Package: vim +Version: 2:8.0.1453-1ubuntu1.1 +Priority: optional +Section: editors +Origin: Ubuntu +Maintainer: Ubuntu Developers <[email protected]> +Original-Maintainer: Debian Vim Maintainers <[email protected]> +Bugs: https://bugs.launchpad.net/ubuntu/+filebug +Installed-Size: 2,852 kB +Provides: editor +Depends: vim-common (= 2:8.0.1453-1ubuntu1.1), vim-runtime (= 2:8.0.1453-1ubuntu1.1), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libgpm2 (>= 1.20.7), libpython3.6 (>= 3.6.5), libselinux1 (>= 1.32), libtinfo5 (>= 6) +Suggests: ctags, vim-doc, vim-scripts +Homepage: https://vim.sourceforge.io/ +Task: cloud-image, server +Supported: 5y +Download-Size: 1,152 kB +APT-Sources: http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages +Description: Vi IMproved - enhanced vi editor + Vim is an almost compatible version of the UNIX editor Vi. + . + Many new features have been added: multi level undo, syntax + highlighting, command line history, on-line help, filename + completion, block operations, folding, Unicode support, etc. + . + This package contains a version of vim compiled with a rather + standard set of features. This package does not provide a GUI + version of Vim. See the other vim-* packages if you need more + (or less). + +N: There is 1 additional record. Please use the '-a' switch to see it +``` + +As you can see in the above output, “apt show” command displays, many important details of the package such as, + + 1. package name, + 2. version, + 3. origin (from where the vim comes from), + 4. maintainer, + 5. home page of the package, + 6. dependencies, + 7. download size, + 8. description, + 9. and many. + + + +So, the available version of Vim package in the Ubuntu repositories is **8.0.1453**. This is the version I get if I install it on my Ubuntu system. + +Alternatively, use **“apt policy”** command if you prefer short output: + +``` +$ apt policy vim +vim: + Installed: (none) + Candidate: 2:8.0.1453-1ubuntu1.1 + Version table: + 2:8.0.1453-1ubuntu1.1 500 + 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages + 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages + 2:8.0.1453-1ubuntu1 500 + 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages +``` + +Or even shorter: + +``` +$ apt list vim +Listing... Done +vim/bionic-updates,bionic-security 2:8.0.1453-1ubuntu1.1 amd64 +N: There is 1 additional version. Please use the '-a' switch to see it +``` + +**Apt** is the default package manager in recent Ubuntu versions. So, this command is just enough to find the detailed information of a package. It doesn’t matter whether given package is installed or not. This command will simply list the given package’s version along with all other details. + +##### Method 2 – Using Apt-get + +To find a package version without installing it, we can use **apt-get** command with **-s** option. + +``` +$ apt-get -s install vim +``` + +**Sample output:** + +``` +NOTE: This is only a simulation! + apt-get needs root privileges for real execution. + Keep also in mind that locking is deactivated, + so don't depend on the relevance to the real current situation! +Reading package lists... Done +Building dependency tree +Reading state information... Done +Suggested packages: + ctags vim-doc vim-scripts +The following NEW packages will be installed: + vim +0 upgraded, 1 newly installed, 0 to remove and 45 not upgraded. +Inst vim (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) +Conf vim (2:8.0.1453-1ubuntu1.1 Ubuntu:18.04/bionic-updates, Ubuntu:18.04/bionic-security [amd64]) +``` + +Here, -s option indicates **simulation**. As you can see in the output, It performs no action. Instead, It simply performs a simulation to let you know what is going to happen when you install the Vim package. + +You can substitute “install” option with “upgrade” option to see what will happen when you upgrade a package. + +``` +$ apt-get -s upgrade vim +``` + +##### Method 3 – Using Aptitude + +**Aptitude** is an ncurses and commandline-based front-end to APT package manger in Debian and its derivatives. + +To find the package version with Aptitude, simply run: + +``` +$ aptitude versions vim +p 2:8.0.1453-1ubuntu1 bionic 500 +p 2:8.0.1453-1ubuntu1.1 bionic-security,bionic-updates 500 +``` + +You can also use simulation option ( **-s** ) to see what would happen if you install or upgrade package. + +``` +$ aptitude -V -s install vim +The following NEW packages will be installed: + vim [2:8.0.1453-1ubuntu1.1] +0 packages upgraded, 1 newly installed, 0 to remove and 45 not upgraded. +Need to get 1,152 kB of archives. After unpacking 2,852 kB will be used. +Would download/install/remove packages. +``` + +Here, **-V** flag is used to display detailed information of the package version. + +Similarly, just substitute “install” with “upgrade” option to see what would happen if you upgrade a package. + +``` +$ aptitude -V -s upgrade vim +``` + +Another way to find the non-installed package’s version using Aptitude command is: + +``` +$ aptitude search vim -F "%c %p %d %V" +``` + +Here, + + * **-F** is used to specify which format should be used to display the output, + * **%c** – status of the given package (installed or not installed), + * **%p** – name of the package, + * **%d** – description of the package, + * **%V** – version of the package. + + + +This is helpful when you don’t know the full package name. This command will list all packages that contains the given string (i.e vim). + +Here is the sample output of the above command: + +``` +[...] +p vim Vi IMproved - enhanced vi editor 2:8.0.1453-1ub +p vim-tlib Some vim utility functions 1.23-1 +p vim-ultisnips snippet solution for Vim 3.1-3 +p vim-vimerl Erlang plugin for Vim 1.4.1+git20120 +p vim-vimerl-syntax Erlang syntax for Vim 1.4.1+git20120 +p vim-vimoutliner script for building an outline editor on top of Vim 0.3.4+pristine +p vim-voom Vim two-pane outliner 5.2-1 +p vim-youcompleteme fast, as-you-type, fuzzy-search code completion engine for Vim 0+20161219+git +``` + +##### Method 4 – Using Apt-cache + +**Apt-cache** command is used to query APT cache in Debian-based systems. It is useful for performing many operations on APT’s package cache. One fine example is we can [**list installed applications from a certain repository/ppa**][3]. + +Not just installed applications, we can also find the version of a package even if it is not installed. For instance, the following command will find the version of Vim package: + +``` +$ apt-cache policy vim +``` + +Sample output: + +``` +vim: + Installed: (none) + Candidate: 2:8.0.1453-1ubuntu1.1 + Version table: + 2:8.0.1453-1ubuntu1.1 500 + 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages + 500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages + 2:8.0.1453-1ubuntu1 500 + 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages +``` + +As you can see in the above output, Vim is not installed. If you wanted to install it, you would get version **8.0.1453**. It also displays from which repository the vim package is coming from. + +##### Method 5 – Using Apt-show-versions + +**Apt-show-versions** command is used to list installed and available package versions in Debian and Debian-based systems. It also displays the list of all upgradeable packages. It is quite handy if you have a mixed stable/testing environment. For instance, if you have enabled both stable and testing repositories, you can easily find the list of applications from testing and also you can upgrade all packages in testing. + +Apt-show-versions is not installed by default. You need to install it using command: + +``` +$ sudo apt-get install apt-show-versions +``` + +Once installed, run the following command to find the version of a package,for example Vim: + +``` +$ apt-show-versions -a vim +vim:amd64 2:8.0.1453-1ubuntu1 bionic archive.ubuntu.com +vim:amd64 2:8.0.1453-1ubuntu1.1 bionic-security security.ubuntu.com +vim:amd64 2:8.0.1453-1ubuntu1.1 bionic-updates archive.ubuntu.com +vim:amd64 not installed +``` + +Here, **-a** switch prints all available versions of the given package. + +If the given package is already installed, you need not to use **-a** option. In that case, simply run: + +``` +$ apt-show-versions vim +``` + +And, that’s all. If you know any other methods, please share them in the comment section below. I will check and update this guide. + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-check-linux-package-version-before-installing-it/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Check-Linux-Package-Version-720x340.png +[2]: https://www.ostechnix.com/find-package-version-linux/ +[3]: https://www.ostechnix.com/list-installed-packages-certain-repository-linux/ diff --git a/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md b/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md new file mode 100644 index 0000000000..1a6f5988e9 --- /dev/null +++ b/sources/tech/20190617 How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers) +[#]: via: (https://www.linuxtechi.com/vlan-tagged-nic-ethernet-card-centos-rhel-servers/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Use VLAN tagged NIC (Ethernet Card) on CentOS and RHEL Servers +====== + +There are some scenarios where we want to assign multiple IPs from different **VLAN** on the same Ethernet card (nic) on Linux servers ( **CentOS** / **RHEL** ). This can be done by enabling VLAN tagged interface. But for this to happen first we must make sure multiple VLANs are attached to port on switch or in other words we can say we should configure trunk port by adding multiple VLANs on switch. + + + +Let’s assume we have a Linux Server, there we have two Ethernet cards (enp0s3 & enp0s8), first NIC ( **enp0s3** ) will be used for data traffic and second NIC ( **enp0s8** ) will be used for control / management traffic. For Data traffic I will using multiple VLANs (or will assign multiple IPs from different VLANs on data traffic ethernet card). + +I am assuming the port from switch which is connected to my server data NIC is configured as trunk port by mapping the multiple VLANs to it. + +Following are the VLANs which is mapped to data traffic Ethernet Card (NIC): + + * VLAN ID (200), VLAN N/W = 172.168.10.0/24 + * VLAN ID (300), VLAN N/W = 172.168.20.0/24 + + + +To use VLAN tagged interface on CentOS 7 / RHEL 7 / CentOS 8 /RHEL 8 systems, [kernel module][1] **8021q** must be loaded. + +Use the following command to load the kernel module “8021q” + +``` +[root@linuxtechi ~]# lsmod | grep -i 8021q +[root@linuxtechi ~]# modprobe --first-time 8021q +[root@linuxtechi ~]# lsmod | grep -i 8021q +8021q 29022 0 +garp 14384 1 8021q +mrp 18542 1 8021q +[root@linuxtechi ~]# +``` + +Use below modinfo command to display information about kernel module “8021q” + +``` +[root@linuxtechi ~]# modinfo 8021q +filename: /lib/modules/3.10.0-327.el7.x86_64/kernel/net/8021q/8021q.ko +version: 1.8 +license: GPL +alias: rtnl-link-vlan +rhelversion: 7.2 +srcversion: 2E63BD725D9DC11C7DA6190 +depends: mrp,garp +intree: Y +vermagic: 3.10.0-327.el7.x86_64 SMP mod_unload modversions +signer: CentOS Linux kernel signing key +sig_key: 79:AD:88:6A:11:3C:A0:22:35:26:33:6C:0F:82:5B:8A:94:29:6A:B3 +sig_hashalgo: sha256 +[root@linuxtechi ~]# +``` + +Now tagged (or mapped) the VLANs 200 and 300 to NIC enp0s3 using the [ip command][2] + +``` +[root@linuxtechi ~]# ip link add link enp0s3 name enp0s3.200 type vlan id 200 +``` + +Bring up the interface using below ip command: + +``` +[root@linuxtechi ~]# ip link set dev enp0s3.200 up +``` + +Similarly mapped the VLAN 300 to NIC enp0s3 + +``` +[root@linuxtechi ~]# ip link add link enp0s3 name enp0s3.300 type vlan id 300 +[root@linuxtechi ~]# ip link set dev enp0s3.300 up +[root@linuxtechi ~]# +``` + +Now view the tagged interface status using ip command: + +[![tagged-interface-ip-command][3]][4] + +Now we can assign the IP address to tagged interface from their respective VLANs using beneath ip command, + +``` +[root@linuxtechi ~]# ip addr add 172.168.10.51/24 dev enp0s3.200 +[root@linuxtechi ~]# ip addr add 172.168.20.51/24 dev enp0s3.300 +``` + +Use below ip command to see whether IP is assigned to tagged interface or not. + +![ip-address-tagged-nic][5] + +All the above changes via ip commands will not be persistent across the reboot. These tagged interfaces will not be available after reboot and after network service restart + +So, to make tagged interfaces persistent across the reboot then use interface **ifcfg files** + +Edit interface (enp0s3) file “ **/etc/sysconfig/network-scripts/ifcfg-enp0s3** ” and add the following content, + +Note: Replace the interface name that suits to your env, + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 +TYPE=Ethernet +DEVICE=enp0s3 +BOOTPROTO=none +ONBOOT=yes +``` + +Save & exit the file + +Create tagged interface file for VLAN id 200 as “ **/etc/sysconfig/network-scripts/ifcfg-enp0s3.200** ” and add the following contents to it. + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3.200 +DEVICE=enp0s3.200 +BOOTPROTO=none +ONBOOT=yes +IPADDR=172.168.10.51 +PREFIX=24 +NETWORK=172.168.10.0 +VLAN=yes +``` + +Save & exit the file + +Similarly create interface file for VLAN id 300 as “/etc/sysconfig/network-scripts/ifcfg-enp0s3.300” and add the following contents to it + +``` +[root@linuxtechi ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp0s3.300 +DEVICE=enp0s3.300 +BOOTPROTO=none +ONBOOT=yes +IPADDR=172.168.20.51 +PREFIX=24 +NETWORK=172.168.20.0 +VLAN=yes +``` + +Save and exit file and then restart network services using the beneath command, + +``` +[root@linuxtechi ~]# systemctl restart network +[root@linuxtechi ~]# +``` + +Now verify whether tagged interface are configured and up & running using the ip command, + +![tagged-interface-status-ip-command-linux-server][6] + +That’s all from this article, I hope you got an idea how to configure and enable VLAN tagged interface on CentOS 7 / 8 and RHEL 7 /8 Severs. Please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/vlan-tagged-nic-ethernet-card-centos-rhel-servers/ + +作者:[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/how-to-manage-kernel-modules-in-linux/ +[2]: https://www.linuxtechi.com/ip-command-examples-for-linux-users/ +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-ip-command-1024x444.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-ip-command.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/ip-address-tagged-nic-1024x343.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/tagged-interface-status-ip-command-linux-server-1024x656.jpg diff --git a/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md b/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md new file mode 100644 index 0000000000..65f492420d --- /dev/null +++ b/sources/tech/20190617 KIT Scenarist is a Powerful Tool for Creating Screenplays.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (KIT Scenarist is a Powerful Tool for Creating Screenplays) +[#]: via: (https://itsfoss.com/kit-scenarist/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +KIT Scenarist is a Powerful Tool for Creating Screenplays +====== + +Did you ever wish that there was an open source tool for all your screenplay writing needs? Well, you are in luck. Today, we will be looking at an application that will do just that. Today, we will be looking at KIT Scenarist. + +### KIT Scenarist: An Open Source tool for writing screenplays + +[KIT Scenarist][1] is a program designed to be your one-stop-shop to create the next great screenplay. KIT Scenarist’s tools are split up into four modules: Research, Cards, Script, and Statistics. When you load KIT Scenarist for the first time after installing it, you will be asked if you want to enable each of these modules. You can also disable any of the modules from the setting menu. + +![Scenarist][2] + +The Research module gives you a place to store your story ideas, as well as, ideas and information for both characters and locations. You can also add images for a character or location to give you inspiration. + +The Cards module shows you the scenes that you have written or sketched out like cards on a cord board. You can drag these scenes around on the board to rearrange them. You can also jump to a certain scene or mark a scene as done. + +The Script module is where the actual writing takes place. It has a widget that tells you approximately how long your screenplay will take to perform. Like a word processor, you can tell KIT Scenarist what parts of the script are the actions, character, dialogue, etc and it will format it correctly. + +![Scenarist Research module][3] + +The Statistics module gives you all kinds of reports and graphs about your screenplay. The scene report shows how long each act is and what characters are in it. The location report shows how much time is spent at each location and in which acts. The cast report shows how many scenes each character is in and how much dialogue they have. There is even a report that lists all of the dialogue for each character. + +[][4] + +Suggested read Tilix: Advanced Tiling Terminal Emulator for Power Users + +Like all well-designed apps, KIT Scenarist has both a light and dark theme. The dark theme is the default. + +![Scenarist Statistics module][5] + +KIT Scenarist stores your projects in `.kitsp` files. These files are essentially SQLite database files with a different extension. This means that if you ever run into issues with KIT Scenarist, you can retrieve your information with an SQLite viewer. + +This application also allows you to import scripts from a wide range of script writing applications. You can import the following file formats: Final Draft Screenplay (.fdx), Final Draft Template (.fdxt), Trelby Screenplay (.trelby), [Fountain Text][6] (.foundation), Celtx Project (.celtx), .odt, . doc and .docx. You can export your outline and script to .docx, .pdf, .fdx. or .Fountain. + +The desktop version of KIT Scenarist is free, but they also have a couple of [Pro options][7]. They have a cloud service to collaborate with others or sync your work to other devices. The cloud service costs $4.99 for a month or $52.90 for a year. They have other subscription lengths. KIT Scenarist is available in the iOS app store or the Google Play store, but cost money there. Finally, if you are an organization who wants to use KIT Scenarist but it is missing a feature you want, they will add it if you finance the work. + +![Scenarist Cards module][8] + +### How to Install Scenarist + +Currently, the only repo that Scenarist is available for downloading is the [Arch User Repository][9]. (Arch rulez :D) + +Otherwise, you have to [download][10] a package installer from the website. They have packages available for Linux (both .deb and .rpm), Windows, and macOS. As I stated above, there are also versions available for both Android and iOS, but they are not free. You can find the source code of KIT Scenarist on GitHub. + +[KIT Scenarist on GitHub][11] + +If KIT Scenarist won’t start on your Linux system, try installing the `libxcb-xinerama0` package. + +![Scenarist Script][12] + +### Final Thoughts on KIT Scenarist + +KIT Scenarist offers the full script writing experience. All your information is stored in one place, so you don’t need to look everywhere for your information. It does everything. Now, the creator just needs to add a feature to submit your script directly to the person who will make you the next famous playwright. + +[][13] + +Suggested read Bookworm: A Simple yet Magnificent eBook Reader for Linux + +If KIT Scenarist looks too overwhelming and you want to try something simpler, I would recommend trying [Trelby][14]. If you are into writing, you may read my list of [useful open source tools for writers][15]. + +Have you every used KIT Scenarist? What is your favorite open source screenwriting tool? Please let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][16]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kit-scenarist/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://kitscenarist.ru/en/index.html +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-about.png?fit=800%2C469&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-research.png?fit=800%2C371&ssl=1 +[4]: https://itsfoss.com/tilix-terminal-emulator/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-statistics.png?fit=800%2C467&ssl=1 +[6]: https://www.fountain.io/ +[7]: https://kitscenarist.ru/en/pricing.html +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-cards.png?fit=800%2C470&ssl=1 +[9]: https://aur.archlinux.org/packages/scenarist +[10]: https://kitscenarist.ru/en/download.html +[11]: https://github.com/dimkanovikov/kitscenarist +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/scenarist-script.png?fit=800%2C468&ssl=1 +[13]: https://itsfoss.com/bookworm-ebook-reader-linux/ +[14]: https://www.trelby.org/ +[15]: https://itsfoss.com/open-source-tools-writers/ +[16]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md b/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md new file mode 100644 index 0000000000..6843910f91 --- /dev/null +++ b/sources/tech/20190618 Cylon - The Arch Linux Maintenance Program For Newbies.md @@ -0,0 +1,257 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Cylon – The Arch Linux Maintenance Program For Newbies) +[#]: via: (https://www.ostechnix.com/cylon-arch-linux-maintenance-program/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +Cylon – The Arch Linux Maintenance Program For Newbies +====== + +![Cylon is an Arch Linux Maintenance Program][1] + +Recently switched to Arch Linux as your daily driver? Great! I’ve got a good news for you. Meet **Cylon** , a maintenance program for Arch Linux and derivatives. It is a menu-driven **Bash** script which provides updates, maintenance, backups and system checks for Arch Linux and its derivatives such as Manjaro Linux etc. Cylon is mainly a CLI program, and also has a basic dialog GUI. In this guide, we will see how to install and use Cylon in Arch Linux. + +### Cylon – The Arch Linux Maintenance Program + +##### Install Cylon + +Cylon is available in the [**AUR**][2]. You can install it using any AUR helpers, for example [**Yay**][3]. + +``` +$ yay -S cylon +``` + +##### Usage + +Please note that Cylon _**will not install all tools**_ by default. Some functions require various dependencies packages to be installed. There are three dependencies and the rest are optional dependencies. The optional dependencies are left to user discretion. When you perform a function, it will display the missing packages if there are any. All missing packages will be shown as **n/a** (not available) in menus. You need to install the missing packages by yourself before using such functions. + +To launch Cylon, type _**cylon**_ in the Terminal: + +``` +$ cylon +``` + +Sample output from my Arch linux system: + +![][4] + +Default interface of Cylon, the Arch Linux maintenance program + +You can also launch Cylon from the Menu. It usually found under **Applications > System Tools**. + +As you see in the above screenshot, there are **14** menu entries in Cylon main menu to perform different functions. To go to each entry, type the respective number. Also, as you see in the screenshot, there is **n/a** besides the 2 and 3 menu entries which means **auracle** and [**Trizen**][5] are not installed. You need to install them first before performing those functions. + +Let us see what each menu entry does. + +**1\. Pacman** + +Under [**Pacman**][6] section, you can do various package management operations such as install, update, upgrade, verify, remove packages, display package information, view Arch Linux news feed and many. Just type a number to perform the respective action. + +![][7] + +You can go back to main menu by typing the number **21**. + +**2. auracle +** + +The **auracle** is an AUR helper program that can be used to perform various AUR actions such as install, update, download, search, remove AUR packages in your Arch linux box. + +**3\. trizen** + +It is same as above section. + +**4\. System Update** + +As the name says, this section is dedicated to perform Arch Linux update. Here you can update both the official and AUR packages. Cylon gives you the following four options in this section. + + 1. Update Arch Main Repos only, + 2. Update AUR only, + 3. Update All repos, + 4. No Update and exit. + + + +![][8] + +**5\. System Maintenance** + +In this section, you can do the following maintenance tasks. + + 1. Failed Systemd Services and status, + 2. Check Journalctl log for Errors, + 3. Check Journalctl for fstrim SSD trim, + 4. Analyze system boot-up performance, + 5. Check for Broken Symlinks, + 6. Find files where no group or User corresponds to file’s numeric ID, + 7. lostfiles, + 8. Diskspace usage, + 9. Find 200 of the biggest files, + 10. Find inodes usage, + 11. Old configuration files scan, + 12. Print sensors information, + 13. Clean journal files, + 14. Delete core dumps /var/lib/systemd/coredump/, + 15. Delete files, + 16. bleachbit n/a, + 17. rmlint n/a, + 18. List All Open Files, + 19. DMI table decoder, + 20. Return. + + + +The non-installed packages will be shown with letters n/a besides that applications. You need to install them first before choosing that particular action. + +** **Recommended Download** – [**Free Video: “Penetration Testing Methodologies Training Course (a $99 value!) FREE”**][9] + +**6\. System backup** + +This section provides backup utilities such as **rsync** to backup your Arch Linux system. Also, there is a custom backup options which allows you to manually backup files/folders to a user-specified location. + +![][10] + +**7\. System Security** + +Cylon provides various security tools including the following: + + 1. ccrypt – Encrypt/decrypt files, + 2. clamav – Antivirus, + 3. rkhunter – RootKit hunter scan, + 4. lynis – System audit tool, + 5. Password generator, + 6. List the password aging info of a user, + 7. Audit SUID/SGID Files. + + + +Remember you need to install them yourself in order to use them. Cylon will not help you to install the missing packages. + +**8\. Network Maintenance** + +This section is for network related functions. Here, you can: + + 1. See wifi link quality continuously on screen, + 2. Use speedtest-cli -testing internet bandwidth, + 3. Check if website up with netcat and ping, + 4. Display all interfaces which are currently available, + 5. Display kernal routing table, + 6. Check the status of UFW, Uncomplicated Firewall, + 7. Network Time Synchronization status check, + 8. traceroute print route packets trace to network host, + 9. tracepath traces path to a network host, + 10. View all open ports + + + +**9\. xterm terminal** + +Here, you can launch xterm terminal at output folder path in new window. + +**10\. View/Edit config file** + +View and edit the configuration files if necessary. + +**11\. System information** + +This is most useful feature of Cylon utlity. This section provides your Arch Linux system’s information such as, + + * Uptime, + * Kernel details, + * OS architecture, + * Username, + * Default Shell, + * Screen resolution, + * CPU, + * RAM (used/total), + * Editor variable, + * Location of pacman cache folder, + * Hold packages, + * Number of orphan packages, + * Total number of installed packages, + * Number of all explicitly installed packages, + * All foreign installed packages, + * All foreign explicitly installed packages, + * All packages installed as dependencies, + * Top 5 largest packages, + * 5 newest updated packages, + * Packages Installed size by repositories. + + + +![][11] + +**12\. Cylon information** + +It will display the information about Cylon program. It also performs the dependencies installation check and display the list of installed non-installed dependencies. + +![][12] + +**13\. Weather** + +It displays the 3 day weather forecast by **wttr.in** utility. + +* * * + +**Related Read:** + + * **[How To Check Weather Details From Command Line In Linux][13]** + + + +* * * + +**14\. Exit** + +Type **14** to exit Cylon. + +For more details, type **cylon -h** in the Terminal to print cylon information. + +* * * + +**Recommended read:** + + * [**Cylon-deb : The Debian Linux Maintenance Program**][14] + + + +* * * + +Cylon script offers a lot of tools and features to maintain your Arch Linux system. If you’re new to Arch Linux, give it a try and see if it helps. + +**Resource:** + + * [**Cylon GitHub page**][15] + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/cylon-arch-linux-maintenance-program/ + +作者:[sk][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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-The-Arch-Linux-Maintenance-Program-720x340.png +[2]: https://aur.archlinux.org/packages/cylon/ +[3]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: http://www.ostechnix.com/wp-content/uploads/2017/06/cylon-interface.png +[5]: https://www.ostechnix.com/trizen-lightweight-aur-package-manager-arch-based-systems/ +[6]: https://www.ostechnix.com/getting-started-pacman/ +[7]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-pacman.png +[8]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-update.png +[9]: https://ostechnix.tradepub.com/free/w_cybf03/prgm.cgi +[10]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-backup.png +[11]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-system-information.png +[12]: http://www.ostechnix.com/wp-content/uploads/2017/06/Cylon-information.png +[13]: https://www.ostechnix.com/check-weather-details-command-line-linux/ +[14]: https://www.ostechnix.com/cylon-deb-debian-linux-maintenance-program/ +[15]: https://github.com/gavinlyonsrepo/cylon diff --git a/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md b/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md new file mode 100644 index 0000000000..94aaf47de2 --- /dev/null +++ b/sources/tech/20190618 How to use MapTool to build an interactive dungeon RPG.md @@ -0,0 +1,231 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use MapTool to build an interactive dungeon RPG) +[#]: via: (https://opensource.com/article/19/6/how-use-maptools) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +How to use MapTool to build an interactive dungeon RPG +====== +By using MapTool, most of a game master's work is done well before a +role-playing game begins. +![][1] + +In my previous article on MapTool, I explained how to download, install, and configure your own private, [open source virtual tabletop][2] so you and your friends can play a role-playing game (RPG) together. [MapTool][3] is a complex application with lots of features, and this article demonstrates how a game master (GM) can make the most of it. + +### Update JavaFX + +MapTool requires JavaFX, but Java maintainers recently stopped bundling it in Java downloads. This means that, even if you have Java installed, you might not have JavaFX installed. + +Some Linux distributions have a JavaFX package available, so if you try to run MapTool and get an error about JavaFX, download the latest self-contained version: + + * For [Ubuntu and other Debian-based systems][4] + * For [Fedora and Red Hat-based systems][5] + + + +### Build a campaign + +The top-level file in MapTool is a campaign (.cmpgn) file. A campaign can contain all of the maps required by the game you're running. As your players progress through the campaign, everyone changes to the appropriate map and plays. + +For that to go smoothly, you must do a little prep work. + +First, you need the digital equivalents of miniatures: _tokens_ in MapTool terminology. Tokens are available from various sites, but the most prolific is [immortalnights.com/tokensite][6]. If you're still just trying out virtual tabletops and aren't ready to invest in digital art yet, you can get a stunning collection of starter tokens from immortalnights.com for $0. + +You can add starter content to MapTool quickly and easily using its built-in resource importer. Go to the **File** menu and select **Add Resource to Library**. + +In the **Add Resource to Library** dialogue box, select the RPTools tab, located at the bottom-left. This lists all the free art packs available from the RPTools server, tokens and maps alike. Click to download and import. + +![Add Resource to Library dialogue][7] + +You can import assets you already have on your computer by selecting files from the file system, using the same dialogue box. + +MapTool resources appear in the Library panel. If your MapTool window has no Library panel, select **Library** in the **Window** menu to add one. + +### Gather your maps + +The next step in preparing for your game is to gather maps. Depending on what you're playing, that might mean you need to draw your maps, purchase a map pack, or just open a map bundled with a game module. If all you need is a generic dungeon, you can also download free maps from within MapTool's **Add Resource to Library**. + +If you have a set of maps you intend to use often, you can import them as resources. If you are building a campaign you intend to use just once, you can quickly add any PNG or JPEG file as a **New Map** in the **Map** menu. + +![Creating a new map][8] + +Set the **Background** to a texture that roughly matches your map or to a neutral color. + +Set the **Map** to your map graphics file. + +Give your new map a unique **Name**. The map name is visible to your players, so keep it free of spoilers. + +To switch between maps, click the **Select Map** button in the top-right corner of the MapTool window, and choose the map name in the drop-down menu that appears. + +![Select a map][9] + +Before you let your players loose on your map, you still have some important prep work to do. + +### Adjust the grid size + +Since most RPGs govern how far players can move during their turn, especially during combat, game maps are designed to a specific scale. The most common scale is one map square for every five feet. Most maps you download already have a grid drawn on them; if you're designing a map, you should draw on graph paper to keep your scale consistent. Whether your map graphic has a grid or not, MapTool doesn't know about it, but you can adjust the digital grid overlay so that your player tokens are constrained into squares along the grid. + +MapTool doesn't show the grid by default, so go to the **Map** menu and select **Adjust grid**. This displays MapTool's grid lines, and your goal is to make MapTool's grid line up with the grid drawn onto your map graphic. If your map graphic doesn't have a grid, it may indicate its scale; a common scale is one inch per five feet, and you can usually assume 72 pixels is one inch (on a 72 DPI screen). While adjusting the grid, you can change the color of the grid lines for your own reference. Set the cell size in pixels. Click and drag to align MapTool's grid to your map's grid. + +![Adjusting the grid][10] + +If your map has no grid and you want the grid to remain visible after you adjust it, go to the **View** menu and select **Show Grid**. + +### Add players and NPCs + +To add a player character (PC), non-player character (NPC), or monster to your map, find an appropriate token in your **Library** panel, then drag and drop one onto your map. In the **New Token** dialogue box that appears, give the token a name and set it as an NPC or a PC, then click the OK button. + +![Adding a player character to the map][11] + +Once a token is on the map, try moving it to see how its movements are constrained to the grid you've designated. Make sure **Interaction Tools** , located in the toolbar just under the **File** menu, is selected. + +![A token moving within the grid][12] + +Each token added to a map has its own set of properties, including the direction it's facing, a light source, player ownership, conditions (such as incapacitated, prone, dead, and so on), and even class attributes. You can set as many or as few of these as you want, but at the very least you should right-click on each token and assign it ownership. Your players must be logged into your MapTool server for tokens to be assigned to them, but you can assign yourself NPCs and monsters in advance. + +The right-click menu provides access to all important token-related functions, including setting which direction it's facing, setting a health bar and health value, a copy and paste function (enabling you and your players to move tokens from map to map), and much more. + +![The token menu unlocks great, arcane power][13] + +### Activate fog-of-war effects + +If you're using maps exclusively to coordinate combat, you may not need a fog-of-war effect. But if you're using maps to help your players visualize a dungeon they're exploring, you probably don't want them to see the whole map before they've made significant moves, like opening locked doors or braving a decaying bridge over a pit of hot lava. + +The fog-of-war effect is an invaluable tool for the GM, and it's essential to set it up early so that your players don't accidentally get a sneak peek at all the horrors your dungeon holds for them. + +To activate fog-of-war on a map, go to the **Map** and select **Fog-of-War**. This blackens the entire screen for your players, so your next step is to reveal some portion of the map so that your players aren't faced with total darkness when they switch to the map. Fog-of-war is a subtractive process; it starts 100% dark, and as the players progress, you reveal new portions of the map using fog-of-war drawing tools available in the **FOG** toolbar, just under the **View** menu. + +You can reveal sections of the map in rectangle blocks, ovals, polygons, diamonds, and freehand shapes. Once you've selected the shape, click and release on the map, drag to define an area to reveal, and then click again. + +![Fog-of-war as experienced by a playe][14] + +If you're accidentally overzealous with what you reveal, you have two ways to reverse what you've done: You can manually draw new fog, or you can reset all fog. The quicker method is to reset all fog with **Ctrl+Shift+A**. The more elegant solution is to press **Shift** , then click and release, draw an area of fog, and then click again. Instead of exposing an area of the map, it restores fog. + +### Add lighting effects + +Fog-of-war mimics the natural phenomenon of not being able to see areas of the world other than where you are, but lighting effects mimic the visibility player characters might experience in light and dark. For games like Pathfinder and Dungeons and Dragons 5e, visibility is governed by light sources matched against light conditions. + +First, activate lighting by clicking on the **Map** menu, selecting **Vision** , and then choosing either Daylight or Night. Now lighting effects are active, but none of your players have light sources, so they have no visibility. + +To assign light sources to players, right-click on the appropriate token and choose **Light Source**. Definitions exist for the D20 system (candle, lantern, torch, and so on) and in generic measurements. + +With lighting effects active, players can expose portions of fog-of-war as their light sources get closer to unexposed fog. That's a great effect, but it doesn't make much sense when players can illuminate the next room right through a solid wall. To prevent that, you have to help MapTool differentiate between empty space and solid objects. + +#### Define solid objects + +Defining walls and other solid objects through which light should not pass is easier than it sounds. MapTool's **Vision Blocking Layer** (VBL) tools are basic and built to minimize prep time. There are several basic shapes available, including a basic rectangle and an oval. Draw these shapes over all the solid walls, doors, pillars, and other obstructions, and you have instant rudimentary physics. + +![Setting up obstructions][15] + +Now your players can move around the map with light sources without seeing what lurks in the shadows of a nearby pillar or behind an innocent-looking door… until it's too late! + +![Lighting effects][16] + +### Track initiative + +Eventually, your players are going to stumble on something that wants to kill them, and that means combat. In most RPG systems, combat is played in rounds, with the order of turns decided by an _initiative_ roll. During combat, each player (in order of their initiative roll, from greatest to lowest) tries to defeat their foe, ideally dealing enough damage until their foe is left with no health points (HP). It's usually the most paperwork a GM has to do during a game because it involves tracking whose turn it is, how much damage each monster has taken, what amount of damage each monster's attack deals, what special abilities each monster has, and more. Luckily, MapTool can help with that—and better yet, you can extend it with a custom macro to do even more. + +MapTool's basic initiative panel helps you keep track of whose turn it is and how many rounds have transpired so far. To view the initiative panel, go to the **Window** menu and select **Initiative**. + +To add characters to the initiative order, right-click a token and select **Add To Initiative**. As you add each, the token and its label appear in the initiative panel in the order that you add them. If you make a mistake or someone holds their action and changes the initiative order, click and drag the tokens in the initiative panel to reorder them. + +During combat, click the **Next** button in the top-left of the initiative panel to progress to the next character. As long as you use the **Next** button, the **Round** counter increments, helping you track how many rounds the combat has lasted (which is helpful when you have spells or effects that last only for a specific number of rounds). + +Tracking combat order is helpful, but it's even better to track health points. Your players should be tracking their own health, but since everyone's staring at the same screen, it doesn't hurt to track it publicly in one place. An HP property and a graphical health bar (which you can activate) are assigned to each token, so that's all the infrastructure you need to track HP in MapTool, but doing it manually takes a lot of clicking around. Since MapTool can be extended with macros, it's trivial to bring all these components together for a smooth GM experience. + +The first step is to activate graphical health bars for your tokens. To do this, right-click on each token and select **Edit**. In the **Edit Token** dialog box, click on the **State** tab and deselect the radio button next to **Hide**. + +![Don't hide the health bar][17] + +Do this for each token whose health you want to expose. + +#### Write a macro + +Macros have access to all token properties, so each token's HP can be tracked by reading and writing whatever value exists in the token's HP property. The graphical health bar, however, bases its state on a percentage, so for the health bars to be meaningful, your tokens also must have some value that represents 100% of its HP. + +Go to the **Edit** menu and select **Campaign Properties** to globally add properties to tokens. In the **Campaign Properties** window, select the **Token Properties** tab and then click the **Basic** category in the left column. Under ***@HP** , add ***@MaxHP** and click the **Update** button. Click the **OK** button to close the window. + +![Adding a property to all tokens][18] + +Now right-click a token and select **Edit**. In the **Edit Token** window, select the **State** tab and enter a value for the token's maximum HP (from the player's character sheet). + +To create a new macro, reveal the **Campaign** panel in the **Window** menu. + +In the **Campaign** panel, right-click and select **Add New Macro**. A button labeled **New** appears in the panel. Right-click on the **New** button and select **Edit**. + +Enter this code in the macro editor window: + + +``` +[h:status = input( +"hpAmount|0|Points", +"hpType|Damage,Healing|Damage or heal?|RADIO|SELECT=0")] +[h:abort(status)] + +[if(hpType == 0),CODE: { +[h:HP = HP - hpAmount] +[h:bar.Health = HP / MaxHP] +[r:token.name] takes [r:hpAmount] damage.}; +{ +[h:diff = MaxHP - HP] +[h:HP = min(HP+hpAmount, MaxHP)] +[h:bar.Health = HP / MaxHP] +[r:token.name] gains [r:min(diff,hpAmount)] HP. };] +``` + +You can find full documentation of functions available in MapTool macros and their syntax from the [RPTools wiki][19]. + +In the **Details** tab, enable **Include Label** and **Apply to Selected Tokens** , and leave all other values at their default. Give your macro a better name than **New** , such as **HPTracker** , then click **Apply** and **OK**. + +![Macro editing][20] + +Your campaign now has a new ability! + +Select a token and click your **HPTracker** button. Enter the number of points to deduct from the token, click **OK** , and watch the health bar change to reflect the token's new state. + +It may seem like a simple change, but in the heat of battle, this is a GM's greatest weapon. + +### During the game + +There's obviously a lot you can do with MapTool, but with a little prep work, most of your work is done well before you start playing. You can even create a template campaign by creating an empty campaign with only the macros and settings you want, so all you have to do is import maps and stat out tokens. + +During the game, your workflow is mostly about revealing areas from fog-of-war and managing combat. The players can manage their own tokens, and your prep work takes care of everything else. + +MapTool makes digital gaming easy and fun, and most importantly, it keeps it open source and self-contained. Level-up today by learning MapTool and using it for your games. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-use-maptools + +作者:[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/dice-keys_0.jpg?itok=PGEs3ZXa +[2]: https://opensource.com/article/18/5/maptool +[3]: https://github.com/RPTools/maptool +[4]: https://github.com/RPTools/maptool/releases +[5]: https://klaatu.fedorapeople.org/RPTools/maptool/ +[6]: https://immortalnights.com/tokensite/ +[7]: https://opensource.com/sites/default/files/uploads/maptool-resources.png (Add Resource to Library dialogue) +[8]: https://opensource.com/sites/default/files/uploads/map-properties.png (Creating a new map) +[9]: https://opensource.com/sites/default/files/uploads/map-select.jpg (Select a map) +[10]: https://opensource.com/sites/default/files/uploads/grid-adjust.jpg (Adjusting the grid) +[11]: https://opensource.com/sites/default/files/uploads/token-new.png (Adding a player character to the map) +[12]: https://opensource.com/sites/default/files/uploads/token-move.jpg (A token moving within the grid) +[13]: https://opensource.com/sites/default/files/uploads/token-menu.jpg (The token menu unlocks great, arcane power) +[14]: https://opensource.com/sites/default/files/uploads/fog-of-war.jpg (Fog-of-war as experienced by a playe) +[15]: https://opensource.com/sites/default/files/uploads/vbl.jpg (Setting up obstructions) +[16]: https://opensource.com/sites/default/files/uploads/map-light.jpg (Lighting effects) +[17]: https://opensource.com/sites/default/files/uploads/token-edit.jpg (Don't hide the health bar) +[18]: https://opensource.com/sites/default/files/uploads/campaign-properties.jpg (Adding a property to all tokens) +[19]: https://lmwcs.com/rptools/wiki/Main_Page +[20]: https://opensource.com/sites/default/files/uploads/macro-detail.jpg (Macro editing) diff --git a/sources/tech/20190619 11 Free and Open Source Video Editing Software.md b/sources/tech/20190619 11 Free and Open Source Video Editing Software.md new file mode 100644 index 0000000000..57ad8a5358 --- /dev/null +++ b/sources/tech/20190619 11 Free and Open Source Video Editing Software.md @@ -0,0 +1,327 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Free and Open Source Video Editing Software) +[#]: via: (https://itsfoss.com/open-source-video-editors/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +11 Free and Open Source Video Editing Software +====== + +We’ve already covered the [top video editors for Linux][1]. That list contained some non-open source software as well. This made us write this article to feature only open source video editors. We’ve also mentioned what platforms are supported by these software so that this list is helpful even if you are not using Linux. + +### Top Free and Open Source Video Editors + +![Best Open Source Video Editors][2] + +Just for your information, this list is not a ranking and the editors listed here are not in any specific order. I have not mentioned the installation procedure but you can find that information on the website of each project. + +#### 1\. Kdenlive + +![][3] + +**Key Features** : + + * Multi-track Video Editing + * All kinds of audio/video format supported with the help of FFmpeg libraries + * 2D Title maker + * Customizable Interface and shortcuts + * Proxy editing to make things faster + * Automatic backup + * Timeline preview + * Keyframeable effects + * Audiometer, Histogram, Waveform, etc. + + + +**Platforms available on:** Linux, macOS and Windows. + +Kdenlive is an open source video editor (and free) available for Windows, Mac OSX, and Linux distros. + +If you are on a Mac, you will have to manually compile and install it. However, if you are on Windows, you can download the EXE file and should have no issues installing it. + +[Kdenlive][4] + +#### 2\. LiVES + +![][5] + +**Key Features:** + + * Frame and sample accurate editing + * Edit video in real-time + * Can be controlled using MIDI, keyboard, Joystic + * Multi-track support + * VJ keyboard control during playback + * Plugins supported + * Compatible with various effects frameworks: projectM, LADSPA audio, and so on. + + + +**Platforms available on:** Linux and macOS. Support for Windows will be added soon. + +LiVES is an interesting open source video editor. You can find the code on [GitHub][6]. It is currently available for **Linux and macOS Leopard**. It will soon be available for Windows (hopefully by the end of 2019). + +[LiVES][7] + +#### 3\. OpenShot + +![][8] + +**Key Features:** + + * Almost all video/audio formats supported + * Key frame animation framework + * Multi-track support + * Desktop integration (drag and drop support) + * Video transition with real-time previews + * 3D animated titles and effects + * Advanced timeline with drag/drop support, panning, scrolling, zooming, and snapping. + + + +**Platforms available on:** Linux, macOS and Windows. + +OpenShot is a quite popular video editor and it is open source as well. Unlike others, OpenShot offers a DMG installer for Mac OSX. So, you don’t have to compile and install it manually. + +If you are a fan of open source solutions and you own a Mac, OpenShot seems like a very good option. + +[OpenShot][9] + +#### 4\. VidCutter + +![][10] + +**Key Features:** + + * Keyframes viewer + * Cut, Split, and add different clips + * Major audio/video formats supported + + + +[][11] + +Suggested read Install Windows Like Desktop Widgets In Ubuntu Linux With Screenlets + +**Platforms available on:** Linux, macOS and Windows. + +VidCutter is an open source video editor for basic tasks. It does not offer a plethora of features – but it works for all the common tasks like clipping or cutting. It’s under active development as well. + +For Linux, it is available on Flathub as well. And, for Windows and Mac OS, you do get EXE and DMG file packages in the latest releases. + +[VidCutter][12] + +#### 5\. Shotcut + +![][13] + +**Key Features:** + + * Supports almost all major audio/video formats with the help of FFmpeg libraries. + * Multiple dockable/undockable panels + * Intuitive UI + * JACK transport sync + * Stereo, mono, and 5.1 surround support + * Waveform, Histogram, etc. + * Easy to use with dual monitors + * Portable version available + + + +**Platforms available on:** Linux, macOS and Windows. + +Shotcut is yet another popular open source video editor available across multiple platforms. It features a nice interface to work on. + +When considering the features, it offers almost everything that you would ever need (from color correction to adding transitions). Also, it provides a portable version for Windows – which is an impressive thing. + +[Shotcut][14] + +#### 6\. Flowblade + +![][15] + +**Key Features:** + + * Advanced timeline control + * Multi-track editing + * [G’mic][16] tool + * All major audio/video formats supported with the help of FFMpeg libraries + + + +**Platforms available on:** Linux + +Flowblade is an intuitive open source video editor available only for Linux. Yes, it is a bummer that we do not have cross-platform support for this. + +However, if you are using a Linux distro, you can either download the .deb file and get it installed or use the source code on GitHub. + +[Flowblade][17] + +#### 7\. Avidemux + +![][18] + +**Key Features:** + + * Trim + * Cut + * Filter support + * Major video format supported + + + +**Platforms available on:** Linux, BSD, macOS and Windows. + +If you are looking for a basic cross-platform open source video editor – this will be one of our recommendations. You just get the ability to cut, save, add a filter, and perform some other basic editing tasks. Their official [SourceForge page][19] might look like it has been abandoned, but it is in active development. + +[Avidemux][19] + +#### 8\. Pitivi + +![][20] + +**Key Features:** + + * All major video formats supported using [GStreamer Multimedia Framework][21] + * Advanced timeline independent of frame rate + * Animated effects and transitions + * Audio waveforms + * Real-time trimming previews + + + +**Platforms available on:** Linux + +Yet another open source video editor that is available only for Linux. The UI is user-friendly and the features offered will help you perform some advanced edits as well. + +You can install it using Flatpak or look for the source code on their official website. It should be available in the repositories of most distributions as well. + +[Pitivi][22] + +#### 9\. Blender + +![][23] + +**Key Features:** + + * VFX + * Modeling tools + * Animation and Rigging tools + * Draw in 2D or 3D + + + +[][24] + +Suggested read 4 Best Modern Open Source Text Editors For Coding in Linux + +**Platforms available on:** Linux, macOS and Windows. + +Blender is an advanced 3D creation suite. And, it is surprising that you get all those powerful abilities for free (and while being open source). + +Of course, Blender is not a solution for every user – however, it is definitely one of the best open source tool available for Windows, macOS, and Linux. You can also find it on [Steam][25] to install it. + +[Blender][26] + +#### 10\. Cinelerra + +![][27] + +**Key Features:** + + * Advanced timeline + * Motion tracking support + * Video stabilization + * Audio mastering + * Color correction + + + +**Platforms available on:** Linux + +Cinelerra is a quite popular open source video editor. However, it has several branches to it (in other words – different versions). I am not sure if that is a good thing – but you get different features (and ability) on each of them. + +Cinelerra GG, CV, CVE, and HV are those variants catering to users with different preferences. Personally, I would recommend to check out [Cinelerra GG][28]. + +[Cinelerra][29] + +#### 11\. NATRON + +![][30] + +**Key Features:** + + * VFX + * Powerful Tracker + * Keying tools for production needs + * Shadertoy and G’mic tools + * OpenFX plugin support + + + +**Platforms available on** : Linux, macOS and Windows. + +If you are into VFX and motion graphics, NATRON is a good alternative to Blender. Of course, in order to compare them for your usage, you will have to give it a try yourself. + +You do have the installer available for Windows and the dmg package for Mac. So, it is quite easy to get it installed. You can always head to its [GitHub page][31] for more information. + +[Natron][32] + +**Wrapping Up** + +So, now that you know about some of the most popular open source video editors available out there – what do you think about them? + +Are they good enough for professional requirements? Or, did we miss any of your favorite open source video editor that deserved the mention? + +I am not an expert video editor and have only experience with simple editing tasks to create YouTube videos. If you are an experienced and professional video editor, I would like to hear your opinion on how good are these open source video editors for the experts. + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-video-editors/ + +作者:[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/best-video-editing-software-linux/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/best-open-source-video-editors-800x450.png?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/06/kdenlive-free-video-editor-on-ubuntu.jpg?ssl=1 +[4]: https://kdenlive.org/en/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/06/lives-video-editor.jpg?fit=800%2C600&ssl=1 +[6]: https://github.com/salsaman/LiVES +[7]: http://lives-video.com/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/06/openshot-free-video-editor-on-ubuntu.jpg?ssl=1 +[9]: https://www.openshot.org/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/06/vidcutter.jpg?fit=800%2C585&ssl=1 +[11]: https://itsfoss.com/install-windows-desktop-widgets-linux/ +[12]: https://github.com/ozmartian/vidcutter +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/06/shotcut-video-editor-linux.jpg?resize=800%2C503&ssl=1 +[14]: https://shotcut.org/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/06/flowblade-movie-editor-on-ubuntu.jpg?ssl=1 +[16]: https://gmic.eu/ +[17]: https://jliljebl.github.io/flowblade/index.html +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/avidemux.jpg?resize=800%2C697&ssl=1 +[19]: http://avidemux.sourceforge.net/ +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/pitvi.jpg?resize=800%2C464&ssl=1 +[21]: https://en.wikipedia.org/wiki/GStreamer +[22]: http://www.pitivi.org/ +[23]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/06/blender-running-on-ubuntu-16.04.jpg?ssl=1 +[24]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[25]: https://store.steampowered.com/app/365670/Blender/ +[26]: https://www.blender.org/ +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/06/cinelerra-screenshot.jpeg?ssl=1 +[28]: https://www.cinelerra-gg.org/ +[29]: http://cinelerra.org/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/natron.jpg?fit=800%2C481&ssl=1 +[31]: https://github.com/NatronGitHub/Natron +[32]: https://natrongithub.github.io/ diff --git a/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md new file mode 100644 index 0000000000..0f3da1b13e --- /dev/null +++ b/sources/tech/20190619 Getting started with OpenSSL- Cryptography basics.md @@ -0,0 +1,342 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with OpenSSL: Cryptography basics) +[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-1) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu/users/akritiko/users/clhermansen) + +Getting started with OpenSSL: Cryptography basics +====== +Need a primer on cryptography basics, especially regarding OpenSSL? Read +on. +![A lock on the side of a building][1] + +This article is the first of two on cryptography basics using [OpenSSL][2], a production-grade library and toolkit popular on Linux and other systems. (To install the most recent version of OpenSSL, see [here][3].) OpenSSL utilities are available at the command line, and programs can call functions from the OpenSSL libraries. The sample program for this article is in C, the source language for the OpenSSL libraries. + +The two articles in this series cover—collectively—cryptographic hashes, digital signatures, encryption and decryption, and digital certificates. You can find the code and command-line examples in a ZIP file from [my website][4]. + +Let’s start with a review of the SSL in the OpenSSL name. + +### A quick history + +[Secure Socket Layer (SSL)][5] is a cryptographic protocol that [Netscape][6] released in 1995. This protocol layer can sit atop HTTP, thereby providing the _S_ for _secure_ in HTTPS. The SSL protocol provides various security services, including two that are central in HTTPS: + + * Peer authentication (aka mutual challenge): Each side of a connection authenticates the identity of the other side. If Alice and Bob are to exchange messages over SSL, then each first authenticates the identity of the other. + * Confidentiality: A sender encrypts messages before sending these over a channel. The receiver then decrypts each received message. This process safeguards network conversations. Even if eavesdropper Eve intercepts an encrypted message from Alice to Bob (a _man-in-the-middle_ attack), Eve finds it computationally infeasible to decrypt this message. + + + +These two key SSL services, in turn, are tied to others that get less attention. For example, SSL supports message integrity, which assures that a received message is the same as the one sent. This feature is implemented with hash functions, which likewise come with the OpenSSL toolkit. + +SSL is versioned (e.g., SSLv2 and SSLv3), and in 1999 Transport Layer Security (TLS) emerged as a similar protocol based upon SSLv3. TLSv1 and SSLv3 are alike, but not enough so to work together. Nonetheless, it is common to refer to SSL/TLS as if they are one and the same protocol. For example, OpenSSL functions often have SSL in the name even when TLS rather than SSL is in play. Furthermore, calling OpenSSL command-line utilities begins with the term **openssl**. + +The documentation for OpenSSL is spotty beyond the **man** pages, which become unwieldy given how big the OpenSSL toolkit is. Command-line and code examples are one way to bring the main topics into focus together. Let’s start with a familiar example—accessing a web site with HTTPS—and use this example to pick apart the cryptographic pieces of interest. + +### An HTTPS client + +The **client** program shown here connects over HTTPS to Google: + + +``` +/* compilation: gcc -o client client.c -lssl -lcrypto */ + +#include <stdio.h> + +#include <stdlib.h> + +#include <openssl/bio.h> /* BasicInput/Output streams */ + +#include <openssl/err.h> /* errors */ + +#include <openssl/ssl.h> /* core library */ + +#define BuffSize 1024 + +void report_and_exit(const char* msg) { +  [perror][7](msg); +  ERR_print_errors_fp(stderr); +  [exit][8](-1); +} + +void init_ssl() { +  SSL_load_error_strings(); +  SSL_library_init(); +} + +void cleanup(SSL_CTX* ctx, BIO* bio) { +  SSL_CTX_free(ctx); +  BIO_free_all(bio); +} + +void secure_connect(const char* hostname) { +  char name[BuffSize]; +  char request[BuffSize]; +  char response[BuffSize]; + +  const SSL_METHOD* method = TLSv1_2_client_method(); +  if (NULL == method) report_and_exit("TLSv1_2_client_method..."); + +  SSL_CTX* ctx = SSL_CTX_new(method); +  if (NULL == ctx) report_and_exit("SSL_CTX_new..."); + +  BIO* bio = BIO_new_ssl_connect(ctx); +  if (NULL == bio) report_and_exit("BIO_new_ssl_connect..."); + +  SSL* ssl = NULL; + +  /* link bio channel, SSL session, and server endpoint */ + +  [sprintf][9](name, "%s:%s", hostname, "https"); +  BIO_get_ssl(bio, &ssl); /* session */ +  SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* robustness */ +  BIO_set_conn_hostname(bio, name); /* prepare to connect */ + +  /* try to connect */ +  if (BIO_do_connect(bio) <= 0) { +    cleanup(ctx, bio); +    report_and_exit("BIO_do_connect..."); +  } + +  /* verify truststore, check cert */ +  if (!SSL_CTX_load_verify_locations(ctx, +                                      "/etc/ssl/certs/ca-certificates.crt", /* truststore */ +                                      "/etc/ssl/certs/")) /* more truststore */ +    report_and_exit("SSL_CTX_load_verify_locations..."); + +  long verify_flag = SSL_get_verify_result(ssl); +  if (verify_flag != X509_V_OK) +    [fprintf][10](stderr, +            "##### Certificate verification error (%i) but continuing...\n", +            (int) verify_flag); + +  /* now fetch the homepage as sample data */ +  [sprintf][9](request, +          "GET / HTTP/1.1\x0D\x0AHost: %s\x0D\x0A\x43onnection: Close\x0D\x0A\x0D\x0A", +          hostname); +  BIO_puts(bio, request); + +  /* read HTTP response from server and print to stdout */ +  while (1) { +    [memset][11](response, '\0', sizeof(response)); +    int n = BIO_read(bio, response, BuffSize); +    if (n <= 0) break; /* 0 is end-of-stream, < 0 is an error */ +  [puts][12](response); +  } + +  cleanup(ctx, bio); +} + +int main() { +  init_ssl(); + +  const char* hostname = "www.google.com:443"; +  [fprintf][10](stderr, "Trying an HTTPS connection to %s...\n", hostname); +  secure_connect(hostname); + +return 0; +} +``` + +This program can be compiled and executed from the command line (note the lowercase L in **-lssl** and **-lcrypto**): + +**gcc** **-o** **client client.c -lssl** **-lcrypto** + +This program tries to open a secure connection to the web site [www.google.com][13]. As part of the TLS handshake with the Google web server, the **client** program receives one or more digital certificates, which the program tries (but, on my system, fails) to verify. Nonetheless, the **client** program goes on to fetch the Google homepage through the secure channel. This program depends on the security artifacts mentioned earlier, although only a digital certificate stands out in the code. The other artifacts remain behind the scenes and are clarified later in detail. + +Generally, a client program in C or C++ that opened an HTTP (non-secure) channel would use constructs such as a _file descriptor_ for a _network socket_, which is an endpoint in a connection between two processes (e.g., the client program and the Google web server). A file descriptor, in turn, is a non-negative integer value that identifies, within a program, any file-like construct that the program opens. Such a program also would use a structure to specify details about the web server’s address. + +None of these relatively low-level constructs occurs in the client program, as the OpenSSL library wraps the socket infrastructure and address specification in high-level security constructs. The result is a straightforward API. Here’s a first look at the security details in the example **client** program. + + * The program begins by loading the relevant OpenSSL libraries, with my function **init_ssl** making two calls into OpenSSL: + +**SSL_library_init(); SSL_load_error_strings();** + + * The next initialization step tries to get a security _context_, a framework of information required to establish and maintain a secure channel to the web server. **TLS 1.2** is used in the example, as shown in this call to an OpenSSL library function: + +**const SSL_METHOD* method = TLSv1_2_client_method(); /* TLS 1.2 */** + +If the call succeeds, then the **method** pointer is passed to the library function that creates the context of type **SSL_CTX**: + +**SSL_CTX*** **ctx** **= SSL_CTX_new(method);** + +The **client** program checks for errors on each of these critical library calls, and then the program terminates if either call fails. + + * Two other OpenSSL artifacts now come into play: a security session of type **SSL**, which manages the secure connection from start to finish; and a secured stream of type **BIO** (Basic Input/Output), which is used to communicate with the web server. The **BIO** stream is generated with this call: + +**BIO* bio = BIO_new_ssl_connect(ctx);** + +Note that the all-important context is the argument. The **BIO** type is the OpenSSL wrapper for the **FILE** type in C. This wrapper secures the input and output streams between the **client** program and Google's web server. + + * With the **SSL_CTX** and **BIO** in hand, the program then links these together in an **SSL** session. Three library calls do the work: + +**BIO_get_ssl(bio, &ssl); /* get a TLS session */** + +**SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); /* for robustness */** + +**BIO_set_conn_hostname(bio, name); /* prepare to connect to Google */** + +The secure connection itself is established through this call: + +**BIO_do_connect(bio);** + +If this last call does not succeed, the **client** program terminates; otherwise, the connection is ready to support a confidential conversation between the **client** program and the Google web server. + + + + +During the handshake with the web server, the **client** program receives one or more digital certificates that authenticate the server’s identity. However, the **client** program does not send a certificate of its own, which means that the authentication is one-way. (Web servers typically are configured _not_ to expect a client certificate.) Despite the failed verification of the web server’s certificate, the **client** program continues by fetching the Google homepage through the secure channel to the web server. + +Why does the attempt to verify a Google certificate fail? A typical OpenSSL installation has the directory **/etc/ssl/certs**, which includes the **ca-certificates.crt** file. The directory and the file together contain digital certificates that OpenSSL trusts out of the box and accordingly constitute a _truststore_. The truststore can be updated as needed, in particular, to include newly trusted certificates and to remove ones no longer trusted. + +The client program receives three certificates from the Google web server, but the OpenSSL truststore on my machine does not contain exact matches. As presently written, the **client** program does not pursue the matter by, for example, verifying the digital signature on a Google certificate (a signature that vouches for the certificate). If that signature were trusted, then the certificate containing it should be trusted as well. Nonetheless, the client program goes on to fetch and then to print Google’s homepage. The next section gets into more detail. + +### The hidden security pieces in the client program + +Let’s start with the visible security artifact in the client example—the digital certificate—and consider how other security artifacts relate to it. The dominant layout standard for a digital certificate is X509, and a production-grade certificate is issued by a certificate authority (CA) such as [Verisign][14]. + +A digital certificate contains various pieces of information (e.g., activation and expiration dates, and a domain name for the owner), including the issuer’s identity and _digital signature_, which is an encrypted _cryptographic hash_ value. A certificate also has an unencrypted hash value that serves as its identifying _fingerprint_. + +A hash value results from mapping an arbitrary number of bits to a fixed-length digest. What the bits represent (an accounting report, a novel, or maybe a digital movie) is irrelevant. For example, the Message Digest version 5 (MD5) hash algorithm maps input bits of whatever length to a 128-bit hash value, whereas the SHA1 (Secure Hash Algorithm version 1) algorithm maps input bits to a 160-bit value. Different input bits result in different—indeed, statistically unique—hash values. The next article goes into further detail and focuses on what makes a hash function _cryptographic_. + +Digital certificates differ in type (e.g., _root_, _intermediate_, and _end-entity_ certificates) and form a hierarchy that reflects these types. As the name suggests, a _root_ certificate sits atop the hierarchy, and the certificates under it inherit whatever trust the root certificate has. The OpenSSL libraries and most modern programming languages have an X509 type together with functions that deal with such certificates. The certificate from Google has an X509 format, and the **client** program checks whether this certificate is **X509_V_OK**. + +X509 certificates are based upon public-key infrastructure (PKI), which includes algorithms—RSA is the dominant one—for generating _key pairs_: a public key and its paired private key. A public key is an identity: [Amazon’s][15] public key identifies it, and my public key identifies me. A private key is meant to be kept secret by its owner. + +The keys in a pair have standard uses. A public key can be used to encrypt a message, and the private key from the same pair can then be used to decrypt the message. A private key also can be used to sign a document or other electronic artifact (e.g., a program or an email), and the public key from the pair can then be used to verify the signature. The following two examples fill in some details. + +In the first example, Alice distributes her public key to the world, including Bob. Bob then encrypts a message with Alice’s public key, sending the encrypted message to Alice. The message encrypted with Alice’s public key is decrypted with her private key, which (by assumption) she alone has, like so: + + +``` +             +------------------+ encrypted msg  +-------------------+ +Bob's msg--->|Alice's public key|--------------->|Alice's private key|---> Bob's msg +             +------------------+                +-------------------+ +``` + +Decrypting the message without Alice’s private key is possible in principle, but infeasible in practice given a sound cryptographic key-pair system such as RSA. + +Now, for the second example, consider signing a document to certify its authenticity. The signature algorithm uses a private key from a pair to process a cryptographic hash of the document to be signed: + + +``` +                    +-------------------+ +Hash of document--->|Alice's private key|--->Alice's digital signature of the document +                    +-------------------+ +``` + +Assume that Alice digitally signs a contract sent to Bob. Bob then can use Alice’s public key from the key pair to verify the signature: + + +``` +                                             +------------------+ +Alice's digital signature of the document--->|Alice's public key|--->verified or not +                                             +------------------+ +``` + +It is infeasible to forge Alice’s signature without Alice’s private key: hence, it is in Alice’s interest to keep her private key secret. + +None of these security pieces, except for digital certificates, is explicit in the **client** program. The next article fills in the details with examples that use the OpenSSL utilities and library functions. + +### OpenSSL from the command line + +In the meantime, let’s take a look at OpenSSL command-line utilities: in particular, a utility to inspect the certificates from a web server during the TLS handshake. Invoking the OpenSSL utilities begins with the **openssl** command and then adds a combination of arguments and flags to specify the desired operation. + +Consider this command: + +**openssl list-cipher-algorithms** + +The output is a list of associated algorithms that make up a _cipher suite_. Here’s the start of the list, with comments to clarify the acronyms: + + +``` +AES-128-CBC ## Advanced Encryption Standard, Cipher Block Chaining +AES-128-CBC-HMAC-SHA1 ## Hash-based Message Authentication Code with SHA1 hashes +AES-128-CBC-HMAC-SHA256 ## ditto, but SHA256 rather than SHA1 +... +``` + +The next command, using the argument **s_client**, opens a secure connection to **[www.google.com][13]** and prints screens full of information about this connection: + +**openssl s_client -connect [www.google.com:443][16] -showcerts** + +The port number 443 is the standard one used by web servers for receiving HTTPS rather than HTTP connections. (For HTTP, the standard port is 80.) The network address **[www.google.com:443][16]** also occurs in the **client** program's code. If the attempted connection succeeds, the three digital certificates from Google are displayed together with information about the secure session, the cipher suite in play, and related items. For example, here is a slice of output from near the start, which announces that a _certificate chain_ is forthcoming. The encoding for the certificates is base64: + + +``` +Certificate chain + 0 s:/C=US/ST=California/L=Mountain View/O=Google LLC/CN=www.google.com + i:/C=US/O=Google Trust Services/CN=Google Internet Authority G3 +\-----BEGIN CERTIFICATE----- +MIIEijCCA3KgAwIBAgIQdCea9tmy/T6rK/dDD1isujANBgkqhkiG9w0BAQsFADBU +MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVR29vZ2xlIFRydXN0IFNlcnZpY2VzMSUw +... +``` + +A major web site such as Google usually sends multiple certificates for authentication. + +The output ends with summary information about the TLS session, including specifics on the cipher suite: + + +``` +SSL-Session: +    Protocol : TLSv1.2 +    Cipher : ECDHE-RSA-AES128-GCM-SHA256 +    Session-ID: A2BBF0E4991E6BBBC318774EEE37CFCB23095CC7640FFC752448D07C7F438573 +... +``` + +The protocol **TLS 1.2** is used in the **client** program, and the **Session-ID** uniquely identifies the connection between the **openssl** utility and the Google web server. The **Cipher** entry can be parsed as follows: + + * **ECDHE** (Elliptic Curve Diffie Hellman Ephemeral) is an effective and efficient algorithm for managing the TLS handshake. In particular, ECDHE solves the _key-distribution problem_ by ensuring that both parties in a connection (e.g., the client program and the Google web server) use the same encryption/decryption key, which is known as the _session key_. The follow-up article digs into the details. + + * **RSA** (Rivest Shamir Adleman) is the dominant public-key cryptosystem and named after the three academics who first described the system in the late 1970s. The key-pairs in play are generated with the RSA algorithm. + + * **AES128** (Advanced Encryption Standard) is a _block cipher_ that encrypts and decrypts blocks of bits. (The alternative is a _stream cipher_, which encrypts and decrypts bits one at a time.) The cipher is _symmetric_ in that the same key is used to encrypt and to decrypt, which raises the key-distribution problem in the first place. AES supports key sizes of 128 (used here), 192, and 256 bits: the larger the key, the better the protection. + +Key sizes for symmetric cryptosystems such as AES are, in general, smaller than those for asymmetric (key-pair based) systems such as RSA. For example, a 1024-bit RSA key is relatively small, whereas a 256-bit key is currently the largest for AES. + + * **GCM** (Galois Counter Mode) handles the repeated application of a cipher (in this case, AES128) during a secured conversation. AES128 blocks are only 128-bits in size, and a secure conversation is likely to consist of multiple AES128 blocks from one side to the other. GCM is efficient and commonly paired with AES128. + + * **SHA256** (Secure Hash Algorithm 256 bits) is the cryptographic hash algorithm in play. The hash values produced are 256 bits in size, although even larger values are possible with SHA. + + + + +Cipher suites are in continual development. Not so long ago, for example, Google used the RC4 stream cipher (Ron’s Cipher version 4 after Ron Rivest from RSA). RC4 now has known vulnerabilities, which presumably accounts, at least in part, for Google’s switch to AES128. + +### Wrapping up + +This first look at OpenSSL, through a secure C web client and various command-line examples, has brought to the fore a handful of topics in need of more clarification. [The next article gets into the details][17], starting with cryptographic hashes and ending with a fuller discussion of how digital certificates address the key distribution challenge. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 + +作者:[Marty Kalin][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/mkalindepauledu/users/akritiko/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_3reasons.png?itok=k6F3-BqA (A lock on the side of a building) +[2]: https://www.openssl.org/ +[3]: https://www.howtoforge.com/tutorial/how-to-install-openssl-from-source-on-linux/ +[4]: http://condor.depaul.edu/mkalin +[5]: https://en.wikipedia.org/wiki/Transport_Layer_Security +[6]: https://en.wikipedia.org/wiki/Netscape +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/perror.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/sprintf.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/memset.html +[12]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[13]: http://www.google.com +[14]: https://www.verisign.com +[15]: https://www.amazon.com +[16]: http://www.google.com:443 +[17]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 diff --git a/sources/tech/20190620 How to SSH into a running container.md b/sources/tech/20190620 How to SSH into a running container.md new file mode 100644 index 0000000000..f0b4cdafc2 --- /dev/null +++ b/sources/tech/20190620 How to SSH into a running container.md @@ -0,0 +1,185 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to SSH into a running container) +[#]: via: (https://opensource.com/article/19/6/how-ssh-running-container) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/bcotton) + +How to SSH into a running container +====== +SSH is probably not the best way to run commands in a container; try +this instead. +![cubes coming together to create a larger cube][1] + +Containers have shifted the way we think about virtualization. You may remember the days (or you may still be living them) when a virtual machine was the full stack, from virtualized BIOS, operating system, and kernel up to each virtualized network interface controller (NIC). You logged into the virtual box just as you would your own workstation. It was a very direct and simple analogy. + +And then containers came along, [starting with LXC][2] and culminating in the Open Container Initiative ([OCI][3]), and that's when things got complicated. + +### Idempotency + +In the world of containers, the "virtual machine" is only mostly virtual. Everything that doesn't need to be virtualized is borrowed from the host machine. Furthermore, the container itself is usually meant to be ephemeral and idempotent, so it stores no persistent data, and its state is defined by configuration files on the host machine. + +If you're used to the old ways of virtual machines, then you naturally expect to log into a virtual machine in order to interact with it. But containers are ephemeral, so anything you do in a container is forgotten, by design, should the container need to be restarted or respawned. + +The commands controlling your container infrastructure (such as **oc, crictl**, **lxc**, and **docker**) provide an interface to run important commands to restart services, view logs, confirm the existence and permissions modes of an important file, and so on. You should use the tools provided by your container infrastructure to interact with your application, or else edit configuration files and relaunch. That's what containers are designed to do. + +For instance, the open source forum software [Discourse][4] is officially distributed as a container image. The Discourse software is _stateless_, so its installation is self-contained within **/var/discourse**. As long as you have a backup of **/var/discourse**, you can always restore the forum by relaunching the container. The container holds no persistent data, and its configuration file is **/var/discourse/containers/app.yml**. + +Were you to log into the container and edit any of the files it contains, all changes would be lost if the container had to be restarted. + +LXC containers you're building from scratch are more flexible, with configuration files (in a location defined by you) passed to the container when you launch it. + +A build system like [Jenkins][5] usually has a default configuration file, such as **jenkins.yaml**, providing instructions for a base container image that exists only to build and run tests on source code. After the builds are done, the container goes away. + +Now that you know you don't need SSH to interact with your containers, here's an overview of what tools are available (and some notes about using SSH in spite of all the fancy tools that make it redundant). + +### OpenShift web console + +[OpenShift 4][6] offers an open source toolchain for container creation and maintenance, including an interactive web console. + +When you log into your web console, navigate to your project overview and click the **Applications** tab for a list of pods. Select a (running) pod to open the application's **Details** panel. + +![Pod details in OpenShift][7] + +Click the **Terminal** tab at the top of the **Details** panel to open an interactive shell in your container. + +![A terminal in a running container][8] + +If you prefer a browser-based experience for Kubernetes management, you can learn more through interactive lessons available at [learn.openshift.com][9]. + +### OpenShift oc + +If you prefer a command-line interface experience, you can use the **oc** command to interact with containers from the terminal. + +First, get a list of running pods (or refer to the web console for a list of active pods). To get that list, enter: + + +``` +`$ oc get pods` +``` + +You can view the logs of a resource (a pod, build, or container). By default, **oc logs** returns the logs from the first container in the pod you specify. To select a single container, add the **\--container** option: + + +``` +`$ oc logs --follow=true example-1-e1337 --container app` +``` + +You can also view logs from all containers in a pod with: + + +``` +`$ oc logs --follow=true example-1-e1337 --all-containers` +``` + +#### Execute commands + +You can execute commands remotely with: + + +``` +$ oc exec example-1-e1337 --container app hostname +        example.local +``` + +This is similar to running SSH non-interactively: you get to run the command you want to run without an interactive shell taking over your environment. + +#### Remote shell + +You can attach to a running container. This still does _not_ open a shell in the container, but it does run commands directly. For example: + + +``` +`$ oc attach example-1-e1337 --container app` +``` + +If you need a true interactive shell in a container, you can open a remote shell with the **oc rsh** command as long as the container includes a shell. By default, **oc rsh** launches **/bin/sh**: + + +``` +`$ oc rsh example-1-e1337 --container app` +``` + +### Kubernetes + +If you're using Kubernetes directly, you can use the **kubetcl** **exec** command to run a Bash shell in your pod. + +First, confirm that your pod is running: + + +``` +`$ kubectl get pods` +``` + +As long as the pod containing your application is listed, you can use the **exec** command to launch a shell in the container. Using the name **example-pod** as the pod name, enter: + + +``` +$ kubectl exec --stdin=false --tty=false +  example-pod -- /bin/bash +[root@example.local][10]:/# ls +bin   core etc   lib    root  srv +boot  dev  home  lib64  sbin  tmp  var +``` + +### Docker + +The **docker** command is similar to **kubectl**. With the **dockerd** daemon running, get the name of the running container (you may have to use **sudo** to escalate privileges if you're not in the appropriate group): + + +``` +$ docker ps +CONTAINER ID    IMAGE       COMMAND      NAME +678ac5cca78e    centos     "/bin/bash"   example-centos +``` + +Using the container name, you can run a command in the container: + + +``` +$ docker exec example/centos cat /etc/os-release +CentOS Linux release 7.6 +NAME="CentOS Linux" +VERSION="7" +ID="centos" +ID_LIKE="rhel fedora" +VERSION_ID="7" +[...] +``` + +Or you can launch a Bash shell for an interactive session: + + +``` +`$ docker exec -it example-centos /bin/bash` +``` + +### Containers and appliances + +The important thing to remember when dealing with the cloud is that containers are essentially runtimes rather than virtual machines. While they have much in common with a Linux system (because they _are_ a Linux system!), they rarely translate directly to the commands and workflow you may have developed on your Linux workstation. However, like appliances, containers have an interface to help you develop, maintain, and monitor them, so get familiar with the front-end commands and services until you're happily interacting with them just as easily as ****you interact with virtual (or bare-metal) machines. Soon, you'll wonder why everything isn't developed to be ephemeral. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/how-ssh-running-container + +作者:[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/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[2]: https://opensource.com/article/18/11/behind-scenes-linux-containers +[3]: https://www.opencontainers.org/ +[4]: http://discourse.org +[5]: http://jenkins.io +[6]: https://www.openshift.com/learn/get-started +[7]: https://opensource.com/sites/default/files/uploads/openshift-pod-access.jpg (Pod details in OpenShift) +[8]: https://opensource.com/sites/default/files/uploads/openshift-pod-terminal.jpg (A terminal in a running container) +[9]: http://learn.openshift.com +[10]: mailto:root@example.local diff --git a/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md b/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md new file mode 100644 index 0000000000..724c97bc01 --- /dev/null +++ b/sources/tech/20190620 How to use OpenSSL- Hashes, digital signatures, and more.md @@ -0,0 +1,337 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to use OpenSSL: Hashes, digital signatures, and more) +[#]: via: (https://opensource.com/article/19/6/cryptography-basics-openssl-part-2) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +How to use OpenSSL: Hashes, digital signatures, and more +====== +Dig deeper into the details of cryptography with OpenSSL: Hashes, +digital signatures, digital certificates, and more +![A person working.][1] + +The [first article in this series][2] introduced hashes, encryption/decryption, digital signatures, and digital certificates through the OpenSSL libraries and command-line utilities. This second article drills down into the details. Let’s begin with hashes, which are ubiquitous in computing, and consider what makes a hash function _cryptographic_. + +### Cryptographic hashes + +The download page for the OpenSSL source code () contains a table with recent versions. Each version comes with two hash values: 160-bit SHA1 and 256-bit SHA256. These values can be used to verify that the downloaded file matches the original in the repository: The downloader recomputes the hash values locally on the downloaded file and then compares the results against the originals. Modern systems have utilities for computing such hashes. Linux, for instance, has **md5sum** and **sha256sum**. OpenSSL itself provides similar command-line utilities. + +Hashes are used in many areas of computing. For example, the Bitcoin blockchain uses SHA256 hash values as block identifiers. To mine a Bitcoin is to generate a SHA256 hash value that falls below a specified threshold, which means a hash value with at least N leading zeroes. (The value of N can go up or down depending on how productive the mining is at a particular time.) As a point of interest, today’s miners are hardware clusters designed for generating SHA256 hashes in parallel. During a peak time in 2018, Bitcoin miners worldwide generated about 75 million terahashes per second—yet another incomprehensible number. + +Network protocols use hash values as well—often under the name **checksum**—to support message integrity; that is, to assure that a received message is the same as the one sent. The message sender computes the message’s checksum and sends the results along with the message. The receiver recomputes the checksum when the message arrives. If the sent and the recomputed checksum do not match, then something happened to the message in transit, or to the sent checksum, or to both. In this case, the message and its checksum should be sent again, or at least an error condition should be raised. (Low-level network protocols such as UDP do not bother with checksums.) + +Other examples of hashes are familiar. Consider a website that requires users to authenticate with a password, which the user enters in their browser. Their password is then sent, encrypted, from the browser to the server via an HTTPS connection to the server. Once the password arrives at the server, it's decrypted for a database table lookup. + +What should be stored in this lookup table? Storing the passwords themselves is risky. It’s far less risky is to store a hash generated from a password, perhaps with some _salt_ (extra bits) added to taste before the hash value is computed. Your password may be sent to the web server, but the site can assure you that the password is not stored there. + +Hash values also occur in various areas of security. For example, hash-based message authentication code ([HMAC][3]) uses a hash value and a secret cryptographic key to authenticate a message sent over a network. HMAC codes, which are lightweight and easy to use in programs, are popular in web services. An X509 digital certificate includes a hash value known as the _fingerprint_, which can facilitate certificate verification. An in-memory truststore could be implemented as a lookup table keyed on such fingerprints—as a _hash map_, which supports constant-time lookups. The fingerprint from an incoming certificate can be compared against the truststore keys for a match. + +What special property should a _cryptographic hash function_ have? It should be _one-way_, which means very difficult to invert. A cryptographic hash function should be relatively straightforward to compute, but computing its inverse—the function that maps the hash value back to the input bitstring—should be computationally intractable. Here is a depiction, with **chf** as a cryptographic hash function and my password **foobar** as the sample input: + + +``` +        +---+ +foobar—>|chf|—>hash value ## straightforward +        +--–+ +``` + +By contrast, the inverse operation is infeasible: + + +``` +            +-----------+ +hash value—>|chf inverse|—>foobar ## intractable +            +-----------+ +``` + +Recall, for example, the SHA256 hash function. For an input bitstring of any length N > 0, this function generates a fixed-length hash value of 256 bits; hence, this hash value does not reveal even the input bitstring’s length N, let alone the value of each bit in the string. By the way, SHA256 is not susceptible to a [_length extension attack_][4]. The only effective way to reverse engineer a computed SHA256 hash value back to the input bitstring is through a brute-force search, which means trying every possible input bitstring until a match with the target hash value is found. Such a search is infeasible on a sound cryptographic hash function such as SHA256. + +Now, a final review point is in order. Cryptographic hash values are statistically rather than unconditionally unique, which means that it is unlikely but not impossible for two different input bitstrings to yield the same hash value—a _collision_. The [_birthday problem_][5] offers a nicely counter-intuitive example of collisions. There is extensive research on various hash algorithms’ _collision resistance_. For example, MD5 (128-bit hash values) has a breakdown in collision resistance after roughly 221 hashes. For SHA1 (160-bit hash values), the breakdown starts at about 261 hashes. + +A good estimate of the breakdown in collision resistance for SHA256 is not yet in hand. This fact is not surprising. SHA256 has a range of 2256 distinct hash values, a number whose decimal representation has a whopping 78 digits! So, can collisions occur with SHA256 hashing? Of course, but they are extremely unlikely. + +In the command-line examples that follow, two input files are used as bitstring sources: **hashIn1.txt** and **hashIn2.txt**. The first file contains **abc** and the second contains **1a2b3c**. + +These files contain text for readability, but binary files could be used instead. + +Using the Linux **sha256sum** utility on these two files at the command line—with the percent sign (**%**) as the prompt—produces the following hash values (in hex): + + +``` +% sha256sum hashIn1.txt +9e83e05bbf9b5db17ac0deec3b7ce6cba983f6dc50531c7a919f28d5fb3696c3 hashIn1.txt + +% sha256sum hashIn2.txt +3eaac518777682bf4e8840dd012c0b104c2e16009083877675f00e995906ed13 hashIn2.txt +``` + +The OpenSSL hashing counterparts yield the same results, as expected: + + +``` +% openssl dgst -sha256 hashIn1.txt +SHA256(hashIn1.txt)= 9e83e05bbf9b5db17ac0deec3b7ce6cba983f6dc50531c7a919f28d5fb3696c3 + +% openssl dgst -sha256 hashIn2.txt +SHA256(hashIn2.txt)= 3eaac518777682bf4e8840dd012c0b104c2e16009083877675f00e995906ed13 +``` + +This examination of cryptographic hash functions sets up a closer look at digital signatures and their relationship to key pairs. + +### Digital signatures + +As the name suggests, a digital signature can be attached to a document or some other electronic artifact (e.g., a program) to vouch for its authenticity. Such a signature is thus analogous to a hand-written signature on a paper document. To verify the digital signature is to confirm two things. First, that the vouched-for artifact has not changed since the signature was attached because it is based, in part, on a cryptographic _hash_ of the document. Second, that the signature belongs to the person (e.g., Alice) who alone has access to the private key in a pair. By the way, digitally signing code (source or compiled) has become a common practice among programmers. + +Let’s walk through how a digital signature is created. As mentioned before, there is no digital signature without a public and private key pair. When using OpenSSL to create these keys, there are two separate commands: one to create a private key, and another to extract the matching public key from the private one. These key pairs are encoded in base64, and their sizes can be specified during this process. + +The private key consists of numeric values, two of which (a _modulus_ and an _exponent_) make up the public key. Although the private key file contains the public key, the extracted public key does _not_ reveal the value of the corresponding private key. + +The resulting file with the private key thus contains the full key pair. Extracting the public key into its own file is practical because the two keys have distinct uses, but this extraction also minimizes the danger that the private key might be publicized by accident. + +Next, the pair’s private key is used to process a hash value for the target artifact (e.g., an email), thereby creating the signature. On the other end, the receiver’s system uses the pair’s public key to verify the signature attached to the artifact. + +Now for an example. To begin, generate a 2048-bit RSA key pair with OpenSSL: + +**openssl genpkey -out privkey.pem -algorithm rsa 2048** + +We can drop the **-algorithm rsa** flag in this example because **genpkey** defaults to the type RSA. The file’s name (**privkey.pem**) is arbitrary, but the Privacy Enhanced Mail (PEM) extension **pem** is customary for the default PEM format. (OpenSSL has commands to convert among formats if needed.) If a larger key size (e.g., 4096) is in order, then the last argument of **2048** could be changed to **4096**. These sizes are always powers of two. + +Here’s a slice of the resulting **privkey.pem** file, which is in base64: + + +``` +\-----BEGIN PRIVATE KEY----- +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBANnlAh4jSKgcNj/Z +JF4J4WdhkljP2R+TXVGuKVRtPkGAiLWE4BDbgsyKVLfs2EdjKL1U+/qtfhYsqhkK +… +\-----END PRIVATE KEY----- +``` + +The next command then extracts the pair’s public key from the private one: + +**openssl rsa -in privkey.pem -outform PEM -pubout -out pubkey.pem** + +The resulting **pubkey.pem** file is small enough to show here in full: + + +``` +\-----BEGIN PUBLIC KEY----- +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZ5QIeI0ioHDY/2SReCeFnYZJY +z9kfk11RrilUbT5BgIi1hOAQ24LMilS37NhHYyi9VPv6rX4WLKoZCmkeYaWk/TR5 +4nbH1E/AkniwRoXpeh5VncwWMuMsL5qPWGY8fuuTE27GhwqBiKQGBOmU+MYlZonO +O0xnAKpAvysMy7G7qQIDAQAB +\-----END PUBLIC KEY----- +``` + +Now, with the key pair at hand, the digital signing is easy—in this case with the source file **client.c** as the artifact to be signed: + +**openssl dgst -sha256 -sign privkey.pem -out sign.sha256 client.c** + +The digest for the **client.c** source file is SHA256, and the private key resides in the **privkey.pem** file created earlier. The resulting binary signature file is **sign.sha256**, an arbitrary name. To get a readable (if base64) version of this file, the follow-up command is: + +**openssl enc -base64 -in sign.sha256 -out sign.sha256.base64** + +The file **sign.sha256.base64** now contains: + + +``` +h+e+3UPx++KKSlWKIk34fQ1g91XKHOGFRmjc0ZHPEyyjP6/lJ05SfjpAJxAPm075 +VNfFwysvqRGmL0jkp/TTdwnDTwt756Ej4X3OwAVeYM7i5DCcjVsQf5+h7JycHKlM +o/Jd3kUIWUkZ8+Lk0ZwzNzhKJu6LM5KWtL+MhJ2DpVc= +``` + +Or, the executable file **client** could be signed instead, and the resulting base64-encoded signature would differ as expected: + + +``` +VMVImPgVLKHxVBapJ8DgLNJUKb98GbXgehRPD8o0ImADhLqlEKVy0HKRm/51m9IX +xRAN7DoL4Q3uuVmWWi749Vampong/uT5qjgVNTnRt9jON112fzchgEoMb8CHNsCT +XIMdyaPtnJZdLALw6rwMM55MoLamSc6M/MV1OrJnk/g= +``` + +The final step in this process is to verify the digital signature with the public key. The hash used to sign the artifact (in this case, the executable **client** program) should be recomputed as an essential step in the verification since the verification process should indicate whether the artifact has changed since being signed. + +There are two OpenSSL commands used for this purpose. The first decodes the base64 signature: + +**openssl enc -base64 -d -in sign.sha256.base64 -out sign.sha256** + +The second verifies the signature: + +**openssl dgst -sha256 -verify pubkey.pem -signature sign.sha256 client** + +The output from this second command is, as it should be: + + +``` +`Verified OK` +``` + +To understand what happens when verification fails, a short but useful exercise is to replace the executable **client** file in the last OpenSSL command with the source file **client.c** and then try to verify. Another exercise is to change the **client** program, however slightly, and try again. + +### Digital certificates + +A digital certificate brings together the pieces analyzed so far: hash values, key pairs, digital signatures, and encryption/decryption. The first step toward a production-grade certificate is to create a certificate signing request (CSR), which is then sent to a certificate authority (CA). To do this for the example with OpenSSL, run: + +**openssl req -out myserver.csr -new -newkey rsa:4096 -nodes -keyout myserverkey.pem** + +This example generates a CSR document and stores the document in the file **myserver.csr** (base64 text). The purpose here is this: the CSR document requests that the CA vouch for the identity associated with the specified domain name—the common name (CN) in CA-speak. + +A new key pair also is generated by this command, although an existing pair could be used. Note that the use of **server** in names such as **myserver.csr** and **myserverkey.pem** hints at the typical use of digital certificates: as vouchers for the identity of a web server associated with a domain such as [www.google.com][6]. + +The same command, however, creates a CSR regardless of how the digital certificate might be used. It also starts an interactive question/answer session that prompts for relevant information about the domain name to link with the requester’s digital certificate. This interactive session can be short-circuited by providing the essentials as part of the command, with backslashes as continuations across line breaks. The **-subj** flag introduces the required information: + + +``` +% openssl req -new +-newkey rsa:2048 -nodes -keyout privkeyDC.pem +-out myserver.csr +-subj "/C=US/ST=Illinois/L=Chicago/O=Faulty Consulting/OU=IT/CN=myserver.com" +``` + +The resulting CSR document can be inspected and verified before being sent to a CA. This process creates the digital certificate with the desired format (e.g., X509), signature, validity dates, and so on: + +**openssl req -text -in myserver.csr -noout -verify** + +Here’s a slice of the output: + + +``` +verify OK +Certificate Request: +Data: +Version: 0 (0x0) +Subject: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Subject Public Key Info: +Public Key Algorithm: rsaEncryption +Public-Key: (2048 bit) +Modulus: +00:ba:36:fb:57:17:65:bc:40:30:96:1b:6e🇩🇪73: +… +Exponent: 65537 (0x10001) +Attributes: +a0:00 +Signature Algorithm: sha256WithRSAEncryption +… +``` + +### A self-signed certificate + +During the development of an HTTPS web site, it is convenient to have a digital certificate on hand without going through the CA process. A self-signed certificate fills the bill during the HTTPS handshake’s authentication phase, although any modern browser warns that such a certificate is worthless. Continuing the example, the OpenSSL command for a self-signed certificate—valid for a year and with an RSA public key—is: + +**openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:4096 -keyout myserver.pem -out myserver.crt** + +The OpenSSL command below presents a readable version of the generated certificate: + +**openssl x509 -in myserver.crt -text -noout** + +Here’s part of the output for the self-signed certificate: + + +``` +Certificate: +Data: +Version: 3 (0x2) +Serial Number: 13951598013130016090 (0xc19e087965a9055a) +Signature Algorithm: sha256WithRSAEncryption +Issuer: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Validity +Not Before: Apr 11 17:22:18 2019 GMT +Not After : Apr 10 17:22:18 2020 GMT +Subject: C=US, ST=Illinois, L=Chicago, O=Faulty Consulting, OU=IT, CN=myserver.com +Subject Public Key Info: +Public Key Algorithm: rsaEncryption +Public-Key: (4096 bit) +Modulus: +00:ba:36:fb:57:17:65:bc:40:30:96:1b:6e🇩🇪73: +… +Exponent: 65537 (0x10001) +X509v3 extensions: +X509v3 Subject Key Identifier: +3A:32:EF:3D:EB:DF:65:E5:A8:96:D7:D7:16:2C:1B:29:AF:46:C4:91 +X509v3 Authority Key Identifier: +keyid:3A:32:EF:3D:EB:DF:65:E5:A8:96:D7:D7:16:2C:1B:29:AF:46:C4:91 + +        X509v3 Basic Constraints: +            CA:TRUE +Signature Algorithm: sha256WithRSAEncryption +     3a:eb:8d:09:53:3b:5c:2e:48:ed:14:ce:f9:20:01:4e:90:c9: +     ... +``` + +As mentioned earlier, an RSA private key contains values from which the public key is generated. However, a given public key does _not_ give away the matching private key. For an introduction to the underlying mathematics, see . + +There is an important correspondence between a digital certificate and the key pair used to generate the certificate, even if the certificate is only self-signed: + + * The digital certificate contains the _exponent_ and _modulus_ values that make up the public key. These values are part of the key pair in the originally-generated PEM file, in this case, the file **myserver.pem**. + * The exponent is almost always 65,537 (as in this case) and so can be ignored. + * The modulus from the key pair should match the modulus from the digital certificate. + + + +The modulus is a large value and, for readability, can be hashed. Here are two OpenSSL commands that check for the same modulus, thereby confirming that the digital certificate is based upon the key pair in the PEM file: + + +``` +% openssl x509 -noout -modulus -in myserver.crt | openssl sha1 ## modulus from CRT +(stdin)= 364d21d5e53a59d482395b1885aa2c3a5d2e3769 + +% openssl rsa -noout -modulus -in myserver.pem | openssl sha1 ## modulus from PEM +(stdin)= 364d21d5e53a59d482395b1885aa2c3a5d2e3769 +``` + +The resulting hash values match, thereby confirming that the digital certificate is based upon the specified key pair. + +### Back to the key distribution problem + +Let’s return to an issue raised at the end of Part 1: the TLS handshake between the **client** program and the Google web server. There are various handshake protocols, and even the Diffie-Hellman version at work in the **client** example offers wiggle room. Nonetheless, the **client** example follows a common pattern. + +To start, during the TLS handshake, the **client** program and the web server agree on a cipher suite, which consists of the algorithms to use. In this case, the suite is **ECDHE-RSA-AES128-GCM-SHA256**. + +The two elements of interest now are the RSA key-pair algorithm and the AES128 block cipher used for encrypting and decrypting messages if the handshake succeeds. Regarding encryption/decryption, this process comes in two flavors: symmetric and asymmetric. In the symmetric flavor, the _same_ key is used to encrypt and decrypt, which raises the _key distribution problem_ in the first place: How is the key to be distributed securely to both parties? In the asymmetric flavor, one key is used to encrypt (in this case, the RSA public key) but a different key is used to decrypt (in this case, the RSA private key from the same pair). + +The **client** program has the Google web server’s public key from an authenticating certificate, and the web server has the private key from the same pair. Accordingly, the **client** program can send an encrypted message to the web server, which alone can readily decrypt this message. + +In the TLS situation, the symmetric approach has two significant advantages: + + * In the interaction between the **client** program and the Google web server, the authentication is one-way. The Google web server sends three certificates to the **client** program, but the **client** program does not send a certificate to the web server; hence, the web server has no public key from the client and can’t encrypt messages to the client. + * Symmetric encryption/decryption with AES128 is nearly a _thousand times faster_ than the asymmetric alternative using RSA keys. + + + +The TLS handshake combines the two flavors of encryption/decryption in a clever way. During the handshake, the **client** program generates random bits known as the pre-master secret (PMS). Then the **client** program encrypts the PMS with the server’s public key and sends the encrypted PMS to the server, which in turn decrypts the PMS message with its private key from the RSA pair: + + +``` +              +-------------------+ encrypted PMS  +--------------------+ +client PMS--->|server’s public key|--------------->|server’s private key|--->server PMS +              +-------------------+                +--------------------+ +``` + +At the end of this process, the **client** program and the Google web server now have the same PMS bits. Each side uses these bits to generate a _master secret_ and, in short order, a symmetric encryption/decryption key known as the _session key_. There are now two distinct but identical session keys, one on each side of the connection. In the **client** example, the session key is of the AES128 variety. Once generated on both the **client** program’s and Google web server’s sides, the session key on each side keeps the conversation between the two sides confidential. A handshake protocol such as Diffie-Hellman allows the entire PMS process to be repeated if either side (e.g., the **client** program) or the other (in this case, the Google web server) calls for a restart of the handshake. + +### Wrapping up + +The OpenSSL operations illustrated at the command line are available, too, through the API for the underlying libraries. These two articles have emphasized the utilities to keep the examples short and to focus on the cryptographic topics. If you have an interest in security issues, OpenSSL is a fine place to start—and to stay. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 + +作者:[Marty Kalin][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/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[2]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 +[3]: https://en.wikipedia.org/wiki/HMAC +[4]: https://en.wikipedia.org/wiki/Length_extension_attack +[5]: https://en.wikipedia.org/wiki/Birthday_problem +[6]: http://www.google.com diff --git a/sources/tech/20190620 You can-t buy DevOps.md b/sources/tech/20190620 You can-t buy DevOps.md new file mode 100644 index 0000000000..36717058a0 --- /dev/null +++ b/sources/tech/20190620 You can-t buy DevOps.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You can't buy DevOps) +[#]: via: (https://opensource.com/article/19/6/you-cant-buy-devops) +[#]: author: (Julie Gunderson https://opensource.com/users/juliegund) + +You can't buy DevOps +====== +But plenty of people are happy to sell it to you. Here's why it's not +for sale. +![Coffee shop photo][1] + +![DevOps price tag graphic][2] + +Making a move to [DevOps][3] can be a daunting undertaking, with many organizations not knowing the right place to start. I recently had some fun taking a few "DevOps assessments" to see what solutions they offered. I varied my answers—from an organization that fully embraces DevOps to one at the beginning of the journey. Some of the assessments provided real value, linking me back to articles on culture and methodologies, while others merely offered me a tool promising to bring all my DevOps dreams into reality. + +Tools are absolutely essential to the DevOps journey; for instance, tools can continuously deliver, automate, or monitor your environment. However, **DevOps is not a product**, and tools alone will not enable the processes necessary to realize the full value of DevOps. People are what matter most; you can't do DevOps without building the people, mindset, and culture first. + +### Don't 'win' at DevOps; become a champion + +As a DevOps advocate at PagerDuty, I am proud to be a part of an organization with a strong commitment to DevOps methodologies, well beyond just "checking the boxes" of tool adoption. + +I recently had a conversation with PagerDuty CEO Jennifer Tejada about being a winner versus a champion. She talked about how winning is fantastic—you get a trophy, a title, or maybe even a few million dollars (if it's the lottery). However, in the big picture, winning is all about short-term goals, while being a champion means focusing on long-term successes or outcomes. This got me thinking about how to apply this principle to organizations embracing DevOps. + +One of my favorite examples of DevOps tooling is XebiaLabs' [Periodic Table of DevOps Tools][4]: + +[![Periodic Table of DevOps][5]][4] + +(Click table for interactive version.) + +The table shows that numerous tools fit into DevOps. However, too many times, I have heard about organizations "transforming to DevOps" by purchasing tools. While tooling is an essential part of the DevOps journey, a tool alone does not create a DevOps environment. You have to consider all the factors that make a DevOps team function well: collaboration, breaking down silos, defined processes, ownership, and automation, along with continuous improvement/continuous delivery. + +Deciding to purchase tooling is a great step in the right direction; what is more important is to define the "why" or the end goal behind decisions first. Which brings us back to the mentality of a champion; look at Olympic gold medalist Michael Phelps, for example. Phelps is the most decorated Olympian of all time and holds 39 world records. To achieve these accomplishments, Phelps didn't stop at one, two, or even 20 wins; he aimed to be a champion. This was all done through commitment, practice, and focusing on the desired end state. + +### DevOps defined + +There are hundreds of definitions for DevOps, but almost everyone can agree on the core tenet outlined in the [State of DevOps Report][6]: + +> "DevOps is a set of principles aimed at building culture and processes to help teams work more efficiently and deliver better software faster." + +You can't change culture and processes with a credit card. Tooling can enable an organization to collaborate better or automate or continuously deliver; however, without the right mindset and adoption, a tool's full capability may not be achievable. + +For example, one of my former colleagues heard how amazing Slack is for teams transforming to DevOps by opening up channels for collaboration. He convinced his manager that Slack would solve all of their communication woes. However, six months into the Slack adoption, most teams were still using Skype, including the manager. Slack ended up being more of a place to talk about brewing beer than a tool to bring the product to market faster. The issue was not Slack; it was the lack of buy-in from the team and organization and knowledge around the product's full functionality. + +Purchasing a tool can definitely be a win for a team, but purchasing a tool is not purchasing DevOps. Making tooling and best practices work for the team and achieving short- and long-term goals are where our conversation around being a champion comes up. This brings us back to the why, the overall and far-reaching goal for the team or organization. Once you identify the goal, how do you get buy-in from key stakeholders? After you achieve buy-in, how do you implement the solution? + +### Organizational change + +#### + +[![Change management comic by Randy Glasbergen][7]][8] + +Change is hard for many organizations and individuals; moreover, meaningful change does not happen overnight. It is important to understand how people and organizations process change. In the [Kotter 8-Step Process for Leading Change][9], it's about articulating the need for a change, creating urgency around the why, then starting small and finding and developing internal champions, _before_ trying to prove wins or, in this case, purchasing a tool. + +If people in an organization are not aware of a problem or that there's a better way of operating, it will be hard to get the buy-in necessary and motivate team members to adopt new ideas and take action. People may be perfectly content with the current state; perhaps the processes in place are adequate or, at a minimum, the current state is a known factor. However, for the overall team to function well and achieve its shared goal in a faster, more agile way, new mechanisms must be put into place first. + +![Kotter 8-Step Process for Leading Change][10] + +### How to be a DevOps champion + +Being a champion in the DevOps world means going beyond the win and delving deeper into the team/organizational structure and culture, thereby identifying outlying issues beyond tools, and then working with others to embrace the right change that leads to defined results. Go back to the beginning and define the end goal. Here are a few sample questions you can ask to get started: + + * What are your core values? + * Why are you trying to become a more agile company or team? + * What obstacles is your team or organization facing? + * What will the tool or process accomplish? + * How are people communicating and collaborating? + * Are there silos and why? + * How are you championing the customer? + * Are employees empowered? + + + +After defining the end state, find other like-minded individuals to be part of your champion team, and don't lose sight of what you are trying to accomplish. When making any change, make sure to start small, e.g., with one team or a test environment. By starting small and building on the wins, internal champions will start creating themselves. + +Remember, companies are happy and eager to try to sell you DevOps, but at the end of the day, DevOps is not a product. It is a fully embraced methodology and mindset of automation, collaboration, people, and processes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/you-cant-buy-devops + +作者:[Julie Gunderson][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/juliegund +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee-shop-devops.png?itok=CPefJZJL (Coffee shop photo) +[2]: https://opensource.com/sites/default/files/uploads/devops-pricetag.jpg (DevOps price tag graphic) +[3]: https://opensource.com/resources/devops +[4]: https://xebialabs.com/periodic-table-of-devops-tools/ +[5]: https://opensource.com/sites/default/files/uploads/periodic-table-of-devops-tools.png (Periodic Table of DevOps) +[6]: https://puppet.com/resources/whitepaper/state-of-devops-report +[7]: https://opensource.com/sites/default/files/uploads/cartoon.png (Change management comic by Randy Glasbergen) +[8]: https://images.app.goo.gl/JiMaWAenNkLcmkZJ9 +[9]: https://www.kotterinc.com/8-steps-process-for-leading-change/ +[10]: https://opensource.com/sites/default/files/uploads/kotter-process.png (Kotter 8-Step Process for Leading Change) diff --git a/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md b/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md new file mode 100644 index 0000000000..3a9003ae9c --- /dev/null +++ b/sources/tech/20190621 7 infrastructure performance and scaling tools you should be using.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 infrastructure performance and scaling tools you should be using) +[#]: via: (https://opensource.com/article/19/6/performance-scaling-tools) +[#]: author: (Pradeep SurisettyPeter Portante https://opensource.com/users/psuriset/users/aakarsh/users/portante/users/anaga) + +7 infrastructure performance and scaling tools you should be using +====== +These open source tools will help you feel confident in your +infrastructure's performance as it scales up. +![Several images of graphs.][1] + +[Sysadmins][2], [site reliability engineers][3] (SREs), and cloud operators all too often struggle to feel confident in their infrastructure as it scales up. Also too often, they think the only way to solve their challenges is to write a tool for in-house use. Fortunately, there are options. There are many open source tools available to test an infrastructure's performance. Here are my favorites. + +### Pbench + +Pbench is a performance testing harness to make executing benchmarks and performance tools easier and more convenient. In short, it: + + * Excels at running micro-benchmarks on large scales of hosts (bare-metal, virtual machines, containers, etc.) while automating a potentially large set of benchmark parameters + * Focuses on installing, configuring, and executing benchmark code and performance tools and not on provisioning or orchestrating the testbed (e.g., OpenStack, RHEV, RHEL, Docker, etc.) + * Is designed to work in concert with provisioning tools like BrowBeat or Ansible playbooks + + + +Pbench's [documentation][4] includes installation and user guides, and the code is [maintained on GitHub][5], where the team welcomes contributions and issues. + +### Ripsaw + +Baselining is a critical aspect of infrastructure reliability. Ripsaw is a performance benchmark Operator for launching workloads on Kubernetes. It deploys as a Kuberentes Operator that then deploys common workloads, including specific applications (e.g., Couchbase) or general performance tests (e.g., Uperf) to measure and establish a performance baseline. + +Ripsaw is [maintained on GitHub][6]. You can also find its maintainers on the [Kubernetes Slack][7], where they are active contributors. + +### OpenShift Scale + +The collection of tools in OpenShift Scale, OpenShift's open source solution for performance testing, do everything from spinning up OpenShift on OpenStack installations (TripleO Install and ShiftStack Install), installing on Amazon Web Services (AWS), or providing containerized tooling, like running Pbench on your cluster or doing cluster limits testing, network tests, storage tests, metric tests with Prometheus, logging, and concurrent build testing. + +Scale's CI suite is flexible enough to both add workloads and include your workloads when deploying to Azure or anywhere else you might run. You can see the full suite of tools [on GitHub][8]. + +### Browbeat + +[Browbeat][9] calls itself "a performance tuning and analysis tool for OpenStack." You can use it to analyze and tune the deployment of your workloads. It also automates the deployment of standard monitoring and data analysis tools like Grafana and Graphite. Browbeat is [maintained on GitHub][10]. + +### Smallfile + +Smallfile is a filesystem workload generator targeted for scale-out, distributed storage. It has been used to test a number of open filesystem technologies, including GlusterFS, CephFS, Network File System (NFS), Server Message Block (SMB), and OpenStack Cinder volumes. It is [maintained on GitHub][11]. + +### Ceph Benchmarking Tool + +Ceph Benchmarking Tool (CBT) is a testing harness that can automate tasks for testing [Ceph][12] cluster performance. It records system metrics with collectl, and it can collect more information with tools including perf, blktrace, and valgrind. CBT can also do advanced testing that includes automated object storage daemon outages, erasure-coded pools, and cache-tier configurations. + +Contributors have extended CBT to use [Pbench monitoring tools and Ansible][13] and to run the [Smallfile benchmark][14]. A separate Grafana visualization dashboard uses Elasticsearch data generated by [Automated Ceph Test][15]. + +### satperf + +Satellite-performance (satperf) is a set of Ansible playbooks and helper scripts to deploy Satellite 6 environments and measure the performance of selected actions, such as concurrent registrations, remote execution, Puppet operations, repository synchronizations and promotions, and more. You can find Satperf [on GitHub][16]. + +### Conclusion + +Sysadmins, SREs, and cloud operators face a wide variety of challenges as they work to scale their infrastructure, but luckily there is also a wide variety of tools to help them get past those common issues. Any of these seven tools should help you get started testing your infrastructure's performance as it scales. + +Are there other open source performance and scaling tools that should be on this list? Add your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/performance-scaling-tools + +作者:[Pradeep SurisettyPeter Portante][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/psuriset/users/aakarsh/users/portante/users/anaga +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_scale_performance.jpg?itok=R7jyMeQf (Several images of graphs.) +[2]: /16/12/yearbook-10-open-source-sysadmin-tools +[3]: /article/19/5/life-performance-engineer +[4]: https://distributed-system-analysis.github.io/pbench/ +[5]: https://github.com/distributed-system-analysis/pbench +[6]: https://github.com/cloud-bulldozer/ripsaw +[7]: https://github.com/cloud-bulldozer/ripsaw#community +[8]: https://github.com/openshift-scale +[9]: https://browbeatproject.org/ +[10]: https://github.com/cloud-bulldozer/browbeat +[11]: https://github.com/distributed-system-analysis/smallfile +[12]: https://ceph.com/ +[13]: https://github.com/acalhounRH/cbt +[14]: https://nuget.pkg.github.com/bengland2/cbt/tree/smallfile +[15]: https://github.com/acalhounRH/automated_ceph_test +[16]: https://github.com/redhat-performance/satperf diff --git a/sources/tech/20190621 The state of open source translation tools for contributors to your project.md b/sources/tech/20190621 The state of open source translation tools for contributors to your project.md new file mode 100644 index 0000000000..07bac654fc --- /dev/null +++ b/sources/tech/20190621 The state of open source translation tools for contributors to your project.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The state of open source translation tools for contributors to your project) +[#]: via: (https://opensource.com/article/19/6/translation-platforms-matter) +[#]: author: (Jean-Baptiste Holcroft https://opensource.com/users/jibec/users/jibec) + +The state of open source translation tools for contributors to your project +====== +There are almost 100 languages with more than 10 million speakers. How +many of your active contributors speak one? +![Team of people around the world][1] + +In the world of free software, many people speak English: It is the **one** language. English helps us cross borders to meet others. However, this language is also a barrier for the majority of people. + +Some master it while others don't. Complex English terms are, in general, a barrier to the understanding and propagation of knowledge. Whenever you use an uncommon English word, ask yourself about your real mastery of what you are explaining, and the unintentional barriers you build in the process. + +_“If you talk to a man in a language he understands, that goes to his head. If you talk to him in his language, that goes to his heart.”_ — Nelson Mandela + +We are 7 billion humans, and less than 400 million of us are English natives. The wonders done day after day by free/libre open source contributors deserve to reach the hearts of the [6.6 billion people][2] for whom English is not their mother tongue. In this day and age, we have the technology to help translate all types of content: websites, documentation, software, and even sounds and images. Even if I do not translate of all of these media personally, I do not know of any real limits. The only prerequisite for getting this content translated is both the willingness of the creators and the collective will of the users, customers, and—in the case of free software—the contributors. + +### Why successful translation requires real tooling + +Some projects are stuck in the stone ages and require translators to use [Git][3], [Mercurial][4], or other development tools. These tools don’t meet the needs of translation communities. Let’s help these projects evolve, as discussed in the section "A call for action." + +Other projects have integrated translation platforms, which are key tools for linguistic diversity and existence. These tools understand the needs of translators and serve as a bridge to the development world. They make translation contribution easy, and keep those doing the translations motivated over time. + +This aspect is important: There are almost 100 languages with more than 10 million speakers. Do you really believe that your project can have an active contributor for each of these languages? Unless you are a huge organization, like Mozilla or LibreOffice, there is no chance. The translators who help you also help two, ten, or a hundred other projects. They need tools to be effective, such as [translation memories][5], progress reports, alerts, ways to collaborate, and knowing that what they do is useful. + +### Translation platforms are in trouble + +However, the translation platforms distributed as free software are disappearing in favor of closed platforms. These platforms set their rules and efforts according to what will bring them the most profit. + +Linguistic and cultural diversity does not bring money: It opens doors and allows local development. It emancipates populations and can ensure the survival of certain cultures and languages. In the 21st century, is your culture really alive if it does not exist in cyberspace? + +The short history of translation platforms is not pretty: + + * In 2011, Transifex ceased to be open when they decided to no longer publish their source code. + * Since September 2017, the [Pootle][6] project seems to have stalled. + * In October 2018, the [Zanata][7] project shut down because it had not succeeded in building a community of technical contributors capable of taking over when corporate funding was halted. + + + +In particular, the [Fedora Project][8]—which I work closely with—has ridden the roller coaster from Transifex to Zanata and is now facing another move and more challenges. + +Two significant platforms remain: + + * [Pontoon][9]: Dedicated to the Mozilla use case (large community, common project). + * [Weblate][10]: A generic platform created by developer [Michal Čihař][11] (a generic purpose platform). + + + +These two tools are of high quality and are technically up-to-date, but Mozilla’s Pontoon is not designed to appeal to the greatest number of people. This project is dedicated to the specific challenges Mozilla faces.  + +### A call for action + +There is an urgent need for large communities to share resources to perpetuate Weblate as free software and promote its adoption. Support is also needed for other tools, such as [po4a][12], the [Translate Toolkit][13], and even our old friend [gettext][14]. Will we accept a sword of Damocles hanging over our heads? Will we continue to consume years of free work without giving a cent in return? Or will we take the lead in bringing security to our communities? + +**What you can do as a contributor**: Promote Weblate as an open source translation platform, and help your beloved project use it. [Hosting is free for open source projects][15]. + +**What you can do as a developer**: Make sure all of your project’s content can be translated into any language. Think about this issue from the beginning, as all tools don’t provide the same internationalization features. + +**What you can do as an entity with a budget**: Whether you’re a company or just part of the community, pay for the support, hosting, or development of the tools you use. Even if the amount is symbolic, doing this will lower the risks. In particular, [here is the info for Weblate][16]. (Note: I’m not involved with the Weblate project other than bug reports and translation.) + +**What to do if you’re a language enthusiast**: Contact me to help create an open source language organization to promote our tools and their usage, and find money to fund them. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/translation-platforms-matter + +作者:[Jean-Baptiste Holcroft][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/jibec/users/jibec +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_global_people_gis_location.png?itok=Rl2IKo12 (Team of people around the world) +[2]: https://www.ethnologue.com/statistics/size +[3]: https://git-scm.com +[4]: https://www.mercurial-scm.org +[5]: https://en.wikipedia.org/wiki/Translation_memory +[6]: http://pootle.translatehouse.org +[7]: http://zanata.org +[8]: https://getfedora.org +[9]: https://github.com/mozilla/pontoon/ +[10]: https://weblate.org +[11]: https://cihar.com +[12]: https://po4a.org +[13]: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/ +[14]: https://www.gnu.org/software/gettext/ +[15]: http://hosted.weblate.org/ +[16]: https://weblate.org/en/hosting/ diff --git a/sources/tech/20190624 Book Review- A Byte of Vim.md b/sources/tech/20190624 Book Review- A Byte of Vim.md new file mode 100644 index 0000000000..e221a3bc6f --- /dev/null +++ b/sources/tech/20190624 Book Review- A Byte of Vim.md @@ -0,0 +1,99 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Book Review: A Byte of Vim) +[#]: via: (https://itsfoss.com/book-review-a-byte-of-vim/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Book Review: A Byte of Vim +====== + +[Vim][1] is a tool that is both simple and very powerful. Most new users will be intimidated by it because it doesn’t ‘work’ like regular graphical text editors. The ‘unusual’ keyboard shortcuts makes people wonder about [how to save and exit Vim][2]. But once you master Vim, there is nothing like it. + +There are numerous [Vim resources available online][3]. We have covered some Vim tricks on It’s FOSS as well. Apart from online resources, plenty of books have been dedicated to this editor as well. Today, we will look at one of such book that is designed to make Vim easy for most users to understand. The book we will be discussing is [A Byte of Vim][4] by [Swaroop C H][5]. + +The author [Swaroop C H][6] has worked in computing for over a decade. He previously worked at Yahoo and Adobe. Out of college, he made money by selling Linux CDs. He started a number of businesses, including an iPod charger named ion. He is currently an engineering manager for the AI team at [Helpshift][7]. + +### A Byte of Vim + +![][8] + +Like all good books, A Byte of Vim starts by talking about what Vim is: “a computer program used for writing any kind of text”. He does on to say, “What makes Vim special is that it is one of those few software which is both simple and powerful.” + +Before diving into telling how to use Vim, Swaroop tells the reader how to install Vim for Windows, Mac, Linux, and BSD. Once the installation is complete, he runs you through how to launch Vim and how to create your first file. + +Next, Swaroop discusses the different modes of Vim and how to navigate around your document using Vim’s keyboard shortcuts. This is followed by the basics of editing a document with Vim, including the Vim version of cut/copy/paste and undo/redo. + +Once the editing basics are covered, Swaroop talks about using Vim to edit multiple parts of a single document. You can also multiple tabs and windows to edit multiple documents at the same time. + +[][9] + +Suggested read  Bring Your Old Computer Back to Life With 4MLinux + +The book also covers extending the functionality of Vim through scripting and installing plugins. There are two ways to using scripts in Vim, use Vim’s built-in scripting language or using a programming language like Python or Perl to access Vim’s internals. There are five types of Vim plugins that can be written or downloaded: vimrc, global plugin, filetype plugin, syntax highlighting plugin, and compiler plugin. + +In a separate section, Swaroop C H covers the features of Vim that make it good for programming. These features include syntax highlighting, smart indentation, support for shell commands, omnicompletion, and the ability to be used as an IDE. + +#### Getting the ‘A Byte of Vim’ book and contributing to it + +A Byte of Book is licensed under [Creative Commons 4.0][10]. You can read an online version of the book for free on [the author’s website][4]. You can also download a [PDF][11], [Epub][12], or [Mobi][13] for free. + +[Get A Byte of Vim for FREE][4] + +If you prefer reading a [hard copy][14], you have that option, as well. + +Please note that the _**original version of A Byte of Vim was written in 2008**_ and converted to PDf. Unfortunately, Swaroop C H lost the original source files and he is working to convert the book to [Markdown][15]. If you would like to help, please visit the [book’s GitHub page][16]. + +Preview | Product | Price | +---|---|---|--- +![Mastering Vim Quickly: From WTF to OMG in no time][17] ![Mastering Vim Quickly: From WTF to OMG in no time][17] | [Mastering Vim Quickly: From WTF to OMG in no time][18] | $34.00[][19] | [Buy on Amazon][20] + +#### Conclusion + +When I first stared into the angry maw that is Vim, I did not have a clue what to do. I wish that I had known about A Byte of Vim then. This book is a good resource for anyone learning about Linux, especially if you are getting into the command line. + +Have you read [A Byte of Vim][4] by Swaroop C H? If yes, how do you find it? If not, what is your favorite book on an open source topic? Let us know in the comments below. + +[][21] + +Suggested read  Iridium Browser: A Browser for the Privacy Conscious + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][22]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/book-review-a-byte-of-vim/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://www.vim.org/ +[2]: https://itsfoss.com/how-to-exit-vim/ +[3]: https://linuxhandbook.com/basic-vim-commands/ +[4]: https://vim.swaroopch.com/ +[5]: https://swaroopch.com/ +[6]: https://swaroopch.com/about/ +[7]: https://www.helpshift.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/06/Byte-of-vim-book.png?resize=800%2C450&ssl=1 +[9]: https://itsfoss.com/4mlinux-review/ +[10]: https://creativecommons.org/licenses/by/4.0/ +[11]: https://www.gitbook.com/download/pdf/book/swaroopch/byte-of-vim +[12]: https://www.gitbook.com/download/epub/book/swaroopch/byte-of-vim +[13]: https://www.gitbook.com/download/mobi/book/swaroopch/byte-of-vim +[14]: https://swaroopch.com/buybook/ +[15]: https://itsfoss.com/best-markdown-editors-linux/ +[16]: https://github.com/swaroopch/byte-of-vim#status-incomplete +[17]: https://i2.wp.com/images-na.ssl-images-amazon.com/images/I/41itW8furUL._SL160_.jpg?ssl=1 +[18]: https://www.amazon.com/Mastering-Vim-Quickly-WTF-time/dp/1983325740?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1983325740 (Mastering Vim Quickly: From WTF to OMG in no time) +[19]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[20]: https://www.amazon.com/Mastering-Vim-Quickly-WTF-time/dp/1983325740?SubscriptionId=AKIAJ3N3QBK3ZHDGU54Q&tag=chmod7mediate-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1983325740 (Buy on Amazon) +[21]: https://itsfoss.com/iridium-browser-review/ +[22]: http://reddit.com/r/linuxusersgroup diff --git a/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md b/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md new file mode 100644 index 0000000000..d4557725ba --- /dev/null +++ b/sources/tech/20190624 Check your password security with Have I Been Pwned- and pass.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Check your password security with Have I Been Pwned? and pass) +[#]: via: (https://opensource.com/article/19/6/check-passwords) +[#]: author: (Brian "bex" Exelbierd https://opensource.com/users/bexelbie/users/jason-baker/users/admin/users/mtsouk) + +Check your password security with Have I Been Pwned? and pass +====== +Periodically checking for password compromise is an excellent way to +help ward off most attackers in most threat models. +![Password lock][1] + +Password security involves a broad set of practices, and not all of them are appropriate or possible for everyone. Therefore, the best strategy is to develop a threat model by thinking through your most significant risks—who and what you are protecting against—then model your security approach on the activities that are most effective against those specific threats. The Electronic Frontier Foundation (EFF) has a [great series on threat modeling][2] that I encourage everyone to read. + +In my threat model, I am very concerned about the security of my passwords against (among other things) [dictionary attacks][3], in which an attacker uses a list of likely or known passwords to try to break into a system. One way to stop dictionary attacks is to have your service provider rate-limit or deny login attempts after a certain number of failures. Another way is not to use passwords in the "known passwords" dataset. + +### Check password security with HIBP + +[Troy Hunt][4] created [Have I Been Pwned?][5] (HIBP) to notify people when their information is found in leaked data dumps and breaches. If you haven't already registered, you should, as the mere act of registering exposes nothing. Troy has built a collection of over 550 million real-world passwords from this data. These are passwords that real people used and were exposed by data that was stolen or accidentally made public. + +The site _does not_ publish the plaintext password list, but it doesn't have to. By definition, this data is already out there. If you've ever reused a password or used a "common" password, then you are at risk because someone is building a dictionary of these passwords to try right now. + +Recently, Firefox and HIBP announced they are [teaming up][6] to make breach searches easier. And the National Institutes of Standards and Technology (NIST) recommends that you [check passwords][7] against those known to be compromised and change them if they are found. HIBP supports this via a password-checking feature that is exposed via an API, so it is easy to use. + +Now, it would be a bad idea to send the website a full list of your passwords. While I trust [HaveIBeenPwned.com][5], it could be compromised one day. Instead, the site uses a process called [k-Anonymity][8] that allows you to check your passwords without exposing them. This is a three-step process. First, let's review the steps, and then we can use the **pass-pwned** plugin to do it for us: + + 1. Create a hash value of your password. A hash value is just a way of turning arbitrary data—your password—into a fixed data representation—the hash value. A cryptographic hash function is collision-resistant, meaning it creates a unique hash value for every input. The algorithm used for the hash is a one-way transformation, which makes it hard to know the input value if you only have the hash value. For example, using the SHA-1 algorithm that HIBP uses, the password **hunter2** becomes **F3BBBD66A63D4BF1747940578EC3D0103530E21D**. + 2. Send the first five characters (**F3BBB** in our example) to the site, and the site will send back a list of all the hash values that start with those five characters. This way, the site can't know which hash values you are interested in. The k-Anonymity process ensures there is so much statistical noise that it is hard for a compromised site to determine which password you inquired about. For example, our query returns a list of 527 potential matches from HIBP. + 3. Search through the list of results to see if your hash is there. If it is, your password has been compromised. If it isn't, the password isn't in a publicly known data breach. HIBP returns a bonus in its data: a count of how many times the password has been seen in data breaches. Astoundingly, **hunter2** has been seen 17,043 times! + + + +### Check password security with pass + +I use [**pass**][9], a [GNU Privacy Guard][10]-based password manager. It has many extensions, which are available on the [**pass** website][11] and as a separately maintained [awesome-style list][12]. One of these extensions is [**pass-pwned**][13], which will check your passwords with HIBP. Both **pass** and **pass-pwned** are packaged for Fedora 29, 30, and Rawhide. You can install the extension with: + + +``` +`sudo dnf install pass pass-pwned` +``` + +or you can follow the manual instructions on their respective websites. + +If you're just getting started with **pass**, read [Managing passwords the open source way][14] for a great overview. + +The following will quickly set up **pass** and check a stored password. This example assumes you already have a GPG key. + + +``` +# Setup a pass password store +$ pass init <GPG key email> + +# Add the password, "hunter2" to the store +$ pass insert awesome-site.com + +# Install the pass-pwned extension +# Download the bash script from the upstream and then review it +$ mkdir ~/.password-store/.extensions +$ wget -O ~/.password-store/.extensions/pwned.bash +$ vim ~/.password-store/.extensions/pwned.bash + +# If everything is OK, set it executable and enable pass extensions +$ chmod u+x ~/.password-store/.extensions/pwned.bash +$ echo 'export PASSWORD_STORE_ENABLE_EXTENSIONS="true"' >> ~/.bash_profile +$ source ~/.bash_profile + +# Check the password +$ pass pwned awesome-site.com +Password found in haveibeenpwned 17043 times + +# Change this password to something randomly generated and verify it +$ pass generate -i awesoem-site.com +The generated password for awesome-site.com is: +<REDACTED> +$ pass pwned awesome-site.com +Password not found in haveibeenpwned +``` + +Congratulations, your password is now more secure than it was before! You can also [use wildcards to check multiple passwords][15] at once. + +Periodically checking for password compromise is an excellent way to help ward off most attackers in most threat models. If your password management system doesn't make it this easy, you may want to upgrade to something like **pass**. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/6/check-passwords + +作者:[Brian "bex" Exelbierd][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/bexelbie/users/jason-baker/users/admin/users/mtsouk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/password.jpg?itok=ec6z6YgZ (Password lock) +[2]: https://ssd.eff.org/en/module/your-security-plan +[3]: https://en.wikipedia.org/wiki/Dictionary_attack +[4]: https://www.troyhunt.com/ +[5]: https://haveibeenpwned.com/ +[6]: https://www.troyhunt.com/were-baking-have-i-been-pwned-into-firefox-and-1password/ +[7]: https://pages.nist.gov/800-63-FAQ/#q-b5 +[8]: https://blog.cloudflare.com/validating-leaked-passwords-with-k-anonymity/ +[9]: https://www.passwordstore.org/ +[10]: https://gnupg.org/ +[11]: https://www.passwordstore.org/#extensions +[12]: https://github.com/tijn/awesome-password-store +[13]: https://github.com/alzeih/pass-pwned +[14]: https://opensource.com/life/14/7/managing-passwords-open-source-way +[15]: https://github.com/alzeih/pass-pwned/issues/3 diff --git a/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md b/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md new file mode 100644 index 0000000000..3021561dd8 --- /dev/null +++ b/sources/tech/20190624 How to Install and Configure KVM on RHEL 8.md @@ -0,0 +1,256 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install and Configure KVM on RHEL 8) +[#]: via: (https://www.linuxtechi.com/install-configure-kvm-on-rhel-8/) +[#]: author: (Pradeep Kumar https://www.linuxtechi.com/author/pradeep/) + +How to Install and Configure KVM on RHEL 8 +====== + +**KVM** is an open source virtualization technology which converts your Linux machine into a type-1 bare-metal hypervisor that allows you to run multiple virtual machines (VMs) or guest VMs + + + +KVM stands for **Kernel based Virtual machine**, as the name suggests KVM is a kernel module, once it is loaded into the kernel , then your Linux machine will start working as a KVM hypervisor. In this article we will demonstrate how to install KVM on RHEL 8 system but before start installing KVM on your RHEL 8 system first we have to make sure that your system’s processor supports hardware virtualization extensions like **Intel VT** or **AMD-V** and enabled it from BIOS. + +**RHEL 8 KVM Lab Details:** + + * OS = RHEL 8 + * Hostname = rhel8-kvm + * Ethernet Cards = ens32 –  192.168.1.4 & ens36 – 192.168..1.12 + * RAM = 4 GB + * CPU = 2 + * Disk = 40 GB Free Space (/var/libvirtd) + + + +Let’s Jump into the KVM installation steps + +### Step:1) Verify Hardware Virtualization is enabled or not + +Open the terminal and execute the beneath egrep command + +``` +[root@linuxtechi ~]# egrep -c '(vmx|svm)' /proc/cpuinfo +2 +[root@linuxtechi ~]# +``` + +If output of above egrep command is equal to 1 or more than 1 then this confirms that hardware virtualization is enabled and supported. + +Alternate way to check whether hardware virtualization is enabled or not , execute the beneath command, + +``` +[root@linuxtechi ~]# lscpu | grep Virtualization: +Virtualization: VT-x +[root@linuxtechi opt]# +``` + +If there is no output in above command then it confirms that Virtualization is not enabled from BIOS. + +**Note:** To enable hardware virtualization reboot your system, go to bios settings and then look for Intel VT or AMD virtualization option and enable one of this option which which suits to your system architecture. + +### Step:2) Install KVM and its dependent packages using dnf + +Run the following dnf command to install KVM and its dependent packages, + +``` +[root@linuxtechi ~]# dnf install qemu-kvm qemu-img libvirt virt-install libvirt-client virt-manager -y +``` + +Once above packages has been installed successfully, then run the below command to confirm whether KVM module has been loaded into the kernel or not, + +``` +root@linuxtechi ~]# lsmod | grep -i kvm +kvm_intel 245760 0 +kvm 745472 1 kvm_intel +irqbypass 16384 1 kvm +[root@linuxtechi ~]# +``` + +### Step:3) Enable and Start libvirtd service + +Run the following systemctl command to enable and start libvirtd service, + +``` +[root@linuxtechi ~]# systemctl enable libvirtd +[root@linuxtechi ~]# systemctl start libvirtd +``` + +### Step:4) Create Network bridge and attach Interface to it  + +In RHEL 8, network scripts are deprecated, We have to use Network Manager (nmcli / nmtui) to configure network and network bridges. + +I have two Ethernet cards on my server, ens36 will attached to bridge br0 and ens32 will be used for management . + +``` +[root@linuxtechi ~]# nmcli connection show +NAME UUID TYPE DEVICE +ens32 1d21959d-e2ea-4129-bb89-163486c8d7bc ethernet ens32 +ens36 1af408b6-c98e-47ce-bca7-5141b721f8d4 ethernet ens36 +virbr0 d0f05de4-4b3b-4710-b904-2524b5ad11bf bridge virbr0 +[root@linuxtechi ~]# +``` + +Delete the existing connection of interface “ens36” + +``` +[root@linuxtechi ~]# nmcli connection delete ens36 +Connection 'ens36' (1af408b6-c98e-47ce-bca7-5141b721f8d4) successfully deleted. +[root@linuxtechi ~]# +``` + +Create a Network Bridge with name “**br0**” using mcli command, + +``` +[root@linuxtechi ~]# nmcli connection add type bridge autoconnect yes con-name br0 ifname br0 +Connection 'br0' (62c14e9d-3e72-41c2-8ecf-d17978ad02da) successfully added. +[root@linuxtechi ~]# +``` + +Assign the same IP of ens36 to the bridge interface using following nmcli commands, + +``` +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.addresses 192.168.1.12/24 ipv4.method manual +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.gateway 192.168.1.1 +[root@linuxtechi ~]# nmcli connection modify br0 ipv4.dns 192.168.1.1 +``` + +Add ens36 interface as bridge salve to the network bridge br0, + +``` +[root@linuxtechi ~]# nmcli connection add type bridge-slave autoconnect yes con-name ens36 ifname ens36 master br0 +Connection 'ens36' (0c2065bc-ad39-47a7-9a3e-85c80cd73c94) successfully added. +[root@linuxtechi ~]# +``` + +Now bring up the network bridge using beneath nmcli command, + +``` +[root@linuxtechi ~]# nmcli connection up br0 +Connection successfully activated (master waiting for slaves) (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/9) +[root@linuxtechi ~]# +``` + +Verify the connections using following command, + +``` +[root@linuxtechi ~]# nmcli connection show +NAME UUID TYPE DEVICE +br0 00bcff8f-af85-49ad-9196-974de2d9d9d1 bridge br0 +ens32 1d21959d-e2ea-4129-bb89-163486c8d7bc ethernet ens32 +ens36 eaef13c9-c24e-4a3f-ae85-21bf0610471e ethernet ens36 +virbr0 d0f05de4-4b3b-4710-b904-2524b5ad11bf bridge virbr0 +[root@linuxtechi ~]# +``` + +View the bridge (br0) details and status using ip command, + +![rhel-8-bridge-details][1] + +**Note:** If you want to use network-scripts in RHEL 8 system then install network-scripts packages, + +``` +~ ]# dnf install network-scripts -y +``` + +### Step:5) Creating and Managing KVM Virtual Machines + +In RHEL 8 there are different ways to create and manage KVM virtual machines, + + * virt-manager (GUI) + * Command Line tools (**virt-install** & **virsh**) + + + +During the KVM installation we have already installed virt-manager and virt-install packages. + +### Creating Virtual Machines using virt-manager GUI tool: + +Run the virt-manager command from command line or Access virt-manager from RHEL 8 Desktop + +[![Access-Virt-Manager-RHEL8][2]][3] + +Click on Monitor Icon to create a new guest VM (Virtual Machine), + +Choose Local Installation Media as ISO, + +[![Choose-ISO-KVM-RHEL8][4]][5] + +Click on forward, + +In the next screen, browse the OS installation ISO file , in my case i have placed Ubuntu 18.04 LTS server ISO file under /opt folder, + +[![Installation-ISO-File-RHEL8-KVM][6]][7] + +click on Forward to Proceed further, + +In the next window you will be prompted to specify RAM and vCPU for your virtual machine, so specify the values that suits your installation and then click on Forward, + +[![Specify-RAM-CPU-KVM-RHEL8][8]][9] + +In next window specify disk size for your Virtual Machine and the click on Forward, in my case i am giving disk space for my VM as 20 GB, + +[![Disk-Image-RHEL8-KVM-VM][10]][11] + +In the next window, specify the name of VM and choose the Network that you want to attach to VM’s Ethernet card, as we had created network bridge “br0” for vms networking, so choose bridge“br0”. + +[![Network-Selection-KVM-RHEL8][12]][13] + +Click on Finish to proceed with VM creation and its OS installation, + +[![OS-Installation-KVM-VM-RHEL8][14]][15] + +Follow the screen Instructions and complete the Installation. + +**Creating KVM Virtual Machine from Command Line** + +if you are fan of command line then there is a command line tool for you called “**virt-install**” to create virtual machines. Once the Virtual machines are provisioned then vms can be managed via command line tool “[virsh][16]“. + +Let’s assume we want to create CentOS 7 VM using virt-install, i have already placed CentOS 7 ISO file under /opt folder, + +Execute beneath command to provision a VM + +``` +[root@linuxtechi ~]# virt-install -n CentOS7-Server --description "CentOS 7 Virtual Machine" --os-type=Linux --os-variant=rhel7 --ram=1096 --vcpus=1 --disk path=/var/lib/libvirt/images/centos7-server.img,bus=virtio,size=20 --network bridge:br0 --graphics none --location /opt/CentOS-7-x86_64-DVD-1511.iso --extra-args console=ttyS0 +``` + +Output of command would be something like below, + +![Virt-Install-KVM-RHEL8][17] + +Follow screen instructions to complete CentOS 7 Installation. That’s all from this tutorial, i hope these steps helped you to setup KVM on your RHEL 8 system, please do share your feedback and comments. + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/install-configure-kvm-on-rhel-8/ + +作者:[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/wp-content/uploads/2019/06/rhel-8-bridge-details-1024x628.jpg +[2]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Access-Virt-Manager-RHEL8-1024x471.jpg +[3]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Access-Virt-Manager-RHEL8.jpg +[4]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Choose-ISO-KVM-RHEL8-1024x479.jpg +[5]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Choose-ISO-KVM-RHEL8.jpg +[6]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Installation-ISO-File-RHEL8-KVM-1024x477.jpg +[7]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Installation-ISO-File-RHEL8-KVM.jpg +[8]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Specify-RAM-CPU-KVM-RHEL8-1024x478.jpg +[9]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Specify-RAM-CPU-KVM-RHEL8.jpg +[10]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Disk-Image-RHEL8-KVM-VM-1024x483.jpg +[11]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Disk-Image-RHEL8-KVM-VM.jpg +[12]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Network-Selection-KVM-RHEL8-1024x482.jpg +[13]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Network-Selection-KVM-RHEL8.jpg +[14]: https://www.linuxtechi.com/wp-content/uploads/2019/06/OS-Installation-KVM-VM-RHEL8-1024x479.jpg +[15]: https://www.linuxtechi.com/wp-content/uploads/2019/06/OS-Installation-KVM-VM-RHEL8.jpg +[16]: https://www.linuxtechi.com/create-revert-delete-kvm-virtual-machine-snapshot-virsh-command/ +[17]: https://www.linuxtechi.com/wp-content/uploads/2019/06/Virt-Install-KVM-RHEL8.jpg diff --git a/sources/tech/20190624 Linux Package Managers Compared - AppImage vs Snap vs Flatpak.md b/sources/tech/20190624 Linux Package Managers Compared - AppImage vs Snap vs Flatpak.md new file mode 100644 index 0000000000..df5686d0a5 --- /dev/null +++ b/sources/tech/20190624 Linux Package Managers Compared - AppImage vs Snap vs Flatpak.md @@ -0,0 +1,222 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux Package Managers Compared – AppImage vs Snap vs Flatpak) +[#]: via: (https://www.ostechnix.com/linux-package-managers-compared-appimage-vs-snap-vs-flatpak/) +[#]: author: (editor https://www.ostechnix.com/author/editor/) + +Linux Package Managers Compared – AppImage vs Snap vs Flatpak +====== + +![3 Linux Package Managers Compared][1] + +**Package managers** provide a way of packaging, distributing, installing, and maintaining apps in an operating system. With modern desktop, server and IoT applications of the Linux operating system and the hundreds of different distros that exist, it becomes necessary to move away from platform specific packaging methods to platform agnostic ones. This post explores 3 such tools, namely **AppImage** , **Snap** and **Flatpak** , that each aim to be the future of software deployment and management in Linux. At the end we summarize a few key findings. + +### 1\. AppImage + +**AppImage** follows a concept called **“One app = one file”**. This is to be understood as an AppImage being a regular independent “file” containing one application with everything it needs to run in the said file. Once made executable, the AppImage can be run like any application in a computer by simply double-clicking it in the users file system.[1] + +It is a format for creating portable software for Linux without requiring the user to install the said application. The format allows the original developers of the software (upstream developers) to create a platform and distribution independent (also called a distribution-agnostic binary) version of their application that will basically run on any flavor of Linux. + +AppImage has been around for a long time. **Klik** , a predecessor of AppImage was created by **Simon Peter** in 2004. The project was shut down in 2011 after not having passed the beta stage. A project named **PortableLinuxApps** was created by Simon around the same time and the format was picked up by a few portals offering software for Linux users. The project was renamed again in 2013 to its current name AppImage and a repository has been maintained in GitHub (project [link][2]) with all the latest changes to the same since 2018.[2][3] + +Written primarily in **C** and donning the **MIT license** since 2013, AppImage is currently developed by **The AppImage project**. It is a very convenient way to use applications as demonstrated by the following features: + + 1. AppImages can run on virtually any Linux system. As mentioned before applications derive a lot of functionality from the operating system and a few common libraries. This is a common practice in the software world since if something is already done, there is no point in doing it again if you can pick and choose which parts from the same to use. The problem is that many Linux distros might not have all the files a particular application requires to run since it is left to the developers of that particular distro to include the necessary packages. Hence developers need to separately include the dependencies of the application for each Linux distro they are publishing their app for. Using the AppImage format developers can choose to include all the libraries and files that they cannot possibly hope the target operating system to have as part of the AppImage file. Hence the same AppImage format file can work on different operating systems and machines without needing granular control. + 2. The one app one file philosophy means that user experience is simple and elegant in that users need only download and execute one file that will serve their needs for using the application. + 3. **No requirement of root access**. System administrators will require people to have root access to stop them from messing with computers and their default setup. This also means that people with no root access or super user privileges cannot install the apps they need as they please. The practice is common in a public setting (such as library or university computers or on enterprise systems). The AppImage file does not require users to “install” anything and hence users need only download the said file and **make it executable** to start using it. This removes the access dilemmas that system administrators have and makes their job easier without sacrificing user experience. + 4. **No effect on core operating system**. The AppImage-application format allows using applications with their full functionality without needing to change or even access most system files. Meaning whatever the applications do, the core operating system setup and files remain untouched. + 5. An AppImage can be made by a developer for a particular version of their application. Any updated version is made as a different AppImage. Hence users if need be can **test multiple versions of the same application** by running different instances using different AppImages. This is an invaluable feature when you need to test your applications from an end-user POV to notice differences. + 6. Take your applications where you go. As mentioned previously AppImages are archived files of all the files that an application requires and can be used without installing or even bothering about the distribution the system uses. Hence if you have a set of apps that you use regularly you may even mount a few AppImage files on a thumb drive and take it with you to use on multiple computers running multiple different distros without worrying whether they’ll work or not. + + + +Furthermore, the **AppImageKit** allows users from all backgrounds to build their own AppImages from applications they already have or for applications that are not provided an AppImage by their upstream developer. + +The package manager is platform independent but focuses primarily on software distribution to end users on their desktops with a dedicated daemon **AppImaged** for integrating the AppImage formats into respective desktop environments. AppImage is supported natively now by a variety of distros such as Ubuntu, Debian, openSUSE, CentOS, Fedora etc. and others may set it up as per their needs. AppImages can also be run on servers with limited functionality via the CLI tools included. + +To know more about AppImages, go to the official [**AppImage documentation**][3] page. + +* * * + +**Suggested read:** + + * [**Search Linux Applications On AppImage, Flathub And Snapcraft Platforms**][4] + + + +* * * + +### 2\. Snappy + +**Snappy** is a software deployment and package management system like AppImage or any other package manager for that instance. It is originally designed for the now defunct **Ubuntu Touch** Operating system. Snappy lets developers create software packages for use in a variety of Linux based distributions. The initial intention behind creating Snappy and deploying **“snaps”** on Ubuntu based systems is to obtain a unified single format that could be used in everything from IoT devices to full-fledged computer systems that ran some version of Ubuntu and in a larger sense Linux itself.[4] + +The lead developer behind the project is **Canonical** , the same company that pilots the Ubuntu project. Ubuntu had native snap support from version 16.04 LTS with more and more distros supporting it out of the box or via a simple setup these days. If you use Arch or Debian or openSUSE you’ll find it easy to install support for the package manager using simple commands in the terminal as explained later in this section. This is also made possible by making the necessary snap platform files available on the respective repos.[5] + +Snappy has the following important components that make up the entire package manager system.[6] + + * **Snap** – is the file format of the packages themselves. Individual applications that are deployed using Snappy are called “Snaps”. Any application may be packaged using the tools provided to make a snap that is intended to run on a different system running Linux. Snap, similar to AppImage is an all-inclusive file and contains all dependencies the application needs to run without assuming them to part of the target system. + * **Snapcraft** – is the tool that lets developers make snaps of their applications. It is basically a command that is part of the snap system as well as a framework that will let you build your own snaps. + * **Snapd** – is the background daemon that maintains all the snaps that are installed in your system. It integrates into the desktop environment and manages all the files and processes related to working with snaps. The snapd daemon also checks for updates normally **4 times a day** unless set otherwise. + * [**Snap Store**][5] – is an online gallery of sorts that lets developers upload their snaps into the repository. Snap store is also an application discovery medium for users and will let users see and experience the application library before downloading and installing them. + + + +The snapd component is written primarily in **C** and **Golang** whereas the Snapcraft framework is built using **Python**. Although both the modules use the GPLv3 license it is to be noted that snapd has proprietary code from Canonical for its server-side operations with just the client side being published under the GPL license. This is a major point of contention with developers since this involves developers signing a CLA form to participate in snap development.[7] + +Going deeper into the finer details of the Snappy package manager the following may be noted: + + 1. Snaps as noted before are all inclusive and contain all the necessary files (dependencies) that the application needs to run. Hence, developers need not to make different snaps for the different distros that they target. Being mindful of the runtimes is all that’s necessary if base runtimes are excluded from the snap. + 2. Snappy packages are meant to support transactional updates. Such a transactional update is atomic and fully reversible, meaning you can use the application while its being updated and that if an update does not behave the way its supposed to, you can reverse the same with no other effects whatsoever. The concept is also called as **delta programming** in which only changes to the application are transmitted as an update instead of the whole package. An Ubuntu derivative called **Ubuntu Core** actually promises the snappy update protocol to the OS itself.[8] + 3. A key point of difference between snaps and AppImages, is how they handle version differences. Using AppImages different versions of the application will have different AppImages allowing you to concurrently use 2 or more different versions of the same application at the same time. However, using snaps means conforming to the transactional or delta update system. While this means faster updates, it keeps you from running two instances of the same application at the same time. If you need to use the old version of an app you’ll need to reverse or uninstall the new version. Snappy does support a feature called [**“parallel install”**][6] which will let users accomplish similar goals, however, it is still in an experimental stage and cannot be considered to be a stable implementation. Snappy also makes use of channels meaning you can use the beta or the nightly build of an app and the stable version at the same time.[9] + 4. Extensive support from major Linux distros and major developers including Google, Mozilla, Microsoft, etc.[4] + 5. Snapd the desktop integration tool supports taking **“snapshots”** of the current state of all the installed snaps in the system. This will let users save the current configuration state of all the applications that are installed via the Snappy package manager and let users revert to that state whenever they desire so. The same feature can also be set to automatically take snapshots at a frequency deemed necessary by the user. Snapshots can be created using the **snap save command** in the snapd framework.[10] + 6. Snaps are designed to be sandboxed during operation. This provides a much-required layer of security and isolation to users. Users need not worry about snap-based applications messing with the rest of the software on their computer. Sandboxing is implemented using three levels of isolation viz, **classic** , **strict** and **devmode**. Each level of isolation allows the app different levels of access within the file system and computer.[11] + + + +On the flip side of things, snaps are widely criticized for being centered around **Canonical’s modus operandi**. Most of the commits to the project are by Canonical employees or contractors and other contributors are required to sign a release form (CLA). The sandboxing feature, a very important one indeed from a security standpoint, is flawed in that the sandboxing actually requires certain other core services to run (such as Mir) while applications running the X11 desktop won’t support the said isolation, hence making the said security feature irrelevant. Questionable press releases and other marketing efforts from Canonical and the “central” and closed app repository are also widely criticized aspects of Snappy. Furthermore, the file sizes of the different snaps are also **comparatively very large** compared to the app sizes of the packages made using AppImage.[7] + +For more details, check [**Snap official documentation**][7]. + +* * * + +**Related read:** + + * [**Install Snap packages in Arch Linux, and Fedora**][8] + + + +* * * + +### 3\. Flatpak + +Like the Snap/Snappy listed above, **Flatpak** is also a software deployment tool that aims to ease software distribution and use in Linux. Flatpak was previously known as **“xdg-app”** and was based on concept proposed by **Lennart Poettering** in 2004. The idea was to contain applications in a secure virtual sandbox allowing for using applications **without the need of root privileges** and without compromising on the systems security. **Alex** started tinkering with Klik (thought to be a former version of AppImage) and wanted to implement the concept better. **Alexander Larsson** who at the time was working with Red Hat wrote an implementation called xdg-app in 2015 that acted as a pre-cursor to the current Flatpak format. + +Flatpak officially came out in 2016 with backing from Red Hat, Endless Computers and Collabora. **Flathub** is the official repository of all Flatpak application packages. At its surface Flatpak like the other is a framework for building and packaging distribution agnostic applications for Linux. It simply requires the developers to conform to a few desktop environment guidelines in order for the application to be successfully integrated into the Flatpak environment. + +Targeted primarily at the three popular desktop implementations **FreeDesktop** , **KDE** , and **GNOME** , the Flatpak framework itself is written in **C** and works on a **LGPL** license. The maintenance repository can be accessed via the GitHub link **[here][9]**. + +A few features of Flatpak that make it stand apart are mentioned below. Notice that features Flatpak shares with AppImage and Snappy are omitted here. + + * Deep integration into popular Linux desktop environments such as GNOME & KDE so that users can simply use Flatpaks using Graphical software management tools instead of resorting to the terminal. Flatpak can be installed from the default repositories of major desktop environments now and once the apps themselves are set-up they can be used and provide features similar to normal desktop applications.[12][13] + * **Forward-compatibility** – Flatpaks are built from the ground up keeping the operating systems core kernel and runtimes in mind. Hence, even if you upgrade or update your distro the Flatpaks you have should still work unless there is a core update. This is especially crucial for people who prefer staying on rolling betas or development versions of their distros. For such people, since the kinks of the OS itself isn’t ironed out usually, the Flatpak application will run seamlessly without having to depend on the OS files or libraries for its operation.[13] + * **Sandboxing using Bubblewrap** – snaps are also by default sandboxed in that they run in isolation from the rest of the applications running while you’re using your computer. However, Flatpaks fully seal the application from accessing OS files and user files during its operation by default. This essentially means that system administrators can be certain that Flatpaks that are installed in their systems cannot exploit the computer and the files it contains whereas for end users this will mean that in order to access a few specific functions or user data root permission is required.[14] + * Flatpak supports decentralized distribution of application natively however the team behind Flatpak still maintains a central online repository of apps/Flatpaks called **Flathub**. Users may in fact configure Flatpak to use multiple remote repositories as they see necessary. As opposed to snap you can have multiple repositories.[13] + * Modular access through the sandbox. Although this capability comes at a great potential cost to the integrity of the system, Flatpak framework allows for channels to be created through the sandbox for exchange of specific information from within the sandbox to the host system or vice versa. The channel is in this case referred to as a portal. A con to this feature is discussed later in the section.[14] + + + +One of the most criticized aspects of Flatpak however is it’s the sandbox feature itself. Sandboxing is how package managers such as Snappy and Flatpak implement important security features. Sandboxing essentially isolates the application from everything else in the system only allowing for user defined exchange of information from within the sandbox to outside. The flaw with the concept being that the sandbox cannot be inherently impregnable. Data has to be eventually transferred between the two domains and simple Linux commands can simply get rid of the sandbox restriction meaning that malicious applications might potentially jump out of the said sandbox.[15] + +This combined with the worse than expected commitment to rolling out security updates for Flatpak has resulted in widespread criticism of the team’s tall claim of providing a secure framework. The blog (named **flatkill** ) linked at the end of this guide in fact mentions a couple of exploits that were not addressed by the Flatpak team as soon as they should’ve been.[15] + +For more details, I suggest you to read [**Flatpak official documentation**][10]. + +* * * + +**Related read:** + + * [**A Beginners Guide To Flatpak**][11] + + + +* * * + +### AppImage vs Snap vs Flatpak + +The table attached below summarizes all the above findings into a concise and technical comparison of the three frameworks. + +**Feature** | **AppImage** | **Snappy** | **Flatpak** +---|---|---|--- +**Unique feature** | Not an appstore or repository, its simply put a packaging format for software distribution. | Led by Canonical (Same company as Ubuntu), features central app repository and active contribution from Canonical. | Features an app store called FlatHub, however, individuals may still host packages and distribute it. +**Target system** | Desktops and Servers. | Desktops, Servers, IoT devices, Embedded devices etc. | Desktops and limited function on servers. +**Libraries/Dependencies** | Base system. Runtimes optional, Libraries and other dependencies packaged. | Base system or via Plugins or can be packaged. | GNOME, KDE, Freedesktop bundled or custom bundled. +**Developers** | Community Driven led by Simon Peter. | Corporate driven by Canonical Ltd. | Community driven by flatpak team supported by enterprise. +**Written in** | C. | Golang, C and Python. | C. +**Initial release** | 2004. | 2014. | 2015. +**Sandboxing** | Can be implemented. | 3 modes – strict, classic, and devmode with varying confinement capabilities. Runs in isolation. | Isolated but Uses system files to run applications by default. +**Sandboxing Platform** | Firejail, AppArmor, Bubblewrap. | AppArmor. | Bubblewrap. +**App Installation** | Not necessary. Will act as self mounted disc. | Installation using snapd. | Installed using flatpak client tools. +**App Execution** | Can be run after setting executing bit. | Using desktop integrated snap tools. Runs isolated with user defined resources. | Needs to be executed using flatpak command if CLI is used. +**User Privileges** | Can be run w/o root user access. | Can be run w/o root user access. | Selectively required. +**Hosting Applications** | Can be hosted anywhere by anybody. | Has to be hosted with Canonical servers which are proprietary. | Can be hosted anywhere by anybody. +**Portable Execution from non system locations** | Yes. | No. | Yes, after flatpak client is configured. +**Central Repository** | AppImageHub. | Snap Store. | Flathub. +**Running multiple versions of the app** | Possible, any number of versions simultaneously. | One version of the app in one channel. Has to be separately configured for more. | Yes. +**Updating applications** | Using CLI command AppImageUpdate or via an updater tool built into the AppImage. | Requires snapd installed. Supports delta updating, will automatically update. | Required flatpak installed. Update Using flatpak update command. +**Package sizes on disk** | Application remains archived. | Application remains archived. | Client side is uncompressed. + +Here is a long tabular comparison of AppImage vs. Snap vs. Flatpak features. Please note that the comparison is made from an AppImage perspective. + + * [**https://github.com/AppImage/AppImageKit/wiki/Similar-projects#comparison**][12] + + + +### Conclusion + +While all three of these platforms have a lot in common with each other and aim to be platform agnostic in approach, they offer different levels of competencies in a few areas. While Snaps can run on a variety of devices including embedded ones, AppImages and Flatpaks are built with the desktop user in mind. AppImages of popular applications on the other had have superior packaging sizes and portability whereas Flatpak really shines with its forward compatibility when its used in a set it and forget it system. + +If there are any flaws in this guide, please let us know in the comment section below. We will update the guide accordingly. + +**References:** + + * **[1]** [**Concepts — AppImage documentation**][13] + * **[2]** [**Slashdot – Point-and-klik Linux Software Installation**][14] + * **[3]** [**History of AppImage project**][15] + * **[4][Snapcraft – Snaps are universal Linux packages][16]** + * **[5][Installing snapd – Snap documentation][17]** + * **[6][Snap documentation][7]** + * **[7][On Snappy and Flatpak: business as usual in the Canonical propaganda department][18]** + * **[8][Snap Updates are getting smaller, here’s why][19]** + * **[9][What Are Linux Snap Packages? Why Use Them?][20]** + * **[10][Snapshots – Snap documentation][21]** + * **[11][Snap confinement – Snap documentation][22]** + * **[12][Desktop Integration – Flatpak documentation][23]** + * **[13][Introduction to Flatpak – Flatpak documentation][24]** + * **[14][Sandbox Permissions – Flatpak documentation][25]** + * **[15][Flatpak – a security nightmare][26]** + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/linux-package-managers-compared-appimage-vs-snap-vs-flatpak/ + +作者:[editor][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.ostechnix.com/author/editor/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Linux-Package-Managers-Compared-1-720x340.png +[2]: https://github.com/AppImage/AppImageKit/blob/master/README.md +[3]: https://docs.appimage.org/ +[4]: https://www.ostechnix.com/search-linux-applications-on-appimage-flathub-and-snapcraft-platforms/ +[5]: https://snapcraft.io/store +[6]: https://blog.ubuntu.com/2019/06/20/parallel-installs-test-and-run-multiple-instances-of-snaps +[7]: https://docs.snapcraft.io/ +[8]: https://www.ostechnix.com/install-snap-packages-arch-linux-fedora/ +[9]: https://github.com/flatpak/flatpak +[10]: http://docs.flatpak.org/en/latest/index.html +[11]: https://www.ostechnix.com/flatpak-new-framework-desktop-applications-linux/ +[12]: https://github.com/AppImage/AppImageKit/wiki/Similar-projects#comparison +[13]: https://docs.appimage.org/introduction/concepts.html#one-app-one-file. +[14]: https://linux.slashdot.org/story/05/01/15/1815210/point-and-klik-linux-software-installation +[15]: https://github.com/AppImage/AppImageKit/wiki/History#timeline. +[16]: https://snapcraft.io/# +[17]: https://docs.snapcraft.io/installing-snapd +[18]: https://www.happyassassin.net/2016/06/16/on-snappy-and-flatpak-business-as-usual-in-the-canonical-propaganda-department/ +[19]: https://blog.ubuntu.com/2017/08/01/snap-updates-are-getting-smaller-heres-why +[20]: https://www.feliciano.tech/blog/what-are-linux-snap-packages-why-use-them/ +[21]: https://docs.snapcraft.io/snapshots +[22]: https://docs.snapcraft.io/snap-confinement +[23]: http://docs.flatpak.org/en/latest/desktop-integration.html?highlight=desktop%20integration +[24]: http://docs.flatpak.org/en/latest/introduction.html +[25]: http://docs.flatpak.org/en/latest/sandbox-permissions.html?highlight=sandboxing +[26]: https://flatkill.org/ diff --git a/sources/tech/20190625 The cost of JavaScript in 2019 - V8.md b/sources/tech/20190625 The cost of JavaScript in 2019 - V8.md new file mode 100644 index 0000000000..e21eefd5ad --- /dev/null +++ b/sources/tech/20190625 The cost of JavaScript in 2019 - V8.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The cost of JavaScript in 2019 · V8) +[#]: via: (https://v8.dev/blog/cost-of-javascript-2019) +[#]: author: (Addy Osmani https://twitter.com/addyosmani) + +The cost of JavaScript in 2019 · V8 +====== +**Note:** If you prefer watching a presentation over reading articles, then enjoy the video below! If not, skip the video and read on. + +[“The cost of JavaScript”][1] as presented by Addy Osmani at #PerfMatters Conference 2019. + +One large change to [the cost of JavaScript][2] over the last few years has been an improvement in how fast browsers can parse and compile script. **In 2019, the dominant costs of processing scripts are now download and CPU execution time.** + +User interaction can be delayed if the browser’s main thread is busy executing JavaScript, so optimizing bottlenecks with script execution time and network can be impactful. + +### Actionable high-level guidance # + +What does this mean for web developers? Parse & compile costs are **no longer as slow** as we once thought. The three things to focus on for JavaScript bundles are: + + * **Improve download time** + * Keep your JavaScript bundles small, especially for mobile devices. Small bundles improve download speeds, lower memory usage, and reduce CPU costs. + * Avoid having just a single large bundle; if a bundle exceeds ~50–100 kB, split it up into separate smaller bundles. (With HTTP/2 multiplexing, multiple request and response messages can be in flight at the same time, reducing the overhead of additional requests.) + * On mobile you’ll want to ship much less especially because of network speeds, but also to keep plain memory usage low. + * **Improve execution time** + * Avoid [Long Tasks][3] that can keep the main thread busy and can push out how soon pages are interactive. Post-download, script execution time is now a dominant cost. + * **Avoid large inline scripts** (as they’re still parsed and compiled on the main thread). A good rule of thumb is: if the script is over 1 kB, avoid inlining it (also because 1 kB is when [code caching][4] kicks in for external scripts). + + + +### Why does download and execution time matter? # + +Why is it important to optimize download and execution times? Download times are critical for low-end networks. Despite the growth in 4G (and even 5G) across the world, our [effective connection types][5] remain inconsistent with many of us running into speeds that feel like 3G (or worse) when we’re on the go. + +JavaScript execution time is important for phones with slow CPUs. Due to differences in CPU, GPU, and thermal throttling, there are huge disparities between the performance of high-end and low-end phones. This matters for the performance of JavaScript, as execution is CPU-bound. + +In fact, of the total time a page spends loading in a browser like Chrome, anywhere up to 30% of that time can be spent in JavaScript execution. Below is a page load from a site with a pretty typical workload (Reddit.com) on a high-end desktop machine:![][6]JavaScript processing represents 10–30% of time spent in V8 during page load. + +On mobile, it takes 3–4× longer for a median phone (Moto G4) to execute Reddit’s JavaScript compared to a high-end device (Pixel 3), and over 6× as long on a low-end device (the <$100 Alcatel 1X):![][7]The cost of Reddit’s JavaScript across a few different device classes (low-end, average, and high-end) + +**Note:** Reddit has different experiences for desktop and mobile web, and so the MacBook Pro results cannot be compared to the other results. + +When you’re trying to optimize JavaScript execution time, keep an eye out for [Long Tasks][8] that might be monopolizing the UI thread for long periods of time. These can block critical tasks from executing even if the page looks visually ready. Break these up into smaller tasks. By splitting up your code and prioritizing the order in which it is loaded, you can get pages interactive faster and hopefully have lower input latency.![][9]Long tasks monopolize the main thread. You should break them up. + +### What has V8 done to improve parse/compile? # + +Raw JavaScript parsing speed in V8 has increased 2× since Chrome 60. At the same time, raw parse (and compile) cost has become less visible/important due to other optimization work in Chrome that parallelizes it. + +V8 has reduced the amount of parsing and compilation work on the main thread by an average of 40% (e.g. 46% on Facebook, 62% on Pinterest) with the highest improvement being 81% (YouTube), by parsing and compiling on a worker thread. This is in addition to the existing off-main-thread streaming parse/compile.![][10]V8 parse times across different versions + +We can also visualize the CPU time impact of these changes across different versions of V8 across Chrome releases. In the same amount of time it took Chrome 61 to parse Facebook’s JS, Chrome 75 can now parse both Facebook’s JS AND 6 times Twitter’s JS.![][11]In the time it took Chrome 61 to parse Facebook’s JS, Chrome 75 can now parse both Facebook’s JS and 6 times Twitter’s JS. + +Let’s dive into how these changes were unlocked. In short, script resources can be streaming-parsed and-compiled on a worker thread, meaning: + + * V8 can parse+compile JavaScript without blocking the main thread. + * Streaming starts once the full HTML parser encounters a `