Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang
2019-09-05 06:10:02 +08:00
8 changed files with 789 additions and 59 deletions

View File

@@ -1,15 +1,17 @@
[#]: collector: (lujun9972)
[#]: translator: (lujun9972)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11306-1.html)
[#]: subject: (Eldoc Goes Global)
[#]: via: (https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/)
[#]: author: (Bozhidar Batsov https://emacsredux.com)
Eldoc 全局化了
EmacsEldoc 全局化了
======
![](https://img.linux.net.cn/data/attachment/album/201909/05/045702d99v9vv4xy0aybmm.jpg)
最近我注意到 Emacs 25.1 增加了一个名为 `global-eldoc-mode` 的模式,它是流行的 `eldoc-mode` 的一个全局化的变体。而且与 `eldoc-mode` 不同的是,`global-eldoc-mode` 默认是开启的!
这意味着你可以删除 Emacs 配置中为主模式开启 `eldoc-mode` 的代码了:
@@ -22,11 +24,12 @@ Eldoc 全局化了
(add-hook 'cider-repl-mode-hook #'eldoc-mode)
```
[有人说 ][1] `global-eldoc-mode` 在某些不支持的模式中会有性能问题。我自己未遇到过,但若你像禁用它则只需要这样:
[有人说][1] `global-eldoc-mode` 在某些不支持的模式中会有性能问题。我自己未遇到过,但若你像禁用它则只需要这样:
```
(global-eldoc-mode -1)
```
现在是时候清理我的配置了!删除代码就是这么爽!
--------------------------------------------------------------------------------
@@ -36,7 +39,7 @@ via: https://emacsredux.com/blog/2018/11/13/eldoc-goes-global/
作者:[Bozhidar Batsov][a]
选题:[lujun9972][b]
译者:[lujun9972](https://github.com/lujun9972)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -1,48 +1,49 @@
[#]: collector: (lujun9972)
[#]: translator: (luming)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: translator: (LuuMing)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11307-1.html)
[#]: subject: (A beginner's guide to building DevOps pipelines with open source tools)
[#]: via: (https://opensource.com/article/19/4/devops-pipeline)
[#]: author: (Bryant Son https://opensource.com/users/brson/users/milindsingh/users/milindsingh/users/dscripter)
使用开源工具构建 DevOps 流水线的初学者指南
======
如果你是 DevOps 新人,请查看这 5 个步骤来构建你的第一个 DevOps 流水线。
![Shaking hands, networking][1]
DevOps 已经成为解决软件开发过程中出现的缓慢、孤立或者其他故障的默认方式。但是当你刚接触 DevOps 并且不确定从哪开始时,那并不意味着什么。本文探索了什么是 DevOps 流水线并且提供了创建它的 5 个步骤。尽管这个教程并不全面,但可以给你以后上手和扩展打下基础。首先,插入一个小故事
> 如果你是 DevOps 新人,请查看这 5 个步骤来构建你的第一个 DevOps 流水线
![](https://img.linux.net.cn/data/attachment/album/201909/05/060323yizmqwn43zwy13za.jpg)
DevOps 已经成为解决软件开发过程中出现的缓慢、孤立或者其他故障的默认方式。但是当你刚接触 DevOps 并且不确定从哪开始时,就意义不大了。本文探索了什么是 DevOps 流水线并且提供了创建它的 5 个步骤。尽管这个教程并不全面,但可以给你以后上手和扩展打下基础。首先,插入一个小故事。
### 我的 DevOps 之旅
我曾经在 Citi 团队的云小组工作,开发<ruby><rt>Infrastructure as a Service</rt>基础设施即服务</ruby>网页应用来管理 Citi 的云基础设施,但我经常对研究如何让开发流水线更加高效以及如何带给团队积极的文化感兴趣。我在 Greg Lavender 推荐的书中找到了答案。Greg Lavender 是 Citi 的云架构和基础设施工程——[The Phoenix 项目][2]的 CTO。这本书尽管解释的是 DevOps 原理,但它读起来像一本小说。
我曾经在花旗集团的云小组工作,开发<ruby><rt>Infrastructure as a Service</rt>基础设施即服务</ruby>网页应用来管理花旗的云基础设施,但我经常对研究如何让开发流水线更加高效以及如何带给团队积极的文化感兴趣。我在 Greg Lavender 推荐的书中找到了答案。Greg Lavender 是花旗的云架构和基础设施工程(即 [Phoenix 项目][2]的 CTO。这本书尽管解释的是 DevOps 原理,但它读起来像一本小说。
书后面的一张表展示了不同公司部署在发布环境上的频率:
公司 | 部署频率
---|---
Amazon | 23,000次/天
Google | 5,500次/天
Netflix | 500次/天
Facebook | 1次/天
Twitter | 3次/周
典型企业 | 1次/9个月
Amazon | 23,000 次/天
Google | 5,500 次/天
Netflix | 500 次/天
Facebook | 1 次/天
Twitter | 3 次/周
典型企业 | 1 次/9 个月
AmazonGoogleNetflix 怎么能做到如此之频繁?那是因为这些公司弄清楚了如何去实现一个近乎完美的 DevOps 流水线。
AmazonGoogleNetflix 怎么能做到如此之频繁?那是因为这些公司弄清楚了如何去实现一个近乎完美的 DevOps 流水线。
那时候,我的团队拥有不同<ruby>构建阶段<rt>stage</rt></ruby>的环境,但是部署在开发服务器上非常手工。所有的开发人员只能访问一个基于 IBM WebSphere Application 社区版开发环境服务器。问题是当多个用户试着同时访问服务器去部署时,服务器就会宕机,因此开发人员在部署时就得互相通知,这一点相当痛苦。此外,还存在代码测试覆盖率低手动部署过程繁琐以及无法根据定义的任务或用户需求跟踪代码部署的问题。
但在花旗实施 DevOps 之前,情况并非如此。那时候,我的团队拥有不同<ruby>构建阶段<rt>stage</rt></ruby>的环境,但是在开发服务器上的部署非常手工。所有的开发人员只能访问一个基于 IBM WebSphere Application 社区版开发环境服务器。问题是当多个用户同时尝试部署时,服务器就会宕机,因此开发人员在部署时就得互相通知,这一点相当痛苦。此外,还存在代码测试覆盖率低手动部署过程繁琐以及无法根据定义的任务或用户需求跟踪代码部署的问题。
我意识到必须做些事情,同时也发现了一个志同道合的团体。我们决定合作去构建一个初的 DevOps 流水线——他启动了一个虚拟机和一个 Tomcat 服务器而我工作在集成了 Atlassian Jira、BitBucket 和代码覆盖测试的 Jenkins 之上。这个项目非常成功:我们近乎全自动化了开发流水线,并在开发服务器上实现了几乎 100% 的正常运行时间,我们可以追踪并改进代码覆盖测试,并且 Git 分支能够与部署任务和 jira 任务关联在一起。此外,大多数用来构建 DevOps 所使用的工具都是开源的。
我意识到必须做些事情,同时也找到了一个有同样感受的同事。我们决定合作去构建一个初的 DevOps 流水线 —— 他设置了一个虚拟机和一个 Tomcat 服务器而我则架设了 Jenkins集成了 Atlassian Jira、BitBucket 和代码覆盖测试。这个业余项目非常成功:我们近乎全自动化了开发流水线,并在开发服务器上实现了几乎 100% 的正常运行,我们可以追踪并改进代码覆盖测试,并且 Git 分支能够与部署任务和 jira 任务关联在一起。此外,大多数用来构建 DevOps 所使用的工具都是开源的。
现在我意识到了我们的 DevOps 流水线是多么的原始,因为我们没有利用高级设置,例如 Jenkins 文件或 Ansible。然而这个简单的过程工作的很好,也许是因为 [Pareto][3] 原则(也被称作 80/20 法则)
现在我意识到了我们的 DevOps 流水线是多么的原始,因为我们没有利用 Jenkins 文件或 Ansible 这样的高级设置。然而,这个简单的过程运作良好,也许是因为 [Pareto][3] 原则(也被称作 80/20 法则)
### DevOps 和 CI/CD 流水线的简要介绍
如果你问一些人,“什么是 DevOps你或许会得到一些不同的回答。DevOps就像 agile涵盖着诸多不同的原则,但大多数人至少会同意这几件事情DevOps 是一个软件开发实践或一个软件开发生命周期SDLC并且它的核心原则是一种文化上的变革开发人员与非开发人员呼吸着同一片天空的气息之前手工的事情变得自动化;每个人做着自己擅长的事;同一时间的部署变得更加频繁;吞吐量提升;灵活度增加。
如果你问一些人,“什么是 DevOps你或许会得到一些不同的回答。DevOps就像敏捷,已经发展到涵盖着诸多不同的学科,但大多数人至少会同意这DevOps 是一个软件开发实践或一个<ruby>软件开发生命周期<rt>software development lifecycle</rt></ruby>SDLC并且它的核心原则是一种文化上的变革 —— 开发人员与非开发人员呼吸着同一片天空的气息之前手工的事情变得自动化;每个人做着自己擅长的事;同一时间的部署变得更加频繁;吞吐量提升;灵活度增加。
虽然拥有正确的软件工具并非实现 DevOps 环境所需的唯一东西但一些工具却是必要的。最关键的一个便是持续集成和持续部署CI/CD。流水线环境拥有不同的构建阶段例如DEVINTTSTQAUATSTGPROD手动的工作能实现自动化,开发人员可以实现高质量的代码,灵活而且大量部署。
虽然拥有正确的软件工具并非实现 DevOps 环境所需的唯一东西但一些工具却是必要的。最关键的一个便是持续集成和持续部署CI/CD流水线环境中,拥有不同的构建阶段例如DEVINTTSTQAUATSTGPROD手动的工作能实现自动化开发人员可以实现高质量的代码灵活而且大量部署。
这篇文章描述了一个构建 DevOps 流水线的五步方法,就像下图所展示的那样,使用开源的工具实现。
@@ -52,15 +53,15 @@ AmazonGoogleNetflix 怎么能做到如此之频繁?那是因为这些公
### 第一步CI/CD 框架
首先你需要的是一个 CI/CD 工具Jenkins一个基于 Java 的 MIT 许可开源 CI/CD 工具,普及了 DevOps 运动并且成为了<ruby>约定俗成的标准<rt>de facto standard</rt><ruby>。
首先你需要的是一个 CI/CD 工具Jenkins一个基于 Java 的 MIT 许可下的开源 CI/CD 工具,它是推广 DevOps 运动的工具,并已成为了<ruby>事实标准<rt>de facto standard</rt><ruby>。
所以,什么是 Jenkins想象它是一种神奇的万能遥控能够和非常非常多不同的服务器和工具打交道,并且能够将它们统一安排起来。就本身而言,像 Jenkins 这样的 CI/CD 工具是没有用的,但将它用作不同工具与服务器之间的插座时会变得非常强大。
所以,什么是 Jenkins想象它是一种神奇的万能遥控能够和多不同的服务器和工具打交道,并且能够将它们统一安排起来。就本身而言,像 Jenkins 这样的 CI/CD 工具本身是没有用的,但随着接入不同工具与服务器时会变得非常强大。
Jenkins 仅是众多构建 DevOps 流水线的开源 CI/CD 工具其中之一。
Jenkins 仅是众多构建 DevOps 流水线的开源 CI/CD 工具之一。
名称 | 协议
名称 | 许可证
---|---
[Jenkins][5] | Creative Commons and MIT
[Jenkins][5] | Creative Commons MIT
[Travis CI][6] | MIT
[CruiseControl][7] | BSD
[Buildbot][8] | GPL
@@ -71,17 +72,17 @@ Jenkins 仅是众多构建 DevOps 流水线的开源 CI/CD 工具其中之一。
![CI/CD tool][11]
You have a CI/CD tool running in your localhost, but there is not much you can do at the moment. Let's follow the next step of DevOps journey.你的 CI/CD 工具运行在本地主机上,但目前你还不能够做些别的。让我们紧随 DevOps 之旅的脚步。
你的 CI/CD 工具在本地主机上运行,但目前你还不能够做些别的。让我们紧随 DevOps 之旅的脚步。
### 第二步:源代码控制管理
为什么需要源代码控制?假设你在开发一个应用。无论你什么时候构建应用,无论你使用的是 JavaPythonC++GoRubyJavaScript 或任意一种语言,你都在编程。你所编写的程序代码称为源代码。在一开始,特别是只有你一个人工作时,将所有的东西放进本地文件夹里或许是 OK 的。但是当项目变得庞大并且邀请其他人协作后,你就需要一种方式来避免共享代码修改时的合并冲突。你也需要一种方式来恢复一个之前的版本——备份复制并粘贴的方式已经很古老了。你(和你的团队)想要更好的解决方式。
验证 CI/CD 工具可以执行某些魔术的最佳也可能是最简单方法是与源代码控制管理SCM工具集成。为什么需要源代码控制?假设你在开发一个应用。无论你什么时候构建应用,无论你使用的是 JavaPythonC++GoRubyJavaScript 或任意一种语言,你都在编程。你所编写的程序代码称为源代码。在一开始,特别是只有你一个人工作时,将所有的东西放进本地文件夹里或许都是可以的。但是当项目变得庞大并且邀请其他人协作后,你就需要一种方式来避免共享代码修改时的合并冲突。你也需要一种方式来恢复一个之前的版本——备份复制并粘贴的方式已经过时了。你(和你的团队)想要更好的解决方式。
这就是 SCM 变得不可或缺的原因。SCM 工具通过保存代码在仓库中来帮助进行版本控制与多人协作。
这就是 SCM 变得不可或缺的原因。SCM 工具通过在仓库中保存代码来帮助进行版本控制与多人协作。
尽管这里有许多 SCM 工具,但 Git 是最标准恰当的。我极力推荐使用 Git但如果你喜欢这里仍有其他的开源工具。
名称 | 协议
名称 | 许可证
---|---
[Git][12] | GPLv2 & LGPL v2.1
[Subversion][13] | Apache 2.0
@@ -97,11 +98,11 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
### 第三步:自动化构建工具
真棒!你可以检出代码并提交你的修改到源代码控制,并且可以邀请你的朋友源代码控制上协作开发。但是到目前为止你还没有构建出应用。要想让它成为一个网页应用,必须编译并将其打包成可部署的包或可执行程序(注意,像解释型编程语言例如 JavaScript 或 PHP 不需要进行编译)
真棒!现在你可以检出代码并将修改提交到源代码控制,并且可以邀请你的朋友源代码控制进行协作。但是到目前为止你还没有构建出应用。要想让它成为一个网页应用,必须将其编译并打包成可部署的包或可执行程序(注意,像 JavaScript 或 PHP 这样的解释型编程语言不需要进行编译)
于是就引出了自动化构建工具。无论你决定使用哪一款构建工具,它们都有一个共同的目标:将源代码构建成某种想要的格式并且将清理、编译、测试、部署到某个位置这些任务自动化。构建工具会根据你的编程语言而有不同,但这里有一些通常使用的开源工具值得考虑。
于是就引出了自动化构建工具。无论你决定使用哪一款构建工具,它们都有一个共同的目标:将源代码构建成某种想要的格式并且将清理、编译、测试、部署到某个位置这些任务自动化。构建工具会根据你的编程语言而有不同,但这里有一些通常使用的开源工具值得考虑。
名称 | 协议| 编程语言
名称 | 许可证 | 编程语言
---|---|---
[Maven][18] | Apache 2.0 | Java
[Ant][19] | Apache 2.0 | Java
@@ -119,17 +120,17 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
[ASDF][31] | Expat (MIT) | LISP
[Cabal][32] | BSD | Haskell
太棒了!你可以将自动化构建工具的配置文件上传进源代码控制管理系统中,并让你的 CI/CD 工具构建它。
太棒了!现在你可以将自动化构建工具的配置文件进源代码控制管理系统中,并让你的 CI/CD 工具构建它。
![Build automation tool][33]
一切都如此美好,对吧?但是哪里可以部署它呢?
一切都如此美好,对吧?但是哪里部署它呢?
### 第四步:网页应用服务器
到目前为止,你有一个可执行或可部署的打包文件。对任何真正用的应用程序来说,它必须提供一些服务或者接口,所以你需要一个容器来发布你的应用。
到目前为止,你有一个可执行或可部署的打包文件。对任何真正用的应用程序来说,它必须提供某种服务或者接口,所以你需要一个容器来发布你的应用。
对于网页应用,网页应用服务器就是容器。应用程序服务器提供了环境,让可部署包中的编程逻辑能够被检测到,提供接口,并通过打开套接字为外部世界提供网页服务。在其他环境下你也需要一个 HTTP 服务器(比如虚拟机)来安装服务应用。现在,我假设你将会自己学习这些东西(尽管我会在下面讨论容器)。
对于网页应用,网页应用服务器就是容器。应用程序服务器提供了环境,让可部署包中的编程逻辑能够被检测到、呈现界面,并通过打开套接字为外部世界提供网页服务。在其他环境下你也需要一个 HTTP 服务器(比如虚拟机)来安装服务应用。现在,我假设你将会自己学习这些东西(尽管我会在下面讨论容器)。
这里有许多开源的网页应用服务器。
@@ -154,13 +155,13 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
### 第五步:代码覆盖测试
实现代码测试件可能是另一个麻烦的需求,但是开发者需要尽早地捕捉程序中的所有错误并提升代码质量来保证用户最终的满意度。幸运的是,这里有许多开源工具来测试你的代码并提出改善质量的建议。甚至更好的,大部分 CI/CD 工具能够集成这些工具并将测试过程自动化进行。
实现代码测试件可能是另一个麻烦的需求,但是开发者需要尽早地捕捉程序中的所有错误并提升代码质量来保证最终用户满意度。幸运的是,这里有许多开源工具来测试你的代码并提出改善质量的建议。甚至更好的,大部分 CI/CD 工具能够集成这些工具并将测试过程自动化进行。
代码测试分为两个部分:“代码测试框架”帮助进行编写与运行测试,“代码质量改进工具”帮助提升代码的质量。
#### 代码测试框架
名称 | 协议 | 编程语言
名称 | 许可证 | 编程语言
---|---|---
[JUnit][45] | Eclipse Public License | Java
[EasyMock][46] | Apache | Java
@@ -172,7 +173,7 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
#### 代码质量改进工具
名称 | 协议 | 编程语言
名称 | 许可证 | 编程语言
---|---|---
[Cobertura][52] | GNU | Java
[CodeCover][53] | Eclipse Public (EPL) | Java
@@ -186,7 +187,7 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
[Mocha][59] | MIT | JavaScript
[Jest][60] | MIT | JavaScript
注意,之前提到的大多数工具和框架都是为 JavaPythonJavaScript 写的,因为 C++ 和 C# 是专有编程语言(尽管 GCC 是开源的)。
注意,之前提到的大多数工具和框架都是为 JavaPythonJavaScript 写的,因为 C++ 和 C# 是专有编程语言(尽管 GCC 是开源的)。
现在你已经运用了代码覆盖测试工具,你的 DevOps 流水线应该就像教程开始那幅图中展示的那样了。
@@ -194,13 +195,13 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
#### 容器
正如我之前所说,你可以在虚拟机或服务器上发布你的应用,但是容器是一个更好的解决方法。
正如我之前所说,你可以在虚拟机VM或服务器上发布你的应用,但是容器是一个更好的解决方法。
[什么是容器][61]?简要的介绍就是 VM 需要占用操作系统大量的资源它提升了应用程序的大小而容器仅仅需要一些库和配置来运行应用程序。显然VM 仍有重要的用途,但容器对于发布应用来说是一个更为轻量的解决方式,也包括应用程序服务器
[什么是容器][61]?简要的介绍就是 VM 需要占用操作系统大量的资源它提升了应用程序的大小而容器仅仅需要一些库和配置来运行应用程序。显然VM 仍有重要的用途,但容器对于发布应用(包括应用程序服务器)来说是一个更为轻量的解决方式。
尽管对于容器来说也有其他的选择,但是 Docker 和 Kubernetes 更为广泛。
名称 | 协议
名称 | 许可证
---|---
[Docker][62] | Apache 2.0
[Kubernetes][63] | Apache 2.0
@@ -210,32 +211,32 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
* [什么是 Docker][65]
* [Docker 简介][66]
* [什么是 Kubernetes][67]
* [从 0 开始的 Kubernetes 实践][68]
* [从开始的 Kubernetes 实践][68]
#### 中间件自动化工具
我们的 DevOps 流水线大部分集中在协作构建与部署应用上,但你也可以用 DevOps 工具完成许多其他的事情。其中之一便是利用它实现<ruby>基础设施管理<rt>Infrastructure as Code</rt></ruby>IaC工具也被熟知中间件自动化工具。这些工具帮助完成中间件的自动化安装管理和其他任务。例如,自动化工具可以用正确的配置下拉应用程序,例如网页服务器数据库和监控工具,并且部署它们到应用服务器上。
我们的 DevOps 流水线大部分集中在协作构建与部署应用上,但你也可以用 DevOps 工具完成许多其他的事情。其中之一便是利用它实现<ruby>基础设施管理<rt>Infrastructure as Code</rt></ruby>IaC工具这也是熟知中间件自动化工具。这些工具帮助完成中间件的自动化安装管理和其他任务。例如,自动化工具可以用正确的配置下拉应用程序,例如网页服务器数据库和监控工具,并且部署它们到应用服务器上。
这里有几个开源的中间件自动化工具值得考虑:
名称 | 协议
名称 | 许可证
---|---
[Ansible][69] | GNU Public
[SaltStack][70] | Apache 2.0
[Chef][71] | Apache 2.0
[Puppet][72] | Apache or GPL
获取更多中间件自动化工具,查看[Opensource.com][64] 上的其它文章:
获取更多中间件自动化工具,查看 [Opensource.com][64] 上的其它文章:
* [Ansible 快速入门指南][73]
* [Ansible 自动化部署策略][74]
* [配置管理工具 Top 5][75]
### 你将去往何处?
### 之后的发展
这只是一个完整 DevOps 流水线的冰山一角。从 CI/CD 工具开始并且探索其他可以自动化的东西来使你的团队更加轻松的工作。并且,寻找[开源通讯工具][76]可以帮助你的团队一起工作的更好。
寻找更多见解,这里有一些非常棒的文章来介绍 DevOps
发现更多见解,这里有一些非常棒的文章来介绍 DevOps
* [什么是 DevOps][77]
* [掌握 5 件事成为 DevOps 工程师][78]
@@ -245,16 +246,16 @@ CI/CD 工具能够自动化进行源代码检入检出以及完成成员之间
使用开源 agile 工具来集成 DevOps 也是一个很好的主意:
* [什么是 agile ][81]
* [4 步为一个了不起的 agile 开发者][82]
* [4 步为一个了不起的 agile 开发者][82]
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/4/devops-pipeline
作者:[Bryant Son (Red Hat, Community Moderator)][a]
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[LuMing](https://github.com/LuuMing)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,64 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (IoT security essentials: Physical, network, software)
[#]: via: (https://www.networkworld.com/article/3435108/iot-security-essentials-physical-network-software.html)
[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/)
IoT security essentials: Physical, network, software
======
Internet of things devices present unique security problems due to being spread out, exposed to physical attacks and often lacking processor power.
Thinkstock
Even in the planning stages of a deployment, IoT security is one of the chief stumbling blocks to successful adoption of the technology.
And while the problem is vastly complicated, there are three key angles to think about when laying out how IoT sensors will be deployed in any given setup: How secure are the device themselves, how many are there and can they receive security patches.
### Physical access
Physical access is an important but, generally, straightforward consideration for traditional IT security. Data centers can be carefully secured, and routers and switches are often located in places where theyre either difficult to fiddle with discreetly or difficult to access in the first place.
Where IoT is concerned, however, best security practices arent as fleshed out. Some types of IoT implementation could be relatively simple to secure a bad actor could find it comparatively difficult to tinker with a piece of complex diagnostic equipment in a well-secured hospital, or a big piece of sophisticated robotic manufacturing equipment on an access-controlled factory floor. Compromises can happen, certainly, but a bad actor trying to get into a secure area is still a well-understood security threat.
By contrast, smart city equipment scattered across a metropolis traffic cameras, smart parking meters, noise sensors and the like is readily accessible by the general public, to say nothing of anybody able to look convincing in a hard hat and hazard vest. The same issue applies to soil sensors in rural areas and any other technology deployed to a sufficiently remote location.
The solutions to this problem vary. Cases and enclosures could deter some attackers, but they might not be practical in some instances. The same goes for video surveillance of the devices, which could become a target itself. The IoT Security Foundation recommends disabling all ports on a device that arent strictly necessary for it perform its function, implementing tamper-proofing on circuit boards, and even embedding those circuits entirely in resin.
### Discovery and networking
Securing the connections between IoT sensors and the backend is arguably the toughest part to solve, in part because an alarming number of organizations arent even aware of all the devices on their network at any given time. Hence, device discovery remains a critically important part of network security for IoT.
**[ [Prepare to become a Certified Information Security Systems Professional with this comprehensive online course from PluralSight. Now offering a 10-day free trial!][1] ]**
The main reason for this lack of visibility is that the nature of IoT as an operational technology, rather than one thats solely administered by IT staff, means that line-of-business personnel will sometimes connect helpful devices to the network without telling the people in charge of keeping the network secure. For network **operations** people, used to having a clear sense of the entire networks topology, this can be an unaccustomed headache.
Beyond IT personnel working closely with the operational side of the business to ensure all devices connected to the network are properly provisioned and monitored, network scanners can discover connected devices on a network automatically, whether thats via network traffic analysis, device profiles, whitelists or other techniques.
### Software patching
Many IoT sensors dont have a lot of built-in computing capability, so some of those devices arent able to run a security-software agent nor accept updates and patches remotely.
That is a huge worry, because there are software vulnerabilities being discovered every day that target the IoT. An inability to patch those holes when theyre discovered is a serious problem.
Moreover, certain devices simply wont be able to be properly secured and made patchable. The only solution might be to find a different product that accomplishes the functional task yet has better security.
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3435108/iot-security-essentials-physical-network-software.html
作者:[Jon Gold][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Jon-Gold/
[b]: https://github.com/lujun9972
[1]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fcertified-information-systems-security-professional-cisspr
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,60 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A guide to human communication for sysadmins)
[#]: via: (https://opensource.com/article/19/9/communication-sysadmins)
[#]: author: (Maxim Burgerhout https://opensource.com/users/wzzrdhttps://opensource.com/users/rikki-endsley)
A guide to human communication for sysadmins
======
The best way to increase your value to an organization is to get to know
the people around you.
![People work on a computer server with devices][1]
Not too long ago, I spoke at a tech event in the Netherlands to an audience mostly made up of sysadmins. One of my topics was how sysadmins can increase the value they deliver to the organization they work for. I believe that among the most important factors for delivering value is for everyone to know the overall organization's priorities and goals, as well as the priorities and goals of the organization's development teams.
This all sounds obvious, but in many organizations, silos almost completely block the inter-team communication needed to understand each other's priorities. Even in large organizations that pat themselves on the back for having gone full DevOps (or aspire to go full DevOps), knowledge of the priorities and goals of other teams is not ubiquitous. When I asked the couple hundred people in my audience whether they knew their development teams and what drives those teams, very few hands came up.
You could argue that if you claim to have gone full DevOps, yet your people don't know the goals and priorities of the teams they work directly with, you are doing it wrong. And you would probably have a point. But put that aside for a moment. Even in a traditional organization—one that is only beginning its DevOps journey, has implemented some parts of the DevOps philosophy, or implemented DevOps only in certain parts of the organization (I have seen them all)—I would heartily recommend getting to know your co-workers. I would _especially_ recommend getting to know the ones outside your team that work with (or on) the platform that you build and maintain.
Sit down for an hour or so with one of the people that develop applications on your platform or with someone who maintains commercial, off-the-shelf software on it. Have them explain to you how your platform and your services make their lives easier and how they make their lives harder. What could you and your team do to improve that situation?
Talking to each other, learning from each other, debating problems _and_ solutions—especially with people whose immediate goals might initially differ from your own—helps everyone move forward together and build something that benefits an entire community.
We see this happening in open source communities around the world all the time. Broad communities that are built from different companies and different people with (potentially) different or even conflicting goals, work. Successful open source communities are usually diverse, and members communicate to meet a broad range of goals, to find compromises, and to accommodate everyone.
There is an obvious parallel between a broad open source community and working with "neighboring teams" in your organization to make your platform fit their interests and goals better. It's just a matter of taking that first step and starting a conversation with them.
At this point, you may be asking, "But this is what I have my architects or service owners for, right?" Well, yeah, of course, they play a role in this. As do many others. And so do you!
As an example, imagine your organization sets a target for your team to deliver a service within one week of the initial request. If the service is delivered within the week, the service-level agreements (SLAs) are met, and all is good, right? In reality, that is only sometimes true.
Imagine your goal is to automatically (upon a self-service request) deliver a new virtual machine (VM) within a day and with a success rate of at least 95%. Now imagine a development team requests dozens of temporary VMs per day for CI/CD purposes, and 95% of them are delivered correctly. Your goal has been met, your SLA has been achieved—but no one is happy with the situation, because the CI/CD pipeline has broken on multiple occasions due to misconfigured VMs.
**[More to read: [10 ways to have better conversations][2]]**
In this example, the goals and SLAs need to be re-evaluated as soon as possible. But having a regular conversation with your developer teams or application maintainers, even in an organization that is pretty siloed, could make experiences like this much less common (and much easier to solve if they occur). Small annoyances and small problems would be unearthed at an early stage; small improvements would be suggested, and small improvements would be made _before_ large deployments of shadow IT happen.
At the end of the day, nothing beats human-to-human communication. Nothing breaks barriers like knowing which face goes with which name. Nothing makes it easier to talk to people than knowing they want to support you in being successful! So, go and talk to your neighboring teams. Have coffee with them. Go build a broad community in your organization!
P.S. Odds are your developer teams will talk to you about cloud and continuous integration and delivery. Those are topics for a potential future follow-up to this article. Stay tuned!
It takes developers, sales, marketing, and product people to take this open source thing and turn...
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/9/communication-sysadmins
作者:[Maxim Burgerhout][a]
选题:[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/wzzrdhttps://opensource.com/users/rikki-endsley
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices)
[2]: https://enterprisersproject.com/article/2019/7/leadership-10-tips-better-conversations

View File

@@ -0,0 +1,71 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Geeks in Cyberspace: A documentary about Linux nerds and the web that was)
[#]: via: (https://opensource.com/article/19/9/geeks-cyberspace)
[#]: author: (Michael Stevenson https://opensource.com/users/mstevenson)
Geeks in Cyberspace: A documentary about Linux nerds and the web that was
======
Film explores how a group of friends helped usher in our present age of
social media, inventing now-familiar conventions that we use every day.
![An old-fashioned video camera][1]
"We invented blogging, we invented podcasting, we invented the LIKE button…"
Rob Malda is only half-joking when he makes these claims in the closing minutes of my new documentary, _Geeks in Cyberspace_. Together with his friends Jeff Bates, Nate Oostendorp, and Kurt Demaagd, Malda helped usher in our present age of social media, inventing now-familiar conventions that we use every day on Reddit, Wikipedia, Facebook, and elsewhere.
### Slashdot's success
Malda created [Slashdot.org][2] more than 20 years ago, in 1997, and his friends helped him turn his proto-blog into an engine of participation. The site was powered by an incredibly rich suite of Linux, Apache, MySQL, and clever Perl hacks, as well as a community of readers who would submit stories, comment on them, then moderate those comments to bring the best bits to the top. _Wired_ called this "open-source journalism" in 1999, and the site would directly influence the creation of Digg and later Reddit.
Slashdot's massive influence in the open source community coincided with what could be termed the open source bubble of the late 1990s, when Linux companies set records on Wall Street, and Microsoft recognized it had a real competitor in projects that were giving their source code away for free. Malda and his friends profited from the speculative craze, albeit modestly in comparison to later social media entrepreneurs. They sold Slashdot to Andover.net in the summer of 1999 for several million dollars in cash and stock options.
### Everything2 and PerlMonks
With some of the profits from Slashdot's sale, the friends looked to reproduce their success with [Everything2][3] (E2), another community website. E2 evolved out of a side project that Oostendorp built in 1998, one that in some ways was even more creative than Slashdot. Called "Everything," the project was to be a user-contributed information database that covered, well, everything—from _The Simpsons_ and beer brands to historical events and computer companies. Sound familiar? Conceived several years before Wikipedia launched, Everything was different from the collaborative encyclopedia we all use today. Rather than a "neutral point of view," it promoted something like "multiple points of view," and it had what could be considered an early ancestor of the ubiquitous "Like" button (as well as a counterpart "I don't like this" button).
E2 launched in 1999 and took on a life of its own. Although its audience was small in comparison to Slashdot, the site's community was tight-knit and dedicated. The E2 communitys story is central to the documentary; it is striking because it reminds us that even in the footnotes of internet history, there are fascinating human stories that are worth recounting.
Technologically, Everything2 was notable for being the first site run on The Everything Engine, software that would now be called a content management system or even an early web framework. As fellow geek chromatic [wrote][4], the Everything Engine was ahead of its time in many ways, if not as robust as the technologies it foreshadowed. The engine was also used to create [PerlMonks][5], the question-and-answer programming site that prefigured Stack Overflow and others.
### Looking back, looking forward
When I look at the history of Slashdot, E2, and PerlMonks, I don't simply see predecessors to today's social media landscape. For one thing, there were many other initiatives that shaped what was to come. More importantly, the value of such history is found in its specificity and how it can help us ask new questions about contemporary social media and imagine future platforms that will eventually challenge today's major players.
With that in mind, I draw two key lessons from the work that Malda and company did at the turn of the century.
First, they showed that getting these things off the ground requires not just a mix of hard work and luck but also an inspired mode of production. Chromatic rightly described the joy and sense of purpose they felt in terms of "momentum" and "a movement." A similar mix of joy and purpose can be found in waves across the cultural spectrum: think, for example, of the emerging scene of [chiptunes][6] artists, whose music I drew on heavily for this documentary, or a (hypothetical) group of journalists who seek to retake the news industry from commercial and political interests. Money certainly matters, as does circumstance. But time and again, for culture to renew itself, inspiration is key.
Second, in the case of social media, an inspired outlook must translate to its community of users in tangible ways. For Slashdot, and even more so for E2 and PerlMonks, community members felt connected to _their_ site's purpose and had a real say in determining daily operations and overall direction.
When real ownership is given, and a community works together to manage complex tasks of maintenance and government, social media becomes much more than a communications infrastructure. As E2 user and documentary subject Dana McNabb wrote many years ago about E2: "Everything is people. I married a noder, some of my best friends are noders, I continue to make new noding friends. Don't tell me this website is just a website."
Although it is hard to imagine something similar ever being said about a platform the size of Facebook or Instagram, I believe such lessons can nonetheless figure into improving our current social media or in our attempts to provide alternatives.
### Acknowledgments
"Geeks in Cyberspace" and this article came out of my research project "The web that was," which also includes [this open access article][7]. The project is funded by the Dutch Research Council, project number 275-45-006. Most of all, thanks are due to Rob Malda, Nate Oostendorp, Kurt Demaagd, Jeff Bates, Tim Vroom, Ryan Postma, chromatic, Dana McNabb, and Cliff Lampe for generously giving their time for this project.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/9/geeks-cyberspace
作者:[Michael Stevenson][a]
选题:[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/mstevenson
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_film.png?itok=aElrLLrw (An old-fashioned video camera)
[2]: https://slashdot.org/
[3]: https://www.everything2.com/
[4]: https://www.perl.com/pub/2010/08/rethinking-perl-web.html
[5]: https://www.perlmonks.org/
[6]: https://en.wikipedia.org/wiki/Chiptune
[7]: https://www.tandfonline.com/doi/full/10.1080/24701475.2018.1495810

View File

@@ -0,0 +1,196 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Environment variables in PowerShell)
[#]: via: (https://opensource.com/article/19/9/environment-variables-powershell)
[#]: author: (Seth Kenlon https://opensource.com/users/sethhttps://opensource.com/users/seth)
Environment variables in PowerShell
======
Up your PowerShell game with environment variables, in Part 2.5 of the
"Variables in shells" miniseries.
![Hands programming][1]
Environment variables are global settings for your Linux, Mac, or Windows computer, stored for the system shell to use when executing commands. Many are set by default during installation or user creation.
For instance, your home directory is set as an environment variable when you log in. How it looks in PowerShell depends on your operating system.
On Windows:
```
PS C:\Users\bogus&gt; Get-Variable HOME -valueOnly
C:\Users\bogus
```
On Linux:
```
pwsh&gt; Get-Variable HOME -valueOnly
HOME=/home/seth
```
On a Mac:
```
pwsh&gt; Get-Variable HOME -valueOnly
HOME=/Users/bogus
```
You usually dont use environment variables directly, but theyre referenced by individual applications and daemons as needed. However, environment variables can be useful when you want to override default settings, or when you need to manage new settings that your system has no reason to create on its own.
This article is about environment variables in the open source PowerShell environment, and so its applicable to PowerShell running on Windows, Linux, and Mac. Users of the Bash shell should refer to my article about [Bash environment variables][2].
For this article, I ran PowerShell on the open source operating system Linux. The commands are the same regardless of your platform, although the output will differ (for instance, it is statistically unlikely that your username is **seth**).
### What are environment variables?
Environment variables in PowerShell are special kinds of variables that provide the system with information about the operating system environment. With environment variables, you can view and change variables in the Windows registry, as well as variables set for a particular session.
In PowerShell, environment variables are stored in the **Env:** "drive", accessible through the _PowerShell environment provider_, a subsystem of PowerShell. This isnt a physical drive, but a virtual file system.
Because environment variables exist in the **Env:** drive, you must prepend **Env:** to the variable name when you reference them. Alternatively, you can set your working location to the **Env:** drive with the **Set-Location** command so you can treat all environment variables as local variables:
```
PS&gt; Set-Location Env:
PS&gt; pwd
Path
\----
Env:/
```
Environment variables convey information about your login session to your computer. For instance, when an application needs to determine where to save a data file by default, it usually calls upon the **HOME** environment variable. You probably never set the **HOME** variable yourself, and yet it exists because most environment variables are managed by your operating system.
You can view all environment variables set on your system with the **Get-ChildItem** command from within the **Env:** drive. The list is long, so pipe the output through **out-host -paging** to make it easy to read:
```
PS&gt; Get-ChildItem | out-host -paging
LOGNAME      seth
LS_COLORS    rs=0:mh=00:bd=48;5;232;38;5;
MAIL         /var/spool/mail/seth
MODULEPATH   /etc/scl/modulefiles:/etc/scl/modulefiles
MODULESHOME  /usr/share/Modules
OLDPWD       /home/seth
PATH         /opt/microsoft/powershell/6:/usr/share/Modules/bin
PSModulePath /home/seth/.local/share/powershell/Modules
PWD          /home/seth
[...]
```
If youre not in the **Env:** drive, then you can do the same thing by adding **Env: **to your command:
```
PS&gt; Get-ChildItem Env: | out-host -paging
LOGNAME      seth
LS_COLORS    rs=0:mh=00:bd=48;5;232;38;5;
MAIL         /var/spool/mail/seth
MODULEPATH   /etc/scl/modulefiles:/etc/scl/modulefiles
```
Environment variables can be set, recalled, and cleared with some of the same syntax used for normal variables. Like other variables, anything you set during a session only applies to that particular session.
If you want to make permanent changes to a variable, you must change them in Windows Registry on Windows, or in a shell configuration file (such as **~/.bashrc**) on Linux or Mac. If youre not familiar with using variables in PowerShell, read my [variables in PowerShell][3] article before continuing.
### What are environment variables used for?
Different environment variables get used by several different systems within your computer. Your **PATH** variable is vital to your shell, for instance, but a lot less significant to, say, Java (which also has paths, but theyre paths to important Java libraries rather than general system folders). However, the **USER** variable is used by several different processes to identify who is requesting a service.
An installer wizard, like the open source [Nullsoft Scriptable Install System (NSIS)][4] framework, updates your environment variables when youre installing a new application. Sometimes, when youre installing something outside of your operating systems intended toolset, you may have to manage an environment variable yourself. Or, you might choose to add an environment variable to suit your preferences.
### How are they different from regular variables?
When you create a normal variable, the variable is considered local, meaning that its not defined outside of the shell that created it.
For example, create a variable:
```
PS&gt; Set-Variable -Name VAR -Value "example"
PS&gt; gv VAR -valueOnly
example
```
Launch a new shell, even from within your current shell:
```
PS&gt; pwsh
PS c:\&gt; gv VAR -valueOnly
gv : Cannot find a variable with the name 'example'.
```
Environment variables, on the other hand, are meant to be global in scope. They exist separately from the shell that created them and are available to other processes.
### How do you set an environment variable?
When setting an environment variable, you should be explicit that it is an environment variable by using the **$Env:** notation:
```
PS Env:/&gt; $Env:FOO = "hello world"
PS Env:/&gt; Get-ChildItem FOO
hello world
```
As a test, launch a new session and access the variable youve just created. Because the variable is an environment variable, though, you must prepend it with **$Env:**:
```
PS Env:/&gt; pwsh
PS c:\&gt; $Env.FOO
hello world
```
Even though youve made a variable available to child processes, its still just a temporary variable. It works, you can verify that it exists, you can use it from any process, but it is destroyed when the shell that created it is closed.
### How do you set environment variables in your profile?
To force an environment variable to persist across sessions, you must add it to your PowerShell profile, such as your **CurrentUser,AllHosts** profile, located in **HOME/Documents/Profile.ps1**:
```
PS&gt; Add-Content -Path $Profile.CurrentUserAllHosts -Value '$Env:FOO = "hello world"'
```
With this line added, any PowerShell session launched instantiates the **FOO** environment variable and sets its value to **hello world**.
There are currently six default profiles controlling PowerShell sessions, so refer to the [Microsoft dev blog][5] for more information.
### How do you discover new environment variables?
You can create and manipulate environment variables at will, and some applications do just that. This fact means that many of your environment variables arent used by most of your applications, and if you add your own arbitrary variables then some could be used by nothing at all.
So the question is: How do you find out which environment variables are meaningful? The answer lies in an applications documentation.
Python, for instance, offers to add the appropriate Python path to your **Path** environment variable during install. **[Note: PATH?]** If you decline, you can set the value yourself now that you know how to modify environment variables.
The same is true for any application you install: The installer is expected to add the appropriate variables to your environment, so you should never need to modify **Env:** manually. If youre developing an application, then your installer should do the same for your users.
To discover significant variables for individual applications, refer to their user and developer documentation.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/9/environment-variables-powershell
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sethhttps://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming)
[2]: https://opensource.com/article/19/8/what-are-environment-variables
[3]: https://opensource.com/article/19/8/variables-powershell
[4]: https://sourceforge.net/projects/nsis/
[5]: https://devblogs.microsoft.com/scripting/understanding-the-six-powershell-profiles

View File

@@ -0,0 +1,103 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Change Themes in Linux Mint)
[#]: via: (https://itsfoss.com/install-themes-linux-mint/)
[#]: author: (It's FOSS Community https://itsfoss.com/author/itsfoss/)
How to Change Themes in Linux Mint
======
Using Linux Mint is, from the start, a unique experience for its main Desktop Environment: Cinnamon. This is one of the main [features why I love Linux Mint][1].
Since Mints dev team [started to take design more serious][2], “Themes” applet became an important way not only to choose new themes, icons, buttons, window borders and mouse pointers, but also to install new themes directly from it. Interested? Lets jump into it.
### How to change themes in Linux Mint
Search for themes in the Menu and open the Themes applet.
![Theme Applet provides an easy way of installing and changing themes][3]
At the applet theres a “Add/Remove” button, pretty simple, huh? And, clicking on it, you and I can see Cinnamon Spices (Cinnamons official addons repository) themes ordered first by popularity.
![Installing new themes in Linux Mint Cinnamon][4]
To install one, all its needed to do is click on yours preferred one and wait for it to download. After that, the theme will be available at the “Desktop” option on the first page of the applet. Just double click on one of the installed themes to start using it.
![Changing themes in Linux Mint Cinnamon][5]
Heres the default Linux Mint look:
![Linux Mint Default Theme][6]
And heres after I change the theme:
![Linux Mint with Carta Theme][7]
All the themes are also available at the Cinnamon Spices site for more information and bigger screenshots so you can take a better look on how your system will look.
[Browse Cinnamon Themes][8]
### Installing third party themes in Linux Mint
_“I saw this amazing theme on another site and it is not available at Cinnamon Spices…”_
Cinnamon Spices has a good collection of themes but youll still find that the theme you saw some place else is not available on the official Cinnamon website.
Well, it would be nice if there was another way, huh? You might imagine that there is (Im mean…obviously there is). So, first things first, there are other websites where you and I can find new cool themes.
Ill recommend going to Cinnamon Look and browse themes there. If you like something download it.
[Get more themes at Cinnamon Look][9]
After the preferred theme is downloaded, you will have a compressed file now with all you need for the installation. Extract it and save at ~/.themes. Confused? The “~” file path is actually your home folder: /home/{YOURUSER}/.themes.
[][10]
Suggested read  Fix "Failed To Start Session" At Login In Ubuntu 16.04
So go to the your Home directory. Press Ctrl+H to [show hidden files in Linux][11]. If you dont see a .themes folder, create a new folder and name .themes. Remember that the dot at the beginning of the folder name is important.
Copy the extracted theme folder from your Downloads directory to the .themes folder in your Home.
After that, look for the installed theme at the applet above mentioned.
Note
Remember that the themes must be made to work on Cinnamon, even though it is a fork from GNOME, not all themes made for GNOME works at Cinnamon.
Changing theme is one part of Cinnamon customization. You can also [change the looks of Linux Mint by changing the icons][12].
I hope you now you know how to change themes in Linux Mint. Which theme are you going to use?
### João Gondim
Linux enthusiast from Brasil.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-themes-linux-mint/
作者:[It's FOSS Community][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/tiny-features-linux-mint-cinnamon/
[2]: https://itsfoss.com/linux-mint-new-design/
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/09/install-theme-linux-mint-1.jpg?resize=800%2C625&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/install-theme-linux-mint-2.jpg?resize=800%2C625&ssl=1
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/09/install-theme-linux-mint-3.jpg?resize=800%2C450&ssl=1
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-mint-default-theme.jpg?resize=800%2C450&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-mint-carta-theme.jpg?resize=800%2C450&ssl=1
[8]: https://cinnamon-spices.linuxmint.com/themes
[9]: https://www.cinnamon-look.org/
[10]: https://itsfoss.com/failed-to-start-session-ubuntu-14-04/
[11]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/
[12]: https://itsfoss.com/install-icon-linux-mint/

View File

@@ -0,0 +1,232 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Get Average CPU and Memory Usage from SAR Reports Using the Bash Script)
[#]: via: (https://www.2daygeek.com/linux-get-average-cpu-memory-utilization-from-sar-data-report/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
How to Get Average CPU and Memory Usage from SAR Reports Using the Bash Script
======
Most Linux administrator monitor system performance with **[SAR report][1]** because it collect performance data for a week.
But you can easily extend this to four weeks by making changes to the “/etc/sysconfig/sysstat” file.
Also, this period can be extended beyond one month. If the value exceeds 28, the log files are placed in multiple directories, one for each month.
To extend the coverage period to 28 days, make the following change to the “/etc/sysconfig/sysstat” file.
Edit the sysstat file and change HISTORY=7 to HISTORY=28.
In this article we have added three bash scripts that will help you to easily view each data file averages in one place.
We have added many useful shell scripts in the past. If you want to check out that collection, go to the link below.
* **[How to automate daily operations using shell script][2]**
These scripts are simple and straightforward. For testing purposes, we have included only two performance metrics, namely CPU and memory.
You can modify other performance metrics in the script to suit your needs.
### Script-1: Bash Script to Get Average CPU Utilization from SAR Reports
This bash script collects the CPU average from each data file and display it on one page.
Since this is a month end, it shows 28 days data for August 2019.
```
# vi /opt/scripts/sar-cpu-avg.sh
#!/bin/sh
echo "+----------------------------------------------------------------------------------+"
echo "|Average: CPU %user %nice %system %iowait %steal %idle |"
echo "+----------------------------------------------------------------------------------+"
for file in `ls -tr /var/log/sa/sa* | grep -v sar`
do
dat=`sar -f $file | head -n 1 | awk '{print $4}'`
echo -n $dat
sar -f $file | grep -i Average | sed "s/Average://"
done
echo "+----------------------------------------------------------------------------------+"
```
Once you run the script, you will get an output like the one below.
```
# sh /opt/scripts/sar-cpu-avg.sh
+----------------------------------------------------------------------------------+
|Average: CPU %user %nice %system %iowait %steal %idle |
+----------------------------------------------------------------------------------+
08/01/2019 all 0.70 0.00 1.19 0.00 0.00 98.10
08/02/2019 all 1.73 0.00 3.16 0.01 0.00 95.10
08/03/2019 all 1.73 0.00 3.16 0.01 0.00 95.11
08/04/2019 all 1.02 0.00 1.80 0.00 0.00 97.18
08/05/2019 all 0.68 0.00 1.08 0.01 0.00 98.24
08/06/2019 all 0.71 0.00 1.17 0.00 0.00 98.12
08/07/2019 all 1.79 0.00 3.17 0.01 0.00 95.03
08/08/2019 all 1.78 0.00 3.14 0.01 0.00 95.08
08/09/2019 all 1.07 0.00 1.82 0.00 0.00 97.10
08/10/2019 all 0.38 0.00 0.50 0.00 0.00 99.12
.
.
.
08/29/2019 all 1.50 0.00 2.33 0.00 0.00 96.17
08/30/2019 all 2.32 0.00 3.47 0.01 0.00 94.20
+----------------------------------------------------------------------------------+
```
### Script-2: Bash Script to Get Average Memory Utilization from SAR Reports
This bash script will collect memory averages from each data file and display it on one page.
Since this is a month end, it shows 28 days data for August 2019.
```
# vi /opt/scripts/sar-memory-avg.sh
#!/bin/sh
echo "+-------------------------------------------------------------------------------------------------------------------+"
echo "|Average: kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty |"
echo "+-------------------------------------------------------------------------------------------------------------------+"
for file in `ls -tr /var/log/sa/sa* | grep -v sar`
do
dat=`sar -f $file | head -n 1 | awk '{print $4}'`
echo -n $dat
sar -r -f $file | grep -i Average | sed "s/Average://"
done
echo "+-------------------------------------------------------------------------------------------------------------------+"
```
Once you run the script, you will get an output like the one below.
```
# sh /opt/scripts/sar-memory-avg.sh
+--------------------------------------------------------------------------------------------------------------------+
|Average: kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit kbactive kbinact kbdirty |
+--------------------------------------------------------------------------------------------------------------------+
08/01/2019 1492331 2388461 61.55 29888 1152142 1560615 12.72 1693031 380472 6
08/02/2019 1493126 2387666 61.53 29888 1147811 1569624 12.79 1696387 373346 3
08/03/2019 1489582 2391210 61.62 29888 1147076 1581711 12.89 1701480 370325 3
08/04/2019 1490403 2390389 61.60 29888 1148206 1569671 12.79 1697654 373484 4
08/05/2019 1484506 2396286 61.75 29888 1152409 1563804 12.75 1702424 374628 4
08/06/2019 1473593 2407199 62.03 29888 1151137 1577491 12.86 1715426 371000 8
08/07/2019 1467150 2413642 62.19 29888 1155639 1596653 13.01 1716900 372574 13
08/08/2019 1451366 2429426 62.60 29888 1162253 1604672 13.08 1725931 376998 5
08/09/2019 1451191 2429601 62.61 29888 1158696 1582192 12.90 1728819 371025 4
08/10/2019 1450050 2430742 62.64 29888 1160916 1579888 12.88 1729975 370844 5
.
.
.
08/29/2019 1365699 2515093 64.81 29888 1198832 1593567 12.99 1781733 376157 15
08/30/2019 1361920 2518872 64.91 29888 1200785 1595105 13.00 1784556 375641 8
+-------------------------------------------------------------------------------------------------------------------+
```
### Script-3: Bash Script to Get Average CPU &amp; Memory Utilization from SAR Reports
This bash script collects the CPU &amp; memory averages from each data file and displays them on a page.
This bash script is slightly different compared to the above script. It shows the average of both (CPU &amp; Memory) in one location, not the other data.
```
# vi /opt/scripts/sar-cpu-mem-avg.sh
#!/bin/bash
for file in `ls -tr /var/log/sa/sa* | grep -v sar`
do
sar -f $file | head -n 1 | awk '{print $4}'
echo "-----------"
sar -u -f $file | awk '/Average:/{printf("CPU Average: %.2f%\n"), 100 - $8}'
sar -r -f $file | awk '/Average:/{printf("Memory Average: %.2f%\n"),(($3-$5-$6)/($2+$3)) * 100 }'
printf "\n"
done
```
Once you run the script, you will get an output like the one below.
```
# sh /opt/scripts/sar-cpu-mem-avg.sh
08/01/2019
-----------
CPU Average: 1.90%
Memory Average: 31.09%
08/02/2019
-----------
CPU Average: 4.90%
Memory Average: 31.18%
08/03/2019
-----------
CPU Average: 4.89%
Memory Average: 31.29%
08/04/2019
-----------
CPU Average: 2.82%
Memory Average: 31.24%
08/05/2019
-----------
CPU Average: 1.76%
Memory Average: 31.28%
.
.
.
08/29/2019
-----------
CPU Average: 3.83%
Memory Average: 33.15%
08/30/2019
-----------
CPU Average: 5.80%
Memory Average: 33.19%
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/linux-get-average-cpu-memory-utilization-from-sar-data-report/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/sar-system-performance-monitoring-command-tool-linux/
[2]: https://www.2daygeek.com/category/shell-script/