2
0
mirror of https://github.com/LCTT/TranslateProject.git synced 2025-03-30 02:40:11 +08:00

pull the newest branch from lctt master

This commit is contained in:
zhousiyu325 2017-06-10 10:51:58 +08:00
commit 63ea944a63
19 changed files with 975 additions and 1436 deletions

View File

@ -1,8 +1,8 @@
如何从参与开源项目的过程中获取自信
===============
![如何从参与开源项目的过程中获取自信](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/open_community_lead.jpg?itok=anXgpnwG "How to gain confidence to participate in open source")
图片来源:[Gabriel Kamener, Sown Together][1] 原创,经 Jen Wike Huger 修改。
随着大脑的发育,你渐渐学会了这世上什么事情可以/应该做,以及什么事情不能/不应该做。你所有的行为都受到周围大众的影响,很多时候,阻碍你参与某事的原因就是你缺乏自信。
@ -18,13 +18,13 @@
你要时刻谨记着:你是完全独立的个人,他人对你做出的评论就像是不存在一样,只有这样才能更好的获得自信。
我们都习惯了这样理解,周围的人都是根据我们的行为来做出评判的。这一习惯相当于学习如何更像社会群体一样生活的副产品。而且很可能在我们的童年,父母根据我们的行为设置的奖励机制时,这个习惯就根植我们心底。到了青春期,老师们对我们的表现来评价,给我们划分等级和分数,拿我们和身边的小伙伴对比。这样的动力和奖励机制给我们的大脑建立了一个包括自我反思在内的反馈回路。我们需要预测自己能否得到回报,并要为那些可能发生的事情做好应对。
我们都习惯了这样认知,周围的人都是根据我们的行为来做出评判的。这一习惯是学习如何更像社会群体一样生活的副产品。而且很可能在我们的童年,父母根据我们的行为设置的奖励机制时,这个习惯就根植我们心底。到了青春期,老师们对我们的表现来评价,给我们划分等级和分数,拿我们和身边的小伙伴对比。这样的动力和奖励机制给我们的大脑建立了一个包括自我反思在内的反馈回路。我们需要预测自己能否得到回报,并要为那些可能发生的事情做好应对。
现今的我们都有这样第一个疑惑:身边的人是如何看我的?然而,真相是多数人都不会花太多时间来对你进行正确客观的评价。我们所有人只是关注自己的回报,我们有自己热衷于某件事的的热情、有大量急待解决的问题。也有一些人忙于关心他们自己如何影响身边的人,他们并不会在身上花费时间。他们根本不会注意到你是否出错、大声谈话还是向他们的背景乐一样。所有的那些疑惑都只是在你自己的脑海中而已,而非在其他任何人脑中。
现今的我们都有这样第一个疑惑:身边的人是如何看我的?然而,真相是多数人都不会花太多时间来对你进行正确客观的评价。我们所有人只是关注自己的回报,我们有自己热衷于某件事的的热情、有大量急待解决的问题。也有一些人忙于关心他们自己如何影响身边的人,他们并不会在身上花费时间。他们根本不会注意到你是否出错、大声谈话还是像他们的背景音乐一样。所有的那些疑惑都只是在你自己的脑海中而已,而非在其他任何人脑中。
我们需要人们所接受的愿望也是人生意义的一部分,但是这类受我们所遇之人的一时兴起。这些人可能对我们缺乏全面认识,比如我们叫什么、我们来自哪里、形成我们认知的经历,等等。我们能否为人们所接受是一件不受我们自身控制的事情。但是,我们是可以通过与之交流来改变的。
我们需要人们所接受的愿望也是人生意义的一部分,但是这类受我们所遇之人的一时兴起。这些人可能对我们缺乏全面认识,比如我们叫什么、我们来自哪里、形成我们认知的经历,等等。我们能否为人们所接受是一件不受我们自身控制的事情。但是,我们是可以通过与之交流来改变的。
在开源的高密度社区的世界里,记住这一点是非常重要的:人们是不会过多的考虑你的。因为你的同事和导师都在忙于其他项目或则社区成员。
在开源的社区化世界里,记住这一点是非常重要的:人们是不会过多的考虑你的感受的。因为你的同事和导师都在忙于其它项目或则社区成员。
一旦你认知了这一点,通过积极地沟通来热情拥抱这个世界吧。寻求帮助、告知他人你的需求、指出你的贡献、让人们知道你和他们在一起努力、你也是这个社区中的活跃分子。当人们向你靠拢 ——而非相反 —— 时,你的开源可信度和自信会得到极大的提高。
@ -32,9 +32,9 @@
任何成功的开源社区都是一个包含教和学的社区。为沐浴在开源中,你不仅需要用到自身的已有知识,还需要不断的吸收消化其他人提供课程中的知识。幸运的是,人们都普遍热衷于分享他们熟悉的事情。
思考一下,当他人问及你的观点时,你是什么感受。得知他人认可了你所说的观点,对你的 ID 和个人精神是多么美好的一件事。
思考一下,当他人问及你的观点时,你是什么感受。得知他人认可了你所说的观点,对你的本我和自我是多么美好的一件事。
在儿童期时,我们的大脑并没有那么发达,无法为我们容纳现实世界中大量的信息量。我们曾一度认为自己是世界的中心。在六岁以前,我们的认知一直在不断成长。在此期间,我们的父母会因我们哭泣而做出回应,周围的成年人都会满足我们要求。这会在我们心底形成自己在世界上最重要的证据。
在儿童期时,我们的大脑并没有那么发达,无法为我们容纳现实世界中大量的信息量。我们曾一度认为自己是世界的中心。在六岁以前,我们的认知一直在不断成长。在此期间,我们的父母会因我们哭泣而做出回应,周围的成年人都会满足我们要求。这会在我们心底形成自己在世界上最重要的证据。
我们的神经回路在此期间建立完成,我们的性格也在此期间形成。随着我们学会参与社会和城市的生活,我们逐渐的认识到自己并非世界的中心。然而,最初形成并深植我们心底那种意识并不会因此马上就消除掉。正确理解我们在整个社会氛围中的个人意识将有助于你与他人建立连接并融洽相处。
@ -44,10 +44,9 @@
自信的人也许会说“是的,我不知道”,但却不会因此而沮丧。
### 一分耕耘,一分收获 (You reap what you sow)
### 一分耕耘,一分收获
你一定听过“不懂装懂,永远是饭桶”。这样说吧,自信就像其他很多的心理现象。
积极地提示自己:我很聪明、有趣、引人关注、极富天赋、健谈、是一个很好的伙伴、独一无二、知识面广、学习能力强、常常自省的思想者,或者是其他你想要具备的特质,久而久之你就会觉得自己就是这样的人。并且,如果这可以在你身上生效,在其他人身上也一样。。
你一定听过“不懂装懂,永远是饭桶”。这样说吧,自信就像其他很多的心理现象。积极地提示自己:我很聪明、有趣、引人关注、极富天赋、健谈、是一个很好的伙伴、独一无二、知识面广、学习能力强、常常自省的思想者,或者是其他你想要具备的特质,久而久之你就会觉得自己就是这样的人。并且,如果这可以在你身上生效,在其他人身上也一样。。
我们把这个称为自我肯定。
@ -55,13 +54,15 @@
那么,你是否有其他增强自信的方法呢?记得在评论区告诉我们哦。
(题图:[Gabriel Kamener, Sown Together][1] 原创,经 Jen Wike Huger 修改。)
----------------------------------
作者简介:
![](https://opensource.com/sites/default/files/styles/profile_pictures/public/profilepicsq_0.jpg?itok=CVMJs36A)
Laura Hilliger - 艺术家、教育事业者、作家、技术专家。她是一个多媒体设计师和开发者、技术联络员、项目经理、一个开放且喜欢协作环境的网络黑客。她主张变革,目前为发展壮大绿色和平组织辛勤工作。Alum @MozillaUC BerkeleyBAVC Adobe。Twitter @epilepticrabbit
Laura Hilliger - 艺术家、教育事业者、作家、技术专家。她是一个多媒体设计师和开发者、技术联络员、项目经理、一个开放且喜欢协作环境的网络黑客。她主张变革,目前为发展壮大绿色和平组织辛勤工作。Alum @MozillaUC BerkeleyBAVC Adobe。Twitter @epilepticrabbit
----------------------------------

View File

@ -0,0 +1,64 @@
教职人员是否可以运用维基百科教学?
============
![Can academic faculty members teach with Wikipedia?](https://camo.githubusercontent.com/47dfe3fec215387fa7bb1f2c038f4e78e0e2e47d/68747470733a2f2f6f70656e736f757263652e636f6d2f73697465732f64656661756c742f66696c65732f7374796c65732f696d6167652d66756c6c2d73697a652f7075626c69632f696d616765732f656475636174696f6e2f4544555f61636164656d6963735f353230783239325f6d612e706e673f69746f6b3d397846574f637436)
图片来自 : opensource.com
自从 2010 年,已经有 29000 个学生完成了 Wiki Ed 这一项目。他们在维基百科上添加了 2500 万词条,相当于 85000 页纸张的内容。这相当于最新出版的 Britannica 百科全书中全部词条的 66%。Wiki Ed 的学生们最积极的时候,他们贡献了维基百科上 10% 的内容, 极大地补充了贫乏的学术板块。
为了了解更多关于这个项目的信息,我联络了 LiAnna Davis -- Wiki Ed 项目的负责人。他极富热情地同意来回答我的问题。
提示:[Wiki 教育基金会 (Wiki Ed)](https://wikiedu.org/) 的平台是用自由软件搭建的,你可以在这里找到: [WikiEdu Dashboard GitHub](https://github.com/WikiEducationFoundation/WikiEduDashboard)。
**Wiki Ed 这一项目是如何启动的?说说你的背景以及你是如何参与进这个项目的。**
在2010年[维基基金会](https://wikimediafoundation.org/wiki/Home)(简称 WMF运营维基百科的非营利组织注意到了一个趋势 -- 大学的教职人员如果本身也是维基词条的编辑者会成功地将编辑维基词条作为一项任务交给了自己课堂里的学生。WMF 就此开展了一个试行项目试图解决这个问题:如果本身不编辑维基词条的教职人员支持课程中包含维基词条的编辑任务,他们是否可以通过维基百科实现教学呢?
我是这个团队的一员,在 2010 年被试行雇用,我对这个问题的回答是:“可以。” 在 2013年WMF 将这个项目的美国分部和加拿大分部拆分,形成了一个新的非营利性组织 -- 维基教育基金会( Wiki Ed自此我也从 WMF 到了Wiki Ed。自那以后我们便成为了一个独立组织我们可以专注于这个项目并且将这个项目拓展开来 -- 起初 WMF 时期每年只有 75 个班级参与,而这个学期已经有 275 班级参与了 Wiki Ed。
**人们总是觉得大学生对科技相关的一切事物都很敏感,尤其是互联网,但是你们的网站上写道,“大学本科学生可能具有高科技敏感度,但这并不代表他们具有数字信息素养。” 你可以稍微解释一下这句话吗?**
仅仅因为一个人可以搞明白自己的 iPhone 如何使用不代表他们可以明辨他们在网上阅读的信息是否值得信赖。 [斯坦福的一项研究](https://sheg.stanford.edu/upload/V3LessonPlans/Executive%20Summary%2011.21.16.pdf) (“评估信息:公民在线推理的基石 November 22, 2016.”)在近期表明:学生们并不具有数字信息素养。然而,当学生们在撰写维基百科文章之时,他们必须这样。他们需要严格遵守维基百科的[可信来源](https://en.wikipedia.org/wiki/Wikipedia:Identifying_reliable_sources) 规范,这些规范明确了维基百科上的任何信息都必须注明来源,这些来源必须是独立的,而且是可以追溯的事实。对于很多学生,这样注明来源还是第一次,多数人之前仅仅是通过谷歌搜索话题或者注明他们亲眼所见的第一手资料来进行资料的检索和查证。他们需要理解哪些资料可靠,哪些资料不可靠,从而成为足够成熟的电子信息消费者。
**你想对那些声称“维基百科不是一个可靠的来源”的人说些什么?**
维基百科是一本百科全书,根据在词典中的定义,它是一个第三手资料。当学生们开始读本科的时候,他们应该学会参考一手和二手资料,而不是第三手资料,因此学生不应该,且不能引用维基百科的内容。但是维基百科在研究之初会是一个不错的选择,它可以给你对这个话题一个广泛的认识,并且帮你发现页面底部那些你可以参考的文章来源。就像我们所鼓励的:“不要引用!用你的语言写!”
> 这样做可以让学生们代入知识生产者的身份,而不是知识的消费者……
**一个教授在 Wiki Ed 项目中的参与是如何影响到他的学生的呢?**
通过运用维基百科教学,导师们可以给学生们提供有价值的媒体素养、批判性思维、线上交流以及写作能力,不论他们在毕业之后会继续选择科研或是加入工作大军,这些极富价值的品质和技能都能帮助他们成功。这样做可以让学生们代入知识生产者的身份,而不是知识的消费者,而且这可以给予他们一个真正在这个世界做出改变的机会,而不是学生们到了学期末便会抛之脑后的生硬习题。
我们正在积极鼓励新的班级在春季学期加入这个项目。感兴趣的教职人员可以点击 [维基教育基金会的教学页](https://teach.wikiedu.org/) 由此开始。
**一个教师会需要哪些职业素养来参与这个项目?学生又是需要哪些训练呢?**
当你在[维基教育基金会的教学页](http://teach.wikiedu.org/)上注册的时候,你会发现 Wiki Ed 为新加入的教职人员提供了如何运用维基百科实现教学的在线指南。我们还有为学生提供的一系列的在线训练,根据他们不同的任务自动分配不同的指南(例如,如果你希望你的学生在文章中插入图片,他们会得到一个如何插入编辑图片的教学单元,如果你不需要,他们便不会得到这个单元的指南)。在部分十几个学科中,我们还有特定的指南书展示了这几个学科的特定编辑方式。除此之外,我们还有熟练维基百科编辑的工作人员帮助回答学生和导师们的问题。我们的系统已经在逐步扩大;我们在这个秋季学期已经支持了超过 6300 个学生,并且已经适应了与没有维基编辑经验的教职人员合作,因此这样就保证了没有人会因为资历不够而无法参与。
**“<ruby>访问学者<rt>Visiting Scholars</rt></ruby>”这个项目是指?**
我们正在试着建立学术界和维基百科之间的联系,而鼓励运用维基百科教学的项目只是其中的一环。在“<ruby>访问学者<rt>Visiting Scholars</rt></ruby>”这一项目中,大学图书馆或者教学部门将公开他们的资料,并提供给一个缺乏资料的认证的维基百科编辑人员(被称作是“访问学者”)。通过大学这一渠道,“访问学者”们可以有机会使用这些资源来完善维基百科广泛领域中的文章。这是一个规模相对小却伟大的项目,因为我们花了很多时间来建立这样的联系,但是这些“学者”们都产出了许多真的很精彩的内容。
**你的合作伙伴有谁?他们的参与如何影响到你现在的成功呢,或者在未来将会如何呢?**
我们与那些将我们工作的价值看做对他们的学科的一种服务的学术机构合作。让我们面对这个现实:当人们想要获取关于一个话题的知识之时,他们不会去读那些同行审议过,并在这些机构发表的学术论文,他们会去维基百科。通过鼓励这些机构中的教职人员用维基百科教学,正可以完善维基百科的在这些学科中的内容和信息。我们的合作伙伴扩充了我们的潜在成员,并且让我们以合作身份大量完善了维基百科上特定学科的内容。
我们欢迎读者点击这个[支持我们](http://wikiedu.org/donate) 的页面通过捐赠来支持我们的工作。
***
作者简介:
Don Watkins 是一个教育家专注教育技术创业家开源提倡者。教育心理学硕士、教育领导力硕士、Linux 系统管理员、思科认证网络支持工程师、Virtual Box 虚拟化认证。关注他: @Don_Watkins
----
via: https://opensource.com/article/17/1/Wiki-Education-Foundation
作者Don Watkins
译者:[scoutydren](https://github.com/scoutydren)
校对:[Bestony](https://github.com/Bestony)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,184 @@
AWS 云服务清单
============================================================
![AWS Cloud terminology](http://cdn2.kerneltalks.com/wp-content/uploads/2017/03/AWS-Cloud-terminology-150x150.png)
_认识 71 个 AWS 云服务的术语 ! 通过了解 AWS 世界中使用的术语开始你的 AWS 云服务使用生涯 !_
AWS<ruby>亚马逊 Web 服务<rt>Amazon Web Services</rt></ruby>,是一个提供了一系列按使用计费的 web 服务的云平台。 它是迄今为止最为著名的云平台之一。由于其灵活性、有效性、弹性、可测量性和无须维护,所以有一些企业正逐步把他们的业务迁移到云端。 由于许多公司目前在使用这些服务,所以对于系统管理员和运维人员来说应该了解一下 AWS。
这篇文章旨在列出这些 AWS 提供的服务并且解释在 AWS 中出现的术语。
截止到目前为止2017 年 3 月AWS 提供了分为 17 组的共计 71 种服务:
### 计算型服务
这是一个提供了虚拟服务器配置功能的服务,即所谓的云计算。它提供了包括以下这一系列的服务。
1. EC2EC2 代表弹性计算云。这种服务提供了可根据个人需求扩展的 [虚拟机][11]。
2. EC2 容器服务:其高性能,高可扩展性使其可在 EC2 集群环境中运行服务。
3. Lightsail该服务使用户非常容易地启动和管理虚拟服务器EC2
4. Elastic Beanstalk该服务能够自动管理你的应用程序的容量配置、负载平衡、扩展以及健康监控从而减少你的管理压力。
5. Lambda它允许你只在你需要的时候运行代码而不用去管理服务器。
6. Batch它使用户能够以自定义的管理方式运行计算工作负载批处理
### 存储型服务
它是一种云存储服务,即由 Amazon 提供的云存储设施。 该组服务包括:
1. S3S3 代表简单存储服务3 个 S。 它给你提供了在线存储服务,你可随时从任何地方存储/检索任何数据。
2. EFSEFS 代表弹性文件系统。 它是一个可以和 EC2 服务器一起使用的在线存储服务。
3. Glacier它是一种低成本/低性能数据存储解决方案,主要针对存档或长期备份。
4. Storage Gateway这种服务的接口会将你的内部应用程序托管在 AWS 之外)与 AWS 存储连接。
### 数据库
AWS 还提供在其基础设施上托管数据库,以便客户可以利用亚马逊最先进的技术来获得更快/高效/安全的数据处理。 该组包括:
1. RDSRDS 代表关系数据库服务。 用于在云上设置,操作和管理关系数据库。
2. DynamoDB其 NoSQL 数据库提供了快速处理和高可扩展性。
3. ElastiCache这是一种为你的 Web 应用程序管理内存缓存以便更快运行它们的方案
4. Redshift它是一个巨大的PB 级)的完全可升级的云端数据仓库服务。
### 网络 & 内容分发
由于 AWS 提供云端的 EC2 服务器,因此网络相关内容也将在出现在这里。 内容分发用于向位于最近位置的用户提供文件。 现如今有许多非常有名的加速网站。
1. VPCVPC 代表虚拟私有云。 它是你自己的虚拟网络,是你的专用 AWS 帐户。
2. CloudFront这是 AWS 的内容分发网络CDN服务。
3. Direct Connect它是将数据中心/场所与 AWS 连接起来的网络方式,以提高吞吐量,降低网络成本,并避免由于基于互联网的连接而导致的连接问题。
4. Route 53它是一个云端的域名系统的 DNS Web 服务。
### 迁移
它提供了一系列服务来帮助你实现本地服务到 AWS 的迁移工作。 这包括
1. Application Discovery Service专门用于分析您的服务器、网络、应用程序以帮助/加速迁移的服务。
2. DMSDMS 指的是数据库迁移服务。 它用于将数据从本地数据库迁移到 EC2 上托管的 RDS 或 DB。
3. Server Migration也称为 SMS服务器迁移服务是一种无代理服务将您的工作负载从本地移动到 AWS。
4. Snowball 当你想要使用物理存储设备而不是基于互联网/基于网络的传输)将大量数据传入/迁出 AWS 时,你应该使用它。
### 开发者工具
顾名思义, 这是一系列帮助开发者简化在云端编码的服务。
1. CodeCommit它是一个安全的、可扩展的、可管理的源代码管理服务用于托管代码仓库。
2. CodeBuild这是一个云端的代码生成器。主要用于执行、测试代码和构建部署软件包。
3. CodeDeploy这是一个可在 AWS 服务器或本地进行自动化应用程序部署的部署服务。
4. CodePipeline这个部署服务可以使编码人员可以在发布之前将其应用程序可视化。
5. X-Ray它可以使用事件调用分析应用程序。
### 管理工具
这是一组可帮助你管理 AWS 上的 Web 服务的服务。
1. CloudWatch监控你的 AWS 资源或应用程序的监控服务。
2. CloudFormation基础设施即代码以集体有序的方式管理 AWS 架构的方式。
3. CloudTrailAWS 帐户的审计和合规工具。
4. Config : AWS 的资源清单、配置历史记录和配置更改通知,以实现安全性和治理。
5. OpsWorks它可以自动化地配置部署 EC2 或内部部署计算。
6. Service Catalog创建和管理被批准在你/公司帐户中使用的 IT 服务目录。
7. Trusted Advisor它的 AWS AI 可以通过审查你的 AWS 基础设施使你的 AWS 基础设施更好,更省钱
8. Managed Service提供持续的基础设施管理。
### 安全性、身份和合规
这是一组很重要的 AWS 服务以确保你的 AWS 空间的安全性。
1. IAMIAM 即身份和访问管理,控制用户访问你的 AWS 资源和服务。
2. Inspector自动安全评估可帮助你在 AWS 上的应用安全和合规。
3. Certificate Manager为 AWS 应用程序提供,管理和部署 SSL / TLS 证书。
4. Directory Service相当于 AWS 的 Microsoft Active Directory。
5. WAF & ShieldWAF 即 Web 应用防火墙。 监控和控制对 CloudFront 或负载均衡器上的内容的访问。
6. Compliance ReportsAWS 基础设施空间的合规报告,以确保您的应用程序符合您的策略。
### 数据分析
AWS 空间的数据分析服务,以帮助您查看、计划和对帐户中的事件采取行动。
1. Athena它是一个基于 SQL 查询的服务,用于分析 S3 存储的数据。
2. EMREMR 的全写是 Elastic Map Reduce。 是一个主要用于大数据处理和分析的服务。
3. CloudSearchAWS 在应用和服务中的搜索功能。
4. Elasticsearch Service它可以创建一个域并在 AWS Cloud 中部署、操作和扩展 Elasticsearch 集群。
5. Kinesis这种服务可以实现实时的大量流数据处理。
6. Data Pipeline它可以帮助我们在不同的 AWS 服务之间实现数据迁移。
7. QuickSight收集、分析和呈现 AWS 的业务数据。
### 人工智能
AWS 的 AI!
1. Lex它可以帮助我们在一些使用语音和文本的应用中构建会话界面。
2. Polly这是一个提供文字到语音转换的服务。
3. Rekognition使您能够将图像分析添加到应用程序。
4. Machine Learning它具有学习数据中的模式的算法。
### 物联网
这个服务保证了 AWS 在不同设备上的高可用性。
1. AWS IoT它使联网硬件设备与 AWS 的应用程序能够交互。
### 游戏开发
顾名思义,这个服务旨在游戏开发。
1. Amazon GameLift该服务旨在部署、管理用于会话的多人游戏的专用游戏服务器。
### 移动服务
这是一组主要针对手持设备的服务。
1. Mobile Hub帮助您创建移动应用的后台功能并将其集成到移动应用。
2. Cognito在连接了互联网设备上控制移动用户的身份验证和 AWS 的访问。
3. Device Farm移动应用测试服务使你可以在 Android 上托管的真实手机上跨 Android、iOS 测试应用。
4. Mobile Analytics在 AWS 上测量、跟踪和分析移动应用数据。
5. Pinpoint针对性的推送通知和移动互动。
### 应用服务
这是一组可以和你在 AWS 上的应用一起使用的服务。
1. Step Functions定义和使用应用程序中的各种功能。
2. SWFSWF 代表简单的工作流服务。其云工作流程管理可帮助开发人员在应用程序生命周期的不同阶段进行协调和贡献。
3. API Gateway帮助开发人员创建、管理和托管 API。
4. Elastic Transcoder帮助开发人员将媒体文件转换为在各种设备上可以播放的格式。
### 消息
AWS 中的通知和消息服务。
1. SQSSQS 表示简单队列服务。完全管理的消息队列服务,用于在 AWS 中的服务和应用之间进行通信。
2. SNSSNS 代表简单通知服务。 为 AWS 用户推送通知服务,提醒他们有关其在 AWS 空间中的服务。
3. SESSES 代表简单电子邮件服务。 这是 AWS 为自己的客户提供高性价比的电子邮件服务。
### 企业生产率
一组帮你提高业务生产率的服务。
1. WorkDocs协同文件共享、存储和编辑服务。
2. WorkMail安全的商务邮件、日程服务。
3. Amazon Chime在线的企业会议
### 桌面和应用程序流式传输
实现桌面应用程序通过云端进行流传输。
1. WorkSpaces完全管理且安全的云计算服务。
2. AppStream 2.0:来自云端的流式桌面应用。
--------------------------------------------------------------------------------
via: http://kerneltalks.com/virtualization/aws-cloud-terminology/
作者:[Shrikant Lavhate][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://kerneltalks.com/virtualization/aws-cloud-terminology/

View File

@ -1,25 +1,24 @@
更快的机器学习即将来到 Linux 内核
============================================================
### Linux 内核新增的异构内存管理将解锁加速 GPU 的新途径,并挖掘其它机器学习硬件的潜能
> Linux 内核新增的异构内存管理将解锁加速 GPU 的新途径,并挖掘其它机器学习硬件的潜能
![更快的机器学习正在来到你身边的 Linux 内核 Faster machine learning is coming to a Linux kernel near you](http://images.techhive.com/images/article/2015/12/machine_learning-100633721-primary.idge.jpg)
![更快的机器学习正在来到你身边的 Linux 内核](http://images.techhive.com/images/article/2015/12/machine_learning-100633721-primary.idge.jpg)
>Credit: Thinkstock
一项开发了很久的内存管理技术将会给机器学习和其它 GPU 驱动的程序很大幅度的提升,而它也将在接下来的几个版本中进入 Linux 内核。
异构内存管理HMM可以允许设备驱动为在其自身内存管理下的进程镜像地址空间。正如红帽的开发者 Jérôme Glisse [所解释的][10],这让像 GPU 这样的硬件设备可以直接访问进程内存,而不用花费复制带来的额外开销。它还不违反现代才做系统提供的内存保护功能。
异构内存管理HMM可以允许设备驱动为在其自身内存管理下的进程镜像地址空间。正如红帽的开发者 Jérôme Glisse [所解释的][10],这让像 GPU 这样的硬件设备可以直接访问进程内存,而不用花费复制带来的额外开销。它还不违反现代操作系统提供的内存保护功能。
一类会从 HMM 中获益最多的应用是基于 GPU 的机器学习。像 OpenCL 和 CUDA 这样的库能够从 HMM 中获得速度的提升。HMM 实现这个的方式和[加速基于 GPU 的机器学习][11]相似,就是让数据留在原地,靠近 GPU 的地方,在那里直接操作数据,尽可能少地移动数据。
一类会从 HMM 中获益最多的应用是基于 GPU 的机器学习。像 OpenCL 和 CUDA 这样的库能够从 HMM 中获得速度的提升。HMM 实现这个的方式和[加速基于 GPU 的机器学习][11]相似,就是让数据留在原地,靠近 GPU在那里直接操作数据尽可能少地移动数据
像这样的加速对于 CUDA英伟达基于 GPU 的处理库)来说,只会有益于在英伟达 GPU 上的操作,这些 GPU 也是目前加速数据处理的主要硬件。但是OpenCL 设计用来编写可以针对多种硬件的代码——CPU、GPU、FPGA 等等——随着这些硬件的成熟HMM 能够提供更加广泛的益处
像这样的加速对于 CUDA英伟达基于 GPU 的处理库)来说,只会有益于在英伟达 GPU 上的操作,这些 GPU 也是目前加速数据处理的主要硬件。但是OpenCL 设计用来编写可以针对多种硬件的代码——CPUGPUFPGA等等——随着这些硬件的成熟HMM 能够提供更加广泛的益处
要让 Linux 中的 HMM 处于可用状态还有一些阻碍。第一个是内核支持,在很长一段时间里都受到限制。[早在 2014][12]年HMM 最初作为 Linux 内核补丁集提出,红帽和英伟达都是关键开发者。需要做的工作不少,但是开发者认为代码可以提交上去,也许接下来的几个内核版本就能把它包含进去
要让 Linux 中的 HMM 处于可用状态还有一些阻碍。第一个是内核支持,在很长一段时间里都很不明了。[早在 2014][12]年HMM 最初作为 Linux 内核补丁集提出,红帽和英伟达都是关键开发者。需要做的工作不少,但是开发者相信可以提交代码,也许接下来的几个内核版本就能把它包含进去。
第二个阻碍是显卡驱动支持,英伟达一直在自己单独做一些工作。据 Glisse 的说法AMD 的 GPU 可能也会支持 HMM所以这种特殊优化不会仅限于英伟达的 GPU。AMD 一直都在尝试提升它的 GPU 市场占有率,有可能会[将 GPU 和 CPU 整合][13]到同一模具。但是,软件生态系统依然更偏向英伟达;要让可以选择成为现实,还需要更多的像 HMM 这样的中立项目,以及让 OpenCL 提供和 CUDA 相当的性能。
第二个阻碍是显卡驱动支持,英伟达一直在自己单独做一些工作。据 Glisse 的说法AMD 的 GPU 可能也会支持 HMM所以这种特殊优化不会仅限于英伟达的 GPU。AMD 一直都在尝试提升它的 GPU 市场占有率,有可能会[将 GPU 和 CPU 整合][13]到同一模具。但是,软件生态系统依然更青睐英伟达;要使其兑现,还需要更多的像 HMM 这样的中立项目,以及让 OpenCL 提供和 CUDA 相当的性能。
第三个阻碍是硬件支持,因为 HMM 的工作需要一项称作可重现页面故障replayable page faults的硬件特性。只有英伟达的帕斯卡系列高端 GPU 才支持这项特性。从某些意义上来说这是个好消息,因为这意味着英伟达只需要提供单一硬件的驱动支持就能让 HMM 正常使用,工作量就少了。
@ -31,7 +30,7 @@ via: http://www.infoworld.com/article/3196884/linux/faster-machine-learning-is-c
作者:[Serdar Yegulalp][a]
译者:[alim0x](https://github.com/alim0x)
校对:[校对者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,125 @@
cron 与 anacron如何在 Linux 中计划任务
============================================================
在本篇中,我们会解释 cron 和 anacron并向你展示如何在 Linux 中设置 anacron。我们也会比较这两个工具。
要[在一个给定时间或者稍后安排一个任务][1],你可以使用 `at` 或者 `batch` 命令,要使命令能够重复运行,你可以使用 cron 以及 anacron 工具。
[cron][2] - 是一个用于运行计划任务如系统备份、更新等的守护进程。它适合在那些 24X7 不间断运行的机器如服务器上运行的计划任务。
命令/脚本被写在 cron 任务脚本中,它是在 `crontab` 文件中被安排的。系统默认的 `crontab` 文件是 `/etc/crontab`,但是每个用户也可以创建自己的 `crontab` 文件来在特定时间运行用户定义的命令。
要创建一份个人 `crontab` 文件,只要输入:
```
$ crontab -e
```
### 如何在 Linux 中设置 anacron
anacron 用于以天为单位的频率运行命令。它的工作与 cron 稍有不同,**它假设机器不会一直开机**。
cron 也适合在那些不会 24X7 运行如笔记本以及桌面电脑的机器上运行每日、每周以及每月的计划任务LCTT 译注:不适合按小时、分钟执行任务)。
假设你有一个计划任务(比如备份脚本)要使用 cron 在每天半夜运行,也许你以及睡着,那时你的桌面/笔记本电脑已经关机。你的备份脚本就不会被运行。
然而,如果你使用 anacron你可以确保在你下次开启桌面/笔记本电脑的时候,备份脚本会被执行。
### anacron 如何在 Linux 工作
anacron 任务被列在 `/etc/anacrontab`任务可以使用下面的格式anacron 文件中的注释必须以 `#` 号开始)安排。
```
period delay job-identifier command
```
从上面的格式中:
* `period` - 这是任务的频率,以天来指定,或者是 `@daily`、`@weekly`、`@monthly` 代表每天、每周、每月一次。你也可以使用数字:`1` - 每天、`7` - 每周、`30` - 每月,或者 `N` - 几天。
* `delay` - 这是在执行一个任务前等待的分钟数。
* `job-id` - 这是写在日志文件中任务的独特名字。
* `command` - 这是要执行的命令或 shell 脚本。
要浏览示例文件,输入:
```
$ ls -l /var/spool/anacron/
total 12
-rw------- 1 root root 9 Jun 1 10:25 cron.daily
-rw------- 1 root root 9 May 27 11:01 cron.monthly
-rw------- 1 root root 9 May 30 10:28 cron.weekly
```
这是实际发生的:
* anacron 会检查任务是否已经在 `period` 字段指定的时间被被执行了。如果没有,则在等待 `delay` 字段中指定的分钟数后,执行 `command` 字段中指定的命令。
* 一旦任务被执行了,它会使用 `job-id`(时间戳文件名)字段中指定的名称将日期记录在 `/var/spool/anacron` 目录中的时间戳文件中。
现在让我们看一个例子。这个会每天运行 `/home/aaronkilik/bin/backup.sh` 脚本:
```
@daily 10 example.daily /bin/bash /home/aaronkilik/bin/backup.sh
```
当机器在 `backup.sh` 期望被运行时是关机的anacron 会在机器开机十分钟之后运行它,而不用再等待 7 天。
这里有两个你应该理解的 anacrontab 文件的重要变量:
* `START_HOURS_RANGE` - 这个设置任务开始运行的时间范围(也就是任务只在这几个小时内运行)。
* `RANDOM_DELAY` - 这定义添加到用户定义的任务延迟的最大随机延迟(默认为 45
这是你的 anacrontab 文件可能看上去的样子。
Anacron `/etc/anacrontab`
```
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
@daily 10 example.daily /bin/bash /home/aaronkilik/bin/backup.sh
```
下面是 cron 以及 anacron 的比较,帮助你理解何时用他们其中一个。
| cron | anacron |
|------|---------|
| 它是守护进程 | 它不是守护进程 |
| 适合服务器 | 适合桌面/笔记本电脑 |
| 可以让你以分钟级运行计划任务 | 只能让你以天为基础来运行计划任务 |
| 关机时不会执行计划任务 | 如果计划任务到期,机器是关机的,那么它会在机器下次开机后执行计划任务 |
| 普通用户和 root 用户都可以使用 | 只有 root 用户可以使用(使用特定的配置启动普通任务) |
cron 和 anacron 主要的区别在于 cron 能在那些持续运行的机器上有效地运行,而 anacron 是针对那些会在一天内或者一周内会关机的机器。
如果你还知道其他方式,请在评论栏中与我们分享。
--------------------------------------------------------------------------------
作者简介:
Aaron Kili 是一个 Linux 和 F.O.S.S 爱好者、Linux 系统管理员、网络开发人员,现在也是 TecMint 的内容创作者,他喜欢和电脑一起工作,坚信共享知识。
------
via: https://www.tecmint.com/cron-vs-anacron-schedule-jobs-using-anacron-on-linux/
作者:[Aaron Kili][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.tecmint.com/author/aaronkili/
[1]:https://www.tecmint.com/linux-cron-alternative-at-command-to-schedule-tasks/
[2]:https://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/
[3]:https://www.tecmint.com/author/aaronkili/
[4]:https://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[5]:https://www.tecmint.com/free-linux-shell-scripting-books/

View File

@ -1,83 +1,84 @@
安卓编年史
安卓编年史20安卓 4.1果冻豆——Google Now 指明未来
================================================================================
![](http://cdn.arstechnica.net/wp-content/uploads/2014/03/playicons2.png)
Ron Amadeo 供图
### 安卓 4.1果冻豆——Google Now指明未来
![华硕制造的 Nexus 7安卓 4.1 的首发设备。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/ASUS_Google_Nexus_7_4_11.jpg)
华硕制造的 Nexus 7安卓 4.1 的首发设备。
![华硕制造的 Nexus 7安卓 4.1 的首发设备](http://cdn.arstechnica.net/wp-content/uploads/2014/03/ASUS_Google_Nexus_7_4_11.jpg)
随着2012年7月安卓 4.1 果冻豆的发布,谷歌的安卓发布节奏进入每六个月一发布的轨道。平台已经成熟,三个月的发布周期就没那么必要了,更长的发布周期也给了 OEM 厂商足够的时间跟上谷歌的节奏。和蜂巢不同小数点后的更新发布现在是主要更新4.1 带来了主要的界面更新和框架变化。
*华硕制造的 Nexus 7安卓 4.1 的首发设备*
果冻豆最大的变化之一,并且你在截图中看不到的是“黄油计划”,谷歌工程师齐心努力让安卓的动画顺畅地跑在 30FPS 上。还有一些核心变化,像垂直同步和三重缓冲,每个动画都经过优化以流畅地绘制。动画和顺滑滚动一直是安卓和 iOS 相比之下的弱点。经过在核心动画框架和单独的应用上的努力,果冻豆让安卓的流畅度大幅接近 iOS
随着 2012 年 7 月安卓 4.1 果冻豆的发布,谷歌的安卓发布节奏进入每六个月一发布的轨道。平台已经成熟,三个月的发布周期就没那么必要了,更长的发布周期也给了 OEM 厂商足够的时间跟上谷歌的节奏。和蜂巢不同小数点后的更新发布现在是主要更新4.1 带来了主要的界面更新和框架变化
和果冻豆一起到来的还有 [Nexus][2] 7由华硕生产的7英寸平板。不像之前主要是横屏模式的 XoomNexus 7 主要以竖屏模式使用像个大一号的手机。Nexus 7 展现了经过一年半的生态建设,谷歌已经准备好了给平板市场带来一部旗舰设备。和 Nexus One 和 GSM Galaxy Nexus 一样Nexus 7 直接由谷歌在线销售。尽管那些早先的设备对习惯于运营商补贴的消费者来说拥有惊人的高价Nexus 7 以仅仅 200 美元的价格推向大众市场。这个价格给你带来一部7英寸1280x800 英寸显示屏,四核 1.2GHz Tegra 3 处理器1GB 内存8GB 内置存储的设备。Nexus 7 的性价比如此之高,许多人都想知道谷歌到底有没有在其旗舰平板上赚到钱
果冻豆最大的变化之一,并且你在截图中看不到的是“黄油计划”,这个名字代表了谷歌工程师让安卓的动画顺畅地跑在 30FPS 上的努力。还有一些核心变化,像垂直同步和三重缓冲,每个动画都经过优化以流畅地绘制。动画和顺滑滚动一直是安卓和 iOS 相比之下的弱点。经过在核心动画框架和单独的应用上的努力,果冻豆让安卓的流畅度大幅接近 iOS
更小更轻7英寸这些因素促成了谷歌巨大的成功并且将谷歌带向了引领行业潮流的位置。一开始制造10英寸 iPad 的苹果,最终也不得不推出和 Nexus 7 相似的 iPad Mini 来应对。
和果冻豆一起到来的还有 [Nexus][2] 7由华硕生产的 7 英寸平板。不像之前主要是横屏模式的 XoomNexus 7 主要以竖屏模式使用像个大一号的手机。Nexus 7 展现了经过一年半的生态建设,谷歌已经准备好了给平板市场带来一部旗舰设备。和 Nexus One 和 GSM Galaxy Nexus 一样Nexus 7 直接由谷歌在线销售。尽管那些早先的设备对习惯于运营商补贴的消费者来说价格高的惊人Nexus 7 以仅仅 200 美元的价格推向大众市场。这个价格给你带来一部 7 英寸、1280x800 英寸显示屏、四核 1.2GHz Tegra 3 处理器、1GB 内存、8GB 内置存储的设备。Nexus 7 的性价比如此之高,许多人都想知道谷歌到底有没有在其旗舰平板上赚到钱。
更小、更轻、7 英寸,这些因素促成了谷歌巨大的成功,并且将谷歌带向了引领行业潮流的位置。一开始制造 10 英寸 iPad 的苹果,最终也不得不推出和 Nexus 7 相似的 iPad Mini 来应对。
![4.1 的新锁屏设计,壁纸,以及系统按钮新的点击高亮。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/picture.png)
4.1 的新锁屏设计,壁纸,以及系统按钮新的点击高亮。
Ron Amadeo 供图
*4.1 的新锁屏设计,壁纸,以及系统按钮新的点击高亮。
[Ron Amadeo 供图]*
蜂巢引入的电子风格在冰淇淋三明治中有所减少,果冻豆在此之上走得更远。它开始从系统中大范围地移除蓝色。迹象就是系统按钮的点击高亮从蓝色变为了灰色。
![新应用阵容合成图以及新的消息可展开通知面板。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/jb-apps-and-notications.png)
新应用阵容合成图以及新的消息可展开通知面板。
Ron Amadeo 供图
通知中心面板完全重制了这个设计一直沿用到今天的奇巧巧克力KitKat。新面板扩展到了屏幕顶部并且覆盖了状态栏图标这意味着通知面板打开的时候不再能看到状态栏。时间突出显示在左上角旁边是日期和设置按钮。清除所有通知按钮冰淇淋三明治中显示为一个“X”按钮现在变为阶梯状的按钮象征着清除所有通知的时候消息交错滑动的动画效果。底部的面板把手从一个小圆换成了一条直线和面板等宽。所有的排版都发生了变化——通知面板的所有项现在都使用了更大更细的字体。通知面板是另一个从冰淇淋三明治和蜂巢中引入的蓝色元素被移除的屏幕。除了触摸高亮之外整个通知面板都是灰色的。
*新应用阵容合成图以及新的消息可展开通知面板。
[Ron Amadeo 供图]*
通知面板也引入了新功能。相较于之前的两行设计现在的通知消息可以展开以显示更多信息。通知消息可以显示最多8行文本甚至还能在消息底部显示按钮。屏幕截图通知消息底部有个分享按钮你也可以直接从未接来电通知拨号或者将一个正在响铃的闹钟小睡这些都可以在通知面板完成。新通知消息默认展开但当它们堆叠到一起时会恢复原来的尺寸。在通知消息上双指向下滑动可以展开消息。
通知中心面板完全重制了这个设计一直沿用到今天的奇巧巧克力KitKat。新面板扩展到了屏幕顶部并且覆盖了状态栏图标这意味着通知面板打开的时候不再能看到状态栏。时间突出显示在左上角旁边是日期和设置按钮。清除所有通知的按钮在冰淇淋三明治中显示为一个“X”按钮现在变为阶梯状的按钮象征着清除所有通知的时候消息交错滑动的动画效果。底部的面板把手从一个小圆换成了一条直线和面板等宽。所有的排版都发生了变化——通知面板的所有项现在都使用了更大更细的字体。通知面板是另一个从冰淇淋三明治和蜂巢中引入的蓝色元素被移除的屏幕。除了触摸高亮之外整个通知面板都是灰色的。
通知面板也引入了新功能。相较于之前的两行设计,现在的通知消息可以展开以显示更多信息。通知消息可以显示最多 8 行文本,甚至还能在消息底部显示按钮。屏幕截图通知消息底部有个分享按钮,你也可以直接从未接来电通知中拨号,或者将一个正在响铃的闹钟小睡,这些都可以在通知面板完成。新通知消息默认展开,但当它们堆叠到一起时会恢复原来的尺寸。在通知消息上双指向下滑动可以展开消息。
![新谷歌搜索应用,带有 Google Now 卡片,语音搜索,以及文字搜索。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/googlenow.png)
新谷歌搜索应用,带有 Google Now 卡片,语音搜索,以及文字搜索。
Ron Amadeo 供图
果冻豆中不止对安卓而言也是对谷歌来说最大的特性是新版谷歌搜索应用。它带来了“Google Now”一个预测性搜索功能。Google Now 在搜索框下面显示为几张卡片,它会提供谷歌认为你所关心的事物的搜索结果。就比如谷歌地图搜索你最近在桌面电脑查找的地点或日历的约会地点,天气,以及旅行时回家的时间。
*新谷歌搜索应用,带有 Google Now 卡片,语音搜索,以及文字搜索。
[Ron Amadeo 供图]*
新版谷歌搜索应用自然可以从谷歌图标启动,但它还可以在任意屏幕从系统栏上滑访问。长按系统栏会唤出一个类似锁屏解锁的环。卡片部分纵向滚动,如果你不想看到它们,可以滑动消除它们。语音搜索是更新的一个大部分。提问不是无脑地输入进谷歌,如果谷歌知道答案,它还会用文本语音转换引擎回答你。传统的文字搜索当然也受支持。只需点击搜索栏然后开始输入即可
果冻豆中不止对安卓而言也是对谷歌来说最大的特性是新版谷歌搜索应用。它带来了“Google Now”一个预测性搜索功能。Google Now 在搜索框下面显示为几张卡片,它会提供谷歌认为你所关心的事物的搜索结果。就比如谷歌地图搜索你最近在桌面电脑查找的地点或日历的约会地点、天气,以及旅行时回家的时间
谷歌经常将 Google Now 称作“谷歌搜索的未来”。告诉谷歌你想要什么这还不够好。谷歌想要在你之前知道你想要什么。Google Now 用谷歌所有的数据挖掘关于你的知识为你服务,这也是谷歌对抗搜索引擎竞争对手,比如必应,最大的优势所在。智能手机比你拥有的其它设备更了解你,所以该服务在安卓上首次亮相。但谷歌慢慢也将 Google Now 加入 Chrome最终似乎会到达 Google.com
新版谷歌搜索应用自然可以从谷歌图标启动,但它还可以在任意屏幕从系统栏上滑访问。长按系统栏会唤出一个类似锁屏解锁的环。卡片部分纵向滚动,如果你不想看到它们,可以滑动消除它们。语音搜索是更新的一个大部分。提问不是无脑地输入进谷歌,如果谷歌知道答案,它还会用文本语音转换引擎回答你。传统的文字搜索当然也支持。只需点击搜索栏然后开始输入即可
尽管功能很重要,但同时 Google Now 是谷歌产品有史以来最重要的设计工作也是毋庸置疑的。谷歌搜索应用引入的白色卡片审美将会成为几乎所有谷歌产品设计的基础。今天,卡片风格被用在 Google Play 商店以及所有的 Play 内容应用Youtube谷歌地图DriveKeepGmailGoogle+以及其它产品。同时也不限于安卓应用。不少谷歌的桌面站点和 iOS 应用也以此设计为灵感。设计是谷歌历史中的弱项之一,但 Google Now 开始谷歌最终在设计上采取了行动,带来一个统一的,全公司范围的设计语言。
谷歌经常将 Google Now 称作“谷歌搜索的未来”。告诉谷歌你想要什么这还不够好。谷歌想要在你之前知道你想要什么。Google Now 用谷歌所有的数据挖掘关于你的知识为你服务,这也是谷歌对抗搜索引擎竞争对手,比如必应,的最大优势所在。智能手机比你拥有的其它设备更了解你,所以该服务在安卓上首次亮相。但谷歌慢慢也将 Google Now 加入 Chrome最终似乎会到达 Google.com。
尽管功能很重要,但同时 Google Now 是谷歌产品有史以来最重要的设计工作也是毋庸置疑的。谷歌搜索应用引入的白色卡片审美将会成为几乎所有谷歌产品设计的基础。今天,卡片风格被用在 Google Play 商店以及所有的 Play 内容应用Youtube、谷歌地图、Drive、Keep、Gmail、Google+ 以及其它产品。同时也不限于安卓应用。不少谷歌的桌面站点和 iOS 应用也以此设计为灵感。设计是谷歌历史上的弱项之一,但 Google Now 开始谷歌最终在设计上采取了行动,带来一个统一的,全公司范围的设计语言。
![又一个 Youtube 重新设计,信息密度有所下降。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/yotuube.png)
又一个 Youtube 的重新设计,信息密度有所下降。
Ron Amadeo 供图
又一个版本,又一个 Youtube 的重新设计。这次列表视图主要基于略缩图,大大的图片占据了屏幕的大部分。信息密度在新列表设计中有所下降。之前 Youtube 每屏大约能显示6个项目现在只能显示3个。
*又一个 Youtube 的重新设计,信息密度有所下降。
[Ron Amadeo 供图]*
又一个版本,又一个 Youtube 的重新设计。这次列表视图主要基于略缩图,大大的图片占据了屏幕的大部分。信息密度在新列表设计中有所下降。之前 Youtube 每屏大约能显示 6 个项目,现在只能显示 3 个。
Youtube 是首批在应用左侧加入滑动抽屉的应用之一,该特性会成为谷歌应用的标准设计风格。抽屉中有你的账户的链接和订阅频道,这让谷歌可以去除页面顶部标签页设计。
![Google Play 服务的职责以及安卓的剩余部分职责。](http://cdn.arstechnica.net/wp-content/uploads/2013/08/playservicesdiagram2.png)
Google Play 服务的职责以及安卓的剩余部分职责。
Ron Amadeo 供图
### Google Play Services—fragmentation and making OS versions (nearly) obsolete ###
*Google Play 服务的职责以及安卓的剩余部分职责。
[Ron Amadeo 供图]*
### Google Play 服务——碎片化和让系统版本(几乎)过时 ###
碎片化那时候看起来这并不是个大问题但2012年12月Google Play 服务 1.0 面向所有安卓2.2及以上版本的手机推出。它添加了一些 Google+ API 和对 OAuth 2.0 的支持。
碎片化那时候看起来这并不是个大问题,但 2012 12 Google Play 服务 1.0 面向所有安卓 2.2 及以上版本的手机推出。它添加了一些 Google+ API 和对 OAuth 2.0 的支持。
尽管这个升级听起来很无聊,但 Google Play 服务最终会成长为安卓整体的一部分。Google Play 服务扮演着正常应用和安卓系统的中间角色,使得谷歌可以升级或替换一些核心组件,并在不发布新安卓版本的前提下添加 API。
有了 Play 服务,谷歌有了直接接触安卓手机核心部分的能力,而不用通过 OEM 更新一集运营商批准的过程。谷歌使用 Play 服务添加了全新的位置系统,恶意软件扫描,远程擦除功能,以及新的谷歌地图 API所有的这一切都不用通过发布一个系统更新实现。正如我们在姜饼部分的结尾提到的感谢 Play 服务里这些“可移植的”API 实现,姜饼仍然能够下载现代版本的 Play 商店和许多其他的谷歌应用。
有了 Play 服务,谷歌有了直接接触安卓手机核心部分的能力,而不用通过 OEM 更新一集运营商批准的过程。谷歌使用 Play 服务添加了全新的位置系统、恶意软件扫描、远程擦除功能,以及新的谷歌地图 API所有的这一切都不用通过发布一个系统更新实现。正如我们在姜饼部分的结尾提到的感谢 Play 服务里这些“可移植的”API 实现,姜饼仍然能够下载现代版本的 Play 商店和许多其他的谷歌应用。
另一个巨大的益处是安卓用户基础的兼容性。最新版本的安卓系统要经过很长时间到达大多数用户手中,这意味着最新版本系统绑定的 API 在大多数用户升级之前对开发者来说没有任何意义。Google Play 服务兼容冻酸奶及以上版本换句话说就是99%的活跃设备,并且更新可以直接通过 Play 商店直接推送到手机上。通过将 API 包含在 Google Play 服务中而不是安卓中,谷歌可以在一周内将新 API 推送到几乎所有用户手中。这对许多版本碎片化引起的问题来说是个[伟大的解决方案][3]。
另一个巨大的益处是安卓用户基础的兼容性。最新版本的安卓系统要经过很长时间到达大多数用户手中,这意味着最新版本系统绑定的 API 在大多数用户升级之前对开发者来说没有任何意义。Google Play 服务兼容冻酸奶及以上版本,换句话说就是 99% 的活跃设备,并且更新可以直接通过 Play 商店直接推送到手机上。通过将 API 包含在 Google Play 服务中而不是安卓中,谷歌可以在一周内将新 API 推送到几乎所有用户手中。这对许多版本碎片化引起的问题来说是个[伟大的解决方案][3]。
----------
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
![Ron Amadeo](https://cdn.arstechnica.net/wp-content/uploads/2016/05/r.amadeo-45843.jpg)
[Ron Amadeo][a] / Ron是Ars Technica的评论编缉专注于安卓系统和谷歌产品。他总是在追寻新鲜事物还喜欢拆解事物看看它们到底是怎么运作的。
[@RonAmadeo][t]
[Ron Amadeo][a] / Ron 是 Ars Technica的评论编缉专注于安卓系统和谷歌产品。他总是在追寻新鲜事物还喜欢拆解事物看看它们到底是怎么运作的。[@RonAmadeo][t]
--------------------------------------------------------------------------------
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/21/
via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/21/
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
译者:[alim0x](https://github.com/alim0x) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,3 +1,5 @@
ictlyh Translating
Many SQL Performance Problems Stem from “Unnecessary, Mandatory Work”
============================================================ 

View File

@ -1,3 +1,4 @@
ictlyh Translating
An introduction to GRUB2 configuration for your Linux machine
============================================================

View File

@ -1,302 +0,0 @@
ictlyh Translating
Writing a Linux Debugger Part 5: Source and signals
============================================================
In the the last part we learned about DWARF information and how it can be used to read variables and associate our high-level source code with the machine code which is being executed. In this part well put this into practice by implementing some DWARF primitives which will be used by the rest of our debugger. Well also take this opportunity to get our debugger to print out the current source context when a breakpoint is hit.
* * *
### Series index
These links will go live as the rest of the posts are released.
1. [Setup][1]
2. [Breakpoints][2]
3. [Registers and memory][3]
4. [Elves and dwarves][4]
5. [Source and signals][5]
6. [Source-level stepping][6]
7. Source-level breakpoints
8. Stack unwinding
9. Reading variables
10. Next steps
* * *
### Setting up our DWARF parser
As I noted way back at the start of this series, well be using [`libelfin`][7] to handle our DWARF information. Hopefully you got this set up in the first post, but if not, do so now, and make sure that you use the `fbreg` branch of my fork.
Once you have `libelfin` building, its time to add it to our debugger. The first step is to parse the ELF executable were given and extract the DWARF from it. This is very easy with `libelfin`, just make these changes to `debugger`:
```
class debugger {
public:
debugger (std::string prog_name, pid_t pid)
: m_prog_name{std::move(prog_name)}, m_pid{pid} {
auto fd = open(m_prog_name.c_str(), O_RDONLY);
m_elf = elf::elf{elf::create_mmap_loader(fd)};
m_dwarf = dwarf::dwarf{dwarf::elf::create_loader(m_elf)};
}
//...
private:
//...
dwarf::dwarf m_dwarf;
elf::elf m_elf;
};
```
`open` is used instead of `std::ifstream` because the elf loader needs a UNIX file descriptor to pass to `mmap` so that it can just map the file into memory rather than reading it a bit at a time.
* * *
### Debug information primitives
Next we can implement functions to retrieve line entries and function DIEs from PC values. Well start with `get_function_from_pc`:
```
dwarf::die debugger::get_function_from_pc(uint64_t pc) {
for (auto &cu : m_dwarf.compilation_units()) {
if (die_pc_range(cu.root()).contains(pc)) {
for (const auto& die : cu.root()) {
if (die.tag == dwarf::DW_TAG::subprogram) {
if (die_pc_range(die).contains(pc)) {
return die;
}
}
}
}
}
throw std::out_of_range{"Cannot find function"};
}
```
Here I take a naive approach of just iterating through compilation units until I find one which contains the program counter, then iterating through the children until we find the relevant function (`DW_TAG_subprogram`). As mentioned in the last post, you could handle things like member functions and inlining here if you wanted.
Next is `get_line_entry_from_pc`:
```
dwarf::line_table::iterator debugger::get_line_entry_from_pc(uint64_t pc) {
for (auto &cu : m_dwarf.compilation_units()) {
if (die_pc_range(cu.root()).contains(pc)) {
auto &lt = cu.get_line_table();
auto it = lt.find_address(pc);
if (it == lt.end()) {
throw std::out_of_range{"Cannot find line entry"};
}
else {
return it;
}
}
}
throw std::out_of_range{"Cannot find line entry"};
}
```
Again, we simply find the correct compilation unit, then ask the line table to get us the relevant entry.
* * *
### Printing source
When we hit a breakpoint or step around our code, well want to know where in the source we end up.
```
void debugger::print_source(const std::string& file_name, unsigned line, unsigned n_lines_context) {
std::ifstream file {file_name};
//Work out a window around the desired line
auto start_line = line <= n_lines_context ? 1 : line - n_lines_context;
auto end_line = line + n_lines_context + (line < n_lines_context ? n_lines_context - line : 0) + 1;
char c{};
auto current_line = 1u;
//Skip lines up until start_line
while (current_line != start_line && file.get(c)) {
if (c == '\n') {
++current_line;
}
}
//Output cursor if we're at the current line
std::cout << (current_line==line ? "> " : " ");
//Write lines up until end_line
while (current_line <= end_line && file.get(c)) {
std::cout << c;
if (c == '\n') {
++current_line;
//Output cursor if we're at the current line
std::cout << (current_line==line ? "> " : " ");
}
}
//Write newline and make sure that the stream is flushed properly
std::cout << std::endl;
}
```
Now that we can print out source, well need to hook this into our debugger. A good place to do this is when the debugger gets a signal from a breakpoint or (eventually) single step. While were at this, we might want to add some better signal handling to our debugger.
* * *
### Better signal handling
We want to be able to tell what signal was sent to the process, but we also want to know how it was produced. For example, we want to be able to tell if we just got a `SIGTRAP` because we hit a breakpoint, or if it was because a step completed, or a new thread spawned, etc. Fortunately, `ptrace` comes to our rescue again. One of the possible commands to `ptrace` is `PTRACE_GETSIGINFO`, which will give you information about the last signal which the process was sent. We use it like so:
```
siginfo_t debugger::get_signal_info() {
siginfo_t info;
ptrace(PTRACE_GETSIGINFO, m_pid, nullptr, &info);
return info;
}
```
This gives us a `siginfo_t` object, which provides the following information:
```
siginfo_t {
int si_signo; /* Signal number */
int si_errno; /* An errno value */
int si_code; /* Signal code */
int si_trapno; /* Trap number that caused
hardware-generated signal
(unused on most architectures) */
pid_t si_pid; /* Sending process ID */
uid_t si_uid; /* Real user ID of sending process */
int si_status; /* Exit value or signal */
clock_t si_utime; /* User time consumed */
clock_t si_stime; /* System time consumed */
sigval_t si_value; /* Signal value */
int si_int; /* POSIX.1b signal */
void *si_ptr; /* POSIX.1b signal */
int si_overrun; /* Timer overrun count;
POSIX.1b timers */
int si_timerid; /* Timer ID; POSIX.1b timers */
void *si_addr; /* Memory location which caused fault */
long si_band; /* Band event (was int in
glibc 2.3.2 and earlier) */
int si_fd; /* File descriptor */
short si_addr_lsb; /* Least significant bit of address
(since Linux 2.6.32) */
void *si_lower; /* Lower bound when address violation
occurred (since Linux 3.19) */
void *si_upper; /* Upper bound when address violation
occurred (since Linux 3.19) */
int si_pkey; /* Protection key on PTE that caused
fault (since Linux 4.6) */
void *si_call_addr; /* Address of system call instruction
(since Linux 3.5) */
int si_syscall; /* Number of attempted system call
(since Linux 3.5) */
unsigned int si_arch; /* Architecture of attempted system call
(since Linux 3.5) */
}
```
Ill just be using `si_signo` to work out which signal was sent, and `si_code` to get more information about the signal. The best place to put this code is in our `wait_for_signal` function:
```
void debugger::wait_for_signal() {
int wait_status;
auto options = 0;
waitpid(m_pid, &wait_status, options);
auto siginfo = get_signal_info();
switch (siginfo.si_signo) {
case SIGTRAP:
handle_sigtrap(siginfo);
break;
case SIGSEGV:
std::cout << "Yay, segfault. Reason: " << siginfo.si_code << std::endl;
break;
default:
std::cout << "Got signal " << strsignal(siginfo.si_signo) << std::endl;
}
}
```
Now to handle `SIGTRAP`s. It suffices to know that `SI_KERNEL` or `TRAP_BRKPT` will be sent when a breakpoint is hit, and `TRAP_TRACE` will be sent on single step completion:
```
void debugger::handle_sigtrap(siginfo_t info) {
switch (info.si_code) {
//one of these will be set if a breakpoint was hit
case SI_KERNEL:
case TRAP_BRKPT:
{
set_pc(get_pc()-1); //put the pc back where it should be
std::cout << "Hit breakpoint at address 0x" << std::hex << get_pc() << std::endl;
auto line_entry = get_line_entry_from_pc(get_pc());
print_source(line_entry->file->path, line_entry->line);
return;
}
//this will be set if the signal was sent by single stepping
case TRAP_TRACE:
return;
default:
std::cout << "Unknown SIGTRAP code " << info.si_code << std::endl;
return;
}
}
```
There are a bunch of different signals and flavours of signals which you could handle. See `man sigaction` for more information.
Since we now correct the program counter when we get the `SIGTRAP`, we can remove this coded from `step_over_breakpoint`, so it now looks like:
```
void debugger::step_over_breakpoint() {
if (m_breakpoints.count(get_pc())) {
auto& bp = m_breakpoints[get_pc()];
if (bp.is_enabled()) {
bp.disable();
ptrace(PTRACE_SINGLESTEP, m_pid, nullptr, nullptr);
wait_for_signal();
bp.enable();
}
}
}
```
* * *
### Testing it out
Now you should be able to set a breakpoint at some address, run the program and see the source code printed out with the currently executing line marked with a cursor.
Next time well be adding the ability to set source-level breakpoints. In the meantime, you can get the code for this post [here][8].
--------------------------------------------------------------------------------
via: https://blog.tartanllama.xyz/c++/2017/04/24/writing-a-linux-debugger-source-signal/
作者:[TartanLlama ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.twitter.com/TartanLlama
[1]:https://blog.tartanllama.xyz/2017/03/21/writing-a-linux-debugger-setup/
[2]:https://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpoints/
[3]:https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-registers/
[4]:https://blog.tartanllama.xyz/c++/2017/04/05/writing-a-linux-debugger-elf-dwarf/
[5]:https://blog.tartanllama.xyz/c++/2017/04/24/writing-a-linux-debugger-source-signal/
[6]:https://blog.tartanllama.xyz/c++/2017/05/06/writing-a-linux-debugger-dwarf-step/
[7]:https://github.com/TartanLlama/libelfin/tree/fbreg
[8]:https://github.com/TartanLlama/minidbg/tree/tut_source

View File

@ -1,3 +1,4 @@
ictlyh Translating
Accelerating your C++ on GPU with SYCL
============================================================

View File

@ -1,222 +0,0 @@
How to Fix SambaCry Vulnerability (CVE-2017-7494) in Linux Systems
============================================================
Samba has long been the standard for providing shared file and print services to Windows clients on *nix systems. Used by home users, mid-size businesses, and large companies alike, it stands out as the go-to solution in environments where different operating systems coexist.
As it sadly happens with broadly-used tools, most Samba installations are under risk of an attack that may exploit a known vulnerability, which was not considered to be serious until the WannaCry ransomware attack hit the news not too long ago.
In this article, we will explain what this Samba vulnerability is and how to protect the systems you are responsible for against it. Depending on your installation type (from repositories or from source), you will need to take a different approach to do it.
If you are currently using Samba in any environment or know someone who does, read on!
### The Vulnerability
Outdated and unpatched systems are vulnerable to a remote code execution vulnerability. In simple terms, this means that a person with access to a writeable share can upload a piece of arbitrary code and execute it with root permissions in the server.
The issue is described in the Samba website as [CVE-2017-7494][1] and is known to affect Samba versions 3.5 (released in early March 2010) and onwards. Unofficially, it has been named SambaCry due to its similarities with WannaCry: both target the SMB protocol and are potentially wormable which can cause it to spread from system to system.
Debian, Ubuntu, CentOS and Red Hat have taken rapid action to protect its users and have released patches for their supported versions. Additionally, security workarounds have also been provided for unsupported ones.
### Updating Samba
As mentioned earlier, there are two approaches to follow depending on the previous installation method:
If you installed Samba from your distributions repositories.
Lets take a look at what you need to do in this case:
#### Fix Sambacry in Debian
Make sure [apt][2] is set to get the latest security updates by adding the following lines to your sources list (/etc/apt/sources.list):
```
deb http://security.debian.org stable/updates main
deb-src http://security.debian.org/ stable/updates main
```
Next, update the list of available packages:
```
# aptitude update
```
Finally, make sure the version of the samba package matches the version where the vulnerability has been fixed (see [CVE-2017-7494][3]):
```
# aptitude show samba
```
![Fix Sambacry in Debian](https://www.tecmint.com/wp-content/uploads/2017/05/Fix-Sambacry-in-Debian.png)
Fix Sambacry in Debian
#### Fix Sambacry in Ubuntu
To begin, check for new available packages and update the samba package as follows:
```
$ sudo apt-get update
$ sudo apt-get install samba
```
The Samba versions where the fix for CVE-2017-7494 has already been applied are the following:
* 17.04: samba 2:4.5.8+dfsg-0ubuntu0.17.04.2
* 16.10: samba 2:4.4.5+dfsg-2ubuntu5.6
* 16.04 LTS: samba 2:4.3.11+dfsg-0ubuntu0.16.04.7
* 14.04 LTS: samba 2:4.3.11+dfsg-0ubuntu0.14.04.8
Finally, run the following command to verify that your Ubuntu box now has the right Samba version installed.
```
$ sudo apt-cache show samba
```
#### Fix Sambacry on CentOS/RHEL 7
The patched Samba version in EL 7 is samba-4.4.4-14.el7_3. To install it, do
```
# yum makecache fast
# yum update samba
```
As before, make sure you have now the patched Samba version:
```
# yum info samba
```
![Fix Sambacry in CentOS](https://www.tecmint.com/wp-content/uploads/2017/05/Fix-Sambacry-in-CentOS.png)
Fix Sambacry in CentOS
Older, still supported versions of CentOS and RHEL have available fixes as well. Check [RHSA-2017-1270][4] to find out more.
##### If you installed Samba from source
Note: The following procedure assumes that you have previously built Samba from source. You are highly encouraged to try it out extensively in a testing environment BEFORE deploying it to a production server.
Additionally, make sure you back up the smb.conf file before you start.
In this case, we will compile and update Samba from source as well. Before we begin, however, we must ensure all the dependencies are previously installed. Note that this may take several minutes.
#### In Debian and Ubuntu:
```
# aptitude install acl attr autoconf bison build-essential \
debhelper dnsutils docbook-xml docbook-xsl flex gdb krb5-user \
libacl1-dev libaio-dev libattr1-dev libblkid-dev libbsd-dev \
libcap-dev libcups2-dev libgnutls28-dev libjson-perl \
libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl \
libpopt-dev libreadline-dev perl perl-modules pkg-config \
python-all-dev python-dev python-dnspython python-crypto xsltproc \
zlib1g-dev libsystemd-dev libgpgme11-dev python-gpgme python-m2crypto
```
#### In CentOS 7 or similar:
```
# yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
libsemanage-python libxslt perl perl-ExtUtils-MakeMaker \
perl-Parse-Yapp perl-Test-Base pkgconfig policycoreutils-python \
python-crypto gnutls-devel libattr-devel keyutils-libs-devel \
libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
pam-devel popt-devel python-devel readline-devel zlib-devel
```
Stop the service:
```
# systemctl stop smbd
```
Download and untar the source (with 4.6.4 being the latest version at the time of this writing):
```
# wget https://www.samba.org/samba/ftp/samba-latest.tar.gz
# tar xzf samba-latest.tar.gz
# cd samba-4.6.4
```
For informative purposes only, check the available configure options for the current release with.
```
# ./configure --help
```
You may include some of the options returned by the above command if they were used in the previous build, or you may choose to go with the default:
```
# ./configure
# make
# make install
```
Finally, restart the service.
```
# systemctl restart smbd
```
and verify youre running the updated version:
```
# smbstatus --version
```
which should return 4.6.4.
### General Considerations
If you are running an unsupported version of a given distribution and are unable to upgrade to a more recent one for some reason, you may want to take the following suggestions into account:
* If SELinux is enabled, you are protected!
* Make sure Samba shares are mounted with the noexec option. This will prevent the execution of binaries residing on the mounted filesystem.
Add,
```
nt pipe support = no
```
to the [global] section of your smb.conf file and restart the service. You may want to keep in mind that this “may disable some functionality in Windows clients”, as per the Samba project.
Important: Be aware that the option “nt pipe support = no” would disable shares listing from Windows clients. Eg: When you type \\10.100.10.2\ from Windows Explorer on a samba server you would get a permission denied. Windows clients would have to manually specify the share as \\10.100.10.2\share_name to access the share.
##### Summary
In this article, we have described the vulnerability known as SambaCry and how to mitigate it. We hope that you will be able to use this information to protect the systems youre responsible for.
If you have any questions or comments about this article, feel free to use the form below to let us know.
--------------------------------------------------------------------------------
作者简介:
Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.
--------------
via: https://www.tecmint.com/fix-sambacry-vulnerability-cve-2017-7494-in-linux/
作者:[Gabriel Cánepa ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.tecmint.com/author/gacanepa/
[1]:https://www.samba.org/samba/security/CVE-2017-7494.html
[2]:https://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/
[3]:https://security-tracker.debian.org/tracker/CVE-2017-7494
[4]:https://rhn.redhat.com/errata/RHSA-2017-1270.html
[5]:https://www.tecmint.com/author/gacanepa/
[6]:https://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[7]:https://www.tecmint.com/free-linux-shell-scripting-books/

View File

@ -1,130 +0,0 @@
translating---geekpi
Cron Vs Anacron: How to Schedule Jobs Using Anacron on Linux
============================================================
In this article, we will explain cron and anacron and also shows you how to setup anacron on Linux. We will as well cover a comparison of these two utilities.
To [schedule a task on given or later time][1], you can use the at or batch commands and to set up commands to run repeatedly, you can employ the cron and anacron facilities.
[Cron][2]  is a daemon used to run scheduled tasks such as system backups, updates and many more. It is suitable for running scheduled tasks on machines that will run continuously 24X7 such as servers.
The commands/tasks are scripted into cron jobs which are scheduled in crontab files. The default system crontab file is /etc/crontab, but each user can also create their own crontab file that can launch commands at times that the user defines.
To create a personal crontab file, simply type the following:
```
$ crontab -e
```
### How to Setup Anacron in Linux
Anacron is used to run commands periodically with a frequency defined in days. It works a little different from cron; assumes that a machine will not be powered on all the time.
It is appropriate for running daily, weekly, and monthly scheduled jobs normally run by cron, on machines that will not run 24-7 such as laptops and desktops machines.
Assuming you have a scheduled task (such as a backup script) to be run using cron every midnight, possibly when your asleep, and your desktop/laptop is off by that time. Your backup script will not be executed.
However, if you use anacron, you can be assured that the next time you power on the desktop/laptop again, the backup script will be executed.
### How Anacron Works in Linux
anacron jobs are listed in /etc/anacrontab and jobs can be scheduled using the format below (comments inside anacrontab file must start with #).
```
period delay job-identifier command
```
From the above format:
* period  this is the frequency of job execution specified in days or as @daily, @weekly, or @monthly for once per day, week, or month. You can as well use numbers: 1 daily, 7 weekly, 30 monthly and N number of days.
* delay  its the number of minutes to wait before executing a job.
* job-id  its the distinctive name for the job written in log files.
To view example files, type:
```
$ ls -l /var/spool/anacron/
total 12
-rw------- 1 root root 9 Jun 1 10:25 cron.daily
-rw------- 1 root root 9 May 27 11:01 cron.monthly
-rw------- 1 root root 9 May 30 10:28 cron.weekly
```
* command  its the command or shell script to be executed.
##### This is what practically happens:
* Anacron will check if a job has been executed within the specified period in the period field. If not, it executes the command specified in the command field after waiting the number of minutes specified in the delay field.
* Once the job has been executed, it records the date in a timestamp file in the /var/spool/anacrondirectory with the name specified in the job-id (timestamp file name) field.
Lets now look at an example. This will run the /home/aaronkilik/bin/backup.sh script everyday:
```
@daily 10 example.daily /bin/bash /home/aaronkilik/bin/backup.sh
```
If the machine is off when the backup.sh job is expected to run, anacron will run it 10 minutes after the machine is powered on without having to wait for another 7 days.
There are two important variables in the anacrontab file that you should understand:
* START_HOURS_RANGE  this sets time range in which jobs will be started (i.e execute jobs during the following hours only).
* RANDOM_DELAY  this defines the maximum random delay added to the user defined delay of a job (by default its 45).
This is how your anacrontab file would possibly look like.
Anacron /etc/anacrontab File
```
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
@daily 10 example.daily /bin/bash /home/aaronkilik/bin/backup.sh
```
The following is a comparison of cron and anacron to help you understand when to use either of them.
| Cron | Anacron |
| Its a daemon | Its not a daemon |
| Appropriate for server machines | Appropriate for desktop/laptop machines |
| Enables you to run scheduled jobs every minute | Only enables you to run scheduled jobs on daily basis |
| Doesnt executed a scheduled job when the machine if off | If the machine if off when a scheduled job is due, it will execute a scheduled job when the machine is powered on the next time |
| Can be used by both normal users and root | Can only be used by root unless otherwise (enabled for normal users with specific configs) |
The major difference between cron and anacron is that cron works effectively on machines that will run continuously while anacron is intended for machines that will be powered off in a day or week.
If you know any other way, do share with us using the comment form below.
--------------------------------------------------------------------------------
作者简介:
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
------
via: https://www.tecmint.com/cron-vs-anacron-schedule-jobs-using-anacron-on-linux/
作者:[Aaron Kili | ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.tecmint.com/author/aaronkili/
[1]:https://www.tecmint.com/linux-cron-alternative-at-command-to-schedule-tasks/
[2]:https://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/
[3]:https://www.tecmint.com/author/aaronkili/
[4]:https://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[5]:https://www.tecmint.com/free-linux-shell-scripting-books/

View File

@ -1,423 +0,0 @@
How to Install and Configure GitLab on Ubuntu 16.04
============================================================
### On this page
1. [Step 1 - Install required Ubuntu Packages][1]
2. [Step 2 - Install Gitlab][2]
3. [Step 3 - Configure Gitlab Main URL][3]
4. [Step 4 - Generate SSL Let's encrypt and DHPARAM Certificate][4]
5. [Step 5 - Enable Nginx HTTPS for GitLab][5]
6. [Step 6 - Configure UFW Firewall][6]
7. [Step 7 - Gitlab post-installation][7]
8. [Step 8 - Testing][8]
9. [Preferences][9]
GitLab is an open source GIT repository manager based on Rails and developed by GitLab Inc. It is a web-based GIT repository manager that allows your team to work on code, track bugs and feature requests and to test and deploy applications. GitLab provides features like a wiki, issue tracking, code reviews, activity feeds and merge management. It is capable of hosting multiple projects.
GitLab is available in four editions:
1. Gitlab CE (Community Edition) - self-hosted, free and support from the Community forum.
2. Gitlab EE (Enterprise Edition) - self-hosted, paid app, comes with additional features.
3. GitLab.com - SaaS, free.
4. GitLab.io - Private GitLab instance managed by GitLab Inc.
In this tutorial, I will show you step-by-step how to install GitLab CE (Community Edition) on your own Ubuntu 16.04 Xenial Xerus server. In this tutorial, I will be using the 'omnibus' package provided by GitLab for easy installation.
**What we will do:**
1. Install Packages
2. Install GitLab
3. Configure GitLab URL
4. Generate SSL Let's encrypt and DHPARAM Certificate
5. Enable Nginx HTTPS for GitLab
6. Configure UFW Firewall
7. Perform the GitLab Installation
8. Testing
**Prerequisites**
* Ubuntu 16.04 Server - 64bit
* Min RAM 2GB
* Root Privileges
### Step 1 - Install required Ubuntu Packages
The first step is to install the packages needed for the GitLab installation. Please log in to the server as root user and upddate the Ubuntu repository.
```
ssh root@GitLabServer
apt-get update
```
Now install the packages including curl for downloading the GitLab repository, ca-certificates, and postfix for the SMTP configuration.
Install all packages with the apt command below.
```
sudo apt install curl openssh-server ca-certificates postfix
```
During postfix installation, you will be prompted about the configuration, select 'Internet Site'.
[![Configure Postfix on Ubuntu](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/1.png)][13]
and then enter the server domain name that shall be used for sending an email.
[![Configure Postfix hostame on ubuntu](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/2.png)][14]
### Step 2 - Install Gitlab
In this step, we will install GitLab using the omnibus packages. Omnibus will install all packages, services, and tools required for running GitLab on your server.
Add GitLab repository with the curl command.
```
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
```
[![Adding GitLab Repository to Ubuntu 16.04](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/3.png)][15]
And then install GitLab CE Community Edition with the apt command.
```
sudo apt install gitlab-ce
```
Wait for the server to download and install the gitlab package. When the installation is complete, you will see the results as below.
[![Install GitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/Nano.png)][16]
### Step 3 - Configure Gitlab Main URL
Now we should configure the URL that will be used to access our GitLab server. I will use the domain name 'gitlab.hakase-labs.co' for the GitLab URL here (please choose your own domain name) and I'll use HTTPS for users access security.
The main configuration of GitLab is in the '/etc/gitlab' directory. Go to that directory and edit the configuration file 'gitlab.rb' with vim.
```
cd /etc/gitlab
vim gitlab.rb
```
In the GitLab configuration go to line 9 'external_url' and change the URL to your URL 'gitlab.hakase-labs.co'.
external_url 'http://gitlab.hakase-labs.co'
Save the file and exit the editor. In the next step will enable HTTPS for GitLab.
[![Configure GitLab main URL](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/41.png)][17]
### Step 4 - Generate SSL Let's encrypt and DHPARAM Certificate
In this step, we will enable the HTTPS protocol for GitLab. I will use a free SSL certificates provided by let's encrypt for the gitlab domain name.
Install letsencrypt command-line tool with apt command.
```
sudo apt install letsencrypt -y
```
When the installation is complete, generate a new certificate for the gitlab domain name with the command below.
```
letsencrypt certonly -d gitlab.hakase-labs.co
```
Enter your email address for the SSL certificate renew notification.
[![Generate SSL Certificate on Ubuntu 16.04](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/5.png)][18]
Choose 'Agree' for the Let's Encrypt Terms of Services and wait.
[![Agreement of Letsencrypt TOS ](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/6.png)][19]
When it's done, you will see the result below.
[![SSL Letsencrypt certificate has been generated](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/7.png)][20]
New Let's encrypt certificate files for GitLab have been generated. You can find the certificate files in the '/etc/letsencrypt/live' directory.
Next, create a new directory named 'ssl' under the GitLab configuration directory.
```
mkdir -p /etc/gitlab/ssl/
```
And generate dhparam pem files in the ssl directory with the openssl command.
```
sudo openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048
```
[![Generate DHPARAM certificate with openssl](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/8.png)][21]
Now change the permissions of the certificate files to 600.
```
chmod 600 /etc/gitlab/ssl/*
```
The SSL Let's encrypt cert for GitLab and the DHPARAM certificate has been generated.
### Step 5 - Enable Nginx HTTPS for GitLab
At this stage, we have the certificate files from Letsencrypt in '/etc/letsencrypt/live' directory and the DHPARAM certificate in the '/etc/gitlab/ssl' directory.
In this step, we will configure a GitLab to use our certificate files. Go to the '/etc/gitlab' directory, then edit 'gitlab.rb' configuration with vim.
```
cd /etc/gitlab/
vim gitlab.rb
```
Change the external url to use 'https' instead of 'http'.
external_url 'https://gitlab.hakase-labs.co'
Then add the new SSL configuration for gitlab as below.
nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/letsencrypt/live/gitlab.hakase-labs.co/fullchain.pem"
nginx['ssl_certificate_key'] = "/etc/letsencrypt/live/gitlab.hakase-labs.co/privkey.pem"
nginx['ssl_dhparam'] = "/etc/gitlab/ssl/dhparams.pem"
**Note:**
We will enable HTTP to HTTPS redirect in gitlab.
Save the file and exit vim.
[![Enable HTTPS on GitLab and enable Redirect HTTP to HTTPS GitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/9.png)][22]
Now we need to run the command below as root to apply the new gitlab configuration.
```
sudo gitlab-ctl reconfigure
```
You will see the results as below.
[![Apply GitLab configuration has been completed](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/10.png)][23]
HTTPS Configuration for GitLab has been completed.
### Step 6 - Configure UFW Firewall
In this step, we will enable the UFW firewall. It's already installed on the system, we just need to start the service. We will run GitLab behind the UFW firewall, so we must open the HTTP and HTTPS ports.
Enable UFW firewall with the command below.
```
ufw enable
```
The command will run ufw service and add it to start automatically at the boot time.
Next, open new ports ssh, HTTP, and HTTPS.
```
ufw allow ssh
ufw allow http
ufw allow https
```
[![Allowing HTTP and HTTPS UFW Firewall Ubuntu](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/11.png)][24]
Now check the firewall status and make sure ssh, http, and https ports is on the list.
```
ufw status
```
HTTP and HTTPS ports are configured.
[![Checking UFW Rules Ubuntu ](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/12.png)][25]
### Step 7 - Gitlab post-installation
GitLab has been installed to the system, and it's running behind the UFW firewall. In this step, we will do some quick settings like changing password, username and profile settings.
Open your web browser and type in the gitlab URL, mine is 'gitlab.hakase-labs.co'. You will be redirected to the HTTPS connection.
**Reset GitLab root password**
[![Reset GitLab Default Password After Installation](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/13.png)][26]
Now login to GitLab with user 'root' and with your password.
[![GitLab Login as default user root](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/14.png)][27]
**Change Username and Profile**
On the top right corner, click your profile and choose 'Profile Settings'.
[![Change GitLab default profile](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/15.png)][28]
On the profile tab, exchange the default name with your name and email with your email address. Now click 'Update Profile'.
[![Change Default Username and Email for GitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/16.png)][29]
Click on the tab 'Account', change username with your own username. Then click 'Update Username'.
[![Chagne Default Username gitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/17.png)][30]
**Add SSH Key**
Make sure you already have a key, if you do not have an SSH key, you can generate with it with the command below.
```
ssh-keygen
```
And you will get two keys, 'id_rsa' your private key and 'id_rsa.pub' your public key.
[![Generate new SSH Key on Ubuntu](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/18.png)][31]
Next, click on the tab 'SSH Key', copy the content of 'id_rsa.pub' file and paste to the key box, and click 'Add Key'.
[![Add SSH Key to GitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/19.png)][32]
New SSH Key has been added.
**Sign up Restrictions and Limit Settings**
Click on the 'admin area' icon, and then click on the gear icon and choose 'Settings'.
[![Configure GitLab system](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/20.png)][33]
On the 'Account and Limit Settings' - you can configure max projects per user and the 'Sign-up Restrictions', you can add the domain name of your email to the white-list box.
And if all is complete, scroll to the bottom and click 'Save'.
[![Configure Limit Setting and Sign-up Restrictions GitLab](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/21.png)][34]
Basic GitLab configuration has been completed.
### Step 8 - Testing
Finally, we will do some tests to ensure that our GitLab system is working properly.
**Create New Project**
Click the plus icon on the top to create a new project repository. Type in your project name, description, and setup the visibility settings of your project. Then click on the 'Create project' button.
[![GitLab Testing Create New Project](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/22.png)][35]
The new project has been created.
**Test First Commit and Push**
After the 'howtoforge' project has been created, you will be redirected to the project page. Now start adding new content to the repository. Make sure Git is installed on your computer and setup the global username and email for git with the command below.
```
git config --global user.name "hakase"
git config --global user.email "admin@hakase-labs.co"
```
Clone the Repository and add a README.md file.
```
git clone https://hakase@gitlab.irsyadf.me/hakase/howtoforge.git
cd howtoforge/
vim README.md
```
You will be asked for the 'hakase' user password. Please type the same password that you used when we accessed GitLab the first time.
Commit a new file to the howtoforge repository.
```
git add .
git commit -m 'Add README.md file by hakase-labs'
```
Next, push the change to the repository on the GitLab server.
```
git push origin master
```
Type in your password and press Enter to continue. You will see the result as below.
[![GitLab Testing First Commit](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/23.png)][36]
Now open the howtoforge project from your web browser, and you will see that the new README.md file has been added to the repository.
[![New GitLab Repository is working](https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/24.png)][37]
Gitlab has been installed on a Ubuntu 16.04 Xenial Xerus server.
### Preferences
* [https://about.gitlab.com/downloads/#ubuntu1604][10][][11]
* [https://docs.gitlab.com/ce/][12]
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/
作者:[Muhammad Arul ][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/
[1]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-install-required-ubuntu-packages
[2]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-install-gitlab
[3]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-configure-gitlab-main-url
[4]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-generate-ssl-lets-encrypt-and-dhparam-certificate
[5]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-enable-nginx-https-for-gitlab
[6]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-configure-ufw-firewall
[7]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-gitlab-postinstallation
[8]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#step-testing
[9]:https://www.howtoforge.com/tutorial/how-to-install-and-configure-gitlab-on-ubuntu-16-04/#preferences
[10]:https://about.gitlab.com/downloads/#ubuntu1604
[11]:https://about.gitlab.com/downloads/#ubuntu1604
[12]:https://docs.gitlab.com/ce/
[13]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/1.png
[14]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/2.png
[15]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/3.png
[16]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/Nano.png
[17]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/41.png
[18]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/5.png
[19]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/6.png
[20]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/7.png
[21]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/8.png
[22]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/9.png
[23]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/10.png
[24]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/11.png
[25]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/12.png
[26]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/13.png
[27]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/14.png
[28]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/15.png
[29]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/16.png
[30]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/17.png
[31]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/18.png
[32]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/19.png
[33]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/20.png
[34]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/21.png
[35]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/22.png
[36]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/23.png
[37]:https://www.howtoforge.com/images/how_to_install_and_configure_gitlab_on_ubuntu_1604/big/24.png

View File

@ -1,63 +0,0 @@
#教职人员是否可以运用维基百科教学?
[![Can academic faculty members teach with Wikipedia?](https://camo.githubusercontent.com/47dfe3fec215387fa7bb1f2c038f4e78e0e2e47d/68747470733a2f2f6f70656e736f757263652e636f6d2f73697465732f64656661756c742f66696c65732f7374796c65732f696d6167652d66756c6c2d73697a652f7075626c69632f696d616765732f656475636174696f6e2f4544555f61636164656d6963735f353230783239325f6d612e706e673f69746f6b3d397846574f637436)](https://camo.githubusercontent.com/47dfe3fec215387fa7bb1f2c038f4e78e0e2e47d/68747470733a2f2f6f70656e736f757263652e636f6d2f73697465732f64656661756c742f66696c65732f7374796c65732f696d6167652d66756c6c2d73697a652f7075626c69632f696d616765732f656475636174696f6e2f4544555f61636164656d6963735f353230783239325f6d612e706e673f69746f6b3d397846574f637436)
图片来自 : opensource.com
自从2010年已经有29000 个学生完成了 Wiki Ed 这一项目。他们在维基百科上添加了 25 百万的词条,等同于 85000 页纸张的内容。这还是 Britannica 百科全书中所有词条的 66%。Wiki Ed 的学生们最积极的时候,他们正贡献着维基百科上那 10% 且尚未发展的学术板块。
为了了解更多关于这个项目的信息,我联络了 LiAnna Davis -- Wiki Ed项目的负责人。他极富热情地同意来回答我的问题。
提示:[Wiki Education Foundation (Wiki Ed)](https://wikiedu.org/) 的平台是用免费软件搭建的,链接为: [WikiEdu Dashboard GitHub](https://github.com/WikiEducationFoundation/WikiEduDashboard).
**Wiki Ed 这一项目是如何启动的?说说你的背景以及你是如何参与进这个项目的。**
在2010年[Wikimedia Foundation](https://wikimediafoundation.org/wiki/Home)简称WMF运营维基百科的非营利组织注意到了一个趋势 -- 大学的教职人员如果本身也是维基词条的编辑者他们已经成功地将编辑维基词条作为一项任务交给了自己课堂里的学生。WMF 就此开展了一个试行项目试图回答这个问题:如果本身不编辑维基词条的教职人员支持课程中包含维基词条的编辑任务,他们是否可以通过维基百科实现教学呢?
我是这个团队的一员在2010年被试行雇用我对这个问题的回答是“可以。” 在 2013年WMF将这个项目的美国分部和加拿大分部拆分形成了一个新的非营利性组织 -- the Wiki Education Foundation Wiki Ed自此我也从 WMF 到了Wiki Ed。自那以后我们便成为了一个独立组织我们可以专注于这个项目并且将这个项目拓展开来 -- 起初 WMF 时期每年只有75个班级参与而这个学期已经有275班级参与了 Wiki Ed。
**人们总是默认大学生对科技相关的一切事物都很敏感,尤其是互联网,但是你们的网站上写道,“大学本科学生可能具有高科技敏感度,但这并不代表他们具有高科技成熟度。” 你可以稍微解释一下这句话吗?**
仅仅因为一个人可以搞明白自己的 iPhone 如何使用不代表他们可以明辨他们在网上阅读的信息是否值得信赖。 [斯坦福的一项研究](https://sheg.stanford.edu/upload/V3LessonPlans/Executive%20Summary%2011.21.16.pdf) ("Evaluating Information: The Cornerstone of Civic Online Reasoning November 22, 2016.")在近期表明:学生们并不具有高科技成熟度。然而,当学生们在撰写维基百科文章之时,他们必须这样。他们需要严格遵守维基百科的[可信来源](https://en.wikipedia.org/wiki/Wikipedia:Identifying_reliable_sources) 规范,这些规范明确了维基百科上的任何信息都必须注明来源,这些来源必须是独立的,而且是可以追溯的事实。对于很多学生,这样注明来源还是第一次,多数人之前仅仅是通过谷歌搜索话题或者注明他们亲眼所见的第一手资料来进行资料的检索和查证。他们需要理解哪些资料可靠,哪些资料不可靠,从而成为足够成熟的电子信息消费者。
**你想对那些声称“维基百科不是一个可靠的来源”的人说些什么?**
维基百科是一本百科全书,根据在词典中的定义,它是一个第三手资料。当学生们开始读本科的时候,他们应该学会参考一手和二手资料,而不是第三手资料,因此学生不应该,且不能引用维基百科的内容。但是维基百科在研究之初会是一个不错的选择,它可以给你对这个话题一个广泛的认识,并且帮你发现页面底部那些你可以参考的文章来源。就像我们所鼓励的:“不要引用!用你的语言写!”
> 这样做可以让学生们代入知识生产者的身份,而不是知识的消耗者...
**一个教授在Wiki Ed项目中的参与是如何影响到他的学生的呢**
通过运用维基百科教学,导师们可以给学生们提供媒体素养,批判性思维,线上交流以及写作能力,不论他们在毕业之后会继续选择科研或是加入工作大军,这些极富价值的品质和技能都能帮助他们成功。这样做可以让学生们代入知识生产者的身份,而不是知识的消耗者,而且这可以给予他们一个真正在这个世界做出改变的机会,而不是学生们到了学期末便会抛之脑后的生硬习题。
我们正在积极鼓励新的班级在春季学期加入这个项目。感兴趣的教职人员可以点击 [the Wikipedia Education Foundation's Teach page](https://teach.wikiedu.org/) 由此开始。
**一个教师会需要哪些职业素养来参与这个项目?学生又是需要哪些训练呢?**
当你在 [the Wikipedia Education Foundation's Teach page](http://teach.wikiedu.org/)上注册的时候你会发现Wiki Ed为新加入的教职人员提供了如何运用维基百科实现教学的在线指南。我们还有为学生提供的一系列的在线训练根据他们不同的任务自动分配不同的指南例如如果你希望你的学生在文章中插入图片他们会得到一个如何插入编辑图片的教学单元如果你不需要他们便不会得到这个单元的指南。在部分十几个学科中我们还有特定的指南书展示了这几个学科的特定编辑方式。除此之外我们还有熟练维基百科编辑的工作人员帮助回答学生和导师们的问题。我们的系统已经在逐步扩大我们在这个秋季学期已经支持了超过 6300 个学生,并且已经适应了与没有维基编辑经验的教职人员合作,因此这样就保证了没有人会因为资历不够而无法参与。
**”访问学者“这个项目是指?**
我们正在试着建立学术界和维基百科之间的联系,而鼓励运用维基百科教学的项目只是其中的一环。在“访问学者”这一项目中,大学图书馆或者教学部门将公开他们的资料,并提供给一个缺乏资料的认证维基百科编辑人员(被称作是“访问学者”)。通过大学这一渠道,“访问学者”们可以有机会使用这些资源来完善维基百科广泛领域中的文章。这是一个规模相对小却伟大的项目,因为我们花了很多时间来建立这样的联系,但是这些“学者”们都产出了许多真的很精彩的内容。
**你的合作伙伴有谁?他们的参与如何影响到你现在的成功呢,或者在未来将会如何呢?**
我们与那些将我们工作的价值看做对他们的学科的一种服务的学术机构合作。让我们面对这个现实:当人们想要获取关于一个话题的知识之时,他们不会去读那些同僚评审过,并在这些机构发表的学术论文,他们会去维基百科。通过鼓励这些机构中的教职人员用维基百科教学,正可以完善维基百科的在这些学科中的内容和信息。我们的合作伙伴扩充了我们的潜在成员,并且让我们以合作身份大量完善了维基百科上特定学科的内容。
我们欢迎读者点击这个页面 [Support Us page](http://wikiedu.org/donate) 通过捐赠来支持我们的工作
***
作者简介:
Don Watkins 是一个教育家专注教育技术创业家开源提倡者。教育心理学硕士教育领导力硕士Linux系统管理员思科认证网络支持工程师 通过 Virtual Box 和 VMware 虚拟化。关注他: @Don_Watkins .
via: https://opensource.com/article/17/1/Wiki-Education-Foundation
作者: Don Watkins
译者:[scoutydren](https://github.com/scoutydren)
校对:[Bestony](https://github.com/Bestony)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -1,218 +0,0 @@
AWS 云服务的相关术语
============================================================
* * *
![AWS Cloud terminology](http://cdn2.kerneltalks.com/wp-content/uploads/2017/03/AWS-Cloud-terminology-150x150.png)
_认识 71 个 AWS 云服务的术语 ! 通过了解 AWS 世界中使用的术语开始你的 AWS 云服务使用生涯 !_
* * *
AWS i.e. 亚马逊 web 服务是一个提供了一系列按使用计费的 web 服务的云平台。 它是迄今为止最为著名的云平台之一。由于其灵活性、有效性、弹性、可测量性和无须维护,所以有一些企业正逐步把他们的业务迁移到云端。 由于许多公司目前在使用这些服务,所以对于系统管理员和运维人员来说应该了解一下 AWS。
这篇文章旨在列出这些 AWS 提供的服务并且解释在 AWS 中出现的术语。
截止到目前为止2017 年 3 月AWS 提供了共计 71 种并分为 17 组服务:
* * *
_计算型服务_
这是一个提供了虚拟服务器配置功能的服务即所谓的云计算。它提供了包括以下这一系列的服务。
1. EC2 : EC2 代表弹性计算云。这种服务提供了可根据个人需求扩展的 [虚拟机][11]
2. EC2 容器服务 : 其高性能,高可扩展性使其可在 EC2 集群环境中运行服务
3. Lightsail : 该服务使用户非常容易地启动和管理虚拟服务器EC2
4. Elastic Beanstalk : 该服务能够自动管理你的应用程序的容量配置、负载平衡、扩展以及健康监控从而减少你的管理负载。
5. Lambda : 它允许你只在你需要的时候运行代码而不用去管理服务器。
6. Batch : 它使用户能够以自定义的管理方式运行计算工作负载(批处理)。
* * *
_存储型服务_
它是一种云存储服务即由Amazon提供的云存储设施。 该组服务包括:
1. S3 : S3代表简单存储服务3次S。 它给你提供了在线存储服务,你可随时从任何地方存储/检索任何数据。
2. EFS : EFS 代表弹性文件系统。 它是一个可以和EC2服务器一起使用的在线存储服务。
3. Glacier : 它是一种低成本/低性能数据存储解决方案,主要针对存档或长期备份。
4. Storage Gateway : 这种服务的接口会将你的内部应用程序(托管在 AWS 之外)与 AWS 存储连接。
* * *
_数据库_
AWS 还提供在其 Infra 上托管数据库,以便客户可以利用亚马逊最先进的技术来获得更快/高效/安全的数据处理。 该组包括:
1. RDS : RDS 代表关系数据库服务。 有助于在云上设置,操作和管理关系数据库。
2. DynamoDB : 其 noSQL 数据库提供快速处理和高可扩展性。
3. ElastiCache : 着是一种为你的 Web 应用程序管理内存缓存以更快运行它们的方案
4. Redshift : 它是一个巨大的PB 级)的完全可升级的云端数据仓库服务。
* * *
_网络 & 内容分发_
由于 AWS 提供云 EC2 服务器,因此网络相关内容也将在出现在这里。 内容分发用于向位于最近位置的用户提供文件。 现如今有许多非常有名的加速网站。
1. VPC : VPC 代表虚拟私有云。 它是你自己的虚拟网络,是你的专用 AWS 帐户。
2. CloudFront : 这是 AWS 的内容分发网络服务。
3. Direct Connect : 它是将数据中心/场所与 AWS 连接起来的网络方式,以提高吞吐量,降低网络成本,并避免由于基于互联网的连接而导致的连接问题。
4. Route 53 : 它是一个云域名系统的 DNS Web 服务。
* * *
_迁移_
它提供了一系列服务来帮助你实现本地服务到 AWS 的迁移工作。 这包括
1. Application Discovery Service : 专门用于分析您的服务器,网络,应用程序以帮助/加速迁移的服务。
2. DMS : DMS 指的是数据库迁移服务。 它用于将数据从本地数据库迁移到 EC2 上托管的 RDS 或 DB。
3. Server Migration : 也称为 SMS服务器迁移服务是一种无代理服务将您的工作负载从本地移动到 AWS。
4. Snowball :  当你想要使用物理存储设备(而不是基于互联网/基于网络的传输)将大量数据传入/迁出AWS时你应该使用它。
* * *
_开发者工具_
见名知义, 这是一系列帮助开发者简化在云端编码的服务。
1. CodeCommit :它是一个安全的,可扩展的,可管理的源代码管理服务,用于托管代码仓库。
2. CodeBuild : 这是一个云端的代码生成器。主要用于执行,测试代码和构建部署软件包。
3. CodeDeploy : 这是一个可在 AWS 服务器或本地进行自动化应用程序部署的部署服务。
4. CodePipeline : 这个部署服务可以使编码人员可以在发布之前将其应用程序可视化。
5. X-Ray : 它可以使用事件调用分析应用程序。
* * *
_管理工具_
这是一组可帮助你管理 AWS 上的Web服务的服务。
1. CloudWatch : 监控服务以监控你的 AWS 资源或应用程序。
2. CloudFormation : 基础设施即代码! 以集体有序的方式管理AWS相对的方式。
3. CloudTrail : AWS 帐户的审计和合规工具。
4. Config : AWS 的资源清单,配置历史记录和配置更改通知,以实现安全性和治理。
5. OpsWorks : 它可以自动化地配置部署EC2或内部部署计算。
6. Service Catalog : 创建和管理被批准在你/公司帐户中使用的 IT 服务目录。
7. Trusted Advisor : 它的 AWS AI 可以通过审查你的 AWS Infra 使你的 AWS Infra 更好,更省钱
8. Managed Service : 提供持续的下一步管理。
* * *
_安全性 特征性和服从性_
这是一组很重要的 AWS 服务以确保你的 AWS 空间的安全性。
1. IAM : IAM 站在用户的身份和访问管理的立场上来控制用户访问你的 AWS 资源和服务。
2. Inspector : 自动安全评估可保证你的应用在 AWS 上的安全和稳定性。
3. Certificate Manager : 为 AWS 应用程序提供管理和部署SSL / TLS证书。
4. Directory Service : 相当于 AWS 的 Microsoft Active Directory。
5. WAF & Shield : WAF 代表 We b应用防火墙。 监控和控制对 CloudFront 或负载均衡器上的内容的访问。
6. Compliance Reports : AWS 基础设施空间的合规报告,以确保您的应用程序符合您的策略。
* * *
_数据分析_
AWS 空间的数据分析服务,以帮助您查看,计划,对帐户中的事件采取行动。
1. Athena : 它是一个基于 SQL 查询的服务,用于分析 S3 存储的数据。
2. EMR : EMR 的全写是 Elastic Map Reduce。 是一个主要用于大数据处理和分析的服务。
3. CloudSearch : AWS 在应用和服务中的搜索功能。
4. Elasticsearch Service : 它可以创建一个域并在 AWS Cloud 中部署,操作和扩展 Elasticsearch 集群。
5. Kinesis : 这种服务可以实现实时的大量流数据处理。
6. Data Pipeline : 它可以帮助我们在不同的 AWS 服务之间实现数据迁移。
7. QuickSight : 收集,分析和呈现 AWS 的业务数据。
* * *
_人工智能_
AWS 中的 AI!
1. Lex : 它可以帮助我们在一些使用语音和文本的应用中构建会话界面。
2. Polly : 这是一个提供文字到语音转换的服务。
3. Rekognition : 使您能够将图像分析添加到应用程序。
4. Machine Learning : 它具有学习数据中的模式的算法。
* * *
_物联网_
这个服务保证了 AWS 在不同设备上的高可用性。
1. AWS IoT : 它使已连接的硬件设备与 AWS 的应用程序能够交互。
* * *
_游戏开发_
见名知义,这个服务旨在游戏开发。
1. Amazon GameLift : 该服务旨在削减,管理用于会话的多人游戏的专用游戏服务器。
* * *
_移动服务_
这是一组主要针对手持设备的服务。
1. Mobile Hub : 帮助您创建移动应用后台功能并将其集成到移动应用。
2. Cognito : 在互联网连接的设备上控制移动用户的身份验证和 AWS 的访问。
3. Device Farm : 移动应用测试服务使你可以在 Android 上托管的实时手机上跨 AndroidiOS 测试应用。
4. Mobile Analytics : 在AWS上测量跟踪和分析移动应用数据。
5. Pinpoint : 有针对性的推送通知和移动互动。
* * *
_应用服务_
这是一组可以和你在 AWS 上的应用一起使用的服务。
1. Step Functions : 定义和使用应用程序中的各种功能。
2. SWF : SWF 代表简单的工作流服务。其云工作流程管理可帮助开发人员在应用程序生命周期的不同阶段进行协调和贡献。
3. API Gateway : 帮助开发人员创建管理和托管API
4. Elastic Transcoder : 帮助开发人员将媒体文件转换为各种设备的播放。
* * *
_消息_
AWS 中的通知和消息服务。
1. SQS : SQS 表示简单队列服务。完全管理的消息队列服务用于在AWS中的服务和应用之间进行通信。
2. SNS : SNS 代表简单通知服务。 为 AWS 用户推送通知服务,提醒他们有关其在 AWS 空间中的服务。
3. SES : SES代表简单电子邮件服务。 这是 AWS 为自己的客户提供高性价比的电子邮件服务。
* * *
_企业生产率_
一组帮你提高业务生产率的服务。
1. WorkDocs : 协同文件共享,存储和编辑服务。
2. WorkMail : 安全的商务邮件,日程服务。
3. Amazon Chime : 在线的企业会议!
* * *
_桌面和应用程序流式传输_
实现桌面应用程序通过云端进行流传输。
1. WorkSpaces : 完全管理且安全的云计算服务。
2. AppStream 2.0 : 来自云端的流式桌面应用。
--------------------------------------------------------------------------------
via: http://kerneltalks.com/virtualization/aws-cloud-terminology/
作者:[Shrikant Lavhate][a]
译者:[chenxinlong](https://github.com/chenxinlong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://kerneltalks.com/virtualization/aws-cloud-terminology/

View File

@ -1,7 +1,7 @@
开发 Linux 调试器第一部分:启动
============================================================
任何写过 hello world 程序的人都应该使用过调试器(如果你还没有,那就停下手头的工作先学习一下吧)。但是,尽管这些工具已经得到了广泛的使用,却并没有太多的资源告诉你它们的工作原理以及如何开发[1][1],尤其是和其它类似编译器等工具链技术相比的时候。
任何写过 hello world 复杂点程序的人都应该使用过调试器(如果你还没有,那就停下手头的工作先学习一下吧)。但是,尽管这些工具已经得到了广泛的使用,却并没有太多的资源告诉你它们的工作原理以及如何开发[1][1],尤其是和其它类似编译器等工具链技术相比的时候。
我们将会支持以下功能:
@ -39,14 +39,14 @@
2. [断点][3]
3. 寄存器和内存
4. Elves 和 dwarves
5. 逐步、源码和信号
6. 使用 DWARF 调试信息逐步执行
5. 源码和信号
6. 源码层逐步执行
7. 源码层断点
8. 调用栈
9. 读取变量
10. 下一步
10. 之后步骤
ELF[Executable and Linkable Format](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format "Executable and Linkable Format") 可执行文件格式DWARF一种广泛使用的调试数据格式参考 [WIKI](https://en.wikipedia.org/wiki/DWARF "DWARF WIKI")
LCTT 译注ELF[Executable and Linkable Format](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format "Executable and Linkable Format") 可执行文件格式DWARF一种广泛使用的调试数据格式参考 [WIKI](https://en.wikipedia.org/wiki/DWARF "DWARF WIKI")
* * *
### 准备环境
@ -82,7 +82,7 @@ int main(int argc, char* argv[]) {
}
```
我们调用 `fort` 把我们的程序分成两个进程。如果我们是在子进程,`fork` 返回 0如果我们是在父进程它会返回子进程的进程ID。
我们调用 `fort` 把我们的程序分成两个进程。如果我们是在子进程,`fork` 返回 0如果我们是在父进程它会返回子进程的进程 ID。
如果我们是在子进程,我们要用希望调试的程序替换正在执行的程序。
@ -224,7 +224,7 @@ via: http://blog.tartanllama.xyz/c++/2017/03/21/writing-a-linux-debugger-setup/
作者:[Simon Brand ][a]
译者:[ictlyh](https://github.com/ictlyh)
校对:[校对者ID](https://github.com/校对者ID)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,297 @@
开发 Linux 调试器第五部分:源码和信号
============================================================
在上一部分我们学习了关于 DWARF 的信息以及它如何可以被用于读取变量和将被执行的机器码和我们高层次的源码联系起来。在这一部分,我们通过实现一些我们调试器后面会使用的 DWARF 原语将它应用于实际情况。我们也会利用这个机会,使我们的调试器可以在命中一个断点时打印出当前的源码上下文。
* * *
### 系列文章索引
随着后面文章的发布,这些链接会逐渐生效。
1. [启动][1]
2. [断点][2]
3. [寄存器和内存][3]
4. [Elves 和 dwarves][4]
5. [源码和信号][5]
6. [源码级逐步执行][6]
7. 源码级断点
8. 调用栈展开
9. 读取变量
10. 下一步
译者注ELF[Executable and Linkable Format](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format "Executable and Linkable Format") 可执行文件格式DWARF一种广泛使用的调试数据格式参考 [WIKI](https://en.wikipedia.org/wiki/DWARF "DWARF WIKI")
* * *
### 设置我们的 DWARF 解析器
正如我在这系列文章开始时备注的,我们会使用 [`libelfin`][7] 来处理我们的 DWARF 信息。希望你已经在第一部分设置好了这些,如果没有的话,现在做吧,确保你使用我仓库的 `fbreg` 分支。
一旦你构建好了 `libelfin`,就可以把它添加到我们的调试器。第一步是解析我们的 ELF 可执行程序并从中提取 DWARF 信息。使用 `libelfin` 可以轻易实现,只需要对`调试器`作以下更改:
```
class debugger {
public:
debugger (std::string prog_name, pid_t pid)
: m_prog_name{std::move(prog_name)}, m_pid{pid} {
auto fd = open(m_prog_name.c_str(), O_RDONLY);
m_elf = elf::elf{elf::create_mmap_loader(fd)};
m_dwarf = dwarf::dwarf{dwarf::elf::create_loader(m_elf)};
}
//...
private:
//...
dwarf::dwarf m_dwarf;
elf::elf m_elf;
};
```
我们使用了 `open` 而不是 `std::ifstream`,因为 elf 加载器需要传递一个 UNIX 文件描述符给  `mmap`,从而可以将文件映射到内存而不是每次读取一部分。
* * *
### 调试信息原语
下一步我们可以实现从程序计数器的值中提取行条目line entries以及函数 DWARF 信息条目function DIEs的函数。我们从 `get_function_from_pc` 开始:
```
dwarf::die debugger::get_function_from_pc(uint64_t pc) {
for (auto &cu : m_dwarf.compilation_units()) {
if (die_pc_range(cu.root()).contains(pc)) {
for (const auto& die : cu.root()) {
if (die.tag == dwarf::DW_TAG::subprogram) {
if (die_pc_range(die).contains(pc)) {
return die;
}
}
}
}
}
throw std::out_of_range{"Cannot find function"};
}
```
这里我采用了朴素的方法,迭代遍历编译单元直到找到一个包含程序计数器的,然后迭代遍历它的孩子直到我们找到相关函数(`DW_TAG_subprogram`)。正如我在上一篇中提到的,如果你想要的话你可以处理类似成员函数或者内联等情况。
接下来是 `get_line_entry_from_pc`
```
dwarf::line_table::iterator debugger::get_line_entry_from_pc(uint64_t pc) {
for (auto &cu : m_dwarf.compilation_units()) {
if (die_pc_range(cu.root()).contains(pc)) {
auto &lt = cu.get_line_table();
auto it = lt.find_address(pc);
if (it == lt.end()) {
throw std::out_of_range{"Cannot find line entry"};
}
else {
return it;
}
}
}
throw std::out_of_range{"Cannot find line entry"};
}
```
同样,我们可以简单地找到正确的编译单元,然后查询行表获取相关的条目。
* * *
### 打印源码
当我们命中一个断点或者逐步执行我们的代码时,我们会想知道处于源码中的什么位置。
```
void debugger::print_source(const std::string& file_name, unsigned line, unsigned n_lines_context) {
std::ifstream file {file_name};
//获得一个所需行附近的窗口
auto start_line = line <= n_lines_context ? 1 : line - n_lines_context;
auto end_line = line + n_lines_context + (line < n_lines_context ? n_lines_context - line : 0) + 1;
char c{};
auto current_line = 1u;
//跳过 start_line 之前的行
while (current_line != start_line && file.get(c)) {
if (c == '\n') {
++current_line;
}
}
//如果我们在当前行则输出光标
std::cout << (current_line==line ? "> " : " ");
//输出行直到 end_line
while (current_line <= end_line && file.get(c)) {
std::cout << c;
if (c == '\n') {
++current_line;
//如果我们在当前行则输出光标
std::cout << (current_line==line ? "> " : " ");
}
}
//输出换行确保恰当地清空了流
std::cout << std::endl;
}
```
现在我们可以打印出源码了,我们需要将这些通过钩子添加到我们的调试器。一个实现这个的好地方是当调试器从一个断点或者(最终)逐步执行得到一个信号时。到了这里,我们可能想要给我们的调试器添加一些更好的信号处理。
* * *
### 更好的信号处理
我们希望能够得知什么信号被发送给了进程,同样我们也想知道它是如何产生的。例如,我们希望能够得知是否由于命中了一个断点从而获得一个 `SIGTRAP`,还是由于逐步执行完成、或者是产生了一个新线程,等等。幸运的是,我们可以再一次使用 `ptrace`。可以给 `ptrace` 的一个命令是 `PTRACE_GETSIGINFO`,它会给你被发送给进程的最后一个信号的信息。我们类似这样使用它:
```
siginfo_t debugger::get_signal_info() {
siginfo_t info;
ptrace(PTRACE_GETSIGINFO, m_pid, nullptr, &info);
return info;
}
```
这会给我们一个 `siginfo_t` 对象,它能提供以下信息:
```
siginfo_t {
int si_signo; /* 信号编号 */
int si_errno; /* errno 值 */
int si_code; /* 信号代码 */
int si_trapno; /* 导致生成硬件信号的陷阱编号
(大部分架构中都没有使用) */
pid_t si_pid; /* 发送信号的进程 ID */
uid_t si_uid; /* 发送信号进程的用户 ID */
int si_status; /* 退出值或信号 */
clock_t si_utime; /* 消耗的用户时间 */
clock_t si_stime; /* 消耗的系统时间 */
sigval_t si_value; /* 信号值 */
int si_int; /* POSIX.1b 信号 */
void *si_ptr; /* POSIX.1b 信号 */
int si_overrun; /* 计时器 overrun 计数;
POSIX.1b 计时器 */
int si_timerid; /* 计时器 ID; POSIX.1b 计时器 */
void *si_addr; /* 导致错误的内存地址 */
long si_band; /* Band event (在 glibc 2.3.2 和之前版本中是 int 类型) */
int si_fd; /* 文件描述符 */
short si_addr_lsb; /* 地址的最不重要位
(自 Linux 2.6.32) */
void *si_lower; /* 出现地址违规的下限 (自 Linux 3.19) */
void *si_upper; /* 出现地址违规的上限 (自 Linux 3.19) */
int si_pkey; /* PTE 上导致错误的保护键 (自 Linux 4.6) */
void *si_call_addr; /* 系统调用指令的地址
(自 Linux 3.5) */
int si_syscall; /* 系统调用尝试次数
(自 Linux 3.5) */
unsigned int si_arch; /* 尝试系统调用的架构
(自 Linux 3.5) */
}
```
我只需要使用 `si_signo` 就可以找到被发送的信号,使用 `si_code` 来获取更多关于信号的信息。放置这些代码的最好位置是我们的 `wait_for_signal` 函数:
```
void debugger::wait_for_signal() {
int wait_status;
auto options = 0;
waitpid(m_pid, &wait_status, options);
auto siginfo = get_signal_info();
switch (siginfo.si_signo) {
case SIGTRAP:
handle_sigtrap(siginfo);
break;
case SIGSEGV:
std::cout << "Yay, segfault. Reason: " << siginfo.si_code << std::endl;
break;
default:
std::cout << "Got signal " << strsignal(siginfo.si_signo) << std::endl;
}
}
```
现在再来处理 `SIGTRAP`。知道当命中一个断点时会发送 `SI_KERNEL` 或 `TRAP_BRKPT`,而逐步执行结束时会发送 `TRAP_TRACE` 就足够了:
```
void debugger::handle_sigtrap(siginfo_t info) {
switch (info.si_code) {
//如果命中了一个断点其中的一个会被设置
case SI_KERNEL:
case TRAP_BRKPT:
{
set_pc(get_pc()-1); //将程序计数器的值设置为它应该指向的地方
std::cout << "Hit breakpoint at address 0x" << std::hex << get_pc() << std::endl;
auto line_entry = get_line_entry_from_pc(get_pc());
print_source(line_entry->file->path, line_entry->line);
return;
}
//如果信号是由逐步执行发送的,这会被设置
case TRAP_TRACE:
return;
default:
std::cout << "Unknown SIGTRAP code " << info.si_code << std::endl;
return;
}
}
```
这里有一大堆不同风格的信号你可以处理。查看 `man sigaction` 获取更多信息。
由于当我们收到 `SIGTRAP` 信号时我们已经修正了程序计数器的值,我们可以从 `step_over_breakpoint` 中移除这些代码,现在它看起来类似:
```
void debugger::step_over_breakpoint() {
if (m_breakpoints.count(get_pc())) {
auto& bp = m_breakpoints[get_pc()];
if (bp.is_enabled()) {
bp.disable();
ptrace(PTRACE_SINGLESTEP, m_pid, nullptr, nullptr);
wait_for_signal();
bp.enable();
}
}
}
```
* * *
### 测试
现在你应该可以在某个地址设置断点,运行程序然后看到打印出了源码,而且正在被执行的行被光标标记了出来。
后面我们会添加设置源码级别断点的功能。同时,你可以从[这里][8]获取该博文的代码。
--------------------------------------------------------------------------------
via: https://blog.tartanllama.xyz/c++/2017/04/24/writing-a-linux-debugger-source-signal/
作者:[TartanLlama ][a]
译者:[ictlyh](https://github.com/ictlyh)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.twitter.com/TartanLlama
[1]:https://blog.tartanllama.xyz/2017/03/21/writing-a-linux-debugger-setup/
[2]:https://blog.tartanllama.xyz/c++/2017/03/24/writing-a-linux-debugger-breakpoints/
[3]:https://blog.tartanllama.xyz/c++/2017/03/31/writing-a-linux-debugger-registers/
[4]:https://blog.tartanllama.xyz/c++/2017/04/05/writing-a-linux-debugger-elf-dwarf/
[5]:https://blog.tartanllama.xyz/c++/2017/04/24/writing-a-linux-debugger-source-signal/
[6]:https://blog.tartanllama.xyz/c++/2017/05/06/writing-a-linux-debugger-dwarf-step/
[7]:https://github.com/TartanLlama/libelfin/tree/fbreg
[8]:https://github.com/TartanLlama/minidbg/tree/tut_source

View File

@ -9,21 +9,21 @@
开源项目要面对的首要挑战之一是如何在贡献者之间沟通。这里有很多的选择论坛、聊天频道、问题列表、邮件列表、pull request 等等。我们该选择哪个合适的来使用,我们又该如何做呢?
令人遗憾的是,项目往往不愿作出有纪律的决定,而是选择“上述所有”。这就导致了一个支离破碎的社区:有些人使用 Slack/Mattermost/IRC而有些人使用论坛有些使用邮件列表有些使用问题列表很少有人都用这些
令人遗憾的是,项目往往不愿做出约束性的决定,而是选择“上述所有”。这就导致了一个支离破碎的社区:有些人使用 Slack/Mattermost/IRC而有些人使用论坛有些使用邮件列表有些使用问题列表很少有人能够读到所有这些途径的内容
我在组织中常见到的一个问题是。我[正在努力建立它们的内部和外部社区][2]。我们会选择哪个渠道,以及出于什么目的?另外,何时可以对它们之一说不呢?
在我[帮助建立内部和外部社区][2]的组织中,这是一个常见的问题。我们会选择哪个渠道,以及出于什么目的?另外,何时可以对它们之一说不呢?
这就是我想在此处深的。
这就是我想在此处深度探讨的。
### 结构化和非结构化
只有一个很小的如花生大小的头脑。因此,我倾向于将问题分成小的部分,这样我可以更好地理解它们。类似地,我倾向于将一个情景中不同困难的选择变成更小的题目来更好地理解它们的目的。我在沟通渠道的选择上也使用这种方法。
并不是个聪明人。因此,我倾向于将问题分成小的部分,这样我可以更好地理解它们。类似地,我倾向于将一个情景中不同困难的选择变成更小的题目来更好地理解它们的目的。我在沟通渠道的选择上也使用这种方法。
相信有两大沟通渠道的分类:结构化和非结构化
认为有两大沟通渠道的分类:结构化和非结构化
结构化渠道在每个单独的沟通单位中都有非常具体的重点。例子如GitHub/GitLab /Jira issue。一个问题是与 bug 或功能有关的一个非常具体的信息。在帖子发布之后的的讨论中通常非常集中在该特定主题上并会有一个结果(比如 bugfix 或者一个功能的最终计划)。结果通常都反映在状态(例如 “FIXED”、“WONTFIX” 或 “INVALID”中。这意味着你可以了解沟通的开始和结束而无需阅读中间的内容。
结构化渠道在每个单独的沟通单位中都有非常具体的重点。例子如GitHub / GitLab /Jira issue(问题)。一个问题是与 bug 或功能有关的一个非常具体的信息。在帖子发布之后的的讨论中通常非常集中在该特定主题上并会有一个结果(比如 bugfix 或者一个功能的最终计划)。结果通常都反映在状态(例如 “FIXED”、“WONTFIX” 或 “INVALID”中。这意味着你可以了解沟通的开始和结束而无需阅读中间的内容。
类似的pull/merge 请求也是结构化的。它们集中在特定类型(通常是代码)的贡献上。在最初的 pull/merge 请求后,讨论会非常集中在一个结果上:让贡献符合要求来合并进入代码库中。
类似的pull/merge 请求也是结构化的。它们集中在特定类型(通常是代码)的贡献上。在最初的 pull/merge 请求后,讨论会非常集中在一个结果上:让贡献符合要求,且合并入代码库中。
另一个例子是 StackOverflow/AskBot 这类的问答帖子。这些帖子以一个问题开始,接着被编辑以及回复来提供对这个问题的精确答案。
@ -33,11 +33,11 @@
### 记录的影响
除了结构化和非结构化沟通的微妙不同外,记录了什么的影响以及如何可以被搜索也扮演了一个很大的角色。
除了结构化和非结构化沟通的微妙不同外,记录了什么以及如何可以它们也扮演了一个很大的角色。
典型,所有的结构化渠道都是记录的。人们可以参考以前的 bug来自 StackOverflow 的问题可以被反复地重用。你可以搜索一些东西,即使有很多讨论,问题pull request 或者提问通常都会被更新以反映最终结论。
典型,所有的结构化渠道都是记录的。人们可以参考以前的 bug来自 StackOverflow 的问题可以被反复地重用。你可以搜索一些东西,即使有很多讨论,通常问题、pull request 或者提问都会被更新以反映最终结论。
这是一个重点:我们希望能够快速,轻松地挖掘旧问题/提问/pull request 等,并链接到它们、引用它们。这里的一个关键部分是我们把这个内容转换成可以引用的材料,可以用来教育和告知人们以前的知识。随着社区的发展,我们的结构化沟通成为一种知识全集,可以通过以往的经验来告知未来。
这是一个重点:我们希望能够快速、轻松地挖掘旧问题/提问/ pull request 等,并链接到它们、引用它们。这里的一个关键部分是我们把这个内容转换成可以引用的材料,从而可以用来教育和告知人们以前的知识。随着社区的发展,我们的结构化沟通成为一种知识全集,可以通过以往的经验来告知未来。
这使得非结构化沟通变得越来越糟。一方面,论坛的搜索通常都简单高效,但是它们当然充满了非结构化的对话,所以你正在寻找的东西可能被埋在讨论之中。例如,许多社区使用论坛作为支持工具。虽然这是一个更强大的平台,但是问题在于,一个问题的答案可能是在 16 楼或者 340 楼中有响应。随着越来越多的信息来源(比如 Twitter的轰炸我们越来越不耐烦地阅读大量的材料这对于非结构化媒体来说可能是一个问题。
@ -55,13 +55,13 @@
虽然这个答案对于不同的项目会不同,但我想在两个层面思考。
首先,你应该通常有限考虑结构化沟通。这有有形的工作可以完成:在 bug/问题 上、pull request、在支持问答讨论上等等。如果你资源有限那么专注在这些渠道上你可以更轻松地在时间和金钱的支出以及在社区的高效产出上画一条虚线
首先,你应该通常优先考虑结构化沟通。这是完成有形工作的地方bug / issue、pull request、问答讨论等等。如果你资源有限那么专注在这些渠道上你可以用较少的时间和金钱支出获得社区的高效产出
再者,如果你热衷于建立一个可以专注于工程、宣传、翻译、文档等方面的更广泛的社区,那么探究是否引入非结构化渠道就有意义了。 社区不仅仅是为了完成工作,而且也是建立关系和友谊,在工作中相互支持,帮助人们在社区中发展壮大。非结构化通信是一个有用的工具。
再者,如果你热衷于建立一个可以专注于工程、宣传、翻译、文档等方面的更广泛的社区,那么探究是否引入非结构化渠道就有意义了。 社区不仅仅是为了完成工作,也是为了建立关系和友谊,在工作中相互支持,帮助人们在社区中发展壮大。非结构化通信是一个有用的工具。
当然,我这里只是抓住了庞大问题的表面,但是希望这对于如何评估和选择沟通渠道的价值提供一些清晰的想法。记住,少即是多:不要被引诱推迟决定并提供所有的渠道。否则你会得到一个支离破碎社区,就像一个空荡荡的餐厅一样。
当然,我只是在一个大的话题上浅谈即止。 不过我希望在如何评估和选择沟通渠道的价值方面,为大家提供了一些清晰的想法。记住,少即是多:不要被引诱推迟决定并提供所有的渠道。否则你会得到一个支离破碎社区,就像一个空荡荡的餐厅一样。
力与你同在,请确保让我知道你进行的如何另外。你可以通过我的[网站][3]和邮箱 [jono@jonobacon.com][4] 联系到我。
愿力与你同在,请让我知道你进行的如何。你可以通过我的[网站][3]和邮箱 [jono@jonobacon.com][4] 联系到我。
--------------------------------------------------------------------------------

View File

@ -0,0 +1,222 @@
Linux 系统中修复 SambaCry 漏洞CVE-2017-7494
============================================================
Samba 很久以来是为 *nix 系统上的 Windows 客户端提供共享文件和打印服务的标准。家庭用户,中型企业和大型公司都在使用它,它作为最佳解决方案在不同操作系统共存的环境中脱颖而出。
由于广泛使用的工具很可能发生这种情况,大多数 Samba 安装都面临着可能利用已知漏洞的攻击的风险,这个漏洞直到 WannaCry 勒索软件攻击的新闻出来之前都被认为是不重要的。
在本文中,我们将解释这个 Samba 漏洞是什么以及如何保护你负责的系统。根据你的安装类型(从仓库或者源码),你需要采取不同的方法。
如果你目前有在任何环境中使用 Samba 或者知道有人在使用,请继续阅读!
### 漏洞
过时和未修补的系统容易受到远程代码执行漏洞的攻击。简单来说,这意味着访问可写共享的人可以上传一段任意代码,并使用服务器中的 root 权限执行该代码。
这个问题在 Samba 网站上被描述为 [CVE-2017-7494][1],并且已知会影响 Samba v3.52010 年 3 月初发布)及以后版本。由于与 WannaCry 有相似之处,它被非官方地被命名为 SambaCry它们均针对 SMB 协议,并且可能是蠕虫病毒 - 这可能导致其从一个系统传播到另一个系统中。
Debian、Ubuntu、CentOS 和 Red Hat 已采取快速的行动来保护它们的用户,并为其支持的版本发布了补丁。另外,还提供了不受支持的安全临时解决方案。
### 更新 Samba
如先前提到的那样,根据你之前安装的方法有两种方式更新:
如果你从发行版的仓库中安装的 Samba。
让我们看下在这种情况下你需要做什么:
#### 在 Debian 下修复 Sambacry
添加下面的行到你的源列表中(/etc/apt/sources.list以确保 [apt][2] 能够获得最新的安全更新:
```
deb http://security.debian.org stable/updates main
deb-src http://security.debian.org/ stable/updates main
```
接下来,更新可用的软件包:
```
# aptitude update
```
最后,确保 samba 软件包的版本符合漏洞修复的版本(见 [CVE-2017-7494][3]
```
# aptitude show samba
```
![Fix Sambacry in Debian](https://www.tecmint.com/wp-content/uploads/2017/05/Fix-Sambacry-in-Debian.png)
在 Debian 中修复 Sambacry
#### 在 Ubuntu 中修复 Sambacry
要开始修复,如下检查新的可用软件包并更新 samba 软件包:
```
$ sudo apt-get update
$ sudo apt-get install samba
```
已经修复 CVE-2017-7494 的 Samba 版本有下面这些:
* 17.04: samba 2:4.5.8+dfsg-0ubuntu0.17.04.2
* 16.10: samba 2:4.4.5+dfsg-2ubuntu5.6
* 16.04 LTS: samba 2:4.3.11+dfsg-0ubuntu0.16.04.7
* 14.04 LTS: samba 2:4.3.11+dfsg-0ubuntu0.14.04.8
最后,运行下面命令验证你的 Ubuntu 已经安装了正确的版本。
```
$ sudo apt-cache show samba
```
#### 在 CentOS/RHEL 7 中修复 Sambacry
在 EL 7 中打过补丁的 Samba 版本是 samba-4.4.4-14.el7_3。要安装它这些做
```
# yum makecache fast
# yum update samba
```
像先前那样,确保你已经安装了打补丁的 Samba 版本:
```
# yum info samba
```
![Fix Sambacry in CentOS](https://www.tecmint.com/wp-content/uploads/2017/05/Fix-Sambacry-in-CentOS.png)
在 CentOS 中修复 Sambacry
旧支持的 CentOS 以及 RHEL 更老的版本也有修复。参见 [RHSA-2017-1270][4] 获取更多。
##### 如果你从源码安装的 Samba
注意:下面的过程假设你先前从源码构建的 Samba。强烈建议你在部署到生产服务器之前先在测试环境尝试。
额外地,开始之前确保你备份了 smb.conf 文件。
在这种情况下,我们也会从源码编译并更新 Samba。然而在开始之前我们必须先确保安装了所有的依赖。注意这也许会花费几分钟。
#### 在 Debian 和 Ubuntu 中:
```
# aptitude install acl attr autoconf bison build-essential \
debhelper dnsutils docbook-xml docbook-xsl flex gdb krb5-user \
libacl1-dev libaio-dev libattr1-dev libblkid-dev libbsd-dev \
libcap-dev libcups2-dev libgnutls28-dev libjson-perl \
libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl \
libpopt-dev libreadline-dev perl perl-modules pkg-config \
python-all-dev python-dev python-dnspython python-crypto xsltproc \
zlib1g-dev libsystemd-dev libgpgme11-dev python-gpgme python-m2crypto
```
#### 在 CentOS 7 或相似的版本中:
```
# yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
libsemanage-python libxslt perl perl-ExtUtils-MakeMaker \
perl-Parse-Yapp perl-Test-Base pkgconfig policycoreutils-python \
python-crypto gnutls-devel libattr-devel keyutils-libs-devel \
libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
pam-devel popt-devel python-devel readline-devel zlib-devel
```
停止服务:
```
# systemctl stop smbd
```
下载并解压源码(在写作时 4.6.4 是最新的版本):
```
# wget https://www.samba.org/samba/ftp/samba-latest.tar.gz
# tar xzf samba-latest.tar.gz
# cd samba-4.6.4
```
出于了解信息的目的,用以下命令检查可用的配置选项。
```
# ./configure --help
```
如果你在先前的版本的构建中有使用到一些选项,你或许可以在上面命令的返回中包含一些选项,或者你可以选择使用默认值:
```
# ./configure
# make
# make install
```
最后重启服务。
```
# systemctl restart smbd
```
并验证你正在使用的是更新后的版本:
```
# smbstatus --version
```
这里返回的应该是 4.6.4。
### 概论
如果你使用的是不受支持的发行版本,并且由于某些原因无法升级到最新版本,你或许要考虑下面这些建议:
* 如果 SELinux 是启用的,你是受保护的!
* 确保 Samba 共享是用 noexec 选项挂载的。这会阻止二进制文件从被挂载的文件系统中执行。
还有将
```
nt pipe support = no
```
添加到 smb.conf 的 [global] 字段中。你或许要记住,根据 Samba 项目,这“或许禁用 Windows 客户端的某些功能”。
重要:注意 “nt pipe support = no” 选项会禁用 Windows 客户端的共享列表。比如:当你在一台 Samba 服务器的 Windows Explorer 中输入 \\10.100.10.2\ 时,你会看到 “permission denied”。Windows 客户端不得不手动执行共享,如 \\10.100.10.2\share_name 来访问共享。
##### 总结
在本篇中,我们已经描述了 SambaCry 漏洞以及如何减轻影响。我们希望你可以使用这个信息来保护你负责的系统。
如果你有关于这篇文章的任何提问以及评论,欢迎使用下面的评论栏让我们知道。
--------------------------------------------------------------------------------
作者简介:
Gabriel Cánepa 是一名 GNU/Linux 系统管理员,阿根廷圣路易斯 Villa Mercedes 的 web 开发人员。他为一家国际大型消费品公司工作,在日常工作中使用 FOSS 工具以提高生产力,并从中获得极大乐趣。
--------------
via: https://www.tecmint.com/fix-sambacry-vulnerability-cve-2017-7494-in-linux/
作者:[Gabriel Cánepa ][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.tecmint.com/author/gacanepa/
[1]:https://www.samba.org/samba/security/CVE-2017-7494.html
[2]:https://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/
[3]:https://security-tracker.debian.org/tracker/CVE-2017-7494
[4]:https://rhn.redhat.com/errata/RHSA-2017-1270.html
[5]:https://www.tecmint.com/author/gacanepa/
[6]:https://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[7]:https://www.tecmint.com/free-linux-shell-scripting-books/