mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-25 23:11:02 +08:00
commit
6559a8e6bd
@ -0,0 +1,227 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11373-1.html)
|
||||
[#]: subject: (Create an online store with this Java-based framework)
|
||||
[#]: via: (https://opensource.com/article/19/1/scipio-erp)
|
||||
[#]: author: (Paul Piper https://opensource.com/users/madppiper)
|
||||
|
||||
使用 Java 框架 Scipio ERP 创建一个在线商店
|
||||
======
|
||||
|
||||
> Scipio ERP 具有包罗万象的应用程序和功能。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201909/22/133258hqvwax5w1zvq5ffa.jpg)
|
||||
|
||||
如果,你想在网上销售产品或服务,但要么找不到合适的软件,要么觉得定制成本太高?那么,[Scipio ERP][1] 也许正是你想要的。
|
||||
|
||||
Scipio ERP 是一个基于 Java 的开源的电子商务框架,具有包罗万象的应用程序和功能。这个项目于 2014 年从 [Apache OFBiz][2] 分叉而来,侧重于更好的定制和更现代的吸引力。这个电子商务组件非常丰富,可以在多商店环境中工作,同时支持国际化,具有琳琅满目的产品配置,而且它还兼容现代 HTML 框架。该软件还为许多其他业务场景提供标准应用程序,例如会计、仓库管理或销售团队自动化。它都是高度标准化的,因此易于定制,如果你想要的不仅仅是一个虚拟购物车,这是非常棒的。
|
||||
|
||||
该系统也使得跟上现代 Web 标准变得非常容易。所有界面都是使用系统的“[模板工具包][3]”构建的,这是一个易于学习的宏集,可以将 HTML 与所有应用程序分开。正因为如此,每个应用程序都已经标准化到核心。听起来令人困惑?它真的不是 HTML——它看起来很像 HTML,但你写的内容少了很多。
|
||||
|
||||
### 初始安装
|
||||
|
||||
在你开始之前,请确保你已经安装了 Java 1.8(或更高版本)的 SDK 以及一个 Git 客户端。完成了?太棒了!接下来,切换到 Github 上的主分支:
|
||||
|
||||
```
|
||||
git clone https://github.com/ilscipio/scipio-erp.git
|
||||
cd scipio-erp
|
||||
git checkout master
|
||||
```
|
||||
|
||||
要安装该系统,只需要运行 `./install.sh` 并从命令行中选择任一选项。在开发过程中,最好一直使用 “installation for development”(选项 1),它还将安装一系列演示数据。对于专业安装,你可以修改初始配置数据(“种子数据”),以便自动为你设置公司和目录数据。默认情况下,系统将使用内部数据库运行,但是它[也可以配置][4]使用各种关系数据库,比如 PostgreSQL 和 MariaDB 等。
|
||||
|
||||
![安装向导][6]
|
||||
|
||||
*按照安装向导完成初始配置*
|
||||
|
||||
通过命令 `./start.sh` 启动系统然后打开链接 <https://localhost:8443/setup/> 完成配置。如果你安装了演示数据, 你可以使用用户名 `admin` 和密码 `scipio` 进行登录。在安装向导中,你可以设置公司简介、会计、仓库、产品目录、在线商店和额外的用户配置信息。暂时在产品商店配置界面上跳过网站实体的配置。系统允许你使用不同的底层代码运行多个在线商店;除非你想这样做,一直选择默认值是最简单的。
|
||||
|
||||
祝贺你,你刚刚安装了 Scipio ERP!在界面上操作一两分钟,感受一下它的功能。
|
||||
|
||||
### 捷径
|
||||
|
||||
在你进入自定义之前,这里有一些方便的命令可以帮助你:
|
||||
|
||||
* 创建一个 shop-override:`./ant create-component-shop-override`
|
||||
* 创建一个新组件:`./ant create-component`
|
||||
* 创建一个新主题组件:`./ant create-theme`
|
||||
* 创建管理员用户:`./ant create-admin-user-login`
|
||||
* 各种其他实用功能:`./ant -p`
|
||||
* 用于安装和更新插件的实用程序:`./git-addons help`
|
||||
|
||||
另外,请记下以下位置:
|
||||
|
||||
* 将 Scipio 作为服务运行的脚本:`/tools/scripts/`
|
||||
* 日志输出目录:`/runtime/logs`
|
||||
* 管理应用程序:`<https://localhost:8443/admin/>`
|
||||
* 电子商务应用程序:`<https://localhost:8443/shop/>`
|
||||
|
||||
最后,Scipio ERP 在以下五个主要目录中构建了所有代码:
|
||||
|
||||
* `framework`: 框架相关的源,应用程序服务器,通用界面和配置
|
||||
* `applications`: 核心应用程序
|
||||
* `addons`: 第三方扩展
|
||||
* `themes`: 修改界面外观
|
||||
* `hot-deploy`: 你自己的组件
|
||||
|
||||
除了一些配置,你将在 `hot-deploy` 和 `themes` 目录中进行开发。
|
||||
|
||||
### 在线商店定制
|
||||
|
||||
要真正使系统成为你自己的系统,请开始考虑使用[组件][7]。组件是一种模块化方法,可以覆盖、扩展和添加到系统中。你可以将组件视为独立 Web 模块,可以捕获有关数据库([实体][8])、功能([服务][9])、界面([视图][10])、[事件和操作][11]和 Web 应用程序等的信息。由于组件功能,你可以添加自己的代码,同时保持与原始源兼容。
|
||||
|
||||
运行命令 `./ant create-component-shop-override` 并按照步骤创建你的在线商店组件。该操作将会在 `hot-deploy` 目录内创建一个新目录,该目录将扩展并覆盖原始的电子商务应用程序。
|
||||
|
||||
![组件目录结构][13]
|
||||
|
||||
*一个典型的组件目录结构。*
|
||||
|
||||
你的组件将具有以下目录结构:
|
||||
|
||||
* `config`: 配置
|
||||
* `data`: 种子数据
|
||||
* `entitydef`: 数据库表定义
|
||||
* `script`: Groovy 脚本的位置
|
||||
* `servicedef`: 服务定义
|
||||
* `src`: Java 类
|
||||
* `webapp`: 你的 web 应用程序
|
||||
* `widget`: 界面定义
|
||||
|
||||
此外,`ivy.xml` 文件允许你将 Maven 库添加到构建过程中,`ofbiz-component.xml` 文件定义整个组件和 Web 应用程序结构。除了一些在当前目录所能够看到的,你还可以在 Web 应用程序的 `WEB-INF` 目录中找到 `controller.xml` 文件。这允许你定义请求实体并将它们连接到事件和界面。仅对于界面来说,你还可以使用内置的 CMS 功能,但优先要坚持使用核心机制。在引入更改之前,请熟悉 `/applications/shop/`。
|
||||
|
||||
#### 添加自定义界面
|
||||
|
||||
还记得[模板工具包][3]吗?你会发现它在每个界面都有使用到。你可以将其视为一组易于学习的宏,它用来构建所有内容。下面是一个例子:
|
||||
|
||||
```
|
||||
<@section title="Title">
|
||||
<@heading id="slider">Slider</@heading>
|
||||
<@row>
|
||||
<@cell columns=6>
|
||||
<@slider id="" class="" controls=true indicator=true>
|
||||
<@slide link="#" image="https://placehold.it/800x300">Just some content…</@slide>
|
||||
<@slide title="This is a title" link="#" image="https://placehold.it/800x300"></@slide>
|
||||
</@slider>
|
||||
</@cell>
|
||||
<@cell columns=6>Second column</@cell>
|
||||
</@row>
|
||||
</@section>
|
||||
```
|
||||
|
||||
不是很难,对吧?同时,主题包含 HTML 定义和样式。这将权力交给你的前端开发人员,他们可以定义每个宏的输出,并坚持使用自己的构建工具进行开发。
|
||||
|
||||
我们快点试试吧。首先,在你自己的在线商店上定义一个请求。你将修改此代码。一个内置的 CMS 系统也可以通过 <https://localhost:8443/cms/> 进行访问,它允许你以更有效的方式创建新模板和界面。它与模板工具包完全兼容,并附带可根据你的喜好采用的示例模板。但是既然我们试图在这里理解系统,那么首先让我们采用更复杂的方法。
|
||||
|
||||
打开你商店 `webapp` 目录中的 [controller.xml][14] 文件。控制器会跟踪请求事件并相应地执行操作。下面的操作将会在 `/shop/test` 下创建一个新的请求:
|
||||
|
||||
```
|
||||
<!-- Request Mappings -->
|
||||
<request-map uri="test">
|
||||
<security https="true" auth="false"/>
|
||||
<response name="success" type="view" value="test"/>
|
||||
</request-map>
|
||||
```
|
||||
|
||||
你可以定义多个响应,如果需要,可以在请求中使用事件或服务调用来确定你可能要使用的响应。我选择了“视图”类型的响应。视图是渲染的响应;其他类型是请求重定向、转发等。系统附带各种渲染器,可让你稍后确定输出;为此,请添加以下内容:
|
||||
|
||||
```
|
||||
<!-- View Mappings -->
|
||||
<view-map name="test" type="screen" page="component://mycomponent/widget/CommonScreens.xml#test"/>
|
||||
```
|
||||
|
||||
用你自己的组件名称替换 `my-component`。然后,你可以通过在 `widget/CommonScreens.xml` 文件的标签内添加以下内容来定义你的第一个界面:
|
||||
|
||||
```
|
||||
<screen name="test">
|
||||
<section>
|
||||
<actions>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonShopAppDecorator" location="component://shop/widget/CommonScreens.xml">
|
||||
<decorator-section name="body">
|
||||
<platform-specific><html><html-template location="component://mycomponent/webapp/mycomponent/test/test.ftl"/></html></platform-specific>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
```
|
||||
|
||||
商店界面实际上非常模块化,由多个元素组成([小部件、动作和装饰器][15])。为简单起见,请暂时保留原样,并通过添加第一个模板工具包文件来完成新网页。为此,创建一个新的 `webapp/mycomponent/test/test.ftl` 文件并添加以下内容:
|
||||
|
||||
```
|
||||
<@alert type="info">Success!</@alert>
|
||||
```
|
||||
|
||||
![自定义的界面][17]
|
||||
|
||||
*一个自定义的界面。*
|
||||
|
||||
打开 <https://localhost:8443/shop/control/test/> 并惊叹于你自己的成就。
|
||||
|
||||
#### 自定义主题
|
||||
|
||||
通过创建自己的主题来修改商店的界面外观。所有主题都可以作为组件在 `themes` 文件夹中找到。运行命令 `./ant create-theme` 来创建你自己的主题。
|
||||
|
||||
![主题组件布局][19]
|
||||
|
||||
*一个典型的主题组件布局。*
|
||||
|
||||
以下是最重要的目录和文件列表:
|
||||
|
||||
* 主题配置:`data/*ThemeData.xml`
|
||||
* 特定主题封装的 HTML:`includes/*.ftl`
|
||||
* 模板工具包 HTML 定义:`includes/themeTemplate.ftl`
|
||||
* CSS 类定义:`includes/themeStyles.ftl`
|
||||
* CSS 框架: `webapp/theme-title/`
|
||||
|
||||
快速浏览工具包中的 Metro 主题;它使用 Foundation CSS 框架并且充分利用了这个框架。然后,然后,在新构建的 `webapp/theme-title` 目录中设置自己的主题并开始开发。Foundation-shop 主题是一个非常简单的特定于商店的主题实现,你可以将其用作你自己工作的基础。
|
||||
|
||||
瞧!你已经建立了自己的在线商店,准备个性化定制吧!
|
||||
|
||||
![搭建完成的 Scipio ERP 在线商店][21]
|
||||
|
||||
*一个搭建完成的基于 Scipio ERP的在线商店。*
|
||||
|
||||
### 接下来是什么?
|
||||
|
||||
Scipio ERP 是一个功能强大的框架,可简化复杂的电子商务应用程序的开发。为了更完整的理解,请查看项目[文档][7],尝试[在线演示][22],或者[加入社区][23].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/scipio-erp
|
||||
|
||||
作者:[Paul Piper][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[laingke](https://github.com/laingke)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/madppiper
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.scipioerp.com
|
||||
[2]: https://ofbiz.apache.org/
|
||||
[3]: https://www.scipioerp.com/community/developer/freemarker-macros/
|
||||
[4]: https://www.scipioerp.com/community/developer/installation-configuration/configuration/#database-configuration
|
||||
[5]: /file/419711
|
||||
[6]: https://opensource.com/sites/default/files/uploads/setup_step5_sm.jpg (Setup wizard)
|
||||
[7]: https://www.scipioerp.com/community/developer/architecture/components/
|
||||
[8]: https://www.scipioerp.com/community/developer/entities/
|
||||
[9]: https://www.scipioerp.com/community/developer/services/
|
||||
[10]: https://www.scipioerp.com/community/developer/views-requests/
|
||||
[11]: https://www.scipioerp.com/community/developer/events-actions/
|
||||
[12]: /file/419716
|
||||
[13]: https://opensource.com/sites/default/files/uploads/component_structure.jpg (component directory structure)
|
||||
[14]: https://www.scipioerp.com/community/developer/views-requests/request-controller/
|
||||
[15]: https://www.scipioerp.com/community/developer/views-requests/screen-widgets-decorators/
|
||||
[16]: /file/419721
|
||||
[17]: https://opensource.com/sites/default/files/uploads/success_screen_sm.jpg (Custom screen)
|
||||
[18]: /file/419726
|
||||
[19]: https://opensource.com/sites/default/files/uploads/theme_structure.jpg (theme component layout)
|
||||
[20]: /file/419731
|
||||
[21]: https://opensource.com/sites/default/files/uploads/finished_shop_1_sm.jpg (Finished Scipio ERP shop)
|
||||
[22]: https://www.scipioerp.com/demo/
|
||||
[23]: https://forum.scipioerp.com/
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11374-1.html)
|
||||
[#]: subject: (How to put an HTML page on the internet)
|
||||
[#]: via: (https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
@ -10,19 +10,21 @@
|
||||
如何在互联网放置 HTML 页面
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201909/22/234957mmzoie1imufsuwea.jpg)
|
||||
|
||||
我喜欢互联网的一点是在互联网放置静态页面是如此简单。今天有人问我该怎么做,所以我想我会快速地写下来!
|
||||
|
||||
### 只是一个 HTML 页面
|
||||
|
||||
我的所有网站都只是静态 HTML 和 CSS。我的网页设计技巧相对不高(<https://wizardzines.com>是我自己开发的最复杂的网站),因此保持我所有的网站相对简单意味着我可以做一些改变/修复,而不会花费大量时间。
|
||||
我的所有网站都只是静态 HTML 和 CSS。我的网页设计技巧相对不高(<https://wizardzines.com> 是我自己开发的最复杂的网站),因此保持我所有的网站相对简单意味着我可以做一些改变/修复,而不会花费大量时间。
|
||||
|
||||
因此,我们将在此文章中采用尽可能简单的方式 - 只需一个 HTML 页面。
|
||||
因此,我们将在此文章中采用尽可能简单的方式 —— 只需一个 HTML 页面。
|
||||
|
||||
### HTML 页面
|
||||
|
||||
我们要放在互联网上的网站只是一个名为 `index.html` 的文件。你可以在 <https://github.com/jvns/website-example> 找到它,它是一个 Github 仓库,其中只包含一个文件。
|
||||
|
||||
HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制自< https://example.com>。
|
||||
HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制自 <https://example.com>。
|
||||
|
||||
### 如何将 HTML 页面放在互联网上
|
||||
|
||||
@ -32,22 +34,19 @@ HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制
|
||||
2. 将 index.html 复制到你自己 neocities 站点的 index.html 中
|
||||
3. 完成
|
||||
|
||||
|
||||
|
||||
上面的 index.html 页面位于 [julia-example-website.neocities.com][2] 中,如果你查看源代码,你将看到它与 github 仓库中的 HTML 相同。
|
||||
上面的 `index.html` 页面位于 [julia-example-website.neocities.com][2] 中,如果你查看源代码,你将看到它与 github 仓库中的 HTML 相同。
|
||||
|
||||
我认为这可能是将 HTML 页面放在互联网上的最简单的方法(这是一次回归 Geocities,它是我在 2003 年制作我的第一个网站的方式):)。我也喜欢 Neocities (像 [glitch][3],我也喜欢)它能实验、学习,并有乐趣。
|
||||
|
||||
### 其他选择
|
||||
|
||||
这绝不是唯一简单的方式 - 在你推送 Git 仓库时,Github pages 和 Gitlab pages 以及 Netlify 都将会自动发布站点,并且它们都非常易于使用(只需将它们连接到你的 github 仓库即可)。我个人使用 Git 仓库的方式,因为 Git 没有东西让我感到紧张 - 我想知道我实际推送的页面发生了什么更改。但我想你如果第一次只想将 HTML/CSS 制作的站点放到互联网上,那么 Neocities 就是一个非常好的方法。
|
||||
|
||||
这绝不是唯一简单的方式,在你推送 Git 仓库时,Github pages 和 Gitlab pages 以及 Netlify 都将会自动发布站点,并且它们都非常易于使用(只需将它们连接到你的 GitHub 仓库即可)。我个人使用 Git 仓库的方式,因为 Git 不会让我感到紧张,我想知道我实际推送的页面发生了什么更改。但我想你如果第一次只想将 HTML/CSS 制作的站点放到互联网上,那么 Neocities 就是一个非常好的方法。
|
||||
|
||||
如果你不只是玩,而是要将网站用于真实用途,那么你或许会需要买一个域名,以便你将来可以更改托管服务提供商,但这有点不那么简单。
|
||||
|
||||
### 这是学习 HTML 的一个很好的起点
|
||||
|
||||
如果你熟悉在 Git 中编辑文件,同时想练习 HTML/CSS 的话,我认为将它放在网站中是一个有趣的方式!我真的很喜欢它的简单性 - 实际上这只有一个文件,所以没有其他花哨的东西需要去理解。
|
||||
如果你熟悉在 Git 中编辑文件,同时想练习 HTML/CSS 的话,我认为将它放在网站中是一个有趣的方式!我真的很喜欢它的简单性 —— 实际上这只有一个文件,所以没有其他花哨的东西需要去理解。
|
||||
|
||||
还有很多方法可以复杂化/扩展它,比如这个博客实际上是用 [Hugo][4] 生成的,它生成了一堆 HTML 文件并放在网络中,但从基础开始总是不错的。
|
||||
|
||||
@ -58,7 +57,7 @@ via: https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/
|
||||
作者:[Julia Evans][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/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (amwps290 )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: translator: (amwps290)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11371-1.html)
|
||||
[#]: subject: (How to set up a TFTP server on Fedora)
|
||||
[#]: via: (https://fedoramagazine.org/how-to-set-up-a-tftp-server-on-fedora/)
|
||||
[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/)
|
||||
@ -12,9 +12,9 @@
|
||||
|
||||
![][1]
|
||||
|
||||
**TFTP** 即简单文本传输协议,允许用户通过 [UDP][2] 协议在系统之间传输文件。默认情况下,协议使用的是 UDP 的 69 号端口。TFTP 协议广泛用于无盘设备的远程启动。因此,在你的本地网络建立一个 TFTP 服务器,这样你就可以进行 [Fedora 的安装][3]和其他无盘设备的一些操作,这将非常有趣。
|
||||
TFTP 即<ruby>简单文本传输协议<rt>Trivial File Transfer Protocol</rt></ruby>,允许用户通过 [UDP][2] 协议在系统之间传输文件。默认情况下,协议使用的是 UDP 的 69 号端口。TFTP 协议广泛用于无盘设备的远程启动。因此,在你的本地网络建立一个 TFTP 服务器,这样你就可以对 [安装好的 Fedora][3] 和其他无盘设备做一些操作,这将非常有趣。
|
||||
|
||||
TFTP 仅仅能够从远端系统读取数据或者向远端系统写入数据。但它并没有列出远端服务器上文件的能力,同时也没有修改远端服务器的能力(译者注:感觉和前一句话矛盾)。用户身份验证也没有规定。 由于安全隐患和缺乏高级功能,TFTP 通常仅用于局域网(LAN)。
|
||||
TFTP 仅仅能够从远端系统读取数据或者向远端系统写入数据,而没有列出远端服务器上文件的能力。它也没提供用户身份验证。由于安全隐患和缺乏高级功能,TFTP 通常仅用于局域网内部(LAN)。
|
||||
|
||||
### 安装 TFTP 服务器
|
||||
|
||||
@ -23,23 +23,24 @@ TFTP 仅仅能够从远端系统读取数据或者向远端系统写入数据。
|
||||
```
|
||||
dnf install tftp-server tftp -y
|
||||
```
|
||||
上述的这条命令会为 [systemd][4] 在 _/usr/lib/systemd/system_ 目录下创建 _tftp.service_ 和 _tftp.socket_ 文件。
|
||||
|
||||
上述的这条命令会在 `/usr/lib/systemd/system` 目录下为 [systemd][4] 创建 `tftp.service` 和 `tftp.socket` 文件。
|
||||
|
||||
```
|
||||
/usr/lib/systemd/system/tftp.service
|
||||
/usr/lib/systemd/system/tftp.socket
|
||||
```
|
||||
|
||||
接下来,将这两个文件复制到 _/etc/systemd/system_ 目录下,并重新命名。
|
||||
接下来,将这两个文件复制到 `/etc/systemd/system` 目录下,并重新命名。
|
||||
|
||||
```
|
||||
cp /usr/lib/systemd/system/tftp.service /etc/systemd/system/tftp-server.service
|
||||
|
||||
cp /usr/lib/systemd/system/tftp.socket /etc/systemd/system/tftp-server.socket
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
|
||||
当你把这些文件复制和重命名后,你就可以去添加一些额外的参数,下面是 _tftp-server.service_ 刚开始的样子:
|
||||
当你把这些文件复制和重命名后,你就可以去添加一些额外的参数,下面是 `tftp-server.service` 刚开始的样子:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
@ -55,13 +56,13 @@ StandardInput=socket
|
||||
Also=tftp.socket
|
||||
```
|
||||
|
||||
在 _[Unit]_ 部分添加如下内容:
|
||||
在 `[Unit]` 部分添加如下内容:
|
||||
|
||||
```
|
||||
Requires=tftp-server.socket
|
||||
```
|
||||
|
||||
修改 _[ExecStart]_ 行:
|
||||
修改 `[ExecStart]` 行:
|
||||
|
||||
```
|
||||
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
|
||||
@ -69,13 +70,14 @@ ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
|
||||
|
||||
下面是这些选项的意思:
|
||||
|
||||
* _**-c**_ 选项允许创建新的文件
|
||||
* _**-p**_ 选项用于指明在正常系统提供的权限检查之上没有其他额外的权限检查
|
||||
* _**-s**_ 建议使用该选项以确保安全性以及与某些引导 ROM 的兼容性,这些引导 ROM 在其请求中不容易包含目录名。
|
||||
* `-c` 选项允许创建新的文件
|
||||
* `-p` 选项用于指明在正常系统提供的权限检查之上没有其他额外的权限检查
|
||||
* `-s` 建议使用该选项以确保安全性以及与某些引导 ROM 的兼容性,这些引导 ROM 在其请求中不容易包含目录名。
|
||||
|
||||
默认的上传和下载位置位于 _/var/lib/tftpboot_。
|
||||
默认的上传和下载位置位于 `/var/lib/tftpboot`。
|
||||
|
||||
下一步,修改 `[Install]` 部分的内容
|
||||
|
||||
下一步,修改 _[Install}_ 部分的内容
|
||||
```
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@ -84,7 +86,8 @@ Also=tftp-server.socket
|
||||
|
||||
不要忘记保存你的修改。
|
||||
|
||||
下面是 _/etc/systemd/system/tftp-server.service_ 文件的完整内容:
|
||||
下面是 `/etc/systemd/system/tftp-server.service` 文件的完整内容:
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Tftp Server
|
||||
@ -109,11 +112,13 @@ systemctl daemon-reload
|
||||
```
|
||||
|
||||
启动服务器:
|
||||
|
||||
```
|
||||
systemctl enable --now tftp-server
|
||||
```
|
||||
|
||||
要更改 TFTP 服务器允许上传和下载的权限,请使用此命令。注意 TFTP 是一种固有的不安全协议,因此不建议你在于其他人共享的网络上这样做。
|
||||
要更改 TFTP 服务器允许上传和下载的权限,请使用此命令。注意 TFTP 是一种固有的不安全协议,因此不建议你在与其他人共享的网络上这样做。
|
||||
|
||||
```
|
||||
chmod 777 /var/lib/tftpboot
|
||||
```
|
||||
@ -127,14 +132,13 @@ firewall-cmd --reload
|
||||
|
||||
### 客户端配置
|
||||
|
||||
|
||||
安装 TFTP 客户端
|
||||
|
||||
```
|
||||
yum install tftp -y
|
||||
```
|
||||
|
||||
运行 _tftp_ 命令连接服务器。下面是一个启用详细信息选项的例子:
|
||||
运行 `tftp` 命令连接服务器。下面是一个启用详细信息选项的例子:
|
||||
|
||||
```
|
||||
[client@thinclient:~ ]$ tftp 192.168.1.164
|
||||
@ -147,11 +151,8 @@ tftp> quit
|
||||
[client@thinclient:~ ]$
|
||||
```
|
||||
|
||||
记住,因为 TFTP 没有列出服务器上文件的能力,因此,在你使用 _get_ 命令之前需要知道文件的具体名称。
|
||||
记住,因为 TFTP 没有列出服务器上文件的能力,因此,在你使用 `get` 命令之前需要知道文件的具体名称。
|
||||
|
||||
* * *
|
||||
|
||||
_Photo by _[_Laika Notebooks_][5]_ on [Unsplash][6]_.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -160,7 +161,7 @@ via: https://fedoramagazine.org/how-to-set-up-a-tftp-server-on-fedora/
|
||||
作者:[Curt Warfield][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[amwps290](https://github.com/amwps290)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,55 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11375-1.html)
|
||||
[#]: subject: (Microsoft brings IBM iron to Azure for on-premises migrations)
|
||||
[#]: via: (https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Skytap 和微软将 IBM 机器搬到了 Azure
|
||||
======
|
||||
|
||||
> 微软再次证明了其摒弃了“非我发明”这一态度来支持客户。
|
||||
|
||||
![](https://images.idgesg.net/images/article/2019/05/cso_microsoft_azure_backups_cloud_computing_binary_data_transfer_by_just_super_gettyimages-1003878434_3x2_2400x1600-100796537-large.jpg)
|
||||
|
||||
当微软将 Azure 作为其 Windows 服务器操作系统的云计算版本发布时,它并没有使其成为仅支持 Windows 系统的版本,它还支持 Linux 系统,并且在短短几年内[其 Linux 实例的数量现在已经超过了Windows 实例的数量][1]。
|
||||
|
||||
很高兴看到微软终于摆脱了这种长期以来非常有害的“非我发明”态度,该公司的最新举动确实令人惊讶。
|
||||
|
||||
微软与一家名为 Skytap 的公司合作,以在 Azure 云服务上提供 IBM Power9 实例,可以在 Azure 云内运行基于 Power 的系统,该系统将与其已有的 Xeon 和 Epyc 实例一同作为 Azure 的虚拟机(VM)。
|
||||
|
||||
Skytap 是一家有趣的公司。它由华盛顿大学的三位教授创立,专门研究本地遗留硬件的云迁移,如 IBM System I 或 Sparc 的云迁移。该公司在西雅图拥有一个数据中心,以 IBM 的硬件运行 IBM 的 PowerVM 管理程序,并且对在美国和英格兰的 IBM 数据中心提供主机托管。
|
||||
|
||||
该公司的座右铭是快速迁移,然后按照自己的节奏进行现代化。因此,它专注于帮助一些企业将遗留系统迁移到云,然后实现应用程序的现代化,这也是它与微软合作的目的。Azure 将通过为企业提供平台来提高传统应用程序的价值,而无需花费巨额费用重写一个新平台。
|
||||
|
||||
Skytap 提供了预览,可以看到使用 Skytap 上的 DB2 提升和扩展原有的 IBM i 应用程序以及通过 Azure 的物联网中心进行扩展时可能发生的情况。该应用程序无缝衔接新旧架构,并证明了不需要完全重写可靠的 IBM i 应用程序即可从现代云功能中受益。
|
||||
|
||||
### 迁移到 Azure
|
||||
|
||||
根据协议,微软将把 IBM 的 Power S922 服务器部署在一个未声明的 Azure 区域。这些机器可以运行 PowerVM 管理程序,这些管理程序支持老式 IBM 操作系统以及 Linux 系统。
|
||||
|
||||
Skytap 首席执行官<ruby>布拉德·希克<rt>Brad Schick</rt></ruby>在一份声明中说道:“通过先替换旧技术来迁移上云既耗时又冒险。……Skytap 的愿景一直是通过一些小小的改变和较低的风险实现企业系统到云平台的迁移。与微软合作,我们将为各种遗留应用程序迁移到 Azure 提供本地支持,包括那些在 IBM i、AIX 和 Power Linux 上运行的程序。这将使企业能够通过使用 Azure 服务进行现代化来延长传统系统的寿命并增加其价值。”
|
||||
|
||||
随着基于 Power 应用程序的现代化,Skytap 随后将引入 DevOps CI/CD 工具链来加快软件的交付。迁移到 Azure 的 Skytap 上后,客户将能够集成 Azure DevOps,以及 Power 的 CI/CD 工具链,例如 Eradani 和 UrbanCode。
|
||||
|
||||
这些听起来像是迈出了第一步,但这意味着以后将会实现更多,尤其是在应用程序迁移方面。如果它仅在一个 Azure 区域中,听起来好像它们正在对该项目进行测试和验证,并可能在今年晚些时候或明年进行扩展。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/Morisun029)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.openwall.com/lists/oss-security/2019/06/27/7
|
||||
[2]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,64 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11370-1.html)
|
||||
[#]: subject: (Oracle Autonomous Linux: A Self Updating, Self Patching Linux Distribution for Cloud Computing)
|
||||
[#]: via: (https://itsfoss.com/oracle-autonomous-linux/)
|
||||
[#]: author: (John Paul https://itsfoss.com/author/john/)
|
||||
|
||||
Oracle Autonomous Linux:用于云计算的自我更新、自我修补的 Linux 发行版
|
||||
======
|
||||
|
||||
自动化是 IT 行业的增长趋势,其目的是消除重复任务中的手动干扰。Oracle 通过推出 Oracle Autonomous Linux 向自动化世界迈出了又一步,这无疑将使 IoT 和云计算行业受益。
|
||||
|
||||
### Oracle Autonomous Linux:减少人工干扰,增多自动化
|
||||
|
||||
![][1]
|
||||
|
||||
周一,Oracle 联合创始人<ruby>拉里·埃里森<rt>Larry Ellison</rt></ruby>参加了在旧金山举行的Oracle OpenWorld 全球大会。[他宣布了][2]一个新产品:世界上第一个自治 Linux。这是 Oracle 向第二代云迈进的第二步。第一步是两年前发布的 [Autonomous Database][3]。
|
||||
|
||||
Oracle Autonomous Linux 的最大特性是降低了维护成本。根据 [Oracle 网站][4] 所述,Autonomous Linux “使用先进的机器学习和自治功能来提供前所未有的成本节省、安全性和可用性,并释放关键的 IT 资源来应对更多的战略计划”。
|
||||
|
||||
Autonomous Linux 可以无需人工干预就安装更新和补丁。这些自动更新包括 “Linux 内核和关键用户空间库”的补丁。“不需要停机,而且可以免受外部攻击和内部恶意用户的攻击。”它们也可以在系统运行时进行,以减少停机时间。Autonomous Linux 还会自动处理伸缩,以确保满足所有计算需求。
|
||||
|
||||
埃里森强调了新的自治系统将如何提高安全性。他特别提到了 [Capitol One 数据泄露][5]是由于配置错误而发生的。他说:“一个防止数据被盗的简单规则:将数据放入自治系统。没有人为错误,没有数据丢失。 那是我们与 AWS 之间的最大区别。”
|
||||
|
||||
有趣的是,Oracle 还瞄准了这一新产品以与 IBM 竞争。埃里森说:“如果你付钱给 IBM,可以停了。”所有 Red Hat 应用程序都应该能够在 Autonomous Linux 上运行而无需修改。有趣的是,Oracle Linux 是从 Red Hat Enterprise Linux 的源代码中[构建][6]的。
|
||||
|
||||
看起来,Oracle Autonomous Linux 不会用于企业市场以外。
|
||||
|
||||
### 关于 Oracle Autonomous Linux 的思考
|
||||
|
||||
Oracle 是云服务市场的重要参与者。这种新的 Linux 产品将使其能够与 IBM 竞争。让人感兴趣的是 IBM 的反应会是如何,特别是当他们有来自 Red Hat 的新一批开源智能软件。
|
||||
|
||||
如果你看一下市场数字,那么对于 IBM 或 Oracle 来说情况都不好。大多数云业务由 [Amazon Web Services、Microsoft Azure 和 Google Cloud Platform][7] 所占据。IBM 和 Oracle 落后于他们。[IBM 收购 Red Hat][8] 试图获得发展。这项新的自主云计划是 Oracle 争取统治地位(或至少试图获得更大的市场份额)的举动。让人感兴趣的是,到底有多少公司因为购买了 Oracle 的系统而在互联网的狂野西部变得更加安全?
|
||||
|
||||
我必须简单提一下:当我第一次阅读该公告时,我的第一反应就是“好吧,我们离天网更近了一步。”如果我们技术性地考虑一下,我们就像是要进入了机器人末日。如果你打算帮我,我计划去购买一些罐头食品。
|
||||
|
||||
你对 Oracle 的新产品感兴趣吗?你会帮助他们赢得云战争吗?在下面的评论中让我们知道。
|
||||
|
||||
如果你觉得这篇文章有趣,请花一点时间在社交媒体、Hacker News 或 [Reddit][9] 上分享。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/oracle-autonomous-linux/
|
||||
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/john/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/oracle-autonomous-linux.png?resize=800%2C450&ssl=1
|
||||
[2]: https://www.zdnet.com/article/oracle-announces-oracle-autonomous-linux/
|
||||
[3]: https://www.oracle.com/in/database/what-is-autonomous-database.html
|
||||
[4]: https://www.oracle.com/corporate/pressrelease/oow19-oracle-autonomous-linux-091619.html
|
||||
[5]: https://www.zdnet.com/article/100-million-americans-and-6-million-canadians-caught-up-in-capital-one-breach/
|
||||
[6]: https://distrowatch.com/table.php?distribution=oracle
|
||||
[7]: https://www.zdnet.com/article/top-cloud-providers-2019-aws-microsoft-azure-google-cloud-ibm-makes-hybrid-move-salesforce-dominates-saas/
|
||||
[8]: https://itsfoss.com/ibm-red-hat-acquisition/
|
||||
[9]: https://reddit.com/r/linuxusersgroup
|
@ -1,62 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Here Comes Oracle Autonomous Linux – World’s First Autonomous Operating System)
|
||||
[#]: via: (https://opensourceforu.com/2019/09/here-comes-oracle-autonomous-linux-worlds-first-autonomous-operating-system/)
|
||||
[#]: author: (Longjam Dineshwori https://opensourceforu.com/author/dineshwori-longjam/)
|
||||
|
||||
Here Comes Oracle Autonomous Linux – World’s First Autonomous Operating System
|
||||
======
|
||||
|
||||
* _**Oracle Autonomous Linux**_ _**delivers automated patching, updates and tuning without human intervention.**_
|
||||
* _**It can help IT companies improve reliability and protect their systems from cyberthreats**_
|
||||
* _**Oracle also introduces Oracle OS Management Service that delivers control and visibility over systems**_
|
||||
|
||||
|
||||
|
||||
![Oracle cloud][1]
|
||||
|
||||
Oracle today marked a major milestone in the company’s autonomous strategy with the introduction of Oracle Autonomous Linux – the world’s first autonomous operating system.
|
||||
|
||||
Oracle Autonomous Linux, along with the new Oracle OS Management Service, is the first and only autonomous operating environment that eliminates complexity and human error to deliver unprecedented cost savings, security and availability for customers, the company claims in a just released statement.
|
||||
|
||||
Keeping systems patched and secure is one of the biggest ongoing challenges faced by IT today. With Oracle Autonomous Linux, the company says, customers can rely on autonomous capabilities to help ensure their systems are secure and highly available to help prevent cyberattacks.
|
||||
|
||||
“Oracle Autonomous Linux builds on Oracle’s proven history of delivering Linux with extreme performance, reliability and security to run the most demanding enterprise applications,” said Wim Coekaerts, senior vice president of operating systems and virtualization engineering, Oracle.
|
||||
|
||||
“Today we are taking the next step in our autonomous strategy with Oracle Autonomous Linux, providing a rich set of capabilities to help our customers significantly improve reliability and protect their systems from cyberthreats,” he added.
|
||||
|
||||
**Oracle OS Management Service**
|
||||
|
||||
Along with Oracle Autonomous Linux, Oracle introduced Oracle OS Management Service, a highly available Oracle Cloud Infrastructure component that delivers control and visibility over systems whether they run Autonomous Linux, Linux or Windows.
|
||||
|
||||
Combined with resource governance policies, OS Management Service, via the Oracle Cloud Infrastructure console or APIs, also enables users to automate capabilities that will execute common management tasks for Linux systems, including patch and package management, security and compliance reporting, and configuration management.
|
||||
|
||||
It can be further automated with other Oracle Cloud Infrastructure services like auto-scaling as workloads need to grow or shrink to meet elastic demand.
|
||||
|
||||
**Always Free Autonomous Database and Cloud Infrastructure**
|
||||
|
||||
Oracle Autonomous Linux, in conjunction with Oracle OS Management Service, uses advanced machine learning and autonomous capabilities to deliver unprecedented cost savings, security and availability and frees up critical IT resources to tackle more strategic initiatives.
|
||||
|
||||
They are included with Oracle Premier Support at no extra charge with Oracle Cloud Infrastructure compute services. Combined with Oracle Cloud Infrastructure’s other cost advantages, most Linux workload customers can expect to have 30-50 percent TCO savings versus both on-premise and other cloud vendors over five years.
|
||||
|
||||
“Adding autonomous capabilities to the operating system layer, with future plans to expand beyond infrastructure software, goes straight after the OpEx challenges nearly all customers face today,” said Al Gillen, Group VP, Software Development and Open Source, IDC.
|
||||
|
||||
“This capability effectively turns Oracle Linux into a service, freeing customers to focus their IT resources on application and user experience, where they can deliver true competitive differentiation,” he added.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensourceforu.com/2019/09/here-comes-oracle-autonomous-linux-worlds-first-autonomous-operating-system/
|
||||
|
||||
作者:[Longjam Dineshwori][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensourceforu.com/author/dineshwori-longjam/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://i2.wp.com/opensourceforu.com/wp-content/uploads/2016/09/Oracle-cloud.jpg?resize=350%2C197&ssl=1
|
@ -0,0 +1,58 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Samsung introduces SSDs it claims will 'never die')
|
||||
[#]: via: (https://www.networkworld.com/article/3440026/samsung-introduces-ssds-it-claims-will-never-die.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Samsung introduces SSDs it claims will 'never die'
|
||||
======
|
||||
New fail-in-place technology in Samsung's SSDs will allow the chips to gracefully recover from chip failure.
|
||||
Samsung
|
||||
|
||||
[Solid-state drives][1] (SSDs) operate by writing to cells within the chip, and after so many writes, the cell eventually dies off and can no longer be written to. For that reason, SSDs have more actual capacity than listed. A 1TB drive, for example, has about 1.2TB of capacity, and as chips die off from repeated writes, new ones are brought online to keep the 1TB capacity.
|
||||
|
||||
But that's for gradual wear. Sometimes SSDs just up and die completely, and without warning after a whole chip fails, not just a few cells. So Samsung is trying to address that with a new generation of SSD memory chips with a technology it calls fail-in-place (FIP).
|
||||
|
||||
**Also read: [Inside Hyperconvergence: Combining compute, storage and networking][2]**
|
||||
|
||||
FIP technology allows a drive to cope with a failure by working around the dead chip and allowing the SSD to keep operating and just not using the bad chip. You will have less storage, but in all likelihood that drive will be replaced anyway, so this helps prevent data loss.
|
||||
|
||||
FIP also scans the data for any damage before copying it to the remaining NAND, which would be the first time I've ever seen a SSD with built-in data recovery.
|
||||
|
||||
### Built-in virtualization and machine learning technology
|
||||
|
||||
The new Samsung SSDs come with two other software innovations. The first is built-in virtualization technology, which allows a single SSD to be divided up into up to 64 smaller drives for a virtual environment.
|
||||
|
||||
The second is V-NAND machine learning technology, which helps to "accurately predict and verify cell characteristics, as well as detect any variation among circuit patterns through big data analytics," as Samsung put it. Doing so means much higher levels of performance from the drive.
|
||||
|
||||
As you can imagine, this technology is aimed at enterprises and large-scale data centers, not consumers. All told, Samsung is launching 19 models of these new SSDs called under the names PM1733 and PM1735.
|
||||
|
||||
**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]**
|
||||
|
||||
The PM1733 line features six models in a 2.5-inch U.2 form factor, offering storage capacity of between 960GB and 15.63TB, as well as four HHHL card-type drives with capacity ranging from 1.92TB to 30.72TB of storage. Each drive is guaranteed for one drive writes per day (DWPD) for five years. In other words, the warranty is good for writing the equivalent of the drive's total capacity once per day every day for five years.
|
||||
|
||||
The PM1735 drives have lower capacity, maxing out at 12.8TB, but they are far more durable, guaranteeing three DWPD for five years. Both drives support PCI Express 4, which has double the throughput of the widely used PCI Express 3. The PM1735 offers nearly 14 times the sequential performance of a SATA-based SSD, with 8GB/s for read operations and 3.8GB/s for writes.
|
||||
|
||||
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/3440026/samsung-introduces-ssds-it-claims-will-never-die.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html
|
||||
[2]: https://www.idginsiderpro.com/article/3409019/inside-hyperconvergence-combining-compute-storage-and-networking.html
|
||||
[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11
|
||||
[4]: https://www.facebook.com/NetworkWorld/
|
||||
[5]: https://www.linkedin.com/company/network-world
|
@ -1,95 +0,0 @@
|
||||
How technology changes the rules for doing agile
|
||||
======
|
||||
|
||||
![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/CIO%20Containers%20Ecosystem.png?itok=lDTaYXzk)
|
||||
|
||||
More companies are trying agile and [DevOps][1] for a clear reason: Businesses want more speed and more experiments - which lead to innovations and competitive advantage. DevOps helps you gain that speed. But doing DevOps in a small group or startup and doing it at scale are two very different things. Any of us who've worked in a cross-functional group of 10 people, come up with a great solution to a problem, and then tried to apply the same patterns across a team of 100 people know the truth: It often doesn't work. This path has been so hard, in fact, that it has been easy for IT leaders to put off agile methodology for another year.
|
||||
|
||||
But that time is over. If you've tried and stalled, it's time to jump back in.
|
||||
|
||||
Until now, DevOps required customized answers for many organizations - lots of tweaks and elbow grease. But today, [Linux containers ][2]and Kubernetes are fueling standardization of DevOps tools and processes. That standardization will only accelerate. The technology we are using to practice the DevOps way of working has finally caught up with our desire to move faster.
|
||||
|
||||
Linux containers and [Kubernetes][3] are changing the way teams interact. Moreover, on the Kubernetes platform, you can run any application you now run on Linux. What does that mean? You can run a tremendous number of enterprise apps (and handle even previously vexing coordination issues between Windows and Linux.) Finally, containers and Kubernetes will handle almost all of what you'll run tomorrow. They're being future-proofed to handle machine learning, AI, and analytics workloads - the next wave of problem-solving tools.
|
||||
|
||||
**[ See our related article,[4 container adoption patterns: What you need to know. ] ][4]**
|
||||
|
||||
Think about machine learning, for example. Today, people still find the patterns in much of an enterprise's data. When machines find the patterns (think machine learning), your people will be able to act on them faster. With the addition of AI, machines can not only find but also act on patterns. Today, with people doing everything, three weeks is an aggressive software development sprint cycle. With AI, machines can change code multiple times per second. Startups will use that capability - to disrupt you.
|
||||
|
||||
Consider how fast you have to be to compete. If you can't make a leap of faith now to DevOps and a one week cycle, think of what will happen when that startup points its AI-fueled process at you. It's time to move to the DevOps way of working now, or get left behind as your competitors do.
|
||||
|
||||
### How are containers changing how teams work?
|
||||
|
||||
DevOps has frustrated many groups trying to scale this way of working to a bigger group. Many IT (and business) people are suspicious of agile: They've heard it all before - languages, frameworks, and now models (like DevOps), all promising to revolutionize application development and IT process.
|
||||
|
||||
**[ Want DevOps advice from other CIOs? See our comprehensive resource, [DevOps: The IT Leader's Guide][5]. ]**
|
||||
|
||||
It's not easy to "sell" quick development sprints to your stakeholders, either. Imagine if you bought a house this way. You're not going to pay a fixed amount to your builder anymore. Instead, you get something like: "We'll pour the foundation in 4 weeks and it will cost x. Then we'll frame. Then we'll do electrical. But we only know the timing on the foundation right now." People are used to buying homes with a price up front and a schedule.
|
||||
|
||||
The challenge is that building software is not like building a house. The same builder builds thousands of houses that are all the same. Software projects are never the same. This is your first hurdle to get past.
|
||||
|
||||
Dev and operations teams really do work differently: I know because I've worked on both sides. We incent them differently. Developers are rewarded for changing and creating, while operations pros are rewarded for reducing cost and ensuring security. We put them in different groups and generally minimize interaction. And the roles typically attract technical people who think quite differently. This situation sets IT up to fail. You have to be willing to break down these barriers.
|
||||
|
||||
Think of what has traditionally happened. You throw pieces over the wall, then the business throws requirements over the wall because they are operating in "house-buying" mode: "We'll see you in 9 months." Developers build to those requirements and make changes as needed for technical constraints. Then they throw it over the wall to operations to "figure out how to run this." Operations then works diligently to make a slew of changes to align the software with their infrastructure. And what's the end result?
|
||||
|
||||
More often than not, the end result isn't even recognizable to the business when they see it in its final glory. We've watched this pattern play out time and time again in our industry for the better part of two decades. It's time for a change.
|
||||
|
||||
It's Linux containers that truly crack the problem - because containers close the gap between development and operations. They allow both teams to understand and design to all of the critical requirements, but still uniquely fulfill their team's responsibilities. Basically, we take out the telephone game between developers and operations. With containers, we can have smaller operations teams, even teams responsible for millions of applications, but development teams that can change software as quickly as needed. (In larger organizations, the desired pace may be faster than humans can respond on the operations side.)
|
||||
|
||||
With containers, you're separating what is delivered from where it runs. Your operations teams are responsible for the host that will run the containers and the security footprint, and that's all. What does this mean?
|
||||
|
||||
First, it means you can get going on DevOps now, with the team you have. That's right. Keep teams focused on the expertise they already have: With containers, just teach them the bare minimum of the required integration dependencies.
|
||||
|
||||
If you try and retrain everyone, no one will be that good at anything. Containers let teams interact, but alongside a strong boundary, built around each team's strengths. Your devs know what needs to be consumed, but don't need to know how to make it run at scale. Ops teams know the core infrastructure, but don't need to know the minutiae of the app. Also, Ops teams can update apps to address new security implications, before you become the next trending data breach story.
|
||||
|
||||
Teaching a large IT organization of say 30,000 people both ops and devs skills? It would take you a decade. You don't have that kind of time.
|
||||
|
||||
When people talk about "building new, cloud-native apps will get us out of this problem," think critically. You can build cloud-native apps in 10-person teams, but that doesn't scale for a Fortune 1000 company. You can't just build new microservices one by one until you're somehow not reliant on your existing team: You'll end up with a siloed organization. It's an alluring idea, but you can't count on these apps to redefine your business. I haven't met a company that could fund parallel development at this scale and succeed. IT budgets are already constrained; doubling or tripling them for an extended period of time just isn't realistic.
|
||||
|
||||
### When the remarkable happens: Hello, velocity
|
||||
|
||||
Linux containers were made to scale. Once you start to do so, [orchestration tools like Kubernetes come into play][6] - because you'll need to run thousands of containers. Applications won't consist of just a single container, they will depend on many different pieces, all running on containers, all running as a unit. If they don't, your apps won't run well in production.
|
||||
|
||||
Think of how many small gears and levers come together to run your business: The same is true for any application. Developers are responsible for all the pulleys and levers in the application. (You could have an integration nightmare if developers don't own those pieces.) At the same time, your operations team is responsible for all the pulleys and levers that make up your infrastructure, whether on-premises or in the cloud. With Kubernetes as an abstraction, your operations team can give the application the fuel it needs to run - without being experts on all those pieces.
|
||||
|
||||
Developers get to experiment. The operations team keeps infrastructure secure and reliable. This combination opens up the business to take small risks that lead to innovation. Instead of having to make only a couple of bet-the-farm size bets, real experimentation happens inside the company, incrementally and quickly.
|
||||
|
||||
In my experience, this is where the remarkable happens inside organizations: Because people say "How do we change planning to actually take advantage of this ability to experiment?" It forces agile planning.
|
||||
|
||||
For example, KeyBank, which uses a DevOps model, containers, and Kubernetes, now deploys code every day. (Watch this [video][7] in which John Rzeszotarski, director of Continuous Delivery and Feedback at KeyBank, explains the change.) Similarly, Macquarie Bank uses DevOps and containers to put something in production every day.
|
||||
|
||||
Once you push software every day, it changes every aspect of how you plan - and [accelerates the rate of change to the business][8]. "An idea can get to a customer in a day," says Luis Uguina, CDO of Macquarie's banking and financial services group. (See this [case study][9] on Red Hat's work with Macquarie Bank).
|
||||
|
||||
### The right time to build something great
|
||||
|
||||
The Macquarie example demonstrates the power of velocity. How would that change your approach to your business? Remember, Macquarie is not a startup. This is the type of disruptive power that CIOs face, not only from new market entrants but also from established peers.
|
||||
|
||||
The developer freedom also changes the talent equation for CIOs running agile shops. Suddenly, individuals within huge companies (even those not in the hottest industries or geographies) can have great impact. Macquarie uses this dynamic as a recruiting tool, promising developers that all new hires will push something live within the first week.
|
||||
|
||||
At the same time, in this day of cloud-based compute and storage power, we have more infrastructure available than ever. That's fortunate, considering the [leaps that machine learning and AI tools will soon enable][10].
|
||||
|
||||
This all adds up to this being the right time to build something great. Given the pace of innovation in the market, you need to keep building great things to keep customers loyal. So if you've been waiting to place your bet on DevOps, now is the right time. Containers and Kubernetes have changed the rules - in your favor.
|
||||
|
||||
**Want more wisdom like this, IT leaders? [Sign up for our weekly email newsletter][11].**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://enterprisersproject.com/article/2018/1/how-technology-changes-rules-doing-agile
|
||||
|
||||
作者:[Matt Hicks][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://enterprisersproject.com/user/matt-hicks
|
||||
[1]:https://enterprisersproject.com/tags/devops
|
||||
[2]:https://www.redhat.com/en/topics/containers?intcmp=701f2000000tjyaAAA
|
||||
[3]:https://www.redhat.com/en/topics/containers/what-is-kubernetes?intcmp=701f2000000tjyaAAA
|
||||
[4]:https://enterprisersproject.com/article/2017/8/4-container-adoption-patterns-what-you-need-know?sc_cid=70160000000h0aXAAQ
|
||||
[5]:https://enterprisersproject.com/devops?sc_cid=70160000000h0aXAAQ
|
||||
[6]:https://enterprisersproject.com/article/2017/11/how-enterprise-it-uses-kubernetes-tame-container-complexity
|
||||
[7]:https://www.redhat.com/en/about/videos/john-rzeszotarski-keybank-red-hat-summit-2017?intcmp=701f2000000tjyaAAA
|
||||
[8]:https://enterprisersproject.com/article/2017/11/dear-cios-stop-beating-yourselves-being-behind-transformation
|
||||
[9]:https://www.redhat.com/en/resources/macquarie-bank-case-study?intcmp=701f2000000tjyaAAA
|
||||
[10]:https://enterprisersproject.com/article/2018/1/4-ai-trends-watch
|
||||
[11]:https://enterprisersproject.com/email-newsletter?intcmp=701f2000000tsjPAAQ
|
@ -1,57 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Microsoft brings IBM iron to Azure for on-premises migrations)
|
||||
[#]: via: (https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Microsoft brings IBM iron to Azure for on-premises migrations
|
||||
======
|
||||
Once again Microsoft shows it has shed its not-invented here attitude to support customers.
|
||||
Microsoft / Just_Super / Getty Images
|
||||
|
||||
When Microsoft launched Azure as a cloud-based version of its Windows Server operating system, it didn't make it exclusively Windows. It also included Linux support, and in just a few years, the [number of Linux instances now outnumbers Windows instances][1].
|
||||
|
||||
It's nice to see Microsoft finally shed that not-invented-here attitude that was so toxic for so long, but the company's latest move is really surprising.
|
||||
|
||||
Microsoft has partnered with a company called Skytap to offer IBM Power9 instances on its Azure cloud service to run Power-based systems inside of the Azure cloud, which will be offered as Azure virtual machines (VM) along with the Xeon and Epyc server instances that it already offers.
|
||||
|
||||
**Also read: [How to make hybrid cloud work][2]**
|
||||
|
||||
Skytap is an interesting company. Founded by three University of Washington professors, it specializes in cloud migrations of older on-premises hardware, such as IBM System I or Sparc. It has a data center in its home town of Seattle, with IBM hardware running IBM's PowerVM hypervisor, plus some co-locations in IBM data centers in the U.S. and England.
|
||||
|
||||
Its motto is to migrate fast, then modernize at your own pace. So, its focus is on helping legacy systems migrate to the cloud and then modernize the apps, which is what the alliance with Microsoft appears to be aimed at. Azure will provide enterprises with a platform to enhance the value of traditional applications without the major expense of rewriting for a new platform.
|
||||
|
||||
Skytap is providing a preview of what’s possible when lifting and extending a legacy IBM i application using DB2 on Skytap and augmenting it with Azure IoT Hub. The application seamlessly spans old and new architectures, demonstrating there is no need to completely rewrite rock-solid IBM i applications to benefit from modern cloud capabilities.
|
||||
|
||||
### Migrating to Azure cloud
|
||||
|
||||
Under the deal, Microsoft will deploy Power S922 servers from IBM and deploy them in an undeclared Azure region. These machines can run the PowerVM hypervisor, which supports legacy IBM operating systems, as well as Linux.
|
||||
|
||||
"Migrating to the cloud by first replacing older technologies is time consuming and risky," said Brad Schick, CEO of Skytap, in a statement. "Skytap’s goal has always been to provide businesses with a path to get these systems into the cloud with little change and less risk. Working with Microsoft, we will bring Skytap’s native support for a wide range of legacy applications to Microsoft Azure, including those dependent on IBM i, AIX, and Linux on Power. This will give businesses the ability to extend the life of traditional systems and increase their value by modernizing with Azure services."
|
||||
|
||||
As Power-based applications are modernized, Skytap will then bring in DevOps CI/CD toolchains to accelerate software delivery. After moving to Skytap on Azure, customers will be able to integrate Azure DevOps, in addition to CI/CD toolchains for Power, such as Eradani and UrbanCode.
|
||||
|
||||
These sound like first steps, which means there will be more to come, especially in terms of the app migration. If it's only in one Azure region, it sounds like they are testing and finding their legs with this project and will likely expand later this year or next.
|
||||
|
||||
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/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.openwall.com/lists/oss-security/2019/06/27/7
|
||||
[2]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,77 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (A Network for All Edges: Why SD-WAN, SDP, and the Application Edge Must Converge in the Cloud)
|
||||
[#]: via: (https://www.networkworld.com/article/3440101/a-network-for-all-edges-why-sd-wan-sdp-and-the-application-edge-must-converge-in-the-cloud.html)
|
||||
[#]: author: (Cato Networks https://www.networkworld.com/author/Matt-Conran/)
|
||||
|
||||
A Network for All Edges: Why SD-WAN, SDP, and the Application Edge Must Converge in the Cloud
|
||||
======
|
||||
Globalization, mobilization, the cloud, and now edge computing are complicating enterprise networking. Here’s why and how you can best prepare yourself.
|
||||
NicoElNino
|
||||
|
||||
The software-defined movement keeps marching on. [Software-defined WAN (SD-WAN)][1] is redefining the branch edge by displacing legacy technologies like MPLS, WAN optimizers, and routers. [Software-defined Perimeter (SDP)][2] is displacing whole network access via mobile VPN with secure and optimized access from any device to specific applications in physical and cloud datacenters. These seem like unrelated developments, despite the “software-defined” buzz, because enterprise IT thinks about physical locations, mobile users, and applications separately. Each enterprise edge, location, person, or application is usually served by different technologies and often by different teams.
|
||||
|
||||
### Emerging Business Needs and Point Solutions, like SD-WAN and SDP, Make the Network Unmanageable
|
||||
|
||||
In recent years, though, managing networking and security got even more complicated due to the accelerating trends of globalization, mobilization, and cloudification.
|
||||
|
||||
Take global locations: Connecting and securing them create a unique set of challenges. Network latency is introduced by distance, requiring predictable long-haul network connectivity. There is often less support from local IT, so the technology footprint at the location must be minimized. Yet security can’t be compromised, so remote locations must still be protected as well as any other location.
|
||||
|
||||
Next, mobile users introduce their own set of challenges. Optimizing and securing application access for mobile users require the extension of the network and security fabric to every user globally. Mobile VPNs are a very bad solution. Since the network is tied to key corporate locations, getting mobile traffic to a firewall at headquarters or to a VPN concentrator over the unpredictable public internet is a pain for road warriors and field workers. And doing so just so the traffic can be inspected on its way to the cloud creates the so-called “[Trombone Effect][3]” and makes performance even worse.
|
||||
|
||||
Finally, the move to cloud applications and cloud datacenters further increases complexity. Instead of optimizing the network for a single destination (the physical datacenter), we now need to optimize it for at least two (physical and cloud datacenters), and sometimes more if we include regional datacenter instances. As the application “edge” got fragmented, a new set of technologies was introduced. These include cloud access security brokers (CASB) and cloud optimization solutions like AWS DirectConnect and Microsoft Azure ExpressRoute. Recently, edge computing is becoming a new megatrend – placing the application itself near the user, introducing new technologies into the mix such as AWS Outpost and Azure Stack.
|
||||
|
||||
### Making the Network Manageable Again with a Converged Cloud-Native Architecture
|
||||
|
||||
What is the remedy for this explosion in requirements and complexity? It seems enterprises are hard at work patching their networks with myriad point solutions to accommodate that shift in business requirements. There is an opportunity for forward-looking enterprises to transform their networks by holistically addressing **all** enterprise edges and distributing networking and security capabilities globally with a cloud-native network architecture.
|
||||
|
||||
Here [are several key attributes of the cloud-native network][4].
|
||||
|
||||
**The Cloud is the Network**
|
||||
|
||||
A cloud-native architecture is essential to serving all types of edges. Traditional appliance-centric designs are optimized for physical edges, not mobile or cloud ones. These legacy designs lock the networking and security capabilities into the physical location, making it difficult to serve other types of edges. This imbalance made sense where networks were mostly used to connect physical locations. We now need an [**edge-neutral** design that can serve any edge: location, user, or application.][5]
|
||||
|
||||
What is this edge neutrality? It means that we place as many networking and security capabilities as possible away from the edge itself – in the cloud. These include global route optimization, WAN and cloud acceleration, and network security capabilities such [as NGFW, IPS, IDS, anti-malware, and cloud security][6]. With a cloud-native architecture, we can distribute these capabilities globally across multiple points of presence to create a dynamic fabric that is within a short distance from any edge. This architecture delivers enterprise-grade optimization and security down to a location, application, user, or device.
|
||||
|
||||
**Built from Scratch as a Multitenant Cloud Service**
|
||||
|
||||
Cloud-native networks are built for the cloud from the ground up. In contrast, managed services that rely on hosted physical and virtual appliances can’t benefit from a cloud platform. Simply put, appliances don’t have any of the key attributes of cloud services. They are single-tenant entities unlike cloud services, which are multi-tenant. They aren't elastic or scalable, so dynamic workloads are difficult to accommodate. And they need to be managed individually, one instance at a time. You can't build a cloud-native network by using appliance-based software.
|
||||
|
||||
**End-to-End Control**
|
||||
|
||||
The cloud-native network has edge-to-edge visibility and control. Traditionally, IT decoupled network services (the transports) from the network functions (routing, optimization, and security). In other cases, the full range of services and functions was bundled by a service provider. By running traffic between all edges and to the Internet through the cloud network, it is possible to dynamically adjust routing based on global network behavior. This is markedly different from trying to use edge solutions that at best have limited visibility to last-mile ISPs or rely on dated protocols like BGP, which are not aware of actual network conditions.
|
||||
|
||||
**Self-Healing by Design**
|
||||
|
||||
Cloud-native networks are [resilient by design][7]. We are all familiar with the resiliency of cloud services like Amazon Web Services, Facebook, and Google. We don’t worry about infrastructure resiliency as we expect that the service will be up and running, masking the state of underlying components. Compare this with typical HA configurations of appliances within and across locations, and what it takes to plan, configure, test, and run these environments.
|
||||
|
||||
### The Cloud-Native Network Is the Network for All Edges and All Functions
|
||||
|
||||
To summarize, the cloud-native network represents a transformation of the legacy IT architecture. Instead of silos, point solutions for emerging requirements like SD-WAN and SDP, and a growing complexity, we must consider a network architecture that will serve the business into the future. By democratizing the network for all edges and delivering network and security functions through a cloud-first/thin-edge design, cloud-native networks are designed to rapidly evolve with the business even as new requirements—and new edges—emerge.
|
||||
|
||||
Cato Networks built the world’s first cloud-native network using the global reach, self-service, and scalability of the cloud. To learn more about Cato Networks and the Cato Cloud, visit [here][8].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3440101/a-network-for-all-edges-why-sd-wan-sdp-and-the-application-edge-must-converge-in-the-cloud.html
|
||||
|
||||
作者:[Cato Networks][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Matt-Conran/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.catonetworks.com/sd-wan?utm_source=idg
|
||||
[2]: https://www.catonetworks.com/glossary-use-cases/software-defined-perimeter-sdp/
|
||||
[3]: https://www.catonetworks.com/news/is-your-network-suffering-from-the-trombone-effect/
|
||||
[4]: https://www.catonetworks.com/cato-cloud/global-private-backbone-3/#Cloud-native_Software_for_Faster_Innovation_and_Lower_Costs
|
||||
[5]: https://www.catonetworks.com/cato-cloud
|
||||
[6]: https://www.catonetworks.com/cato-cloud/enterprise-grade-security-as-a-service-built-directly-into-the-network/
|
||||
[7]: https://www.catonetworks.com/cato-cloud/global-private-backbone-3/#Self-healing_By_Design_for_24x7_Operation
|
||||
[8]: http://www.networkworld.com/cms/article/catonetowrks.com/cato-cloud
|
@ -0,0 +1,71 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Linux on the mainframe: Then and now)
|
||||
[#]: via: (https://opensource.com/article/19/9/linux-mainframes-part-2)
|
||||
[#]: author: (Elizabeth K. Joseph https://opensource.com/users/pleia2https://opensource.com/users/pleia2https://opensource.com/users/lauren-pritchett)
|
||||
|
||||
Linux on the mainframe: Then and now
|
||||
======
|
||||
It's been two decades since IBM got onboard with Linux on the mainframe.
|
||||
Here's what happened.
|
||||
![Penguin driving a car with a yellow background][1]
|
||||
|
||||
Last week, I introduced you to the origins of the [mainframe's origins from a community perspective][2]. Let's continue our journey, picking up at the end of 1999, which is when IBM got onboard with Linux on the mainframe (IBM Z).
|
||||
|
||||
According to the [Linux on z Systems Wikipedia page][3]:
|
||||
|
||||
> "IBM published a collection of patches and additions to the Linux 2.2.13 kernel on December 18, 1999, to start today's mainline Linux on Z. Formal product announcements quickly followed in 2000."
|
||||
|
||||
These patches weren't part of the mainline Linux kernel yet, but they did get Linux running on z/VM (Virtual Machine for IBM Z), for anyone who was interested. Several efforts followed, including the first Linux distro—put together out of Marist College in Poughkeepsie, N.Y., and Think Blue Linux by Millenux in Germany. The first real commercial distribution came from SUSE on October 31, 2000; this is notable in SUSE history because the first edition of what is now known as SUSE Enterprise Linux (SLES) is that S/390 port. Drawing again from Wikipedia, the [SUSE Enterprise Linux page][4] explains:
|
||||
|
||||
> "SLES was developed based on SUSE Linux by a small team led by Josué Mejía and David Áreas as principal developer who was supported by Joachim Schröder. It was first released on October 31, 2000 as a version for IBM S/390 mainframe machines… In April 2001, the first SLES for x86 was released."
|
||||
|
||||
Red Hat quickly followed with support, and community-driven distributions, including Debian, Slackware, and Gentoo, followed, as they gained access to mainframe hardware to complete their builds. Over the next decade, teams at IBM and individual distributions improved support, even getting to the point where a VM was no longer required, and Linux could run on what is essentially "bare metal" alongside the traditional z/OS. With the release of Ubuntu 16.04 in 2016, Canonical also began official support for the platform.
|
||||
|
||||
In 2015, some of the biggest news in Linux mainframe history occurred: IBM began offering a Linux-only mainframe called LinuxONE. With z/OS and similar traditional configurations, this was released as the IBM z13; with Linux, these mainframes were branded Rockhopper and Emperor. These two machines came only with Integrated Facility for Linux (IFL) processors, meaning it wasn't even possible to run z/OS, only Linux. This investment from IBM in an entire product line for Linux was profound.
|
||||
|
||||
With the introduction of this machine, we also saw the first support for KVM on the mainframe. KVM can replace z/VM as the virtualization technology. This allows for all the standard tooling around KVM to be used for managing virtual machines on the mainframe, including libvirt and OpenStack.
|
||||
|
||||
Also in 2015, The Linux Foundation announced the [Open Mainframe Project][5]. Both a community and a series of open source software projects geared specifically towards the mainframe, the flagship project, [Zowe][6], has gathered contributions from multiple companies in the mainframe ecosystem. While it is created for z/OS, Zowe has been a driving force behind the modernization of interactions with mainframes today. On the Linux on Z side, [ADE][7], announced in 2016, is used to detect "anomalous time slices and messages in Linux logs" so that they can be analyzed alongside other mainframe logs.
|
||||
|
||||
In 2017, the z14 was released, and LinuxONE Rockhopper II and Emperor II were introduced. One of the truly revolutionary changes with this release was the size of the Rockhopper II: it's air-cooled and fits in the space of a 19" rack. No longer does a company need special space and consideration for this mainframe in their datacenter, it has standard connectors and fits in standard spaces. Then, on September 12, 2019, the z15 was launched alongside the LinuxONE III, and the really notable thing from an infrastructure perspective is the size. A considerable amount of effort was put into making it run happily alongside non-Z systems in the data center, so there is only a 19" version.
|
||||
|
||||
![LinuxONE Emperor III mainframe][8]
|
||||
|
||||
LinuxONE Emperor III mainframe | Used with permission, Copyright IBM
|
||||
|
||||
There are one, two, three, or four-frame configurations, but they'll still fit in a standard datacenter spot. See inside a four-frame, water-cooled version.
|
||||
|
||||
![Inside the water-cooled LinuxONE III][9]
|
||||
|
||||
Inside the water-cooled LinuxONE III | Used with permission, Copyright IBM
|
||||
|
||||
As a long-time x86 Linux systems administrator new to the mainframe world, I'm excited to be a part of it at IBM and to introduce my fellow systems administrators and developers to the platform. Looking forward, I see a future where mainframes continue to be used in tandem with cloud and edge technologies to leverage the best of all worlds.
|
||||
|
||||
The modernization of the mainframe isn't stopping any time soon. The mainframe may have a long history, but it's not old.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/linux-mainframes-part-2
|
||||
|
||||
作者:[Elizabeth K. Joseph][a]
|
||||
选题:[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/pleia2https://opensource.com/users/pleia2https://opensource.com/users/lauren-pritchett
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background)
|
||||
[2]: https://opensource.com/article/19/9/linux-mainframes-part-1
|
||||
[3]: https://en.wikipedia.org/wiki/Linux_on_z_Systems
|
||||
[4]: https://en.wikipedia.org/wiki/SUSE_Linux_Enterprise
|
||||
[5]: https://www.openmainframeproject.org/
|
||||
[6]: https://www.zowe.org/
|
||||
[7]: https://www.openmainframeproject.org/projects/anomaly-detection-engine-for-linux-logs-ade
|
||||
[8]: https://opensource.com/sites/default/files/uploads/linuxone_iii_pair.jpg (LinuxONE Emperor III mainframe)
|
||||
[9]: https://opensource.com/sites/default/files/uploads/water-cooled_rear.jpg (Inside the water-cooled LinuxONE III)
|
@ -0,0 +1,86 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Code it, ship it, own it with full-service ownership)
|
||||
[#]: via: (https://opensource.com/article/19/9/full-service-ownership)
|
||||
[#]: author: (Julie GundersonJustin Kearns https://opensource.com/users/juliegundhttps://opensource.com/users/juliegundhttps://opensource.com/users/juliegundhttps://opensource.com/users/kearnsjdhttps://opensource.com/users/ophir)
|
||||
|
||||
Code it, ship it, own it with full-service ownership
|
||||
======
|
||||
Making engineers responsible for their code and services in production
|
||||
offers multiple advantages—for the engineer as well as the code.
|
||||
![Gears above purple clouds][1]
|
||||
|
||||
Software teams seeking to provide better products and services must focus on faster release cycles. But running reliable systems at ever-increasing speeds presents a big challenge. Software teams can have both quality and speed by adjusting their policies around ongoing service ownership. While on-call plays a large part in this model, advancement in knowledge, more resilient code, increased collaboration, and better practices mean engineers don't have to wake up to a nightmare.
|
||||
|
||||
This four-part series will delve into the concepts of full-service ownership, psychological safety in transformation, the ethics of accountability, and the impact of ownership on the customer experience.
|
||||
|
||||
### What is full-service ownership?
|
||||
|
||||
![Code it, ship it, own it][2]
|
||||
|
||||
Full-service ownership is the philosophy that engineers are responsible for the code and services they create in production. Using the "code it, ship it, own it," mentality means embracing the [DevOps principle][3] of no longer throwing code over the wall to operations nor relying on the [site reliability engineering (SRE) team][4] to ensure the reliability of services in the wild. Instead:
|
||||
|
||||
> Accountability, reliability, and continuous improvement are the main objectives of full-service ownership.
|
||||
|
||||
Putting engineers on-call for what they create brings accountability directly into the hands of that engineer and team.
|
||||
|
||||
### Why accountability matters
|
||||
|
||||
Digital transformation has changed how people work and how consumers consume. There is an implicit expectation in consumers' minds that services will work. For example, when I try to make an online purchase (almost always through my mobile device), I expect a seamless, secure, and efficient experience. When I am interrupted because a page won't load or throws an error, I simply move on to another company that can fulfill my request. According to the [PagerDuty State of Digital Operations 2017 UK report][5], 86.6% of consumers will do the same thing.
|
||||
|
||||
![Amount of time consumers will wait for an unresponsive app][6]
|
||||
|
||||
Empowering engineers to work on the edge of the customer experience by owning the full lifecycle of their code and services gives companies a competitive advantage. As well as benefiting the company, full-service ownership benefits the engineer. Accountability ensures high-quality work and gives engineers a direct line of sight into how the code or service is performing and impacting the customers' day-to-day.
|
||||
|
||||
### Reliability beyond subject-matter experts
|
||||
|
||||
Services will go down; it's an inevitable facet of operating in the digital world. However, how long those services are down—and the impact the outages have on customers—will be mitigated by bringing the
|
||||
|
||||
subject matter expert (SME) or "owner" into the incident immediately. The SME is the engineer who created the code or service and has the intimate, technical knowledge to both respond to incidents and take corrective action to ensure their services experience fewer interruptions through continuous improvement. As the responsible party, the engineers are incented to automate, test, and create code that is as bulletproof as possible.
|
||||
|
||||
Also, teams that adopt full-service ownership increase their overall knowledge. Through practices that include on-call handoffs, code reviews, daily standups, and Failure Friday exercises, individual engineers develop greater expertise around the entire codebase. New skills include systems thinking, collaboration, and working in non-siloed environments. Teams and individuals build necessary redundancy in skills and knowledge by sharing information.
|
||||
|
||||
### Continuous improvement
|
||||
|
||||
As engineers strive to improve their product, code, and/or services continuously, a side-effect of full-service ownership is the refinement of services and alerting. Alerts that interrupt time outside regular work hours must be actionable. If team members are repeatedly interrupted with non-actionable alerts, there is an opportunity to improve the system by analyzing the data. Cleaning up the monitoring system is an investment of time; however, committing to actionable alerting will make on-call better for everyone on the team and reduce alert fatigue—which will free up mental energy to focus on future releases and automation.
|
||||
|
||||
Developers who write the code and define the alerts for that code are more likely to create actionable alerts. It will literally wake them up at night if they don't. Beyond actionable alerts, engineers are incented to produce the highest quality code, as better code equals fewer interruptions.
|
||||
|
||||
While on-call can interrupt your personal life, on-call is not meant to be "always-on." Rather, it's a shared team responsibility to ensure high-quality code. Instead of looking at full-service ownership as an on-call requirement, you can argue that it is building in time to go "off-call."
|
||||
|
||||
Imagine you are on the operations team triaging an incident; time is of the essence, and you need answers fast. Are you going to carefully run through a list of all members of the team responsible for that service? Or are you going to call the SME you know always answers the phone on a Sunday afternoon? Repeatedly calling the same one or two people places an undue burden on those individuals, potentially causing a single source of failure that can lead to burnout. With that said, an on-call rotation serves multiple functions:
|
||||
|
||||
1. Engineers know that their code and services are being covered when they are off-call so they can fully relax.
|
||||
2. The burden of being the "go-to" SME is parsed out to the rest of the team on rotation.
|
||||
3. Services become more reliable.
|
||||
4. Team knowledge and skills increase through deeper understanding of the codebase.
|
||||
|
||||
|
||||
|
||||
By going beyond coding to shipping and owning, full-service ownership reduces the chaos associated with incidents by defining roles and responsibilities, removing unnecessary layers, and ultimately fostering a culture of empowerment and accountability. And, in the next article in this series, I'll share how full-service ownership can foster psychological safety.
|
||||
|
||||
What has your experience been? Has being on-call helped you to become a better engineer? Do you loathe the thought of picking up a "pager"? Let us know your thoughts in the comments below or tweet [@julie_gund][7].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/full-service-ownership
|
||||
|
||||
作者:[Julie GundersonJustin Kearns][a]
|
||||
选题:[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/juliegundhttps://opensource.com/users/juliegundhttps://opensource.com/users/juliegundhttps://opensource.com/users/kearnsjdhttps://opensource.com/users/ophir
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds)
|
||||
[2]: https://opensource.com/sites/default/files/uploads/code_ship_own.png (Code it, ship it, own it)
|
||||
[3]: https://opensource.com/article/18/1/getting-devops
|
||||
[4]: https://opensource.com/article/18/10/sre-startup
|
||||
[5]: https://www.pagerduty.com/resources/reports/digital-operations-uk/
|
||||
[6]: https://opensource.com/sites/default/files/uploads/unresponsiveapps.png (Amount of time consumers will wait for an unresponsive app)
|
||||
[7]: https://twitter.com/julie_gund
|
134
sources/talk/20190920 How to decommission a data center.md
Normal file
134
sources/talk/20190920 How to decommission a data center.md
Normal file
@ -0,0 +1,134 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to decommission a data center)
|
||||
[#]: via: (https://www.networkworld.com/article/3439917/how-to-decommission-a-data-center.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
How to decommission a data center
|
||||
======
|
||||
Decommissioning a data center is lot more complicated than shutting down servers and switches. Here’s what you should keep in mind.
|
||||
3dSculptor / Getty Images
|
||||
|
||||
About the only thing harder than building a [data center][1] is dismantling one, because the potential for disruption of business is much greater when shutting down a data center than constructing one.
|
||||
|
||||
The recent [decommissioning of the Titan supercomputer][2] at the Oak Ridge National Laboratory (ORNL) reveals just how complicated the process can be. More than 40 people were involved with the project, including staff from ORNL, supercomputer manufacturer Cray, and external subcontractors. Electricians were required to safely shut down the 9 megawatt-capacity system, and Cray staff was on hand to disassemble and recycle Titan’s electronics and its metal components and cabinets. A separate crew handled the cooling system. In the end, 350 tons of equipment and 10,800 pounds of refrigerant were removed from the site.
|
||||
|
||||
**Read more data center stories**
|
||||
|
||||
* [NVMe over Fabrics creates data-center storage disruption][3]
|
||||
* [Data center workloads become more complex][4]
|
||||
* [What is data-center management as a service (DMaaS)?][5]
|
||||
* [Data center staff aging faster than equipment][6]
|
||||
* [Micro-modular data centers set to multiply][7]
|
||||
|
||||
|
||||
|
||||
While most enterprise IT pros aren’t likely to face decommissioning a computer the size of Titan, it is likely they’ll be involved with dismantling smaller-scale data centers given the trend for companies to [move away from on-premises data centers][8].
|
||||
|
||||
The pace of data center closure is going to accelerate over next three or four years, according to Rick Villars, research vice president, datacenter and cloud, at [IDC][9]. "Every company we’ve spoken to is planning to close 10% to 50% of their data centers over the next four years, and in some cases even 100%. No matter who you talk to, they absolutely have on the agenda they want to close data centers," Villars says.
|
||||
|
||||
Successfully retiring a data center requires navigating many steps. Here’s how to get started.
|
||||
|
||||
### Inventory data-center assets
|
||||
|
||||
The first step is a complete inventory. However, given the preponderance of [zombie servers][10] in IT environments, it’s clear that a good number of IT departments don’t have a handle on data-center asset management.
|
||||
|
||||
"They need to know what they have. That’s the most basic. What equipment do you have? What apps live on what device? And what data lives on each device?” says Ralph Schwarzbach, who worked as a security and decommissioning expert with Verisign and Symantec before retiring.
|
||||
|
||||
All that information should be in a configuration management database (CMDB), which serves as a repository for configuration data pertaining to physical and virtual IT assets. A CMDB “is a popular tool, but having the tool and processes in place to maintain data accuracy are two distinct things," Schwarzbach says.
|
||||
|
||||
A CMDB is a necessity for asset inventory, but “any good CMDB is only as good as the data you put in it,” says Al DeRose, a senior IT director responsible for infrastructure design, implementation and management at a large media firm. “If your asset management department is very good at entering data, your CMDB is great. [In] my experience, smaller companies will do a better job of assets. Larger companies, because of the breadth of their space, aren’t so good at knowing what their assets are, but they are getting better.”
|
||||
|
||||
### Map dependences among data-center resources
|
||||
|
||||
Preparation also includes mapping out dependencies in the data center. The older a data center is, the more dependencies you are likely to find.
|
||||
|
||||
It’s important to segment what’s in the data center so that you can move things in orderly phases and limit the risk of something going wrong, says Andrew Wertkin, chief strategy officer with [BlueCat Networks][11], a networking connectivity provider that helps companies migrate to the cloud. "Ask how can I break this into phases that are independent – meaning ‘I can’t move that app front-end because it depends on this database,’" Wertkin says.
|
||||
|
||||
The WAN is a good example. Connection points are often optimized, so when you start to disassemble it, you need to know who is getting what in terms of connections and optimized services so you don’t create SLA issues when you break the connection. Changing the IP addresses of well-known servers, even temporarily, also creates connection problems. The solution is to do it in steps, not all at once.
|
||||
|
||||
### Questions to ask decomissioning providers
|
||||
|
||||
Given the complexities and manpower needs of decommissioning a data center, it’s important to hire a professional who specializes in it.
|
||||
|
||||
Experience and track record are everything when it comes to selecting a vendor, says Mike Satter, vice president at [OceanTech][12], which provides data center decommissioning and IT asset disposition services. There are a lot of small companies that say they can decommission a data center and fail because they lack experience and credentials, he says. "I can't tell you how many times we’ve come into a mess where we had to clean up what someone else did. There were servers all over the floor, hardware everywhere," Satter says.
|
||||
|
||||
His advice? Ask a lot of questions.
|
||||
|
||||
"I love having a client who asks a lot of questions," Satter says. “Don’t be shy to ask for references,” he adds. “If you are going to have someone do work on your house, you look up their references. You better know who the contractor will be. Maybe 10% of the time have I had people actually look into their contractor.”
|
||||
|
||||
Among the processes you should ask about and conditions you should expect are:
|
||||
|
||||
* Have the vendor provide you with a detailed statement of work laying out how they will handle every aspect of the data center decommissioning project.
|
||||
* Ask the vendor to do a walkthrough with you, prior to the project, showing how they will execute each step.
|
||||
* Find out if the vendor outsources any aspect of data center decommissioning, including labor or data destruction.
|
||||
* Inquire about responsible recycling (see more below).
|
||||
* Ask for references for the last three data center decommissioning clients the vendor serviced.
|
||||
* Ask if the vendor will be able to recover value from your retired IT hardware. If so, find out how much and when you could expect to receive the compensation.
|
||||
* Ask how data destruction will be handled. If the solution is software based, find out the name of the software.
|
||||
* Learn about the vendor’s security protocols around data destruction.
|
||||
* Find out where the truck goes when it leaves with the gear.
|
||||
* Ask how hazardous materials will be disposed.
|
||||
* Ask how metals and other components will be disposed.
|
||||
|
||||
|
||||
|
||||
### Recycle electronics responsibly
|
||||
|
||||
As gear is cleared out of the data center, it’s important to make sure it’s disposed of safely, from both a security and environmental standpoint.
|
||||
|
||||
When it comes to electronics recycling, the key certification to look for is the [R2 Standard][13], Satter says. R2 – sometimes referred to as the responsible recycling certification – is a standard for electronics recyclers that requires certified companies to have a policy on managing used and end-of-life electronics equipment, components and materials for reuse, recovery and/or recycling.
|
||||
|
||||
But R2 does more than that; it offers a traceable chain of custody for all equipment, tracking who touched every piece and its ultimate fate. R2 certified providers “aren’t outsourced Craigslist tech people. These are people who do it every day," Satter says. "There are techniques to remove that gear. They have a group to do data security on site, and a compliance project manager to make sure compliance is met and the chain of custody is met."
|
||||
|
||||
And don’t be cheap, DeRose adds. "When I decommission a data center, I use a well-known company that does asset removal, asset destruction, chain of custody, provides certifications of destruction for hard drives, and proper disposal of toxic materials. All that needs to be very well documented not [only] for the environment’s protection but [also] for the company’s protection. You can’t wake up one morning and find your equipment was found dumped in a landfill or in a rainforest," DeRose says.
|
||||
|
||||
Documentation is critical when disposing of electronic waste, echoes Schwarzbach. "The process must capture and store info related to devices being decommissioned: What is the intent for the device, recycling or new service life? What data resides on it? Who owns the data? And [what is] the category of data?"
|
||||
|
||||
In the end, it isn't the liability of the disposal company if servers containing customer or medical information turn up at a used computer fair, it's the fault of the owners. "The creator of e-waste is ultimately liable for the e-waste," Schwarzbach says.
|
||||
|
||||
### Control who's coming into the data center
|
||||
|
||||
Shutting down a data center means one inevitability: You will have to bring in outside consultants to do the bulk of the work, as the ORNL example shows. Chances are, your typical data center doesn't let anywhere near 40 people inside during normal operations. But during decommissioning, you will have a lot of people going in and out, and this is not a step to be taken lightly.
|
||||
|
||||
"In a normal scenario, the number of people allowed in the data center is selected. Now, all of a sudden, you got a bunch of contractors coming in to pack and ship, and maybe there’s another 50 people with access to your data center. It’s a process and security nightmare if all these people have access to your boxes and requires a whole other level of vetting," Wertkin says. His solution: Log people in and out and use video cameras.
|
||||
|
||||
Any company hired to do a decommissioning project needs to clearly identify the people involved, DeRose says. "You need to know who your company is sending, and they need to show ID.” People are to be escorted in and out and never given a keycard. In addition, contractors should not to be left to decommission any room on their own. There should always be someone on staff overseeing the process, DeRose says.
|
||||
|
||||
In short, the decommissioning process means lots of outside, non-staff being given access to your most sensitive systems, so vigilance is mandatory.
|
||||
|
||||
None of the steps involved in a data center decommissioning should be hands-off, even when it requires outside experts. For the security and integrity of your data, the IT staff must be fully involved at all times, even if it is just to watch others do their work. When millions of dollars (even depreciated) of server gear goes out the door in the hands of non-employees, your involvement is paramount.
|
||||
|
||||
Join the Network World communities on [Facebook][14] and [LinkedIn][15] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3439917/how-to-decommission-a-data-center.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3223692/what-is-a-data-centerhow-its-changed-and-what-you-need-to-know.html
|
||||
[2]: https://www.networkworld.com/article/3408176/the-titan-supercomputer-is-being-decommissioned-a-costly-time-consuming-project.html
|
||||
[3]: https://www.networkworld.com/article/3394296/nvme-over-fabrics-creates-data-center-storage-disruption.html
|
||||
[4]: https://www.networkworld.com/article/3400086/data-center-workloads-become-more-complex-despite-promises-to-the-contrary.html
|
||||
[5]: https://www.networkworld.com/article/3269265/data-center-management-what-does-dmaas-deliver-that-dcim-doesnt
|
||||
[6]: https://www.networkworld.com/article/3301883/data-center/data-center-staff-are-aging-faster-than-the-equipment.html
|
||||
[7]: https://www.networkworld.com/article/3238476/data-center/micro-modular-data-centers-set-to-multiply.html
|
||||
[8]: https://www.networkworld.com/article/3391465/another-strong-cloud-computing-quarter-puts-pressure-on-data-centers.html
|
||||
[9]: https://www.idc.com
|
||||
[10]: https://www.computerworld.com/article/3196355/a-third-of-virtual-servers-are-zombies.html
|
||||
[11]: https://www.bluecatnetworks.com/
|
||||
[12]: https://www.oceantech.com/services/data-center-decommissioning/
|
||||
[13]: https://sustainableelectronics.org/r2-standard
|
||||
[14]: https://www.facebook.com/NetworkWorld/
|
||||
[15]: https://www.linkedin.com/company/network-world
|
79
sources/talk/20190921 How spicy should a jalapeno be.md
Normal file
79
sources/talk/20190921 How spicy should a jalapeno be.md
Normal file
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How spicy should a jalapeno be?)
|
||||
[#]: via: (https://opensource.com/article/19/9/how-spicy-should-jalapeno-be)
|
||||
[#]: author: (Peter Webb https://opensource.com/users/peterwebbhttps://opensource.com/users/mgifford)
|
||||
|
||||
How spicy should a jalapeno be?
|
||||
======
|
||||
Open source agriculture engages students in becoming problem solvers for
|
||||
the future.
|
||||
![Jalapenos][1]
|
||||
|
||||
Everyone has opinions and preferences, especially when it comes to food. To establish a criterion when answering "How spicy should a jalapeño be?." the Scoville Heat Scale was developed as a standard to measure spiciness. This scale allows people to communicate and share information about how spicy we like our peppers.
|
||||
|
||||
Similarly, open source technology standards, such as USB, I2C, MQTT, and others, were developed to enable global compatibility. Furthermore, open source hardware platforms have enabled communities to “speak the same language” without reinventing the wheel. For example, Raspberry Pi makes it easy for people to use their hardware as a baseline and then add onto it. This has created a revolution in many industries by enabling individuals, startups, and large corporations to apply hardware and software to complex problems without having to design them from the ground up.
|
||||
|
||||
### MARSfarm: Using food to engage students in STEM
|
||||
|
||||
[MARSfarm][2] is a program that aims to increase students’ engagement with science, technology, engineering, and math (STEM) by relating agriculture to real-life problems, such as growing more food with fewer resources.
|
||||
|
||||
MARSfarm’s goal is to provide [engaging material to inspire individuals and students][3] to collaborate on solving big problems, like how we can sustainably survive on another planet, while simultaneously improving the food system here on our own planet. We do this by tying together the world of food and technology and enabling users to choose things like how spicy they want the jalapeño they are growing to be. More importantly, we want to alter other compounds besides spiciness (known as capsaicin by chemists), like Vitamin K, which is a concern for those who lack access to fresh fruits and vegetables, such as an astronaut living on Mars. With standardized open source hardware and software as a base, a user can focus on whatever unique objectives they have for their own “garden” while retaining the benefits of a larger community.
|
||||
|
||||
### The importance of open source and standards
|
||||
|
||||
When trying to define standards with food, there is no “right” answer. Food is very personal and influenced by socioeconomic factors as well as (perhaps most importantly) geographical region.
|
||||
|
||||
We designed MARSfarm using open source principles to allow teachers to customize and add to the hardware and software in their classrooms. To make it more familiar and approachable, we tried to leverage existing standardized software and hardware platforms. By sticking with common software languages like Python and HTML and hardware like the Raspberry Pi, we reduce the potential barriers to entry for users who could be intimidated by a project of this magnitude. Other hardware we use, like PVC, Mylar, and full-spectrum LEDs, are globally accessible from brick-and-mortar storefronts and online retailers that adhere to industry standards to ensure consistency throughout the community.
|
||||
|
||||
By keeping our hardware and software standard, we can also create a marketplace where users can exchange “recipes” for growing food. Similar to how [Thingverse][4] has enabled anyone with a 3D printer to make just about anything—without having to be an engineer—simply by exchanging CAD files, we want to enable our users to find climate recipes from around the world and grow them—without having to be a botanist. The way to achieve this is by having a large number of people growing the same plant but with different climate factors. The more data that is aggregated, the better we’ll understand how different climate factors affect things like taste and the time it takes a plant to grow.
|
||||
|
||||
We also enlisted the support of open source agricultural projects like the [Open Agriculture Initiative][5] at the MIT Media Lab, where we’ve found many other individuals passionate about applying technology to optimize food. Another consistent source of innovation in agriculture has been NASA, which has achieved [record harvests and been a point of collaboration][6] between universities and countries for decades.
|
||||
|
||||
### Building a _food computer_
|
||||
|
||||
Open source communities thrive when they’re applied to something both significant and personal. There is perhaps nothing more personal than the food we consume, the literal fuel that powers us.
|
||||
|
||||
Until very recently, even within the last decade, many plants could not be grown in certain regions due to lack of available light, which is the most fundamental input a plant requires for its most basic process, photosynthesis. With the advent of technologies like LEDs, organizations (other than NASA) can afford to grow just about anything, anywhere, within the bounds of what the market demands and will pay for.
|
||||
|
||||
As we continue living far away from where our food is produced, we continue to understand it less and less. When we forget our personal connection to food, we risk damaging not only our health but our communities and the planet where our species lives. To mitigate this risk, MARSfarm leads projects like the [$300 Food Computer][7], which makes indoor growing systems more affordable and accessible. These types of projects also put more of this technology in more classrooms. The more that individuals and students work with these projects, the more data we’ll have, and the better we will understand the best ways to grow our food.
|
||||
|
||||
In fact, the improvement in lighting technology has been so dramatic that consumer products like [Aerogarden][8] have empowered thousands of individuals to grow edible plants at home, not only on their windowsills but on their countertops where there is no access to natural light.
|
||||
|
||||
Because of these leaps in technology, we’re developing a world where there are “libraries” of plants that can be “forked” onto devices to be grown by anyone. If you’d like to get started, please to visit our [GitHub][9] where we host software for all of our ongoing projects.
|
||||
|
||||
### Help spread the word
|
||||
|
||||
We need your help to expose as many students as possible to the wonders of applying open source technology to agriculture. Please share this with at least one teacher you know and any students who have a passion for STEM. MARSfarm is actively working with open source contributors, recruiting employees, and conducting beta tests in schools.
|
||||
|
||||
* * *
|
||||
|
||||
_For more information about what the farmers of tomorrow are doing with open tools and principles today, watch the video [Farming for the Future][3]._
|
||||
|
||||
Co-authored by John Whitehead . For many people spring means a return to the bounty of fresh, local...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/how-spicy-should-jalapeno-be
|
||||
|
||||
作者:[Peter Webb][a]
|
||||
选题:[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/peterwebbhttps://opensource.com/users/mgifford
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/jalepeno.jpg?itok=R_LWPTlm (Jalapenos)
|
||||
[2]: https://marsfarm.io/
|
||||
[3]: https://www.redhat.com/en/open-source-stories/farming-for-the-future
|
||||
[4]: https://www.thingiverse.com/
|
||||
[5]: https://forum.openag.media.mit.edu/
|
||||
[6]: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20150015991.pdf
|
||||
[7]: https://marsfarm.io/home/community/mvp-food-computer/
|
||||
[8]: https://www.aerogarden.com/
|
||||
[9]: https://github.com/futureag
|
@ -1,3 +1,4 @@
|
||||
wenwensnow is translating
|
||||
Go on very small hardware (Part 1)
|
||||
============================================================
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (PsiACE)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,83 +0,0 @@
|
||||
[#]: 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
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -62,7 +62,7 @@ via: https://opensource.com/article/19/8/cloud-native-java-and-more
|
||||
|
||||
作者:[Tim Hildred][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[laingke](https://github.com/laingke)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,103 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to freeze and lock your Linux system (and why you would want to))
|
||||
[#]: via: (https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
How to freeze and lock your Linux system (and why you would want to)
|
||||
======
|
||||
What it means to freeze a terminal window and lock a screen -- and how to manage these activities on your Linux system.
|
||||
Sandra Henry-Stocker
|
||||
|
||||
How you freeze and "thaw out" a screen on a Linux system depends a lot on what you mean by these terms. Sometimes “freezing a screen” might mean freezing a terminal window so that activity within that window comes to a halt. Sometimes it means locking your screen so that no one can walk up to your system when you're fetching another cup of coffee and type commands on your behalf.
|
||||
|
||||
In this post, we'll examine how you can use and control these actions.
|
||||
|
||||
**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][1] ]**
|
||||
|
||||
### How to freeze a terminal window on Linux
|
||||
|
||||
You can freeze a terminal window on a Linux system by typing **Ctrl+S** (hold control key and press "s"). Think of the "s" as meaning "start the freeze". If you continue typing commands after doing this, you won't see the commands you type or the output you would expect to see. In fact, the commands will pile up in a queue and will be run only when you reverse the freeze by typing **Ctrl+Q**. Think of this as "quit the freeze".
|
||||
|
||||
One easy way to view how this works is to use the date command and then type **Ctrl+S**. Then type the date command again and wait a few minutes before typing **Ctrl+Q**. You'll see something like this:
|
||||
|
||||
```
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:47:34 PM EDT
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:49:49 PM EDT
|
||||
```
|
||||
|
||||
The gap between the two times shown will indicate that the second date command wasn't run until you unfroze your window.
|
||||
|
||||
Terminal windows can be frozen and unfrozen whether you're sitting at the computer screen or running remotely using a tool such as PuTTY.
|
||||
|
||||
And here's a little trick that can come in handy. If you see that a terminal window appears to be inactive, one possibility is that you or someone else inadvertently typed **Ctrl+S**. In any case, entering **Ctrl+Q** just in case this resolves the problem is not a bad idea.
|
||||
|
||||
### How to lock your screen
|
||||
|
||||
To lock your screen before you leave your desk, either **Ctrl+Alt+L** or **Super+L** (i.e., holding down the Windows key and pressing L) should work. Once your screen is locked, you will have to enter your password to log back in.
|
||||
|
||||
### Automatic screen locking on Linux systems
|
||||
|
||||
While best practice suggests that you lock your screen whenever you are about to leave your desk, Linux systems usually automatically lock after a period of no activity. The timing for "blanking" a screen (making it go dark) and actually locking the screen (requiring a login to use it again) depend on settings that you can set to your personal preferences.
|
||||
|
||||
To change how long it takes for your screen to go dark when using GNOME screensaver, open your settings window and select **Power** and then **Blank screen**. You can choose times between 1 and 15 minutes or never. To select how long after the blanking the screen locks, go to settings, select **Privacy** and then **Blank screen.** Settings should include 1, 2, 3, 5 and 30 minutes or one hour.
|
||||
|
||||
### How to lock your screen from the command line
|
||||
|
||||
If you are using Gnome screensaver, you can also lock the screen from the command line using this command:
|
||||
|
||||
```
|
||||
gnome-screensaver-command -l
|
||||
```
|
||||
|
||||
That's a lowercase L for "lock".
|
||||
|
||||
### How to check your lockscreen state
|
||||
|
||||
You can also use the gnome screensaver command to check whether your screen is locked,. With the **\--query** option, the command tells you whether screen is currently locked (i.e., active). With the --time option, it tells you how long the lock has been in effect. Here's an sample sctipt:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
gnome-screensaver-command --query
|
||||
gnome-screensaver-command --time
|
||||
```
|
||||
|
||||
Running the script will show output like this:
|
||||
|
||||
```
|
||||
$ ./check_lockscreen
|
||||
The screensaver is active
|
||||
The screensaver has been active for 1013 seconds.
|
||||
```
|
||||
|
||||
#### Wrap-up
|
||||
|
||||
Freezing your terminal window is easy if you remember the proper control sequences. For screen locking, how well it works depends on the controls you put in place for yourself or whether you're comfortable working with the defaults.
|
||||
|
||||
**[ Also see: [Invaluable tips and tricks for troubleshooting Linux][2] ]**
|
||||
|
||||
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/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua
|
||||
[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
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -0,0 +1,162 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (An introduction to audio processing and machine learning using Python)
|
||||
[#]: via: (https://opensource.com/article/19/9/audio-processing-machine-learning-python)
|
||||
[#]: author: (Jyotika Singh https://opensource.com/users/jyotika-singhhttps://opensource.com/users/jroakeshttps://opensource.com/users/don-watkinshttps://opensource.com/users/clhermansenhttps://opensource.com/users/greg-p)
|
||||
|
||||
An introduction to audio processing and machine learning using Python
|
||||
======
|
||||
The pyAudioProcessing library classifies audio into different categories
|
||||
and genres.
|
||||
![abstract illustration with black background][1]
|
||||
|
||||
At a high level, any machine learning problem can be divided into three types of tasks: data tasks (data collection, data cleaning, and feature formation), training (building machine learning models using data features), and evaluation (assessing the model). Features, [defined][2] as "individual measurable propert[ies] or characteristic[s] of a phenomenon being observed," are very useful because they help a machine understand the data and classify it into categories or predict a value.
|
||||
|
||||
![Machine learning at a high level][3]
|
||||
|
||||
Different data types use very different processing techniques. Take the example of an image as a data type: it looks like one thing to the human eye, but a machine sees it differently after it is transformed into numerical features derived from the image's pixel values using different filters (depending on the application).
|
||||
|
||||
![Data types and feature formation in images][4]
|
||||
|
||||
[Word2vec][5] works great for processing bodies of text. It represents words as vectors of numbers, and the distance between two word vectors determines how similar the words are. If we try to apply Word2vec to numerical data, the results probably will not make sense.
|
||||
|
||||
![Word2vec for analyzing a corpus of text][6]
|
||||
|
||||
So, there are processing techniques specific to the audio data type that works well with audio.
|
||||
|
||||
### What are audio signals?
|
||||
|
||||
Audio signals are signals that vibrate in the audible frequency range. When someone talks, it generates air pressure signals; the ear takes in these air pressure differences and communicates with the brain. That's how the brain helps a person recognize that the signal is speech and understand what someone is saying.
|
||||
|
||||
There are a lot of MATLAB tools to perform audio processing, but not as many exist in Python. Before we get into some of the tools that can be used to process audio signals in Python, let's examine some of the features of audio that apply to audio processing and machine learning.
|
||||
|
||||
![Examples of audio terms to learn][7]
|
||||
|
||||
Some data features and transformations that are important in speech and audio processing are Mel-frequency cepstral coefficients ([MFCCs][8]), Gammatone-frequency cepstral coefficients (GFCCs), Linear-prediction cepstral coefficients (LFCCs), Bark-frequency cepstral coefficients (BFCCs), Power-normalized cepstral coefficients (PNCCs), spectrum, cepstrum, spectrogram, and more.
|
||||
|
||||
We can use some of these features directly and extract features from some others, like spectrum, to train a machine learning model.
|
||||
|
||||
### What are spectrum and cepstrum?
|
||||
|
||||
Spectrum and cepstrum are two particularly important features in audio processing.
|
||||
|
||||
![Spectrum and cepstrum][9]
|
||||
|
||||
Mathematically, a spectrum is the [Fourier transform][10] of a signal. A Fourier transform converts a time-domain signal to the frequency domain. In other words, a spectrum is the frequency domain representation of the input audio's time-domain signal.
|
||||
|
||||
A [cepstrum][11] is formed by taking the log magnitude of the spectrum followed by an inverse Fourier transform. This results in a signal that's neither in the frequency domain (because we took an inverse Fourier transform) nor in the time domain (because we took the log magnitude prior to the inverse Fourier transform). The domain of the resulting signal is called the quefrency.
|
||||
|
||||
### What does this have to do with hearing?
|
||||
|
||||
The reason we care about the signal in the frequency domain relates to the biology of the ear. Many things must happen before we can process and interpret a sound. One happens in the cochlea, a fluid-filled part of the ear with thousands of tiny hairs that are connected to nerves. Some of the hairs are short, and some are relatively longer. The shorter hairs resonate with higher sound frequencies, and the longer hairs resonate with lower sound frequencies. Therefore, the ear is like a natural Fourier transform analyzer!
|
||||
|
||||
![How the ear works][12]
|
||||
|
||||
Another fact about human hearing is that as the sound frequency increases above 1kHz, our ears begin to get less selective to frequencies. This corresponds well with something called the Mel filter bank.
|
||||
|
||||
![MFCC][13]
|
||||
|
||||
Passing a spectrum through the Mel filter bank, followed by taking the log magnitude and a [discrete cosine transform][14] (DCT) produces the Mel cepstrum. DCT extracts the signal's main information and peaks. It is also widely used in JPEG and MPEG compressions. The peaks are the gist of the audio information. Typically, the first 13 coefficients extracted from the Mel cepstrum are called the MFCCs. These hold very useful information about audio and are often used to train machine learning models.
|
||||
|
||||
Another filter inspired by human hearing is the Gammatone filter bank. This filter bank is used as a front-end simulation of the cochlea. Thus, it has many applications in speech processing because it aims to replicate how we hear.
|
||||
|
||||
![GFCC][15]
|
||||
|
||||
GFCCs are formed by passing the spectrum through Gammatone filter bank, followed by loudness compression and DCT. The first (approximately) 22 features are called GFCCs. GFCCs have a number of applications in speech processing, such as speaker identification.
|
||||
|
||||
Other features useful in audio processing tasks (especially speech) include LPCC, BFCC, PNCC, and spectral features like spectral flux, entropy, roll off, centroid, spread, and energy entropy.
|
||||
|
||||
### Building a classifier
|
||||
|
||||
As a quick experiment, let's try building a classifier with spectral features and MFCC, GFCC, and a combination of MFCCs and GFCCs using an open source Python-based library called [pyAudioProcessing][16].
|
||||
|
||||
To start, we want pyAudioProcessing to classify audio into three categories: speech, music, or birds.
|
||||
|
||||
![Segmenting audio into speech, music, and birds][17]
|
||||
|
||||
Using a small dataset (50 samples for training per class) and without any fine-tuning, we can gauge the potential of this classification model to identify audio categories.
|
||||
|
||||
![MFCC of speech, music, and bird signals][18]
|
||||
|
||||
Next, let's try pyAudioProcessing on a music genre classification problem using the [GZTAN][19] audio dataset and audio features: MFCC and spectral features.
|
||||
|
||||
![Music genre classification][20]
|
||||
|
||||
Some genres do well while others have room for improvement. Some things that can be explored from this data include:
|
||||
|
||||
* Data quality check: Is more data needed?
|
||||
* Features around the beat and other aspects of music audio
|
||||
* Features other than audio, like transcription and text
|
||||
* Would a different classifier be better? There has been research on using neural networks to classify music genres.
|
||||
|
||||
|
||||
|
||||
Regardless of the results of this quick test, it is evident that these features get useful information out of the signal, a machine can work with them, and they form a good baseline to work with.
|
||||
|
||||
### Learn more
|
||||
|
||||
Here are some useful resources that can help in your journey with Python audio processing and machine learning:
|
||||
|
||||
* [pyAudioAnalysis][21]
|
||||
* [pyAudioProcessing][16]
|
||||
* [Power-normalized cepstral coefficients (PNCC) for robust speech recognition][22]
|
||||
* [LPCC features][23]
|
||||
* [Speech recognition using MFCC][24]
|
||||
* [Speech/music classification using block-based MFCC features][25]
|
||||
* [Musical genre classification of audio signals][26]
|
||||
* Libraries for reading audio in Python: [SciPy][27], [pydub][28], [libROSA][29], pyAudioAnalysis
|
||||
* Libraries for getting features: libROSA, pyAudioAnalysis (for MFCC); pyAudioProcessing (for MFCC and GFCC)
|
||||
* Basic machine learning models to use on audio: sklearn, hmmlearn, pyAudioAnalysis, pyAudioProcessing
|
||||
|
||||
|
||||
|
||||
* * *
|
||||
|
||||
_This article is based on Jyotika Singh's presentation "[Audio processing and ML using Python][30]" from PyBay 2019._
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/audio-processing-machine-learning-python
|
||||
|
||||
作者:[Jyotika Singh][a]
|
||||
选题:[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/jyotika-singhhttps://opensource.com/users/jroakeshttps://opensource.com/users/don-watkinshttps://opensource.com/users/clhermansenhttps://opensource.com/users/greg-p
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/FeedbackLoop.png?itok=l7Sa9fHt (abstract illustration with black background)
|
||||
[2]: https://en.wikipedia.org/wiki/Feature_(machine_learning)
|
||||
[3]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_1.png (Machine learning at a high level)
|
||||
[4]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_1a.png (Data types and feature formation in images)
|
||||
[5]: https://en.wikipedia.org/wiki/Word2vec
|
||||
[6]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_2b.png (Word2vec for analyzing a corpus of text)
|
||||
[7]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_4.png (Examples of audio terms to learn)
|
||||
[8]: https://en.wikipedia.org/wiki/Mel-frequency_cepstrum
|
||||
[9]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_5.png (Spectrum and cepstrum)
|
||||
[10]: https://en.wikipedia.org/wiki/Fourier_transform
|
||||
[11]: https://en.wikipedia.org/wiki/Cepstrum
|
||||
[12]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_6.png (How the ear works)
|
||||
[13]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_7.png (MFCC)
|
||||
[14]: https://en.wikipedia.org/wiki/Discrete_cosine_transform
|
||||
[15]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_8.png (GFCC)
|
||||
[16]: https://github.com/jsingh811/pyAudioProcessing
|
||||
[17]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_10.png (Segmenting audio into speech, music, and birds)
|
||||
[18]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_11.png (MFCC of speech, music, and bird signals)
|
||||
[19]: http://marsyas.info/downloads/datasets.html
|
||||
[20]: https://opensource.com/sites/default/files/uploads/audioprocessing-ml_12.png (Music genre classification)
|
||||
[21]: https://github.com/tyiannak/pyAudioAnalysis
|
||||
[22]: http://www.cs.cmu.edu/~robust/Papers/OnlinePNCC_V25.pdf
|
||||
[23]: https://link.springer.com/content/pdf/bbm%3A978-3-319-17163-0%2F1.pdf
|
||||
[24]: https://pdfs.semanticscholar.org/3439/454a00ef811b3a244f2b0ce770e80f7bc3b6.pdf
|
||||
[25]: https://pdfs.semanticscholar.org/031b/84fb7ae3fae3fe51a0a40aed4a0dcb55a8e3.pdf
|
||||
[26]: https://pdfs.semanticscholar.org/4ccb/0d37c69200dc63d1f757eafb36ef4853c178.pdf
|
||||
[27]: https://www.scipy.org/
|
||||
[28]: https://github.com/jiaaro/pydub
|
||||
[29]: https://librosa.github.io/librosa/
|
||||
[30]: https://pybay.com/speaker/jyotika-singh/
|
@ -0,0 +1,101 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Why it's time to embrace top-down cybersecurity practices)
|
||||
[#]: via: (https://opensource.com/article/19/9/cybersecurity-practices)
|
||||
[#]: author: (Matt ShealyAnderson Silva https://opensource.com/users/mshealyhttps://opensource.com/users/asnaylorhttps://opensource.com/users/ansilvahttps://opensource.com/users/bexelbiehttps://opensource.com/users/mkalindepauleduhttps://opensource.com/users/alanfdoss)
|
||||
|
||||
Why it's time to embrace top-down cybersecurity practices
|
||||
======
|
||||
An open culture doesn't mean being light on security practices. Having
|
||||
executives on board with cybersecurity, including funding it adequately,
|
||||
is critical for protecting and securing company data.
|
||||
![Two different business organization charts][1]
|
||||
|
||||
Cybersecurity is no longer just the domain of the IT staff putting in firewalls and backing up servers. It takes a commitment from the top and a budget to match. The stakes are high when it comes to keeping your customers' information safe.
|
||||
|
||||
The average cost of a data breach in 2018 was $148 for each compromised record. That equals an average cost of [$3.86 million per breach][2]. Because it takes organizations more than six months—196 days on average—to detect breaches, a lot of remediation must happen after discovery.
|
||||
|
||||
With compliance regulations in most industries tightening and stricter security rules, such as the [General Data Protection Regulation][3] (GDPR) becoming law, breaches can lead to large fines as well as loss of reputation.
|
||||
|
||||
To build a cybersecurity solution from the top down, you need to build a solid foundation. This foundation should be viewed not as a technology problem but as a governance issue. Tech solutions will play a role, but it takes more than that—it starts with building a culture of safety.
|
||||
|
||||
### Build a cybersecurity culture
|
||||
|
||||
"A chain is no stronger than its weakest link," Thomas Reid wrote back in 1786. The message still applies when it comes to cybersecurity today. Your systems are only as secure as your least safety-conscious team member. One lapse, by one person, can compromise your data.
|
||||
|
||||
It's important to build a culture where all team members understand the importance of cybersecurity. Security is not just the IT department's job. It is everyone's responsibility.
|
||||
|
||||
Training is a continuous responsibility. When new team members are on-boarded, they need to be trained in security best practices. When team members leave, their access must be restricted immediately. As team members get comfortable in their positions, there should be [strong policies, procedures, and training][4] to keep them safety conscious.
|
||||
|
||||
### Maintain secure systems
|
||||
|
||||
Corporate policies and procedures will establish a secure baseline for your systems. It's important to maintain strict adherence as systems expand or evolve. Secure network design must match these policies.
|
||||
|
||||
A secure system will be able to filter all incoming traffic at the network perimeter. Only traffic required to support your organization should be allowed to get through this perimeter. Unfortunately, threats sometimes still get in.
|
||||
|
||||
Zero-day attacks are increasing in number, and more threat actors are exploiting known defects in software. In 2018, more than [three-quarters of successful endpoint attacks exploited zero-day flaws][5]. While it's difficult to guard against unknown threats, you can minimize your exposure by strictly applying updates and patches immediately when they're released.
|
||||
|
||||
### Manage user privileges
|
||||
|
||||
By limiting each individual user's access and privileges, companies can utilize micro-segmenting to minimize potential damage done by a possible attack. If an attack does get through your secure perimeter, this will limit the number of areas the attacker has access to.
|
||||
|
||||
User access should be limited to only the privileges they need to do their jobs, especially when it comes to sensitive data. Most breaches start with email phishing. Unsuspecting employees click on a malicious link or are tricked into giving up their login credentials. The less access employees have, the less damage a hacker can do.
|
||||
|
||||
Identity and access management (IAM) systems can deploy single sign-on (SSO) to reduce the number of passwords users need to access systems by using an authentication token accepted by different apps. Multi-factor authentication practices combined with reducing privileges can lower risk to the entire system.
|
||||
|
||||
### Implement continuous monitoring
|
||||
|
||||
Your security needs [continuous monitoring across your enterprise][6] to detect and prevent intrusion. This includes servers, networks, Software-as-a-Service (SaaS), cloud services, mobile users, third-party applications, and much more. In reality, it is imperative that every entry point and connection are continuously monitored.
|
||||
|
||||
Your employees are working around the clock, especially if you are a global enterprise. They are working from home and working on the road. This means multiple devices, internet accesses, and servers, all of which need to be monitored.
|
||||
|
||||
Likewise, hackers are working continuously to find any flaw in your system that could lead to a possible cyberattack. Don't wait for your next IT audit to worry about finding the flaws; this should be a continual process and high priority.
|
||||
|
||||
### Conduct regular risk assessments
|
||||
|
||||
Even with continuous monitoring, chief information security officers (CISOs) and IT managers should regularly conduct risk assessments. New devices, hardware, third-party apps, and cloud services are being added all the time. It's easy to forget how all these individual pieces, added one at a time, all fit into the big picture.
|
||||
|
||||
The regularly scheduled, formal risk assessment should take an exhaustive look at infrastructure and access points. It should include penetration testing to identify potential threats.
|
||||
|
||||
Your risk assessment should also analyze backups and data-recovery planning in case a breach occurs. Don't just set up your security and hope it works. Have a plan for what you will do if access is breached, know who will be responsible for what, and establish an expected timeline to implement your plan.
|
||||
|
||||
### Pay attention to remote teams and BYOD users
|
||||
|
||||
More team members than ever work remotely. Whether they are working on the road, at a remote location, or from home, they pose a cybersecurity risk. They are connecting remotely, which can [leave channels open for intrusion or data interception][7].
|
||||
|
||||
Team members often mix company devices and personal devices almost seamlessly. The advent of BYOD (bring your own device) means company assets may also be vulnerable to apps and software installed on personal devices. While you can manage what's on company devices, when employees check their company email from their personal phone or connect to a company server from their personal laptop, you've increased your overall risk.
|
||||
|
||||
Personal devices and remote connections should always utilize a virtual private network (VPN). A VPN uses encrypted connections to the internet that create a private tunnel that masks the user's IP address. As Douglas Crawford, resident security expert at ProPrivacy.com, [explains][8], "Until the Edward Snowden revelations, people assumed that 128-bit encryption was in practice uncrackable through brute force. They believed it would be so for around another 100 years (taking Moore's Law into account). In theory, this still holds true. However, the scale of resources that the NSA seems willing to throw at cracking encryption has shaken many experts' faith in these predictions. Consequently, system administrators the world over are scrambling to upgrade cipher key lengths."
|
||||
|
||||
### A top-down cybersecurity strategy is essential
|
||||
|
||||
When it comes to cybersecurity, a top-down strategy is essential to providing adequate protection. Building a culture of cybersecurity throughout the organization, maintaining secure systems, and continuous monitoring are essential to safeguarding your systems and your data.
|
||||
|
||||
A top-down approach means your IT department is not solely focused on your company's tech stack while management is solely focused on the company mission and objectives. These are no longer siloed departments; they are interwoven and dependent on each other to ensure success.
|
||||
|
||||
Ultimately, success is defined as keeping your customer information safe and secure. Continuous monitoring and protection of sensitive information are critical to the success of the entire company. With top management on board with funding cybersecurity adequately, IT can ensure optimum security practices.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/cybersecurity-practices
|
||||
|
||||
作者:[Matt ShealyAnderson 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/mshealyhttps://opensource.com/users/asnaylorhttps://opensource.com/users/ansilvahttps://opensource.com/users/bexelbiehttps://opensource.com/users/mkalindepauleduhttps://opensource.com/users/alanfdoss
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_orgchart2.png?itok=R_cnshU2 (Two different business organization charts)
|
||||
[2]: https://securityintelligence.com/ponemon-cost-of-a-data-breach-2018/
|
||||
[3]: https://ec.europa.eu/info/law/law-topic/data-protection_en
|
||||
[4]: https://us.norton.com/internetsecurity-how-to-cyber-security-best-practices-for-employees.html
|
||||
[5]: https://www.ponemon.org/news-2/82
|
||||
[6]: https://digitalguardian.com/blog/what-continuous-security-monitoring
|
||||
[7]: https://www.chamberofcommerce.com/business-advice/ransomeware-the-terrifying-threat-to-small-business
|
||||
[8]: https://proprivacy.com/guides/the-ultimate-privacy-guide
|
@ -0,0 +1,341 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Hone advanced Bash skills by building Minesweeper)
|
||||
[#]: via: (https://opensource.com/article/19/9/advanced-bash-building-minesweeper)
|
||||
[#]: author: (Abhishek Tamrakar https://opensource.com/users/tamrakarhttps://opensource.com/users/dnearyhttps://opensource.com/users/sethhttps://opensource.com/users/sethhttps://opensource.com/users/marcobravo)
|
||||
|
||||
Hone advanced Bash skills by building Minesweeper
|
||||
======
|
||||
The nostalgia of classic games can be a great source for mastering
|
||||
programming. Deep dive into Bash with Minesweeper.
|
||||
![bash logo on green background][1]
|
||||
|
||||
I am no expert on teaching programming, but when I want to get better at something, I try to find a way to have fun with it. For example, when I wanted to get better at shell scripting, I decided to practice by programming a version of the [Minesweeper][2] game in Bash.
|
||||
|
||||
If you are an experienced Bash programmer and want to hone your skills while having fun, follow along to write your own version of Minesweeper in the terminal. The complete source code is found in this [GitHub repository][3].
|
||||
|
||||
### Getting ready
|
||||
|
||||
Before I started writing any code, I outlined the ingredients I needed to create my game:
|
||||
|
||||
1. Print a minefield
|
||||
2. Create the gameplay logic
|
||||
3. Create logic to determine the available minefield
|
||||
4. Keep count of available and discovered (extracted) mines
|
||||
5. Create the endgame logic
|
||||
|
||||
|
||||
|
||||
### Print a minefield
|
||||
|
||||
In Minesweeper, the game world is a 2D array (columns and rows) of concealed cells. Each cell may or may not contain an explosive mine. The player's objective is to reveal cells that contain no mine, and to never reveal a mine. Bash version of the game uses a 10x10 matrix, implemented using simple bash arrays.
|
||||
|
||||
First, I assign some random variables. These are the locations that mines could be placed on the board. By limiting the number of locations, it will be easy to build on top of this. The logic could be better, but I wanted to keep the game looking simple and a bit immature. (I wrote this for fun, but I would happily welcome your contributions to make it look better.)
|
||||
|
||||
The variables below are some default variables, declared to call randomly for field placement, like the variables a-g, we will use them to calculate our extractable mines:
|
||||
|
||||
|
||||
```
|
||||
# variables
|
||||
score=0 # will be used to store the score of the game
|
||||
# variables below will be used to randomly get the extract-able cells/fields from our mine.
|
||||
a="1 10 -10 -1"
|
||||
b="-1 0 1"
|
||||
c="0 1"
|
||||
d="-1 0 1 -2 -3"
|
||||
e="1 2 20 21 10 0 -10 -20 -23 -2 -1"
|
||||
f="1 2 3 35 30 20 22 10 0 -10 -20 -25 -30 -35 -3 -2 -1"
|
||||
g="1 4 6 9 10 15 20 25 30 -30 -24 -11 -10 -9 -8 -7"
|
||||
#
|
||||
# declarations
|
||||
declare -a room # declare an array room, it will represent each cell/field of our mine.
|
||||
```
|
||||
|
||||
Next, I print my board with columns (0-9) and rows (a-j), forming a 10x10 matrix to serve as the minefield for the game. (M[10][10] is a 100-value array with indexes 0-99.) If you want to know more about Bash arrays, read [_You don't know Bash: An introduction to Bash arrays_][4].
|
||||
|
||||
Lets call it a function, **plough,** we print the header first: two blank lines, the column headings, and a line to outline the top of the playing field:
|
||||
|
||||
|
||||
```
|
||||
printf '\n\n'
|
||||
printf '%s' " a b c d e f g h i j"
|
||||
printf '\n %s\n' "-----------------------------------------"
|
||||
```
|
||||
|
||||
Next, I establish a counter variable, called **r**, to keep track of how many horizontal rows have been populated. Note that, we will use the same counter variable '**r**' as our array index later in the game code. In a [Bash **for** loop][5], using the **seq** command to increment from 0 to 9, I print a digit (**d%**) to represent the row number ($row, which is defined by **seq**):
|
||||
|
||||
|
||||
```
|
||||
r=0 # our counter
|
||||
for row in $(seq 0 9); do
|
||||
printf '%d ' "$row" # print the row numbers from 0-9
|
||||
```
|
||||
|
||||
Before we move ahead from here, lets check what we have made till now. We printed sequence **[a-j] **horizontally first and then we printed row numbers in a range **[0-9]**, we will be using these two ranges to act as our users input coordinates to locate the mine to extract.** **
|
||||
|
||||
Next,** **Within each row, there is a column intersection, so it's time to open a new **for** loop. This one manages each column, so it essentially generates each cell in the playing field. I have added some helper functions that you can see the full definition of in the source code. For each cell, we need something to make the field look like a mine, so we initialize the empty ones with a dot (.), using a custom function called [**is_null_field**][6]. Also, we need an array variable to store the value for each cell, we will use the predefined global array variable **[room][7]** along with an index [variable **r**][8]. As **r** increments, we iterate over the cells, dropping mines along the way.
|
||||
|
||||
|
||||
```
|
||||
for col in $(seq 0 9); do
|
||||
((r+=1)) # increment the counter as we move forward in column sequence
|
||||
is_null_field $r # assume a function which will check, if the field is empty, if so, initialize it with a dot(.)
|
||||
printf '%s \e[33m%s\e[0m ' "|" "${room[$r]}" # finally print the separator, note that, the first value of ${room[$r]} will be '.', as it is just initialized.
|
||||
#close col loop
|
||||
done
|
||||
```
|
||||
|
||||
Finally, I keep the board well-defined by enclosing the bottom of each row with a line, and then close the row loop:
|
||||
|
||||
|
||||
```
|
||||
printf '%s\n' "|" # print the line end separator
|
||||
printf ' %s\n' "-----------------------------------------"
|
||||
# close row for loop
|
||||
done
|
||||
printf '\n\n'
|
||||
```
|
||||
|
||||
The full **plough** function looks like:
|
||||
|
||||
|
||||
```
|
||||
plough()
|
||||
{
|
||||
r=0
|
||||
printf '\n\n'
|
||||
printf '%s' " a b c d e f g h i j"
|
||||
printf '\n %s\n' "-----------------------------------------"
|
||||
for row in $(seq 0 9); do
|
||||
printf '%d ' "$row"
|
||||
for col in $(seq 0 9); do
|
||||
((r+=1))
|
||||
is_null_field $r
|
||||
printf '%s \e[33m%s\e[0m ' "|" "${room[$r]}"
|
||||
done
|
||||
printf '%s\n' "|"
|
||||
printf ' %s\n' "-----------------------------------------"
|
||||
done
|
||||
printf '\n\n'
|
||||
}
|
||||
```
|
||||
|
||||
It took me some time to decide on needing the **is_null_field**, so let's take a closer look at what it does. We need a dependable state from the beginning of the game. That choice is arbitrary–it could have been a number or any character. I decided to assume everything was declared as a dot (.) because I believe it makes the gameboard look pretty. Here's what that looks like:
|
||||
|
||||
|
||||
```
|
||||
is_null_field()
|
||||
{
|
||||
local e=$1 # we used index 'r' for array room already, let's call it 'e'
|
||||
if [[ -z "${room[$e]}" ]];then
|
||||
room[$r]="." # this is where we put the dot(.) to initialize the cell/minefield
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
Now that, I have all the cells in our mine initialized, I get a count of all available mines by declaring and later calling a simple function shown below:
|
||||
|
||||
|
||||
```
|
||||
get_free_fields()
|
||||
{
|
||||
free_fields=0 # initialize the variable
|
||||
for n in $(seq 1 ${#room[@]}); do
|
||||
if [[ "${room[$n]}" = "." ]]; then # check if the cells has initial value dot(.), then count it as a free field.
|
||||
((free_fields+=1))
|
||||
fi
|
||||
done
|
||||
}
|
||||
```
|
||||
|
||||
Here is the printed minefield, where [**a-j]** are columns, and [**0-9**] are rows.
|
||||
|
||||
![Minefield][9]
|
||||
|
||||
### Create the logic to drive the player
|
||||
|
||||
The player logic reads an option from [stdin][10] as a coordinate to the mines and extracts the exact field on the minefield. It uses Bash's [parameter expansion][11] to extract the column and row inputs, then feeds the column to a switch that points to its equivalent integer notation on the board, to understand this, see the values getting assigned to variable '**o'** in the switch case statement below. For instance, a player might enter **c3**, which Bash splits into two characters: **c** and **3**. For simplicity, I'm skipping over how invalid entry is handled.
|
||||
|
||||
|
||||
```
|
||||
colm=${opt:0:1} # get the first char, the alphabet
|
||||
ro=${opt:1:1} # get the second char, the digit
|
||||
case $colm in
|
||||
a ) o=1;; # finally, convert the alphabet to its equivalent integer notation.
|
||||
b ) o=2;;
|
||||
c ) o=3;;
|
||||
d ) o=4;;
|
||||
e ) o=5;;
|
||||
f ) o=6;;
|
||||
g ) o=7;;
|
||||
h ) o=8;;
|
||||
i ) o=9;;
|
||||
j ) o=10;;
|
||||
esac
|
||||
```
|
||||
|
||||
Then it calculates the exact index and assigns the index of the input coordinates to that field.
|
||||
|
||||
There is also a lot of use of **shuf** command here, **shuf** is a [Linux utility][12] designed to provide a random permutation of information where the **-i** option denotes indexes or possible ranges to shuffle and **-n** denotes the maximum number or output given back. Double parentheses allow for [mathematical evaluation][13] in Bash, and we will use them heavily here.
|
||||
|
||||
Let's assume our previous example received **c3** via stdin. Then, **ro=3** and **o=3** from above switch case statement converted **c** to its equivalent integer, put it into our formula to calculate final index '**i'.**
|
||||
|
||||
|
||||
```
|
||||
i=$(((ro*10)+o)) # Follow BODMAS rule, to calculate final index.
|
||||
is_free_field $i $(shuf -i 0-5 -n 1) # call a custom function that checks if the final index value points to a an empty/free cell/field.
|
||||
```
|
||||
|
||||
Walking through this math to understand how the final index '**i**' is calculated:
|
||||
|
||||
|
||||
```
|
||||
i=$(((ro*10)+o))
|
||||
i=$(((3*10)+3))=$((30+3))=33
|
||||
```
|
||||
|
||||
The final index value is 33. On our board, printed above, the final index points to 33rd cell and that should be 3rd (starting from 0, otherwise 4th) row and 3rd (C) column.
|
||||
|
||||
### Create the logic to determine the available minefield
|
||||
|
||||
To extract a mine, after the coordinates are decoded and the index is found, the program checks whether that field is available. If it's not, the program displays a warning, and the player chooses another coordinate.
|
||||
|
||||
In this code, a cell is available if it contains a dot (**.**) character. Assuming it's available, the value in the cell is reset and the score is updated. If a cell is unavailable because it does not contain a dot, then a variable **not_allowed** is set. For brevity, I leave it to you to look at the source code of the game for the contents of [the warning statement][14] in the game logic.
|
||||
|
||||
|
||||
```
|
||||
is_free_field()
|
||||
{
|
||||
local f=$1
|
||||
local val=$2
|
||||
not_allowed=0
|
||||
if [[ "${room[$f]}" = "." ]]; then
|
||||
room[$f]=$val
|
||||
score=$((score+val))
|
||||
else
|
||||
not_allowed=1
|
||||
fi
|
||||
}
|
||||
```
|
||||
|
||||
![Extracting mines][15]
|
||||
|
||||
If the coordinate entered is available, the mine is discovered, as shown below. When **h6** is provided as input, some values at random populated on our minefields, these values are added to users score after the mins are extracted.
|
||||
|
||||
![Extracting mines][16]
|
||||
|
||||
Now remember the variables we declared at the start, [a-g], I will now use them here to extract random mines assigning their value to the variable **m** using Bash indirection. So, depending upon the input coordinates, the program picks a random set of additional numbers (**m**) to calculate the additional fields to be populated (as shown above) by adding them to the original input coordinates, represented here by **i (**calculated above**)**.
|
||||
|
||||
Please note the character **X** in below code snippet, is our sole GAME-OVER trigger, we added it to our shuffle list to appear at random, with the beauty of **shuf** command, it can appear after any number of chances or may not even appear for our lucky winning user.
|
||||
|
||||
|
||||
```
|
||||
m=$(shuf -e a b c d e f g X -n 1) # add an extra char X to the shuffle, when m=X, its GAMEOVER
|
||||
if [[ "$m" != "X" ]]; then # X will be our explosive mine(GAME-OVER) trigger
|
||||
for limit in ${!m}; do # !m represents the value of value of m
|
||||
field=$(shuf -i 0-5 -n 1) # again get a random number and
|
||||
index=$((i+limit)) # add values of m to our index and calculate a new index till m reaches its last element.
|
||||
is_free_field $index $field
|
||||
done
|
||||
```
|
||||
|
||||
I want all revealed cells to be contiguous to the cell selected by the player.
|
||||
|
||||
![Extracting mines][17]
|
||||
|
||||
### Keep a count of available and extracted mines
|
||||
|
||||
The program needs to keep track of available cells in the minefield; otherwise, it keeps asking the player for input even after all the cells have been revealed. To implement this, I create a variable called **free_fields**, initially setting it to 0. In a **for** loop defined by the remaining number of available cells/fields in our minefields. ****If a cell contains a dot (**.**), then the count of **free_fields** is incremented.
|
||||
|
||||
|
||||
```
|
||||
get_free_fields()
|
||||
{
|
||||
free_fields=0
|
||||
for n in $(seq 1 ${#room[@]}); do
|
||||
if [[ "${room[$n]}" = "." ]]; then
|
||||
((free_fields+=1))
|
||||
fi
|
||||
done
|
||||
}
|
||||
```
|
||||
|
||||
Wait, what if, the **free_fields=0**? That means, our user had extracted all the mines. Please feel free to look at [the exact code][18] to understand better.
|
||||
|
||||
|
||||
```
|
||||
if [[ $free_fields -eq 0 ]]; then # well that means you extracted all the mines.
|
||||
printf '\n\n\t%s: %s %d\n\n' "You Win" "you scored" "$score"
|
||||
exit 0
|
||||
fi
|
||||
```
|
||||
|
||||
### Create the logic for Gameover
|
||||
|
||||
For the Gameover situation, we print to the middle of the terminal using some [nifty logic][19] that I leave it to the reader to explore how it works.
|
||||
|
||||
|
||||
```
|
||||
if [[ "$m" = "X" ]]; then
|
||||
g=0 # to use it in parameter expansion
|
||||
room[$i]=X # override the index and print X
|
||||
for j in {42..49}; do # in the middle of the minefields,
|
||||
out="gameover"
|
||||
k=${out:$g:1} # print one alphabet in each cell
|
||||
room[$j]=${k^^}
|
||||
((g+=1))
|
||||
done
|
||||
fi
|
||||
```
|
||||
|
||||
Finally, we can print the two lines which are most awaited.
|
||||
|
||||
|
||||
```
|
||||
if [[ "$m" = "X" ]]; then
|
||||
printf '\n\n\t%s: %s %d\n' "GAMEOVER" "you scored" "$score"
|
||||
printf '\n\n\t%s\n\n' "You were just $free_fields mines away."
|
||||
exit 0
|
||||
fi
|
||||
```
|
||||
|
||||
![Minecraft Gameover][20]
|
||||
|
||||
That's it, folks! If you want to know more, access the source code for this Minesweeper game and other games in Bash from my [GitHub repo][3]. I hope it gives you some inspiration to learn more Bash and to have fun while doing so.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/advanced-bash-building-minesweeper
|
||||
|
||||
作者:[Abhishek Tamrakar][a]
|
||||
选题:[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/tamrakarhttps://opensource.com/users/dnearyhttps://opensource.com/users/sethhttps://opensource.com/users/sethhttps://opensource.com/users/marcobravo
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background)
|
||||
[2]: https://en.wikipedia.org/wiki/Minesweeper_(video_game)
|
||||
[3]: https://github.com/abhiTamrakar/playground/tree/master/bash_games
|
||||
[4]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays
|
||||
[5]: https://opensource.com/article/19/6/how-write-loop-bash
|
||||
[6]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L114-L120
|
||||
[7]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L41
|
||||
[8]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L74
|
||||
[9]: https://opensource.com/sites/default/files/uploads/minefield.png (Minefield)
|
||||
[10]: https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)
|
||||
[11]: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
|
||||
[12]: https://linux.die.net/man/1/shuf
|
||||
[13]: https://www.tldp.org/LDP/abs/html/dblparens.html
|
||||
[14]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L143-L177
|
||||
[15]: https://opensource.com/sites/default/files/uploads/extractmines.png (Extracting mines)
|
||||
[16]: https://opensource.com/sites/default/files/uploads/extractmines2.png (Extracting mines)
|
||||
[17]: https://opensource.com/sites/default/files/uploads/extractmines3.png (Extracting mines)
|
||||
[18]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L91
|
||||
[19]: https://github.com/abhiTamrakar/playground/blob/28143053ced699c80569666f25268e8b96c38c46/bash_games/minesweeper.sh#L131-L141
|
||||
[20]: https://opensource.com/sites/default/files/uploads/gameover.png (Minecraft Gameover)
|
447
sources/tech/20190920 How to compare strings in Java.md
Normal file
447
sources/tech/20190920 How to compare strings in Java.md
Normal file
@ -0,0 +1,447 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to compare strings in Java)
|
||||
[#]: via: (https://opensource.com/article/19/9/compare-strings-java)
|
||||
[#]: author: (Girish Managoli https://opensource.com/users/gammayhttps://opensource.com/users/sethhttps://opensource.com/users/clhermansenhttps://opensource.com/users/clhermansen)
|
||||
|
||||
How to compare strings in Java
|
||||
======
|
||||
There are six ways to compare strings in Java.
|
||||
![Javascript code close-up with neon graphic overlay][1]
|
||||
|
||||
String comparison is a fundamental operation in programming and is often quizzed during interviews. These strings are a sequence of characters that are _immutable_ which means unchanging over time or unable to be changed.
|
||||
|
||||
Java has a number of methods for comparing strings; this article will teach you the primary operation of how to compare strings in Java.
|
||||
|
||||
There are six options:
|
||||
|
||||
1. The == operator
|
||||
2. String equals
|
||||
3. String equalsIgnoreCase
|
||||
4. String compareTo
|
||||
5. String compareToIgnoreCase
|
||||
6. Objects equals
|
||||
|
||||
|
||||
|
||||
### The == operator
|
||||
|
||||
**==** is an operator that returns **true** if the contents being compared refer to the same memory or **false** if they don't. If two strings compared with **==** refer to the same string memory, the return value is **true**; if not, it is **false**.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string2 = "YOURTEXT";
|
||||
|
||||
[System][3].out.println("Output: " + (string1 == string2));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
The return value of **==** above is **false**, as "MYTEXT" and "YOURTEXT" refer to different memory.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string6 = "MYTEXT";
|
||||
|
||||
[System][3].out.println("Output: " + (string1 == string6));
|
||||
|
||||
Output: true
|
||||
```
|
||||
|
||||
In this case, the return value of **==** is **true**, as the compiler internally creates one memory location for both "MYTEXT" memories, and both variables refer to the same memory location.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string7 = string1;
|
||||
|
||||
[System][3].out.println("Output: " + (string1 == string7));
|
||||
|
||||
Output: true
|
||||
```
|
||||
|
||||
If you guessed right, you know string7 is initialized with the same memory location as string1 and therefore **==** is true.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string4 = new [String][2]("MYTEXT");
|
||||
|
||||
[System][3].out.println("Output: " + (string1 == string4));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
In this case, the compiler creates a new memory location, even though the value is the same for string4 and string1.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string5 = new [String][2](string1);
|
||||
|
||||
[System][3].out.println("Output: " + (string1 == string4));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
Here, string5 is a new string object initialized with string1; hence, **string1 == string4** is not true.
|
||||
|
||||
### String equals
|
||||
|
||||
The string class has a **String equals** method to compare two strings. String comparison with **equals** is case-sensitive. According to the [docs][4]:
|
||||
|
||||
|
||||
```
|
||||
/**
|
||||
* Compares this string to the specified object. The result is {@code
|
||||
* true} if and only if the argument is not {@code null} and is a {@code
|
||||
* String} object that represents the same sequence of characters as this
|
||||
* object.
|
||||
*
|
||||
* @param anObject
|
||||
* The object to compare this {@code String} against
|
||||
*
|
||||
* @return {@code true} if the given object represents a {@code String}
|
||||
* equivalent to this string, {@code false} otherwise
|
||||
*
|
||||
* @see #compareTo(String)
|
||||
* @see #equalsIgnoreCase(String)
|
||||
*/
|
||||
public boolean equals(Object anObject) { ... }
|
||||
```
|
||||
|
||||
Let's see a few examples:
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string2 = "YOURTEXT";
|
||||
|
||||
[System][3].out.println("Output: " + string1.equals(string2));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
If the strings are not the same, the output of the **equals** method is obviously **false**.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string3 = "mytext";
|
||||
|
||||
[System][3].out.println("Output: " + string1.equals(string3));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
These strings are the same in value but differ in case; hence, the output is **false**.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string4 = new [String][2]("MYTEXT");
|
||||
|
||||
[System][3].out.println("Output: " + string1.equals(string4));
|
||||
|
||||
Output: true
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string5 = new [String][2](string1);
|
||||
|
||||
[System][3].out.println("Output: " + string1.equals(string5));
|
||||
|
||||
Output: true
|
||||
```
|
||||
|
||||
The examples in both these cases are **true**, as the two values are the same. Unlike with **==**, the second example above returns **true**.
|
||||
|
||||
The string object on which **equals** is called should obviously be a valid string object and non-null.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string8 = null;
|
||||
|
||||
[System][3].out.println("Output: " + string8.equals(string1));
|
||||
|
||||
[Exception][5] in thread _____ java.lang.[NullPointerException][6]
|
||||
```
|
||||
|
||||
The above evidently is not a good code.
|
||||
|
||||
|
||||
```
|
||||
[System][3].out.println("Output: " + string1.equals(string8));
|
||||
|
||||
Output: false
|
||||
```
|
||||
|
||||
This is alright.
|
||||
|
||||
### String equalsIgnoreCase
|
||||
|
||||
The behavior of **equalsIgnoreCase** is identical to **equals** with one difference—the comparison is not case-sensitive. The [docs][4] say:
|
||||
|
||||
|
||||
```
|
||||
/**
|
||||
* Compares this {@code String} to another {@code String}, ignoring case
|
||||
* considerations. Two strings are considered equal ignoring case if they
|
||||
* are of the same length and corresponding characters in the two strings
|
||||
* are equal ignoring case.
|
||||
*
|
||||
* <p> Two characters {@code c1} and {@code c2} are considered the same
|
||||
* ignoring case if at least one of the following is true:
|
||||
* <ul>
|
||||
* <li> The two characters are the same (as compared by the
|
||||
* {@code ==} operator)
|
||||
* <li> Applying the method {@link
|
||||
* java.lang.Character#toUpperCase(char)} to each character
|
||||
* produces the same result
|
||||
* <li> Applying the method {@link
|
||||
* java.lang.Character#toLowerCase(char)} to each character
|
||||
* produces the same result
|
||||
* </ul>
|
||||
*
|
||||
* @param anotherString
|
||||
* The {@code String} to compare this {@code String} against
|
||||
*
|
||||
* @return {@code true} if the argument is not {@code null} and it
|
||||
* represents an equivalent {@code String} ignoring case; {@code
|
||||
* false} otherwise
|
||||
*
|
||||
* @see #equals(Object)
|
||||
*/
|
||||
public boolean equalsIgnoreCase(String anotherString) { ... }
|
||||
```
|
||||
|
||||
The second example in **equals** (above) is the only difference from the comparison in **equalsIgnoreCase**.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string3 = "mytext";
|
||||
|
||||
[System][3].out.println("Output: " + string1.equalsIgnoreCase(string3));
|
||||
|
||||
Output: true
|
||||
```
|
||||
|
||||
This returns **true** because the comparison is case-independent. All other examples under **equals** remain the same as they are for **equalsIgnoreCase**.
|
||||
|
||||
### String compareTo
|
||||
|
||||
The **compareTo** method compares two strings lexicographically (i.e., pertaining to alphabetical order) and case-sensitively and returns the lexicographical difference in the two strings. The [docs][4] describe lexicographical order computation as:
|
||||
|
||||
|
||||
```
|
||||
/**
|
||||
* Compares two strings lexicographically.
|
||||
* The comparison is based on the Unicode value of each character in
|
||||
* the strings. The character sequence represented by this
|
||||
* {@code String} object is compared lexicographically to the
|
||||
* character sequence represented by the argument string. The result is
|
||||
* a negative integer if this {@code String} object
|
||||
* lexicographically precedes the argument string. The result is a
|
||||
* positive integer if this {@code String} object lexicographically
|
||||
* follows the argument string. The result is zero if the strings
|
||||
* are equal; {@code compareTo} returns {@code 0} exactly when
|
||||
* the {@link #equals(Object)} method would return {@code true}.
|
||||
* <p>
|
||||
* This is the definition of lexicographic ordering. If two strings are
|
||||
* different, then either they have different characters at some index
|
||||
* that is a valid index for both strings, or their lengths are different,
|
||||
* or both. If they have different characters at one or more index
|
||||
* positions, let <i>k</i> be the smallest such index; then the string
|
||||
* whose character at position <i>k</i> has the smaller value, as
|
||||
* determined by using the &lt; operator, lexicographically precedes the
|
||||
* other string. In this case, {@code compareTo} returns the
|
||||
* difference of the two character values at position {@code k} in
|
||||
* the two string -- that is, the value:
|
||||
* <blockquote><pre>
|
||||
* this.charAt(k)-anotherString.charAt(k)
|
||||
* </pre></blockquote>
|
||||
* If there is no index position at which they differ, then the shorter
|
||||
* string lexicographically precedes the longer string. In this case,
|
||||
* {@code compareTo} returns the difference of the lengths of the
|
||||
* strings -- that is, the value:
|
||||
* <blockquote><pre>
|
||||
* this.length()-anotherString.length()
|
||||
* </pre></blockquote>
|
||||
*
|
||||
* @param anotherString the {@code String} to be compared.
|
||||
* @return the value {@code 0} if the argument string is equal to
|
||||
* this string; a value less than {@code 0} if this string
|
||||
* is lexicographically less than the string argument; and a
|
||||
* value greater than {@code 0} if this string is
|
||||
* lexicographically greater than the string argument.
|
||||
*/
|
||||
public int compareTo(String anotherString) { ... }
|
||||
```
|
||||
|
||||
Let's look at some examples.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "A";
|
||||
[String][2] string2 = "B";
|
||||
|
||||
[System][3].out.println("Output: " + string1.compareTo(string2));
|
||||
|
||||
Output: -1
|
||||
[System][3].out.println("Output: " + string2.compareTo(string1));
|
||||
|
||||
Output: 1
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "A";
|
||||
[String][2] string3 = "a";
|
||||
|
||||
[System][3].out.println("Output: " + string1.compareTo(string3));
|
||||
|
||||
Output: -32
|
||||
|
||||
[System][3].out.println("Output: " + string3.compareTo(string1));
|
||||
|
||||
Output: 32
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "A";
|
||||
[String][2] string6 = "A";
|
||||
|
||||
[System][3].out.println("Output: " + string1.compareTo(string6));
|
||||
|
||||
Output: 0
|
||||
|
||||
[/code] [code]
|
||||
|
||||
String string1 = "A";
|
||||
String string8 = null;
|
||||
|
||||
System.out.println("Output: " + string8.compareTo(string1));
|
||||
|
||||
Exception in thread ______ java.lang.NullPointerException
|
||||
at java.lang.String.compareTo(String.java:1155)
|
||||
|
||||
String string1 = "A";
|
||||
String string10 = "";
|
||||
|
||||
System.out.println("Output: " + string1.compareTo(string10));
|
||||
|
||||
Output: 1
|
||||
```
|
||||
|
||||
### String compareToIgnoreCase
|
||||
|
||||
The behavior of **compareToIgnoreCase** is identical to **compareTo** with one difference: the strings are compared without case consideration.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "A";
|
||||
[String][2] string3 = "a";
|
||||
|
||||
[System][3].out.println("Output: " + string1.compareToIgnoreCase(string3));
|
||||
|
||||
Output: 0
|
||||
```
|
||||
|
||||
### Objects equals
|
||||
|
||||
The **Objects equals** method invokes the overridden **String equals** method; its behavior is the same as in the **String equals** example above.
|
||||
|
||||
|
||||
```
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string2 = "YOURTEXT";
|
||||
|
||||
[System][3].out.println("Output: " + Objects(string1, string2));
|
||||
|
||||
Output: false
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string3 = "mytext";
|
||||
|
||||
[System][3].out.println("Output: " + Objects(string1, string3));
|
||||
|
||||
Output: false
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string6 = "MYTEXT";
|
||||
|
||||
[System][3].out.println("Output: " + Objects(string1, string6));
|
||||
|
||||
Output: true
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string1 = "MYTEXT";
|
||||
[String][2] string8 = null;
|
||||
|
||||
[System][3].out.println("Output: " + Objects.equals(string1, string8));
|
||||
|
||||
Output: false
|
||||
|
||||
[System][3].out.println("Output: " + Objects.equals(string8, string1));
|
||||
|
||||
Output: false
|
||||
|
||||
[/code] [code]
|
||||
|
||||
[String][2] string8 = null;
|
||||
[String][2] string9 = null;
|
||||
|
||||
[System][3].out.println("Output: " + Objects.equals(string8, string9));
|
||||
|
||||
Output: true
|
||||
```
|
||||
|
||||
The advantage here is that the **Objects equals** method checks for null values (unlike **String equals**). The implementation of **Object equals** is:
|
||||
|
||||
|
||||
```
|
||||
public static boolean equals([Object][7] a, [Object][7] b) {
|
||||
return (a == b) || (a != null && a.equals(b));
|
||||
}
|
||||
```
|
||||
|
||||
### Which method to use?
|
||||
|
||||
There are many methods to compare two strings. Which one should you use? As a common practice, use **String equals** for case-sensitive strings and **String equalsIgnoreCase** for case-insensitive comparisons. However, one caveat: take care of NPE (**NullPointerException**) if one or both strings are null.
|
||||
|
||||
The source code is available on [GitLab][8] and [GitHub][9].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/compare-strings-java
|
||||
|
||||
作者:[Girish Managoli][a]
|
||||
选题:[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/gammayhttps://opensource.com/users/sethhttps://opensource.com/users/clhermansenhttps://opensource.com/users/clhermansen
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay)
|
||||
[2]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
|
||||
[3]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
|
||||
[4]: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/lang/String.java
|
||||
[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception
|
||||
[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+nullpointerexception
|
||||
[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+object
|
||||
[8]: https://gitlab.com/gammay/stringcomparison
|
||||
[9]: https://github.com/gammay/stringcompare
|
@ -0,0 +1,120 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Managing network interfaces and FirewallD in Cockpit)
|
||||
[#]: via: (https://fedoramagazine.org/managing-network-interfaces-and-firewalld-in-cockpit/)
|
||||
[#]: author: (Shaun Assam https://fedoramagazine.org/author/sassam/)
|
||||
|
||||
Managing network interfaces and FirewallD in Cockpit
|
||||
======
|
||||
|
||||
![][1]
|
||||
|
||||
In the [last article][2], we saw how Cockpit can manage storage devices. This article will focus on the networking functionalities within the UI. We’ll see how to manage the interfaces attached to the system in Cockpit. We’ll also look at the firewall and demonstrate how to assign a zone to an interface, and allow/deny services and ports.
|
||||
|
||||
To access these controls, verify the _cockpit-networkmanager_ and _cockpit-firewalld_ packages are installed.
|
||||
|
||||
To start, log into the Cockpit UI and select the **Networking** menu option. As is consistent with the UI design we see performance graphs at the top and a summary of the logs at the bottom of the page. Between them are the sections to manage the firewall and interface(s).
|
||||
|
||||
![][3]
|
||||
|
||||
### Firewall
|
||||
|
||||
Cockpit’s firewall configuration page works with FirewallD and allows admins to quickly configure these settings. The page has options for assigning zones to specific interfaces, as well as a list of services configured to those zones.
|
||||
|
||||
#### Adding a zone
|
||||
|
||||
Let’s start by configuring a zone to an available interface. First, click the **Add Zone** button. From here you can select a pre-configured or custom zone. Selecting one of the zones will display a brief description of that zone, as well as the services, or ports, allowed, or opened, in that zone. Select the interface you want to assign the zone to. Also, there’s the option to configure the rules to apply to the **Entire Subset**, or you can specify a **Range** of IP addresses. In the example below, we add the Internal zone to an available network card. The IP range can also be configured so the rule is only applied to the specified addresses.
|
||||
|
||||
![][4]
|
||||
|
||||
#### Adding and removing services/ports
|
||||
|
||||
To allow network access to services, or open ports, click the **Add Services** button. From here you can search (or filter) for a service, or manually enter the port(s) you would like to open. Selecting the **Custom Ports** option provides options to enter the port number or alias into the TCP and/or UDP fields. You can also provide an optional name to label the rule. In the example below, the Cockpit service/socket is added to the Internal zone. Once completed, click the **Add Services**, or **Add Ports**, button. Likewise, to remove the service click the red trashcan to the right, select the zone(s), and click **Remove service**.
|
||||
|
||||
For more information about using Cockpit to configure your system’s firewall, visit the [Cockpit project’s Github page][5].
|
||||
|
||||
![][6]
|
||||
|
||||
### Interfaces
|
||||
|
||||
The interfaces section displays both physical and virtual/logical NICs assigned to the system. From the main screen we see the name of the interface, the IP address, and activity stats of the NIC. Selecting an interface will display IP related information and options to manually configure them. You can also choose to have the network card inactive after a reboot by toggling the **Connect automatically** option. To enable, or disable, the network interface, click the toggle switch in the top right corner of the section.
|
||||
|
||||
![][7]
|
||||
|
||||
#### Bonding
|
||||
|
||||
Bonding network interfaces can help increase bandwidth availability. It can also serve as a redundancy plan in the event one of the NIC’s fail.
|
||||
|
||||
To start, click the **Add Bond** button located in the header of the Interfaces section. In the Bond Settings overlay, enter a name and select the interfaces you wish to bond in the list below. Next, select the **MAC Address** you would like to assign to the bond. Now select the **Mode**, or purpose, of the bond: Round Robin, Active Backup, Broadcast, &c. (the demo below shows a complete list of modes.)
|
||||
|
||||
Continue the configuration by selecting the **Primary** NIC, and a **Link Monitoring** option. You can also tweak the **Monitoring Interval**, and **Link Up Delay** and **Link Down Delay** options. To finish the configuration, click the **Apply** button. We’re taken back to the main screen, and the new bonded interface we just created is added to the list of interfaces.
|
||||
|
||||
From here we can configure the bond like any other interface. We can even delve deeper into the interface’s settings for the bond. As seen in the example below, selecting one of the interfaces in the bond’s settings page provides details pertaining to the interface link. There’s also an added option for changing the bond settings. To delete the bond, click the **Delete** button.
|
||||
|
||||
![][8]
|
||||
|
||||
#### Teaming
|
||||
|
||||
Teaming, like bonding, is another method used for link aggregation. For a comparison between bonding and teaming, refer to [this chart][9]. You can also find more information about teaming on the [Red Hat documentation site.][10]
|
||||
|
||||
As with creating a bond, click the **Add Team** button. The settings are similar in the sense you can give it a name, select the interfaces, link delay, and the mode or **Runner** as it’s referred to here. The options are similar to the ones available for bonding. By default the **Link Watch** option is set to Ethtool, but also has options for ARP Ping, and NSNA Ping.
|
||||
|
||||
Click the **Apply** button to complete the setup. It will also return you to the main networking screen. For further configuration, such as IP assignment and changing the runner, click the newly made team interface. As with bonding, you can click one of the interfaces in the link aggregation. Depending on the runner, you may have additional options for the Team Port. Click the **Delete** button from the screen to remove the team.
|
||||
|
||||
![][11]
|
||||
|
||||
#### Bridging
|
||||
|
||||
From the article, [Build a network bridge with Fedora][12]:
|
||||
|
||||
> “A bridge is a network connection that combines multiple network adapters.”
|
||||
|
||||
One excellent example for a bridge is combining the physical NIC with a virtual interface, like the one created and used for KVM virtualization. [Leif Madsen’s blog][13] has an excellent article on how to achieve this in the CLI. This can also be accomplished in Cockpit with just a few clicks. The example below will accomplish the first part of Leif’s blog using the web UI. We’ll bridge the enp9s0 interface with the virbr0 virtual interface.
|
||||
|
||||
Click the **Add Bridge** button to launch the settings box. Provide a name and select the interfaces you would like to bridge. To enable **Spanning Tree Protocol (STP)**, click the box to the right of the label. Click the **Apply** button to finalize the configuration.
|
||||
|
||||
As is consistent with teaming and bonding, selecting the bridge from the main screen will display the details of the interface. As seen in the example below, the physical device takes control and the virtual interface will adopt that device’s IP address.
|
||||
|
||||
Select the individual interface in the bridge’s detail screen for more options. And once again, click the **Delete** button to remove the bridge.
|
||||
|
||||
![][14]
|
||||
|
||||
#### Adding VLANs
|
||||
|
||||
Cockpit allows admins to create VLANs, or virtual networks, using any of the interfaces on the system. Click the **Add VLAN** button and select an interface. Furthermore, in the **Parent** drop-down list, assign the VLAN ID, and if you like, give it a new name. By default the name will be the same as the parent followed by a dot and the ID. For example, interface _enp11s0_ with VLAN ID _9_ will result in _enp11s0.9_). Click **Apply** to save the settings and to return to the networking main screen. Click the VLAN interface for further configuration. As always, click the **Delete** button to remove the VLAN.
|
||||
|
||||
![][15]
|
||||
|
||||
As we can see, Cockpit can help admins with common network configurations when managing the system’s connectivity. In the next article, we’ll explore how Cockpit handles user management and peek into the add-on 389 Directory Servers.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/managing-network-interfaces-and-firewalld-in-cockpit/
|
||||
|
||||
作者:[Shaun Assam][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/author/sassam/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-networking-816x345.jpg
|
||||
[2]: https://fedoramagazine.org/performing-storage-management-tasks-in-cockpit/
|
||||
[3]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-network-main-screen-1024x687.png
|
||||
[4]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-add-zone.gif
|
||||
[5]: https://github.com/cockpit-project/cockpit/wiki/Feature:-Firewall
|
||||
[6]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-add_remove-services.gif
|
||||
[7]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-interfaces-overview-1.gif
|
||||
[8]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-interface-bonding.gif
|
||||
[9]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-comparison_of_network_teaming_to_bonding
|
||||
[10]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/ch-configure_network_teaming
|
||||
[11]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-interface-teaming.gif
|
||||
[12]: https://fedoramagazine.org/build-network-bridge-fedora
|
||||
[13]: http://blog.leifmadsen.com/blog/2016/12/01/create-network-bridge-with-nmcli-for-libvirt/
|
||||
[14]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-interface-bridging.gif
|
||||
[15]: https://fedoramagazine.org/wp-content/uploads/2019/09/cockpit-interface-vlans.gif
|
295
sources/tech/20190921 Top Open Source Video Players for Linux.md
Normal file
295
sources/tech/20190921 Top Open Source Video Players for Linux.md
Normal file
@ -0,0 +1,295 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Top Open Source Video Players for Linux)
|
||||
[#]: via: (https://itsfoss.com/video-players-linux/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
Top Open Source Video Players for Linux
|
||||
======
|
||||
|
||||
_**Wondering which video player should you use on Linux? Here’s a list of top open source video players available for Linux distributions.**_
|
||||
|
||||
You can watch Hulu, Prime Video and/or [Netflix on Linux][1]. You can also [download videos from YouTube][2] and watch them later or if you are in a country where you cannot get Netflix and other streaming services, you may have to rely on torrent services like [Popcorn Time in Linux][3].
|
||||
|
||||
Watching movies/TV series or other video contents on computers is not an ‘ancient tradition’ yet. Usually, you go with the default video player that comes baked in with your Linux distribution (that could be anything).
|
||||
|
||||
You won’t have an issue utilizing the default player – however, if you specifically want more open-source video player choices (or alternatives to the default one), you should keep reading.
|
||||
|
||||
### Best Linux video players
|
||||
|
||||
![][4]
|
||||
|
||||
I have included the installation steps for Ubuntu but that shouldn’t make it the list of Ubuntu video players. These open source software should be available in any Linux distribution you are using.
|
||||
|
||||
Installing the software
|
||||
|
||||
Another note for Ubuntu users. You should have [universe repository enabled][5] in order to find and install these video players from the software center or by using command line. I have mentioned the commands but if you like, you can also install them from the Software Center.
|
||||
|
||||
_Please keep in mind that the list is in no particular order of ranking._
|
||||
|
||||
#### 1\. VLC Media Player
|
||||
|
||||
![][6]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* Built-in codecs
|
||||
* Customization options
|
||||
* Cross-platform
|
||||
* Every video file format supported
|
||||
* Extensions available for added functionalities
|
||||
|
||||
|
||||
|
||||
[VLC Media Player][7] is unquestionably the most popular open source video player. Not just limited to Linux – but it’s a must-have video player for every platform (including Windows).
|
||||
|
||||
It is a quite powerful video player capable of handling a variety of file formats and codecs. You can customize the look of it by using skins and enhance the functionalities with the help of certain extensions. Other features like [subtitle synchronization][8], audio/video filters, etc, exist as well.
|
||||
|
||||
[VLC Media Player][7]
|
||||
|
||||
#### How to install VLC?
|
||||
|
||||
You can easily [install VLC in Ubuntu][9] from the Software Center or download it from the [official website][7].
|
||||
|
||||
If you’re utilizing the terminal, you will have to separately install the components as per your requirements by following the [official resource][10]. To install the player, just type in:
|
||||
|
||||
```
|
||||
sudo apt install vlc
|
||||
```
|
||||
|
||||
#### 2\. MPlayer
|
||||
|
||||
![][11]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* Wide range of output drivers supported
|
||||
* Major file formats supported
|
||||
* Cross-platform
|
||||
* Command-line based
|
||||
|
||||
|
||||
|
||||
Yet another impressive open-source video player (technically, a video player engine). [MPlayer][12] may not offer you an intuitive user experience but it supports a wide range of output drivers and subtitle files.
|
||||
|
||||
Unlike others, MPlayer does not offer a working GUI (it has one, but it doesn’t work as expected). So, you will have to utilize the terminal in order to play a video. Even though this isn’t a popular choice – it works and a couple of video players that I’ll be listing below are inspired (or based) from MPlayer but with a GUI.
|
||||
|
||||
[MPlayer][12]
|
||||
|
||||
#### How to install MPlayer?
|
||||
|
||||
We already have an article on [installing MPlayer on Ubuntu and other Linux distros][13]. If you’re interested to install this, you should check it out.
|
||||
|
||||
```
|
||||
sudo apt install mplayer mplayer-gui
|
||||
```
|
||||
|
||||
#### 3\. SMPlayer
|
||||
|
||||
![][14]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* Supports all major video formats
|
||||
* Built-in codecs
|
||||
* Cross-platform (Windows & Linux)
|
||||
* Play ad-free YouTube video
|
||||
* Opensubtitles integration
|
||||
* UI Customization available
|
||||
* Based on MPlayer
|
||||
|
||||
|
||||
|
||||
As mentioned, SMPlayer uses MPlayer as the playback engine. So, it supports a wide range of file formats. In addition to all the basic features, it also lets you play YouTube videos from within the video player (by getting rid of the annoying ads).
|
||||
|
||||
If you want to know about SMPlayer a bit more – we have a separate article here: [SMPlayer in Linux][15].
|
||||
|
||||
Similar to VLC, it also comes baked in with codecs, so you don’t have to worry about finding codecs and installing them to make it work unless there’s something specific you need.
|
||||
|
||||
[SMPlayer][16]
|
||||
|
||||
#### How to install SMPlayer?
|
||||
|
||||
SMPlayer should be available in your Software Center. However, if you want to utilize the terminal, type in this:
|
||||
|
||||
```
|
||||
sudo apt install smplayer
|
||||
```
|
||||
|
||||
#### 4\. MPV Player
|
||||
|
||||
![][17]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* Minimalist GUI
|
||||
* Video codecs built in
|
||||
* High-quality video output by video scaling
|
||||
* Cross-platform
|
||||
* YouTube Videos supported via CLI
|
||||
|
||||
|
||||
|
||||
If you are looking for a video player with a streamlined/minimal UI, this is for you. Similar to the above-mentioned video players, we also have a separate article on [MPV Player][18] with installation instructions (if you’re interested to know more about it).
|
||||
|
||||
Keeping that aside, it offers what you would expect from a standard video player. You can even try it on your Windows/Mac systems.
|
||||
|
||||
[MPV Player][19]
|
||||
|
||||
#### How to install MPV Player?
|
||||
|
||||
You will find it listed in the Software Center or Package Manager. In either case, you can download the required package for your distro from the [official download page][20].
|
||||
|
||||
If you’re on Ubuntu, you can type in this in the terminal:
|
||||
|
||||
```
|
||||
sudo apt install mpv
|
||||
```
|
||||
|
||||
#### 5\. Dragon Player
|
||||
|
||||
![][21]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* Simple UI
|
||||
* Tailored for KDE
|
||||
* Supports playing CDs and DVDs
|
||||
|
||||
|
||||
|
||||
This has been specifically tailored for KDE desktop users. It is a dead-simple video player with all the basic features needed. You shouldn’t expect anything fancy out of it – but it does support the major file formats.
|
||||
|
||||
[Dragon Player][22]
|
||||
|
||||
#### How to install Dragon Player?
|
||||
|
||||
You will find it listed in the official repo. In either case, you can type in the following command to install it via terminal:
|
||||
|
||||
```
|
||||
sudo apt install dragonplayer
|
||||
```
|
||||
|
||||
#### 6\. GNOME Videos
|
||||
|
||||
![Totem Video Player][23]
|
||||
|
||||
Key Highlights:
|
||||
|
||||
* A simple video player for GNOME Desktop
|
||||
* Plugins supported
|
||||
* Ability to sort/access separate video channels
|
||||
|
||||
|
||||
|
||||
The default video player for distros with GNOME desktop environment (previously known as Totem). It supports all the major file formats and also lets you take a snap while playing a video. Similar to some of the others, it is a very simple and useful video player. You can try it out if you want.
|
||||
|
||||
[Gnome Videos][24]
|
||||
|
||||
#### How to install Totem (GNOME Videos)?
|
||||
|
||||
You can just type in “totem” to find the video player for GNOME listed in the software center. If not, you can also try utilizing the terminal with the following command:
|
||||
|
||||
```
|
||||
sudo apt install totem
|
||||
```
|
||||
|
||||
#### 7\. Deepin Movie
|
||||
|
||||
![][25]
|
||||
|
||||
If you are using [Deepin OS][26], you will find this as your default video player for Deepin Desktop Environment. It features all the basic functionalities that you would normally look in a video player. You can try compiling the source to install it if you aren’t using Deepin.
|
||||
|
||||
[Deepin Movie][27]
|
||||
|
||||
#### How to Install Deepin?
|
||||
|
||||
You can find it in the Software Center. If you’d want to compile, the source code is available at [GitHub][28]. In either case, type in the following command in the terminal:
|
||||
|
||||
```
|
||||
sudo apt install deepin-movie
|
||||
```
|
||||
|
||||
#### 8\. Xine Multimedia Engine
|
||||
|
||||
![][29]
|
||||
|
||||
Key Higlights:
|
||||
|
||||
* Customization available
|
||||
* Subtitles supported
|
||||
* Major file formats supported
|
||||
* Streaming playback support
|
||||
|
||||
|
||||
|
||||
Xine is an interesting portable media player. You can either choose to utilize the GUI or call the xine library from other applications to make use of the features available.
|
||||
|
||||
It supports a wide range of file formats. You can customize the skin of the GUI. It supports all kinds of subtitles (even from the DVDs). In addition to this, you can take a snapshot while playing the video, which comes handy.
|
||||
|
||||
[Xine Multimedia][30]
|
||||
|
||||
#### How to install Xine Multimedia?
|
||||
|
||||
You probably won’t find this in your Software Center. So, you can try typing this in your terminal to get it installed:
|
||||
|
||||
```
|
||||
sudo apt install xine-ui
|
||||
```
|
||||
|
||||
In addition to that, you can also check for available binary packages on their [official website][31].
|
||||
|
||||
**Wrapping Up**
|
||||
|
||||
We would recommend you to try out these open source video players over anything else. In addition to all these, you can also try [Miro Player][32] which is no more being actively maintained but works – so you can give it a try, if nothing else works for you.
|
||||
|
||||
However, if you think we missed one of your favorite Linux video player that deserves a mentioned, let us know about it in the comments down below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/video-players-linux/
|
||||
|
||||
作者:[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/watch-netflix-in-ubuntu-linux/
|
||||
[2]: https://itsfoss.com/download-youtube-linux/
|
||||
[3]: https://itsfoss.com/popcorn-time-ubuntu-linux/
|
||||
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/Video-Players-for-Linux.png?ssl=1
|
||||
[5]: https://itsfoss.com/ubuntu-repositories/
|
||||
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/vlc-media-player.jpg?ssl=1
|
||||
[7]: https://www.videolan.org/vlc/
|
||||
[8]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/
|
||||
[9]: https://itsfoss.com/install-latest-vlc/
|
||||
[10]: https://wiki.videolan.org/Debian/#Debian
|
||||
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2015/10/mplayer-video.jpg?ssl=1
|
||||
[12]: http://www.mplayerhq.hu/design7/news.html
|
||||
[13]: https://itsfoss.com/mplayer/
|
||||
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-coco.jpg?ssl=1
|
||||
[15]: https://itsfoss.com/smplayer/
|
||||
[16]: https://www.smplayer.info/en/info
|
||||
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/08/mpv-player-interface.png?ssl=1
|
||||
[18]: https://itsfoss.com/mpv-video-player/
|
||||
[19]: https://mpv.io/
|
||||
[20]: https://mpv.io/installation/
|
||||
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/dragon-player.jpg?ssl=1
|
||||
[22]: https://kde.org/applications/multimedia/org.kde.dragonplayer
|
||||
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/totem-video-player.png?ssl=1
|
||||
[24]: https://wiki.gnome.org/Apps/Videos
|
||||
[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/deepin-movie.jpg?ssl=1
|
||||
[26]: https://www.deepin.org/en/
|
||||
[27]: https://www.deepin.org/en/original/deepin-movie/
|
||||
[28]: https://github.com/linuxdeepin/deepin-movie-reborn
|
||||
[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/xine-multilmedia.jpg?ssl=1
|
||||
[30]: https://www.xine-project.org/home
|
||||
[31]: https://www.xine-project.org/releases
|
||||
[32]: http://www.getmiro.com/
|
@ -0,0 +1,97 @@
|
||||
技术如何改变敏捷的规则
|
||||
======
|
||||
|
||||
![](https://enterprisersproject.com/sites/default/files/styles/620x350/public/images/CIO%20Containers%20Ecosystem.png?itok=lDTaYXzk)
|
||||
|
||||
越来越多的企业正因为一个非常明显的原因开始尝试敏捷和[DevOps][1]: 企业需要通过更快的速度和更多的实验为创新和竞争性提供优势。而DevOps将帮助我们得到所需的创新速度。但是,在小团队或初创企业中实践DevOps与进行大规模实践完全是两码事。我们都明白这样的一个事实,那就是在10人的跨职能团队中能够很好地解决问题的方案,当将相同的模式应用到100人的团队中时就可能无法奏效。这条道路是如此艰难,以至于IT领导者很容易将敏捷方法的推行再推迟一年。
|
||||
|
||||
但那样的时代已经结束了。如果你已经尝试过,但是没有成功,那么现在是时候重新开始了。
|
||||
|
||||
直到现在,DevOps需要为许多组织提供个性化的解决方案,因此往往需要进行大量的调整以及付出额外的工作。但在今天,[Linux容器][2]和Kubernetes正在推动DevOps工具和过程的标准化。而这样的标准化将会加速整个软件开发过程。因此,我们用来实践DevOps工作方式的技术最终能够满足我们加快软件开发速度的愿望。
|
||||
|
||||
Linux容器和[Kubernetes][3]正在改变团队交互的方式。此外,你可以在Kubernetes平台上运行任何能够在Linux运行的应用程序。这意味着什么呢?你可以运行大量的企业及应用程序(甚至可以解决以前令人烦恼的Windows和Linux之间的协调问题)。最后,容器和Kubernetes将能够满足未来所有运行内容的需求。它们正在经受着未来的考验,以应对机器学习、人工智能和分析工作等下一代解决问题工具。
|
||||
|
||||
**[ 参考相关文章,[4 container adoption patterns: What you need to know. ] ][4]**
|
||||
|
||||
让我们以机器学习为例来思考一下。今天,人们可以在大量的企业数据中找到一些模式。当机器发现这些模式时(想想机器学习),你的员工就能更快地采取行动。随着人工智能的加入,机器不仅可以发现模式,还可以对模式进行操作。如今,三个星期已经成为了一个积极的软件开发冲刺周期。有了人工智能,机器每秒可以多次修改代码。创业公司会利用这种能力来“打扰你”。
|
||||
|
||||
考虑一下你需要多快才能参与到竞争当中。如果你对于无法对于DevOps和每周一个迭代周期充满信心,那么考虑一下当那个创业公司将AI驱动的过程指向你时会发生什么?现在是时候转向DevOps的工作方式了,否认就会像你的竞争对手一样被甩在后面。
|
||||
|
||||
### 容器技术如何改变团队的工作?
|
||||
|
||||
DevOps使得许多试图将这种工作方式扩展到更大范围的团队感到沮丧。即使许多IT(和业务)人员之前都听说过敏捷相关的语言、框架、模型(如DevOps)等承诺将会彻底应用程序开发和IT过程的全部相关内容,但他们还是对此持怀疑态度。
|
||||
|
||||
**[ 想要获取来自其他CIO们的建议吗?不放参考下我们的综述性资源, [DevOps: The IT Leader's Guide][5]. ]**
|
||||
|
||||
向你的涉众“推销”快速开发冲刺也不是一件容易的事情。想象一下,如果你以这种方式买了一栋房子:你将不再需要向开发商支付固定的金额,而是会得到这样的信息:“我们将在4周内浇筑完地基,其成本是X,之后再搭建房屋框架和铺设电路,但是我们现在只能够知道地基完成的时间表。”人们已经习惯了买房子的时候有一个预先的价格和交付时间表。
|
||||
|
||||
挑战在于构建软件与构建房屋不同。同一个建筑商往往建造了成千上万个完全相同的房子,而软件项目从来都各不相同。这是你要克服的第一个障碍。
|
||||
|
||||
开发和运维团队的工作方式确实不同,我之所以知道这一点是因为我曾经从事过这两方面的工作。企业往往会用不同的方式来激励他们,开发人员会因为更改和创建而获得奖励,而运维专家则会因降低成本和确保安全性而获得奖励。我们会把他们分成不同的小组,并且尽量减少互动。而这些角色通常会吸引那些思维方式完全不同的技术人员。但是这样的解决方案注定会失败,你必须打破横亘在开发和运维之间的藩篱。
|
||||
|
||||
想想传统情况下会发生什么。业务会把需求扔过墙,这是因为他们在“买房”模式下运作,并且说上一句“我们9个月后见。”开发人员根据这些需求进行开发,并根据技术约束的需要进行更改。然后,他们把它扔过墙传递给运维人员,并说一句“搞清楚如何运行这个软件”。然后,运维人员勤就会奋地进行大量更改,使软件与基础设施保持一致。然而,最终的结果是什么呢?
|
||||
|
||||
通常情况下,当业务人员看到需求实现的最终结果时甚至根本辨认不出。在过去20年的大部分时间里,我们一次又一次地目睹了这种模式在软件行业中上演。而现在,是时候改变了。
|
||||
|
||||
Linux容器能够真正地解决这样的问题,这是因为容器缩小了开发和运维之间的间隙。容器技术允许两个团队共同理解和设计所有的关键需求,但仍然独立地履行各自团队的职责。基本上,我们去掉了开发人员和运维人员之间的电话游戏。
|
||||
|
||||
因为容器技术,我们可以使得运维团队的规模更小,但依旧能够承担起数百万应用程序的运维工作,并且能够使得开发团队可以更加快速地根据需要更改软件。(在较大的组织中,所需的速度可能比运维人员的响应速度更快。)
|
||||
|
||||
使用容器,您可以将所需要交付的内容与它运行的位置分开。你的运维团队只需要负责运行容器的主机和安全的内存占用,仅此而已。这意味着什么呢?
|
||||
|
||||
首先,这意味着你现在可以和团队一起实践DevOps了。没错,只需要让团队专注于他们已经拥有的专业知识,而对于容器,只需让团队了解所需集成依赖关系的必要知识即可。
|
||||
|
||||
如果你想要重新训练每个人,往往会收效甚微。容器技术允许团队之间进行交互,但同时也会为每个团队提供一个围绕该团队优势而构建的强大边界。开发人员会知道需要消耗什么,但不需要知道如何使其大规模运行。运维团队了解核心基础设施,但不需要了解应用程序的细节。此外,运维团队也可以通过更新应用程序来解决新的安全问题,以免你成为下一个数据泄露的热门话题。
|
||||
|
||||
想要为一个大型IT组织,比如30000人的团队教授运维和开发技能?那或许需要花费你十年的时间,而你可能并没有那么多时间。
|
||||
|
||||
当人们谈论“构建新的云原生应用程序将帮助我们摆脱这个问题”时,请批判性地进行思考。你可以在10个人的团队中构建云原生应用程序,但这对《财富》杂志前1000强的企业而言或许并不适用。除非你不再需要依赖现有的团队,否则你无法一个接一个地构建新的微服务:你最终将得到一个竖井式的组织。这是一个诱人的想法,但你不能指望这些应用程序来重新定义你的业务。我还没见过哪家公司能在如此大规模的并行开发中获得成功。IT预算已经受到限制;在很长一段时间内将预算翻倍甚至三倍是不现实的。
|
||||
|
||||
### 当奇迹发生时: 你好, 速度
|
||||
|
||||
Linux容器就是为扩容而生的。一旦你开始这样做,[Kubernetes之类的编制工具就会发挥作用][6],这是因为你将需要运行数千个容器。应用程序将不仅仅由一个容器组成,它们将依赖于许多不同的部分,所有的部分都会作为一个单元运行在容器上。如果不这样做,你的应用程序将无法在生产环境中很好地运行。
|
||||
|
||||
思考一下有多少小滑轮和杠杆组合在一起来支撑你的业务,对于任何应用程序都是如此。开发人员负责应用程序中的所有滑轮和杠杆。(如果开发人员没有这些组件,您可能会在集成时做噩梦。)与此同时,无论是在线下还是在云上,运维团队都会负责构成基础设施的所有滑轮和杠杆。做一个较为抽象的比喻,使用Kubernetes,你的运维团队就可以为应用程序提供运行所需的燃料,但又不必成为所有方面的专家。
|
||||
|
||||
开发人员进行实验,运维团队则保持基础设施的安全和可靠。这样的组合使得企业敢于承担小风险,从而实现创新。不同于打几个孤注一掷的赌,公司中真正的实验往往是循序渐进的和快速的。
|
||||
|
||||
从个人经验来看,这就是组织内部发生的显著变化:因为人们说:“我们如何通过改变计划来真正地利用这种能力进行实验?”它强制执行敏捷计划。
|
||||
|
||||
举个例子,使用DevOps模型、容器和Kubernetes的KeyBank如今每天都会部署代码。(观看视频[7],其中主导了KeyBank持续交付和反馈的John Rzeszotarski将解释这一变化。)类似地,Macquarie银行也借助DevOps和容器技术每天将一些东西投入生产环境。
|
||||
|
||||
一旦你每天都推出软件,它就会改变你计划的每一个方面,并且会[加速业务的变化速度][8]。Macquarie银行和金融服务集团的CDO,Luis Uguina表示:“创意可以在一天内触达客户。”(参见[9]对Red Hat与Macquarie银行合作的案例研究)。
|
||||
|
||||
### 是时候去创造一些伟大的东西了
|
||||
|
||||
Macquarie的例子说明了速度的力量。这将如何改变你的经营方式?记住,Macquarie不是一家初创企业。这是CIO们所面临的颠覆性力量,它不仅来自新的市场进入者,也来自老牌同行。
|
||||
|
||||
开发人员的自由还改变了运营敏捷商店的CIO们的人才方程式。突然之间,大公司里的个体(即使不是在最热门的行业或地区)也可以产生巨大的影响。Macquarie利用这一变动作为招聘工具,并向开发人员承诺,所有新招聘的员工将会在第一周内推出新产品。
|
||||
|
||||
与此同时,在这个基于云的计算和存储能力的时代,我们比以往任何时候都拥有更多可用的基础设施。考虑到[机器学习和人工智能工具将很快实现的飞跃][10],这是幸运的。
|
||||
|
||||
所有这些都说明现在正是打造伟大事业的好时机。考虑到市场创新的速度,你需要不断地创造伟大的东西来保持客户的忠诚度。因此,如果你一直在等待将赌注押在DevOps上,那么现在就是正确的时机。容器技术和Kubernetes改变了规则,并且对你有利。
|
||||
|
||||
**想要获取更多这样的智慧吗, IT领导者? [订阅每周邮件][11].**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://enterprisersproject.com/article/2018/1/how-technology-changes-rules-doing-agile
|
||||
|
||||
作者:[Matt Hicks][a]
|
||||
译者:[JayFrank](https://github.com/JayFrank)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://enterprisersproject.com/user/matt-hicks
|
||||
[1]:https://enterprisersproject.com/tags/devops
|
||||
[2]:https://www.redhat.com/en/topics/containers?intcmp=701f2000000tjyaAAA
|
||||
[3]:https://www.redhat.com/en/topics/containers/what-is-kubernetes?intcmp=701f2000000tjyaAAA
|
||||
[4]:https://enterprisersproject.com/article/2017/8/4-container-adoption-patterns-what-you-need-know?sc_cid=70160000000h0aXAAQ
|
||||
[5]:https://enterprisersproject.com/devops?sc_cid=70160000000h0aXAAQ
|
||||
[6]:https://enterprisersproject.com/article/2017/11/how-enterprise-it-uses-kubernetes-tame-container-complexity
|
||||
[7]:https://www.redhat.com/en/about/videos/john-rzeszotarski-keybank-red-hat-summit-2017?intcmp=701f2000000tjyaAAA
|
||||
[8]:https://enterprisersproject.com/article/2017/11/dear-cios-stop-beating-yourselves-being-behind-transformation
|
||||
[9]:https://www.redhat.com/en/resources/macquarie-bank-case-study?intcmp=701f2000000tjyaAAA
|
||||
[10]:https://enterprisersproject.com/article/2018/1/4-ai-trends-watch
|
||||
[11]:https://enterprisersproject.com/email-newsletter?intcmp=701f2000000tsjPAAQ
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
@ -7,16 +7,16 @@
|
||||
[#]: via: (https://www.networkworld.com/article/3330497/linux/linux-commands-for-measuring-disk-activity.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
Linux commands for measuring disk activity
|
||||
用于测量磁盘活动的 Linux 命令
|
||||
======
|
||||
![](https://images.idgesg.net/images/article/2018/12/tape-measure-100782593-large.jpg)
|
||||
Linux systems provide a handy suite of commands for helping you see how busy your disks are, not just how full. In this post, we examine five very useful commands for looking into disk activity. Two of the commands (iostat and ioping) may have to be added to your system, and these same two commands require you to use sudo privileges, but all five commands provide useful ways to view disk activity.
|
||||
Linux 系统提供了一套方便的命令,帮助您查看磁盘有多忙,而不仅仅是磁盘有多满。在本文中,我们将研究五个非常有用的命令,用于查看磁盘活动。其中两个命令(iostat 和 ioping)可能必须添加到您的系统中,这两个相同的命令要求您使用 sudo 特权,但是这五个命令都提供了查看磁盘活动的有用方法。
|
||||
|
||||
Probably one of the easiest and most obvious of these commands is **dstat**.
|
||||
这些命令中最简单、最明显的一个可能是 **dstat** 了。
|
||||
|
||||
### dtstat
|
||||
|
||||
In spite of the fact that the **dstat** command begins with the letter "d", it provides stats on a lot more than just disk activity. If you want to view just disk activity, you can use the **-d** option. As shown below, you’ll get a continuous list of disk read/write measurements until you stop the display with a ^c. Note that after the first report, each subsequent row in the display will report disk activity in the following time interval, and the default is only one second.
|
||||
尽管 **dstat** 命令以字母 "d" 开头,但它提供的统计信息远远不止磁盘活动。如果您只想查看磁盘活动,可以使用 **-d** 选项。如下所示,您将得到一个磁盘读/写测量值的连续列表,直到使用 a ^c 停止显示为止。注意,在第一个报告之后,显示中的每个后续行将在接下来的时间间隔内报告磁盘活动,缺省值仅为一秒。
|
||||
|
||||
```
|
||||
$ dstat -d
|
||||
@ -29,7 +29,7 @@ $ dstat -d
|
||||
0 0 ^C
|
||||
```
|
||||
|
||||
Including a number after the -d option will set the interval to that number of seconds.
|
||||
在 -d 选项后面包含一个数字将把间隔设置为其秒数。
|
||||
|
||||
```
|
||||
$ dstat -d 10
|
||||
@ -41,9 +41,9 @@ $ dstat -d 10
|
||||
0 9011B ^C
|
||||
```
|
||||
|
||||
Notice that the reported data may be shown in a number of different units — e.g., M (megabytes), k (kilobytes), and B (bytes).
|
||||
请注意,报告的数据可能以许多不同的单位显示——例如,M (megabytes), k (kilobytes), and B (bytes).
|
||||
|
||||
Without options, the dstat command is going to show you a lot of other information as well — indicating how the CPU is spending its time, displaying network and paging activity, and reporting on interrupts and context switches.
|
||||
如果没有选项,dstat 命令还将显示许多其他信息——指示 CPU 如何使用时间、显示网络和分页活动、报告中断和上下文切换。
|
||||
|
||||
```
|
||||
$ dstat
|
||||
@ -55,11 +55,11 @@ usr sys idl wai stl| read writ| recv send| in out | int csw
|
||||
0 1 99 0 0| 0 16k| 64B 468B| 0 0 | 64 81 ^C
|
||||
```
|
||||
|
||||
The dstat command provides valuable insights into overall Linux system performance, pretty much replacing a collection of older tools, such as vmstat, netstat, iostat, and ifstat, with a flexible and powerful command that combines their features. For more insight into the other information that the dstat command can provide, refer to this post on the [dstat][1] command.
|
||||
dstat 命令提供了关于整个 Linux 系统性能的有价值的见解,几乎可以用它灵活而功能强大的命令来代替 vmstat,netstat,iostat 和 ifstat 等较旧的工具集合,该命令结合了这些旧工具的功能。要深入了解 dstat 命令可以提供的其它信息,请参阅这篇关于 [dstat][1] 命令的文章。
|
||||
|
||||
### iostat
|
||||
|
||||
The iostat command helps monitor system input/output device loading by observing the time the devices are active in relation to their average transfer rates. It's sometimes used to evaluate the balance of activity between disks.
|
||||
iostat 命令通过观察设备活动的时间与其平均传输速率之间的关系,帮助监视系统输入/输出设备的加载情况。它有时用于评估磁盘之间的活动平衡。
|
||||
|
||||
```
|
||||
$ iostat
|
||||
@ -90,7 +90,7 @@ loop15 0.01 0.01 0.00 20026 0
|
||||
loop16 0.00 0.00 0.00 24 0
|
||||
```
|
||||
|
||||
Of course, all the stats provided on Linux loop devices can clutter the display when you want to focus solely on your disks. The command, however, does provide the **-p** option, which allows you to just look at your disks — as shown in the commands below.
|
||||
当然,当您只想关注磁盘时,Linux loop 设备上提供的所有统计信息都会使结果显得杂乱无章。但是,该命令也确实提供了 **-p** 选项,该选项使您可以仅查看磁盘——如以下命令所示。
|
||||
|
||||
```
|
||||
$ iostat -p sda
|
||||
@ -104,9 +104,9 @@ sda 1.06 0.89 72.54 2843737 232815784
|
||||
sda1 1.04 0.88 72.54 2821733 232815784
|
||||
```
|
||||
|
||||
Note that **tps** refers to transfers per second.
|
||||
请注意 **tps** 是指每秒的传输量。
|
||||
|
||||
You can also get iostat to provide repeated reports. In the example below, we're getting measurements every five seconds by using the **-d** option.
|
||||
您还可以让 iostat 提供重复的报告。在下面的示例中,我们使用 **-d** 选项每五秒钟进行一次测量。
|
||||
|
||||
```
|
||||
$ iostat -p sda -d 5
|
||||
@ -121,7 +121,7 @@ sda 0.80 0.00 11.20 0 56
|
||||
sda1 0.80 0.00 11.20 0 56
|
||||
```
|
||||
|
||||
If you prefer to omit the first (stats since boot) report, add a **-y** to your command.
|
||||
如果您希望省略第一个(自启动以来的统计信息)报告,请在命令中添加 **-y**。
|
||||
|
||||
```
|
||||
$ iostat -p sda -d 5 -y
|
||||
@ -132,7 +132,7 @@ sda 0.80 0.00 11.20 0 56
|
||||
sda1 0.80 0.00 11.20 0 56
|
||||
```
|
||||
|
||||
Next, we look at our second disk drive.
|
||||
接下来,我们看第二个磁盘驱动器。
|
||||
|
||||
```
|
||||
$ iostat -p sdb
|
||||
@ -149,7 +149,7 @@ sdb1 0.00 0.01 0.00 35344 0
|
||||
|
||||
### iotop
|
||||
|
||||
The **iotop** command is top-like utility for looking at disk I/O. It gathers I/O usage information provided by the Linux kernel so that you can get an idea which processes are most demanding in terms in disk I/O. In the example below, the loop time has been set to 5 seconds. The display will update itself, overwriting the previous output.
|
||||
**iotop** 命令是类似 top 的实用程序,用于查看磁盘 I/O。它收集 Linux 内核提供的 I/O 使用信息,以便您了解哪些进程在磁盘 I/O 方面的要求最高。在下面的示例中,循环时间被设置为5秒。显示将自动更新,覆盖前面的输出。
|
||||
|
||||
```
|
||||
$ sudo iotop -d 5
|
||||
@ -167,7 +167,7 @@ Current DISK READ: 0.00 B/s | Current DISK WRITE: 12.39 K/s
|
||||
|
||||
### ioping
|
||||
|
||||
The **ioping** command is an altogether different type of tool, but it can report disk latency — how long it takes a disk to respond to requests — and can be helpful in diagnosing disk problems.
|
||||
**ioping** 命令是一种完全不同的工具,但是它可以报告磁盘延迟——也就是磁盘响应请求需要多长时间,而这有助于诊断磁盘问题。
|
||||
|
||||
```
|
||||
$ sudo ioping /dev/sda1
|
||||
@ -184,7 +184,7 @@ min/avg/max/mdev = 831.0 us / 947.9 us / 1.17 ms / 158.0 us
|
||||
|
||||
### atop
|
||||
|
||||
The **atop** command, like **top** provides a lot of information on system performance, including some stats on disk activity.
|
||||
**atop** 命令,像 **top** 一样提供了大量有关系统性能的信息,包括有关磁盘活动的一些统计信息。
|
||||
|
||||
```
|
||||
ATOP - butterfly 2018/12/26 17:24:19 37d3h13m------ 10ed
|
||||
@ -212,7 +212,7 @@ NET | enp0s25 0% | pcki 10 | pcko 8 | si 1 Kbps | so 3 Kbp0.73 ms |
|
||||
3362 0.00s 0.00s 0K 0K NE 0 0 E - 0% <sleep>
|
||||
```
|
||||
|
||||
If you want to look at _just_ the disk stats, you can easily manage that with a command like this:
|
||||
如果您 _只_ 想查看磁盘统计信息,则可以使用以下命令轻松进行管理:
|
||||
|
||||
```
|
||||
$ atop | grep DSK
|
||||
@ -228,11 +228,11 @@ DSK | sda | busy 2% | read 0 | write 92 | avio 2.43 ms |
|
||||
^C
|
||||
```
|
||||
|
||||
### Being in the know with disk I/O
|
||||
### 了解磁盘 I/O
|
||||
|
||||
Linux provides enough commands to give you good insights into how hard your disks are working and help you focus on potential problems or slowdowns. Hopefully, one of these commands will tell you just what you need to know when it's time to question disk performance. Occasional use of these commands will help ensure that especially busy or slow disks will be obvious when you need to check them.
|
||||
Linux 提供了足够的命令,可以让您很好地了解磁盘的工作强度,并帮助您关注潜在的问题或慢速。希望这些命令中的一个可以告诉您何时需要质疑磁盘性能。偶尔使用这些命令将有助于确保当您需要检查磁盘,特别是忙碌或缓慢的磁盘时可以显而易见地发现它们。
|
||||
|
||||
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
|
||||
加入 [Facebook][2] 和 [LinkedIn][3] 上的 Network World 社区,对最重要的话题发表评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -240,7 +240,7 @@ via: https://www.networkworld.com/article/3330497/linux/linux-commands-for-measu
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[laingke](https://github.com/laingke)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
@ -1,235 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (laingke)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Create an online store with this Java-based framework)
|
||||
[#]: via: (https://opensource.com/article/19/1/scipio-erp)
|
||||
[#]: author: (Paul Piper https://opensource.com/users/madppiper)
|
||||
|
||||
使用这个 Java 框架创建一个在线商店
|
||||
======
|
||||
Scipio ERP 具有广泛的应用程序和功能。
|
||||
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_whitehurst_money.png?itok=ls-SOzM0)
|
||||
|
||||
所以,你想在网上销售产品或服务,但要么找不到合适的软件,要么认为定制成本太高? [Scipio ERP][1] 也许正是你想要的。
|
||||
|
||||
Scipio ERP 是一个基于 Java 的开放源码电子商务框架,具有广泛的应用程序和功能。这个项目在 2014 年从 [Apache OFBiz][2] fork 而来,侧重于更好的定制和更现代的吸引力。这个电子商务组件应用非常广泛,可以在多商店安装中工作,同时完成国际化,并具有广泛的产品配置,而且它还兼容现代 HTML 框架。该软件还为许多其他业务案例提供标准应用程序,例如会计,仓库管理或销售人员自动化。它都是高度标准化的,因此易于定制,如果您想要的不仅仅是一个虚拟购物车,这是非常棒的。
|
||||
|
||||
该系统也使得跟上现代 web 标准变得非常容易。所有界面都是使用系统的“[模板工具包][3]”构建的,这是一个易于学习的宏集,可以将 HTML 与所有应用程序分开。正因为如此,每个应用程序都已经标准化到核心。听起来令人困惑?它真的不是——它看起来很像 HTML,但你写的内容少了很多。
|
||||
|
||||
### 初始安装
|
||||
|
||||
在您开始之前,请确保您已经安装了 Java 1.8(或更高版本)的 SDK 以及一个 Git 客户端。完成了?太棒了!接下来,切换到 Github 上的主分支:
|
||||
|
||||
```
|
||||
git clone https://github.com/ilscipio/scipio-erp.git
|
||||
cd scipio-erp
|
||||
git checkout master
|
||||
```
|
||||
|
||||
要安装系统,只需要运行 **./install.sh** 并从命令行中选择任一选项。在开发过程中,最好一直使用 **installation for development** (选项 1),它还将安装一系列演示数据。对于专业安装,您可以修改初始配置数据(“种子数据”),以便自动为您设置公司和目录数据。默认情况下,系统将使用内部数据库运行,但是它[也可以配置][4]使用各种关系数据库,比如 PostgreSQL 和 MariaDB 等。
|
||||
|
||||
![安装向导][6]
|
||||
|
||||
按照安装向导完成初始配置,
|
||||
|
||||
通过命令 **./start.sh** 启动系统然后打开链接 **<https://localhost:8443/setup/>** 完成配置。如果您安装了演示数据, 您可以使用用户名 **admin** 和密码 **scipio** 进行登录。在安装向导中,您可以设置公司简介、会计、仓库、产品目录、在线商店和额外的用户配置信息。暂时在产品商店配置界面上跳过网站实体的配置。系统允许您使用不同的底层代码运行多个在线商店;除非您想这样做,一直选择默认值是最简单的。
|
||||
|
||||
祝贺您,您刚刚安装了 Scipio ERP!在界面上操作一两分钟,感受一下它的功能。
|
||||
|
||||
### 捷径
|
||||
|
||||
在您进入自定义之前,这里有一些方便的命令可以帮助您:
|
||||
|
||||
* 创建一个 shop-override:**./ant create-component-shop-override**
|
||||
* 创建一个新组件:**./ant create-component**
|
||||
* 创建一个新主题组件:**./ant create-theme**
|
||||
* 创建管理员用户:**./ant create-admin-user-login**
|
||||
* 各种其他实用功能:**./ant -p**
|
||||
* 用于安装和更新插件的实用程序:**./git-addons help**
|
||||
|
||||
|
||||
|
||||
另外,请记下以下位置:
|
||||
|
||||
* 将 Scipio 作为服务运行的脚本:**/tools/scripts/**
|
||||
* 日志输出目录:**/runtime/logs**
|
||||
* 管理应用程序:**<https://localhost:8443/admin/>**
|
||||
* 电子商务应用程序:**<https://localhost:8443/shop/>**
|
||||
|
||||
|
||||
|
||||
最后,Scipio ERP 在以下五个主要目录中构建了所有代码:
|
||||
|
||||
* Framework: 框架相关的源,应用程序服务器,通用界面和配置
|
||||
* Applications: 核心应用程序
|
||||
* Addons: 第三方扩展
|
||||
* Themes: 修改界面外观
|
||||
* Hot-deploy: 您自己的组件
|
||||
|
||||
|
||||
|
||||
除了一些配置,您将在 hot-deploy 和 themes 目录中工作。
|
||||
|
||||
### 在线商店定制
|
||||
|
||||
要真正使系统成为您自己的系统,请开始考虑使用[组件][7]。组件是一种模块化方法,可以覆盖,扩展和添加到系统中。您可以将组件视为可以捕获有关数据库([实体][8]),功能([服务][9]),界面([视图][10]),[事件和操作][11]和 Web 应用程序信息的独立 Web 模块。由于组件功能,您可以添加自己的代码,同时保持与原始源兼容。
|
||||
|
||||
运行命令 **./ant create-component-shop-override** 并按照步骤创建您的在线商店组件。该操作将会在 hot-deploy 目录内创建一个新目录,该目录将扩展并覆盖原始的电子商务应用程序。
|
||||
|
||||
![组件目录结构][13]
|
||||
|
||||
一个典型的组件目录结构。
|
||||
|
||||
您的组件将具有以下目录结构:
|
||||
|
||||
* config: 配置
|
||||
* data: 种子数据
|
||||
* entitydef: 数据库表定义
|
||||
* script: Groovy 脚本的位置
|
||||
* servicedef: 服务定义
|
||||
* src: Java 类
|
||||
* webapp: 您的 web 应用程序
|
||||
* widget: 界面定义
|
||||
|
||||
|
||||
|
||||
此外,**ivy.xml** 文件允许您将 Maven 库添加到构建过程中,**ofbiz-component.xml** 文件定义整个组件和 Web 应用程序结构。除了一些在当前目录所能够看到的,您还可以在 Web 应用程序的 **WEB-INF** 目录中找到 **controller.xml** 文件。这允许您定义请求实体并将它们连接到事件和界面。仅对于界面来说,您还可以使用内置的 CMS 功能,但优先要坚持使用核心机制。在引入更改之前,请熟悉**/applications/shop/**。
|
||||
|
||||
#### 添加自定义界面
|
||||
|
||||
还记得[模板工具包][3]吗?您会发现它在每个界面都有使用到。您可以将其视为一组易于学习的宏,它用来构建所有内容。下面是一个例子:
|
||||
|
||||
```
|
||||
<@section title="Title">
|
||||
<@heading id="slider">Slider</@heading>
|
||||
<@row>
|
||||
<@cell columns=6>
|
||||
<@slider id="" class="" controls=true indicator=true>
|
||||
<@slide link="#" image="https://placehold.it/800x300">Just some content…</@slide>
|
||||
<@slide title="This is a title" link="#" image="https://placehold.it/800x300"></@slide>
|
||||
</@slider>
|
||||
</@cell>
|
||||
<@cell columns=6>Second column</@cell>
|
||||
</@row>
|
||||
</@section>
|
||||
```
|
||||
|
||||
不是很难,对吧?同时,主题包含 HTML 定义和样式。这将权力交给您的前端开发人员,他们可以定义每个宏的输出,并坚持使用自己的构建工具进行开发。
|
||||
|
||||
我们快点试试吧。首先,在您自己的在线商店上定义一个请求。您将修改此代码。一个内置的 CMS 系统也可以通过 **<https://localhost:8443/cms/>** 进行访问,它允许您以更有效的方式创建新模板和界面。它与模板工具包完全兼容,并附带可根据您的喜好采用的示例模板。但是既然我们试图在这里理解系统,那么首先让我们采用更复杂的方法。
|
||||
|
||||
打开您商店 webapp 目录中的 **[controller.xml][14]** 文件。Controller 跟踪请求事件并相应地执行操作。下面的操作将会在 **/shop/test** 下创建一个新的请求:
|
||||
|
||||
```
|
||||
<!-- Request Mappings -->
|
||||
<request-map uri="test">
|
||||
<security https="true" auth="false"/>
|
||||
<response name="success" type="view" value="test"/>
|
||||
</request-map>
|
||||
```
|
||||
|
||||
您可以定义多个响应,如果需要,可以在请求中使用事件或服务调用来确定您可能要使用的响应。我选择了“视图”类型的响应。视图是渲染的响应; 其他类型是请求重定向,转发等。系统附带各种渲染器,可让您稍后确定输出; 为此,请添加以下内容:
|
||||
|
||||
```
|
||||
<!-- View Mappings -->
|
||||
<view-map name="test" type="screen" page="component://mycomponent/widget/CommonScreens.xml#test"/>
|
||||
```
|
||||
|
||||
用您自己的组件名称替换 **my-component**。然后,您可以通过在 **widget/CommonScreens.xml** 文件的标签内添加以下内容来定义您的第一个界面:
|
||||
|
||||
```
|
||||
<screen name="test">
|
||||
<section>
|
||||
<actions>
|
||||
</actions>
|
||||
<widgets>
|
||||
<decorator-screen name="CommonShopAppDecorator" location="component://shop/widget/CommonScreens.xml">
|
||||
<decorator-section name="body">
|
||||
<platform-specific><html><html-template location="component://mycomponent/webapp/mycomponent/test/test.ftl"/></html></platform-specific>
|
||||
</decorator-section>
|
||||
</decorator-screen>
|
||||
</widgets>
|
||||
</section>
|
||||
</screen>
|
||||
```
|
||||
|
||||
商店界面实际上非常模块化,由多个元素组成([小部件,动作和装饰器][15])。为简单起见,请暂时保留原样,并通过添加第一个模板工具包文件来完成新网页。为此,创建一个新的 **webapp/mycomponent/test/test.ftl** 文件并添加以下内容:
|
||||
|
||||
```
|
||||
<@alert type="info">Success!</@alert>
|
||||
```
|
||||
|
||||
![自定义的界面][17]
|
||||
|
||||
一个自定义的界面。
|
||||
|
||||
打开 **<https://localhost:8443/shop/control/test/>** 并惊叹于你自己的成就。
|
||||
|
||||
#### 自定义主题
|
||||
|
||||
通过创建自己的主题来修改商店的界面外观。所有主题都可以作为组件在themes文件夹中找到。运行命令 **./ant create-theme** 来创建您自己的主题。
|
||||
|
||||
![主题组件布局][19]
|
||||
|
||||
一个典型的主题组件布局。
|
||||
|
||||
以下是最重要的目录和文件列表:
|
||||
|
||||
* 主题配置:**data/\*ThemeData.xml**
|
||||
* 特定主题封装的HTML:**includes/\*.ftl**
|
||||
* 模板工具包HTML定义:**includes/themeTemplate.ftl**
|
||||
* CSS 类定义:**includes/themeStyles.ftl**
|
||||
* CSS 框架: **webapp/theme-title/**
|
||||
|
||||
|
||||
|
||||
快速浏览工具包中的 Metro 主题;它使用 Foundation CSS 框架并且充分利用了这个框架。然后,然后,在新构建的 **webapp/theme-title** 目录中设置自己的主题并开始开发。Foundation-shop 主题是一个非常简单的特定于商店的主题实现,您可以将其用作您自己工作的基础。
|
||||
|
||||
瞧!您已经建立了自己的在线商店,准备个性化定制吧!
|
||||
|
||||
![搭建完成的 Scipio ERP 在线商店][21]
|
||||
|
||||
一个搭建完成的基于 Scipio ERP的在线商店。
|
||||
|
||||
### 接下来是什么?
|
||||
|
||||
Scipio ERP 是一个功能强大的框架,可简化复杂的电子商务应用程序的开发。为了更完整的理解,请查看项目[文档][7],尝试[在线演示][22],或者[加入社区][23].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/1/scipio-erp
|
||||
|
||||
作者:[Paul Piper][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[laingke](https://github.com/laingke)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/madppiper
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.scipioerp.com
|
||||
[2]: https://ofbiz.apache.org/
|
||||
[3]: https://www.scipioerp.com/community/developer/freemarker-macros/
|
||||
[4]: https://www.scipioerp.com/community/developer/installation-configuration/configuration/#database-configuration
|
||||
[5]: /file/419711
|
||||
[6]: https://opensource.com/sites/default/files/uploads/setup_step5_sm.jpg (Setup wizard)
|
||||
[7]: https://www.scipioerp.com/community/developer/architecture/components/
|
||||
[8]: https://www.scipioerp.com/community/developer/entities/
|
||||
[9]: https://www.scipioerp.com/community/developer/services/
|
||||
[10]: https://www.scipioerp.com/community/developer/views-requests/
|
||||
[11]: https://www.scipioerp.com/community/developer/events-actions/
|
||||
[12]: /file/419716
|
||||
[13]: https://opensource.com/sites/default/files/uploads/component_structure.jpg (component directory structure)
|
||||
[14]: https://www.scipioerp.com/community/developer/views-requests/request-controller/
|
||||
[15]: https://www.scipioerp.com/community/developer/views-requests/screen-widgets-decorators/
|
||||
[16]: /file/419721
|
||||
[17]: https://opensource.com/sites/default/files/uploads/success_screen_sm.jpg (Custom screen)
|
||||
[18]: /file/419726
|
||||
[19]: https://opensource.com/sites/default/files/uploads/theme_structure.jpg (theme component layout)
|
||||
[20]: /file/419731
|
||||
[21]: https://opensource.com/sites/default/files/uploads/finished_shop_1_sm.jpg (Finished Scipio ERP shop)
|
||||
[22]: https://www.scipioerp.com/demo/
|
||||
[23]: https://forum.scipioerp.com/
|
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (wxy)
|
||||
[#]: 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/)
|
||||
|
||||
区块链 2.0 :以太坊(九)
|
||||
======
|
||||
|
||||
![Ethereum][1]
|
||||
|
||||
在本系列的上一指南中,我们讨论了 [Hyperledger 项目(HLP)][2],这是一个由 Linux 基金会开发的增长最快的产品。在本指南中,我们将详细讨论什么是“<ruby>以太坊<rt>Ethereum</rt></ruby>”及其功能。许多研究人员认为,互联网的未来将基于<ruby>去中心化计算<rt>decentralized computing</rt></ruby>的原理。实际上,去中心化计算是互联网放在首位的更广泛目标之一。但是,由于可用的计算能力不同,互联网发生了另一次变化。尽管现代服务器功能使服务器端处理和执行成为可能,但在世界上大部分地区缺乏像样的移动网络使客户端也是如此。现在,现代智能手机具有 SoC(片上系统),在客户端本身上也能够处理许多此类操作,但是,由于安全地检索和存储数据而受到的限制仍然迫使开发人员进行服务器端计算和数据管理。因此,当前可以观察到数据传输能力的瓶颈。
|
||||
|
||||
由于分布式数据存储和程序执行平台的进步,所有这些可能很快就会改变。[区块链][3]允许在分布式用户网络(而不是中央服务器)上进行安全的数据管理和程序执行,这在互联网历史上基本上是第一次。
|
||||
|
||||
以太坊就是一个这样的区块链平台,使开发人员可以访问用于在这样的去中心化网络上构建和运行应用程序的框架和工具。尽管它以其加密货币而广为人知,以太坊不只是<ruby>以太币<rt>ether</rt></ruby>(加密货币)。这是一种完整的<ruby>图灵完备<rt>Turing complete</rt></ruby>编程语言,旨在开发和部署 DApp(即<ruby>分布式应用<rt>Distributed APPlication</rt></ruby>) [^1]。我们会在接下来的一篇文章中详细介绍 DApp。
|
||||
|
||||
以太坊是开源的,默认情况下是一个公共(非许可)区块链,并具有一个大范围的智能合约平台底层(Solidity)。以太坊提供了一个称为“以太坊虚拟机(EVM)”的虚拟计算环境,以运行应用程序和[智能合约][4] [^2]。 以太坊虚拟机在世界各地成千上万个参与节点上运行,这意味着应用程序数据在保证安全的同时,几乎不可能被篡改或丢失。
|
||||
|
||||
### 以太坊的背后:什么使之不同
|
||||
|
||||
在 2017 年,为了推广以太坊区块链的功能的利用,30 多个技术和金融领域的名人聚集在一起。因此,“<ruby>以太坊企业联盟<rt>Ethereum Enterprise Alliance</rt></ruby>”(EEA)由众多支持成员组成,包括微软、摩根大通、思科、德勤和埃森哲。摩根大通已经拥有 Quorum,这是一个基于以太坊的去中心化金融服务计算平台,目前正在运营中;而微软拥有通过其 Azure 云业务销售的基于以太坊的云服务[^3]。
|
||||
|
||||
### 什么是以太币,它和以太坊有什么关系
|
||||
|
||||
以太坊的创建者<ruby>维塔利克·布特林<rt>Vitalik Buterin</rt></ruby>深谙去中心化处理平台的真正价值以及为比特币提供动力的底层区块链技术。他提议比特币应该开发以支持运行分布式应用程序(DApp)和程序(现在称为智能合约)的想法,未能获得多数同意。
|
||||
|
||||
因此,他在 2013 年发表的白皮书中提出了以太坊的想法。原始白皮书仍在维护中,读者可从[此处][5]获得。这个想法是开发一个基于区块链的平台来运行智能合约和应用程序,这些合约和应用程序设计为在节点和用户设备而非服务器上运行。
|
||||
|
||||
以太坊系统经常被误认为就是加密货币以太币,但是,必须重申,以太坊是一个用于开发和执行应用程序的全栈平台,自成立以来一直如此,而比特币并非如此。**以太网目前是按市值计算的第二大加密货币**,在撰写本文时,其平均交易价格为每个以太币 170 美元 [^4]。
|
||||
|
||||
### 该平台的功能和技术特性 [^5]
|
||||
|
||||
* 正如我们已经提到的,称为以太币的加密货币只是该平台功能之一。该系统的目的不仅仅是处理金融交易。 实际上,以太坊平台和比特币之间的主要区别在于它们的脚本功能。以太坊是以图灵完备的编程语言开发的,这意味着它具有类似于其他主要编程语言的脚本和应用程序功能。开发人员需要此功能才能在平台上创建 DApp 和复杂的智能合约,而该功能是比特币缺失的。
|
||||
* 以太币的“挖矿”过程更加严格和复杂。尽管可以使用专用的 ASIC 来开采比特币,但以太坊使用的基本哈希算法(EThash)降低了 ASIC 在这方面的优势。
|
||||
* 为激励矿工和节点运营者运行网络而支付的交易费用本身是使用称为 “<ruby>燃料<rt>Gas</rt></ruby>”的计算令牌来计算的。通过要求交易的发起者支付与执行交易所需的计算资源数量成比例的以太币,燃料提高了系统的弹性以及对外部黑客和攻击的抵抗力。这与其他平台(例如比特币)相反,在该平台上,交易费用与交易规模一并衡量。因此,以太坊的平均交易成本从根本上低于比特币。这也意味着在以太坊虚拟机上运行的应用程序需要付费,具体取决于应用程序要解决的计算问题。基本上,执行越复杂,费用就越高。
|
||||
* 以太坊的出块时间估计约为 10 - 15 秒。出块时间是在区块链网络上打时间戳和创建区块所需的平均时间。与将在比特币网络上进行同样的交易要花费 10 分钟以上的时间相比,很明显,就交易和区块验证而言,以太坊要快得多。
|
||||
* *有趣的是,对可开采的以太币数量或开采速度没有硬性限制,这导致其系统设计不像比特币那么激进*。
|
||||
|
||||
### 总结
|
||||
|
||||
尽管与以太坊相比,它远远超过了类似的平台,但在以太坊企业联盟开始推动之前,该平台本身尚缺乏明确的发展道路。虽然以太坊平台确实推动了企业发展,但必须注意,以太坊还可以满足小型开发商和个人的需求。 这样一来,为最终用户和企业开发的平台就为以太坊遗漏了许多特定功能。另外,以太坊基金会提出和开发的区块链模型是一种公共模型,而 Hyperledger 项目等项目提出的模型是私有的和需要许可的。
|
||||
|
||||
虽然只有时间才能证明以太坊、Hyperledger 和 R3 Corda 等平台中,哪一个平台会在现实场景中找到最多粉丝,但此类系统确实证明了以区块链为动力的未来主张的正确性。
|
||||
|
||||
[^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]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
校对:[校对者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
|
@ -0,0 +1,96 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to freeze and lock your Linux system (and why you would want to))
|
||||
[#]: via: (https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
如何冻结和锁定你的 Linux 系统(以及为何你会希望做)
|
||||
======
|
||||
冻结终端窗口并锁定屏幕意味着什么 - 以及如何在 Linux 系统上管理这些活动。
|
||||
|
||||
如何在 Linux 系统上冻结和“解冻”屏幕,很大程度上取决于这些术语的含义。有时“冻结屏幕”可能意味着冻结终端窗口,以便该窗口内的活动停止。有时它意味着锁定屏幕,这样就没人可以在你去拿一杯咖啡时,走到你的系统旁边代替你输入命令了。
|
||||
|
||||
在这篇文章中,我们将研究如何使用和控制这些操作。
|
||||
|
||||
### 如何在 Linux 上冻结终端窗口
|
||||
|
||||
你可以输入 **Ctrl+S**(按住 Ctrl 键和 “s” 键)冻结 Linux 系统上的终端窗口。把 “s” 想象成“开始冻结” (start the freeze)。如果在此操作后继续输入命令,那么你不会看到输入的命令或你希望看到的输出。实际上,命令将堆积在一个队列中,并且只有在通过输入 **Ctrl+Q** 解冻时才会运行。把它想象成“退出冻结” (quit the freeze)。
|
||||
|
||||
查看其工作的一种简单方式是使用 date 命令,然后输入 **Ctrl+S**。接着再次输入 date 命令并等待几分钟后再次输入 **Ctrl+Q**。你会看到这样的情景:
|
||||
|
||||
```
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:47:34 PM EDT
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:49:49 PM EDT
|
||||
```
|
||||
|
||||
这两次时间显示的差距表示第二次的 date 命令直到你解冻窗口时才运行。
|
||||
|
||||
无论你是坐在计算机屏幕前还是使用 PuTTY 等工具远程运行,终端窗口都可以冻结和解冻。
|
||||
|
||||
这有一个可以派上用场的小技巧。如果你发现终端窗口似乎处于非活动状态,那么可能是你或其他人无意中输入了 **Ctrl+S**。无论如何,输入 **Ctrl+Q** 来尝试解决不妨是个不错的办法。
|
||||
|
||||
### 如何锁定屏幕
|
||||
|
||||
要在离开办公桌前锁定屏幕,请按住 **Ctrl+Alt+L** 或 **Super+L**(即按住 Windows 键和 L 键)。屏幕锁定后,你必须输入密码才能重新登录。
|
||||
|
||||
### Linux 系统上的自动屏幕锁定
|
||||
|
||||
虽然最佳做法建议你在即将离开办公桌时锁定屏幕,但 Linux 系统通常会在一段时间没有活动后自动锁定。 “消隐”屏幕(使其变暗)并实际锁定屏幕(需要登录才能再次使用)的时间取决于你个人首选项中的设置。
|
||||
|
||||
要更改使用 GNOME 屏幕保护程序时屏幕变暗所需的时间,请打开设置窗口并选择 **Power** 然后 **Blank screen**。你可以选择 1 到 15 分钟或从不变暗。要选择屏幕变暗后锁定所需时间,请进入设置,选择 **Privacy**,然后选择**Blank screen**。设置应包括 1、2、3、5 和 30 分钟或一小时。
|
||||
|
||||
### 如何在命令行锁定屏幕
|
||||
|
||||
如果你使用的是 Gnome 屏幕保护程序,你还可以使用以下命令从命令行锁定屏幕:
|
||||
|
||||
```
|
||||
gnome-screensaver-command -l
|
||||
```
|
||||
|
||||
这里是小写的 L,代表“锁定”。
|
||||
|
||||
### 如何检查锁屏状态
|
||||
|
||||
你还可以使用 gnome-screensaver 命令检查屏幕是否已锁定。使用 **\--query** 选项,该命令会告诉你屏幕当前是否已锁定(即处于活动状态)。使用 --time 选项,它会告诉你锁定生效的时间。这是一个示例脚本:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
gnome-screensaver-command --query
|
||||
gnome-screensaver-command --time
|
||||
```
|
||||
|
||||
运行脚本将会输出:
|
||||
|
||||
```
|
||||
$ ./check_lockscreen
|
||||
The screensaver is active
|
||||
The screensaver has been active for 1013 seconds.
|
||||
```
|
||||
|
||||
#### 总结
|
||||
|
||||
如果你记住了正确的控制方式,那么锁定终端窗口是很简单的。对于屏幕锁定,它的效果取决于你自己的设置,或者你是否习惯使用默认设置。
|
||||
|
||||
在 [Facebook][3] 和 [LinkedIn][4] 上加入 Network World 社区,来评论最新主题。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,142 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (arrowfeng)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Remove (Delete) Symbolic Links in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
在 Linux 中怎样移除(删除)符号链接
|
||||
======
|
||||
|
||||
你可能有时需要在 Linux 上创建或者删除符号链接。
|
||||
|
||||
如果有,你知道该怎样做吗?
|
||||
|
||||
之前你做过吗?你踩坑没有?
|
||||
|
||||
如果你踩过坑,那没什么问题。如果还没有,别担心,我们将在这里帮助你。
|
||||
|
||||
使用 rm 和 unlink 命令就能完成移除(删除)符号链接的操作。
|
||||
|
||||
### 什么是符号链接?
|
||||
|
||||
符号链接又称 symlink 或者 软链接,它是一种特殊的文件类型,在 Linux 中该文件指向另一个文件或者目录。
|
||||
|
||||
它类似于 Windows 中的快捷方式。
|
||||
|
||||
它能在相同或者不同的文件系统或分区中指向一个文件或着目录。
|
||||
|
||||
符号链接通常用来链接库文件。它也可用于链接日志文件和在 NFS (网络文件系统)上的文件夹。
|
||||
|
||||
### 什么是 rm 命令?
|
||||
|
||||
这个 **[rm command][1]** 被用来移除文件和目录。它非常危险,你每次使用 rm 命令的时候要非常小心。
|
||||
|
||||
### 什么是 unlink 命令?
|
||||
|
||||
unlink 命令被用来移除特殊的文件。它被作为 GNU Gorutils 的一部分安装了。
|
||||
|
||||
### 1) 使用 rm 命令怎样移除符号链接文件
|
||||
|
||||
rm 命令是在 Linux 中使用最频繁的命令,它允许我们像下列描述那样去移除符号链接。
|
||||
|
||||
```
|
||||
# rm symlinkfile
|
||||
```
|
||||
|
||||
始终将 rm 命令与 “-i” 一起使用以了解正在执行的操作。
|
||||
|
||||
```
|
||||
# rm -i symlinkfile1
|
||||
rm: remove symbolic link ‘symlinkfile1’? y
|
||||
```
|
||||
|
||||
它允许我们一次移除多个符号链接
|
||||
|
||||
```
|
||||
# rm -i symlinkfile2 symlinkfile3
|
||||
|
||||
rm: remove symbolic link ‘symlinkfile2’? y
|
||||
rm: remove symbolic link ‘symlinkfile3’? y
|
||||
```
|
||||
|
||||
### 1a) 使用 rm 命令怎样移除符号链接目录
|
||||
|
||||
这像移除符号链接文件那样。
|
||||
|
||||
使用下列命令移除符号链接目录。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir’? y
|
||||
```
|
||||
|
||||
使用下列命令移除多个符号链接目录。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir1 symlinkdir2
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir1’? y
|
||||
rm: remove symbolic link ‘symlinkdir2’? y
|
||||
```
|
||||
|
||||
如果你增加 _**“/”**_ 在结尾,这个符号链接目录将不会被删除。如果你加了,你将得到一个错误。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir/
|
||||
|
||||
rm: cannot remove ‘symlinkdir/’: Is a directory
|
||||
```
|
||||
|
||||
你可以增加 **“-r”** 去处理上述问题。如果你增加这个参数,它将会删除目标目录下的内容,并且它不会删除这个符号链接文件。
|
||||
|
||||
```
|
||||
# rm -ri symlinkdir/
|
||||
|
||||
rm: descend into directory ‘symlinkdir/’? y
|
||||
rm: remove regular file ‘symlinkdir/file4.txt’? y
|
||||
rm: remove directory ‘symlinkdir/’? y
|
||||
rm: cannot remove ‘symlinkdir/’: Not a directory
|
||||
```
|
||||
|
||||
### 2) 使用 unlink 命令怎样移除符号链接
|
||||
|
||||
unlink 命令删除指定文件。它一次仅接受一个文件。
|
||||
|
||||
删除符号链接文件
|
||||
|
||||
```
|
||||
# unlink symlinkfile
|
||||
```
|
||||
|
||||
删除符号链接目录
|
||||
|
||||
```
|
||||
# unlink symlinkdir2
|
||||
```
|
||||
|
||||
如果你增加 _**“/”**_ 在结尾,你不能使用 unlink 命令删除符号链接目录
|
||||
|
||||
```
|
||||
# unlink symlinkdir3/
|
||||
|
||||
unlink: cannot unlink ‘symlinkdir3/’: Not a directory
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[arrowfeng](https://github.com/arrowfeng)
|
||||
校对:[校对者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/linux-remove-files-directories-folders-rm-command/
|
Loading…
Reference in New Issue
Block a user