Merge branch 'onionstalgia-talk-4' of github.com:onionstalgia/TranslateProject into onionstalgia-talk-4

* 'onionstalgia-talk-4' of github.com:onionstalgia/TranslateProject: (46 commits)
  申请修改
  [绕过检查] 添加来源分支检查
  RP
  提交译文
  Update 20220510 Easily Connect your iPhone with Linux as KDE Connect Arrives on the App Store.md
  translation
  RP
  RP
  translating
  translated
  [手动选题][tech]: 20230214.1 ️ Lua loops how to use while and repeat until.md
  Update 20230214.1 ️ Lua loops how to use while and repeat until.md
  gpchn translating
  gpchn translation completed
  gpchn translation completed
  Translating
  Update 20230209.1 ️ GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago.md
  RP
  translating by perfiffer
  R
  ...
This commit is contained in:
onionstalgia 2023-02-17 21:48:33 +08:00
commit 698673aab7
41 changed files with 2747 additions and 1648 deletions

View File

@ -12,6 +12,8 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: ensure source branch is not "master"
run: '[ "${{ github.head_ref }}" != master ]'
- name: "checkout master branch & return to pull request branch" - name: "checkout master branch & return to pull request branch"
run: CURRENT=$(echo ${{github.ref}} | sed "s|refs/|refs/remotes/|") && git checkout master && git checkout $CURRENT run: CURRENT=$(echo ${{github.ref}} | sed "s|refs/|refs/remotes/|") && git checkout master && git checkout $CURRENT
- name: run check - name: run check

View File

@ -0,0 +1,94 @@
[#]: subject: "How we hired an open source developer"
[#]: via: "https://opensource.com/article/22/2/how-we-hired-open-source-developer"
[#]: author: "Mike Bursell https://opensource.com/users/mikecamel"
[#]: collector: "lujun9972"
[#]: translator: "XiaotingHuang22"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15543-1.html"
我们是如何聘请开源开发人员的
======
> 我的团队不再采用标准的算法编程笔试,而是采用一套能够产出更多相关成果的流程。
![][0]
作为初创安全公司 [Profian][2] 的首席执行官和联合创始人,我参与了我们聘请开发人员从事 [Enarx][3] 的工作。Enarx 是一个处理机密信息计算的安全项目,几乎完全用 [Rust 语言][4] 编写少部分用汇编语言。Profian 现在已经在这次招聘找到了所有要找的人一些开发人员将在接下来的几周内开始工作。然而Enarx 绝对欢迎新的贡献者,如果事情继续顺利,公司将来肯定会雇用更多的人。
招聘人员并不容易,加上 Profian 还有一系列特别的要求,这让招人变得更加困难。因此我认为分享我们如何解决这个问题应该还蛮有意思的,而且也会对社区有帮助。
### 我们寻找什么样的人才?
以下就是我前文提到的特别要求:
* **系统编程**Profian 主要需要那些喜欢系统层编程的人。这一层面的编程已经处于栈的底层,有很多直接与硬件或操作系统的交互。例如,要创建客户端-服务器部分,我们必须编写相当多的协议、管理加密等等,而这方面的工具还不是很成熟(请参阅下面的 “Rust” 一节)。
* **Rust**:项目几乎都是用 Rust 语言编写的,那些不是的则是用汇编语言写的(目前只有 x86 平台尽管随着我们添加更多平台情况可能会有所改变。Rust 是一门很新、很酷同时也令人兴奋的编程语言,但它同时也很年轻,并且一些领域没有你想要的所有支持或者没有你希望的那么成熟 —— 这包括从密码学到多线程库到编译器/构建基本架构。
* **分散各地的团队**Profian 正在建立一个能够及时通讯联系的团队。Profian 在德国、芬兰、荷兰、北卡罗来纳州(美国)、马萨诸塞州(美国)、弗吉尼亚州(美国)和乔治亚州(美国)都有开发人员。我在英国,我们的社区经理在巴西,我们有来自印度和尼日利亚的实习生。从一开始我们就知道团队很难聚集在一个地方工作,因此我们需要能够通过视频、聊天和(最不济的情况下)电子邮件与人交流和协作的成员。
* **安全**Enarx 是一个安全项目。虽然我们并不是专门在寻找安全专家,但我们需要能够将安全放在首位去思考和工作,并设计和编写适用于安全环境的代码的人。
* **Git**:我们所有的代码都存储在 Git 中(主要是 [GitHub][5],还有一些存在 GitLab。我们围绕代码的大部分交互都是围绕 Git 进行的,因此任何加入我们团队的人都需要能自如使用它作为日常工作中的标准工具。
* **开源**:开源不仅仅是许可;更是一种心态,同时,这也是一种合作方式。大量开源软件是由不同地域的人创建的,他们甚至可能不认为彼此身处于一个团队。我们需要知道我们招的人不仅能在公司内部凝聚成一个紧密的团队,同时也能够与组织外部的人员协作,并接受 Profian 的“默认开放”文化,这里的开放不仅仅限于代码,还要有开放的讨论、沟通和文档。
### 我们是如何找到人才的?
正如我在其他地方提到的,[招聘很困难][6]。Profian 使用多种方式寻找候选人,它们取得了不同程度的成功:
* 领英招聘广告
* 领英搜索
* 特定语言的讨论板和招聘板例如Reddit
* 外部招募人员(特别致敬来自 [Interstem][7] 公司的 Gerald
* 口耳相传/个人推荐
虽然很难从质量方面判断这些来源如何,但如果没有外部招聘人员,我们肯定会在数量上苦苦挣扎(我们也有一些来自该途径的优秀候选人)。
### 我们如何筛选出想要的人才?
我们需要按照上述的所有要求衡量所有候选人,但并非所有要求都是同等重要的。例如,虽然我们热衷于雇用 Rust 程序员,但那些在系统级别具有强大 C/C++ 技能的人也能成为团队里有用的一份子,因为他们能够很快掌握 Rust 语言。另一方面,熟悉使用 Git 是至关重要的,因为我们无法花时间去培养新团队成员,让他们跟上我们的工作方式。
你可能会觉得很惊讶,但强大的开源背景并不是必需的要求,在类似模式中工作的心态是必需的,而任何有开源参与历史的人都可能对 Git 有很好的了解。同理,在一个分散各地的团队中工作的能力这一条件上,我们认为有过任意开源社区的参与经历都会是个积极的指标,因为有如此多的开源项目都是由分散各地的人们完成的。至于安全这一条件,我们则一致决定这只是一个“锦上添花”的条件。
我们想让这个过程简单快捷。 Profian 没有设置专门的人力资源部门或人力职能,因为我们正忙于编写代码。以下是我们最终使用的招聘流程(实际流程中可能略有不同),我们试图在 1-2 周内完成招聘:
1. 初审:个人履历/简历/GitHub/GitLab/领英主页,决定是否面试
2. 我作为 CEO 和候选人进行一场 30-40 分钟的讨论,了解他们是否适合我们团队的文化,同时让他们有机会了解我们,并了解他们是否真的像在初审提交的材料中所说的那样精通技术
3. 由 Nathaniel 领导的有关技术方面的深入讨论,通常我也在场
4. 与团队其他成员谈话
5. 编码笔试
6. 快速决策(通常在 24 小时内)
编码笔试很关键,但我们决定不采用通常的方法。我们的观点是,许多科技公司钟爱的纯“算法编码”笔试对我们想要的几乎毫无用处:考察候选人是否可以快速理解一段代码,解决一些问题,并与团队合作完成以上的工作。我们创建了一个 GitHub 存储库,其中包含一些几乎可以正常运行的 Rust 代码(事实上,我们最终使用了两个,其中一个用于技术栈上层的人),然后让候选人修复它,在上面执行一些与 Git 相关的过程,并稍作改进,在此过程中添加测试。
测试中一个必不可少的部分是让候选人通过我们的聊天室与团队互动。我们安排了 15 分钟的视频通话时间用于设置和初始问题,两个小时用于做笔试(“开卷”——以及与团队交谈,鼓励候选人使用互联网上所有可用的资源),然后是 30 分钟的总结会议,在这个会议上团队可以提出问题,候选人可以思考任务。这个谈话,结合笔试期间的聊天互动,让我们了解了候选人与团队沟通的能力。候选人挂断电话之后我们通常会在 5-10 分钟内决定是否要雇用他们。
这种方法通常效果很好。一些候选人在任务上遇到困难,一些人沟通不畅,一些人在 Git 交互方面做得不好 —— 这些是我们没有雇佣的人。这并不意味着他们不是优秀的程序员或者以后不适合该项目或公司,但他们不符合我们现在需要的标准。在我们聘用的开发人员中,他们的 Rust 经验水平和与团队互动的需求各不相同,但 Git 专业知识水平以及他们在和我们讨论之后的反应始终足以让我们决定接受他们。
### 感想
总的来说,我不认为我们会对筛选过程进行大的改动 —— 尽管我很确定我们可以在搜寻过程环节做得更好。通过编码笔试,我们可以筛选掉相当多的候选人,而且很好地帮了我们挑选合适的人。希望通过了这次选拔的每个人都很适合这个项目并且产出出色的代码(以及测试和文档等等)。时间会证明一切!
* * *
本文最初发布于 [Alice、Eve 和 Bob 安全博客][8] 上,经许可后重新发布。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/2/how-we-hired-open-source-developer
作者:[Mike Bursell][a]
选题:[lujun9972][b]
译者:[XiaotingHuang22](https://github.com/XiaotingHuang22)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mikecamel
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team)
[2]: https://profian.com/
[3]: https://enarx.dev/
[4]: https://opensource.com/article/21/3/rust-programmer
[5]: https://github.com/enarx/
[6]: https://aliceevebob.com/2021/11/09/recruiting-is-hard/
[7]: https://www.interstem.co.uk/
[8]: https://aliceevebob.com/
[0]: https://img.linux.net.cn/data/attachment/album/202302/16/074428qxbm44dxh00x42z7.jpg

View File

@ -3,23 +3,26 @@
[#]: author: "Gopala Krishna Behara https://www.opensourceforu.com/author/gopalakrishna-behara/" [#]: author: "Gopala Krishna Behara https://www.opensourceforu.com/author/gopalakrishna-behara/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: "onionstalgia" [#]: translator: "onionstalgia"
[#]: reviewer: " " [#]: reviewer: "wxy"
[#]: publisher: " " [#]: publisher: "wxy"
[#]: url: " " [#]: url: "https://linux.cn/article-15548-1.html"
为什么企业应该选择平台即服务PaaS 为什么企业应该选择平台即服务PaaS
====== ======
*<ruby>平台即服务<rt>PaaS</rt></ruby> "能够快速、轻松地创建网络应用,而无需购买和维护其下的软件和基础设施。本文解释了它为什么有用。*
平台即服务(以下简称 PaaS是一种“免去了建立和维护基础设施的复杂工作为客户提供开发、运行和管理应用程序的平台”的云计算服务。这是云原生应用和支持系统所依托的核心平台。 ![][0]
> 平台即服务能够快速、轻松地创建网络应用,而无需购买和维护其下的软件和基础设施。本文解释了它为什么有用。
<ruby>平台即服务<rt>PaaS</rt></ruby>(以下简称 PaaS指的是云计算服务它为客户提供了开发、运行和管理应用程序的平台而免去了建立和维护与开发和启动应用程序相关的基础设施的复杂工作。这是云原生应用和支持系统所依托的核心平台。
PaaS 通常包括不同的应用基础功能,包括应用平台、集成平台、业务分析平台、事件流服务和移动后端服务。此外,它还包括一套与监控、管理、部署相关的功能。 PaaS 通常包括不同的应用基础功能,包括应用平台、集成平台、业务分析平台、事件流服务和移动后端服务。此外,它还包括一套与监控、管理、部署相关的功能。
开发人员希望他们的开发环境不需要等待而运营团队则更关心性能和稳定性。这经常引起两方间的冲突。PaaS 为这两方创造了和平的环境。作为服务交付的应用平台,即 PaaS被用于部署用户代码。Cloud Foundry、Cloudify 和 OpenShift 这些开源环境都可用作 PaaS。 开发人员希望他们的开发环境不需要等待而运营团队则更关心性能和稳定性。这经常引起两方间的冲突。PaaS 为这两方创造了和平的环境。一个作为服务交付的应用平台被称作 PaaS被用于部署用户代码。Cloud Foundry、Cloudify 和 OpenShift 这些开源环境都可用作 PaaS。
### PaaS 的采用模式 ### PaaS 的采用模式
云计算必须满足五个基本特征——按需服务、接入网络、资源池化、弹性和可度量的服务。为此云计算提供了三种服务模式软件即服务SaaS、平台即服务PaaS、基础设施即服务IaaS 云计算必须满足五个基本特征按需服务、接入网络、资源池化、弹性和可度量的服务。为此,云计算提供了三种服务模式:<ruby>软件即服务<rt>Software as a Service</rt></ruby>SaaS<ruby>平台即服务<rt>Platform as a Service</rt></ruby>PaaS<ruby>基础设施即服务<rt>Infrastructure as a Service</rt></ruby>IaaS
业务选用 PaaS 的关键驱动力: 业务选用 PaaS 的关键驱动力:
@ -27,25 +30,25 @@ PaaS 通常包括不同的应用基础功能,包括应用平台、集成平台
* 通过减少应用程序的交付时间和提高开发和交付质量,最大限度地降低 IT 成本 * 通过减少应用程序的交付时间和提高开发和交付质量,最大限度地降低 IT 成本
* 增加中间件之间的灵活性和集成度 * 增加中间件之间的灵活性和集成度
**简单 PaaS** 是踏入 PaaS 领域的入门。它可以提供应用程序服务,并将它们暴露在自助服务的目录中,自动部署和计量服务使用的资源。 *简单 PaaS*:踏入 PaaS 领域的入口。它可以提供应用程序服务,并将它们暴露在自助服务的目录中;自动部署和计量服务使用的资源。
*管理 PaaS* 管理已配置应用程序的<ruby>服务级别协议<rt>SLA</rt></ruby><ruby>服务质量<rt>QoS</rt></ruby>,例如弹性、应用程序性能、安全性等。 *管理 PaaS*管理已配置应用程序的<ruby>服务级别协议<rt>SLA</rt></ruby><ruby>服务质量<rt>QoS</rt></ruby>,例如弹性、应用程序性能、安全性等。
*编程 PaaS* 允许应用程序与外部应用程序或公共云集成,并实现自动扩展和云爆发场景。 *编程 PaaS*允许应用程序与外部应用程序或公共云集成,并实现自动扩展和云爆发场景。
*<ruby>面向流程<rt>Process-oriented</rt></ruby> PaaS* 允许通过创建持续交付流程来实现<ruby>开发运维<rt>DevOps</rt></ruby>流程,该流程可以自动构建、测试应用程序并将其交付到云环境中。 *面向流程 PaaS*允许通过创建持续交付流程来实现<ruby>开发运维<rt>DevOps</rt></ruby>流程,该流程可以自动构建、测试应用程序并将其交付到云环境中。
除了这些采用模式之外,还有其他的 PaaS 变体如下,这些变化可能与上文的模式有一定重合 除了这些采用模式之外,还有其他的 PaaS 变体如下,这些变化可能与上文的模式有一定重合
**<ruby>集成平台即服务<rt>iPaaS</rt></ruby>**是一套能够开发、执行和管理集成流的云服务。集成流可以是个人内部或跨多个组织连接的,可以包含任何企业内部或基于云的流程、服务、应用和数据。这些组合变化可能也符合上述的模式之一,例如 MuleSoft CloudHub 和 BizTalk。 *集成平台即服务iPaaS*一套能够开发、执行和管理集成流的云服务。集成流可以是个人内部或跨多个组织连接的,可以包含任何企业内部或基于云的流程、服务、应用和数据。这些组合变化可能也符合上述的模式之一,例如 MuleSoft CloudHub 和 BizTalk。
**<ruby>移动平台即服务<rt>mPaaS</rt></ruby>**是为开发移动应用提供的<ruby>集成开发环境<rt>IDE</rt></ruby>,并且支持多种移动平台。 *移动平台即服务mPaaS*为开发移动应用提供的集成开发环境IDE,并且支持多种移动平台。
**<ruby>数据库平台即服务<rt>dbPaas</rt></ruby>**是一种按需的、安全且可扩展的自助式数据库平台可自动配置和管理数据库。dbPaaS 使扩展数据库变得更加容易,并使它们更加可靠。 *数据库平台即服务dbPaas*一种按需的、安全且可扩展的自助式数据库平台可自动配置和管理数据库。dbPaaS 使扩展数据库变得更加容易,并使它们更加可靠。
**<ruby>物联网平台即服务<rt>IoTPaaS</rt></ruby>**提供了实现异构物联网拓扑所需的通信、安全、分析和管理的通用基础架构。它为构建物联网解决方案提供了更简单、更敏捷的模型。 *物联网平台即服务IoTPaaS*提供了实现异构物联网拓扑所需的通信、安全、分析和管理的通用基础架构。它为构建物联网解决方案提供了更简单、更敏捷的模型。
**<ruby>业务流程管理平台即服务<rt>bpmPaaS</rt></ruby>**是一个完整的预集成业务流程管理平台,托管在云端并作为服务交付。它被用于开发和执行整个企业的业务流程和以工作流程为中心的应用程序。例如 Pega cloud 和 OpenText Cordys cloud。 *业务流程管理平台即服务bpmPaaS*一个完整的预集成业务流程管理平台,托管在云端并作为服务交付。它被用于开发和执行整个企业的业务流程和以工作流程为中心的应用程序。例如 Pega cloud 和 OpenText Cordys cloud。
PaaS 的一些基本特征: PaaS 的一些基本特征:
@ -65,19 +68,19 @@ PaaS 的一些基本特征:
* 应用堆栈的选择 * 应用堆栈的选择
* 语言、数据库和框架支持 * 语言、数据库和框架支持
* 规模的可扩展性 * 规模的可扩展性
* <ruby>服务质量<rt>QoS</rt></ruby> * 服务质量QoS
* 开发和运营的工具 * 开发和运营的工具
* 它有多适合你的业务 * 它有多适合你的业务
现在让我们快速浏览下流行的开源 PaaS。 现在让我们快速浏览下流行的开源 PaaS。
**Cloud Foundry**提供了多种云的选择、开发者框架和应用服务。Cloud Foundry 使构建、测试、部署和扩展应用程序变得更快、更容易。 *Cloud Foundry*提供了多种云的选择、开发者框架和应用服务。Cloud Foundry 使构建、测试、部署和扩展应用程序变得更快、更容易。
它有不同的发行版本,其中比较流行的是 Pivotal 和 IBM。它包含应用<ruby>运行时<rt>runtime</rt></ruby>和容器运行时。在 Pivotal 上包含有应用服务和容器服务。 它有不同的发行版本,其中比较流行的是 Pivotal 和 IBM。它包含应用<ruby>运行时<rt>runtime</rt></ruby>和容器运行时。在 Pivotal 上包含有应用服务和容器服务。
**OpenShift**红帽的云计算 PaaS 产品。这是一个云端的应用平台,应用开发者和团队可以在这里构建、测试、部署和运行他们的应用程序。 *OpenShift*红帽的云计算 PaaS 产品。这是一个云端的应用平台,应用开发者和团队可以在这里构建、测试、部署和运行他们的应用程序。
**Cloudify** 在开放的原则下开发和设计,用以推动 IT 转型革命。它使组织能够在其上设计、建立和提供各种商业应用和网络服务。Cloudify 的最新版本为 4.3,它包含了先进的安全、控制和<ruby>真自服务<rt>true self-service</rt></ruby>等增强功能。Cloudify 4.3 还为 Kubernetes 容器编排引入了全新的概念。 *Cloudify*在开放的原则下开发和设计,用以推动 IT 转型革命。它使组织能够在其上设计、建立和提供各种商业应用和网络服务。Cloudify 的最新版本为 4.3,它包含了先进的安全、控制和<ruby>真自服务<rt>true self-service</rt></ruby>等增强功能。Cloudify 4.3 还为 Kubernetes 容器编排引入了全新的概念。
| 功能 | Cloud Foundry | Cloudify | OpenShift | | 功能 | Cloud Foundry | Cloudify | OpenShift |
| :- | :- | :- | :- | | :- | :- | :- | :- |
@ -117,9 +120,11 @@ via: https://www.opensourceforu.com/2022/09/why-enterprises-should-opt-for-platf
作者:[Gopala Krishna Behara][a] 作者:[Gopala Krishna Behara][a]
选题:[lkxed][b] 选题:[lkxed][b]
译者:[onionstalgia](https://github.com/onionstalgia) 译者:[onionstalgia](https://github.com/onionstalgia)
校对:[校对者ID](https://github.com/校对者ID) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/gopalakrishna-behara/ [a]: https://www.opensourceforu.com/author/gopalakrishna-behara/
[b]: https://github.com/lkxed [b]: https://github.com/lkxed
[0]: https://img.linux.net.cn/data/attachment/album/202302/17/094352atasztuxqg4t1ctt.jpg

View File

@ -3,22 +3,24 @@
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: "Chao-zhi" [#]: translator: "Chao-zhi"
[#]: reviewer: " " [#]: reviewer: "wxy"
[#]: publisher: " " [#]: publisher: "wxy"
[#]: url: " " [#]: url: "https://linux.cn/article-15537-1.html"
如何在 Arch Linux 中安装 GNOME 桌面 [完整指南] 如何在 Arch Linux 中安装 GNOME 桌面
====== ======
**本指南解释了在 Arch Linux 中安装 GNOME 桌面所需的步骤。** ![][0]
本指南有两部分。第一部分是关于安装基本的 Arch 系统。第二部分是在 Arch Linux 基础上安装完整的 GNOME 桌面环境。 > 本指南解释了在 Arch Linux 中安装 GNOME 桌面所需的步骤。
本指南有两部分:第一部分是关于安装基本的 Arch 系统;第二部分是在 Arch Linux 基础上安装完整的 GNOME 桌面环境。
### 什么是 GNOME 桌面? ### 什么是 GNOME 桌面?
GNOME 是一个流行的桌面环境,是许多基于桌面的顶级 Linux 发行版的默认桌面选择,如 Ubuntu 和 Fedora。几乎所有的口味都提供了一个 GNOME 桌面选项 GNOME 是一个流行的桌面环境,是如 Ubuntu 和 Fedora 等许多基于桌面的顶级 Linux 发行版的默认桌面。几乎所有的定制版都提供了一个 GNOME 桌面版本
GNOME 桌面是稳定和用户友好的桌面之一,因此它被许多普通高级用户所青睐。如果你想要一个在你进行工作时保持隐形的桌面GNOME 就是这样的。它在工作时不会妨碍到你。因此,尽管有许多关于 GNOME3目前的迭代速度慢、资源重等的争议它仍然是许多人的流行和默认选项 GNOME 桌面是稳定和用户友好的桌面之一,因此它被许多普通高级用户所青睐。如果你想要一个在你进行工作时保持隐形的桌面GNOME 就是这样的一个。它不会在你工作时妨碍你。因此,尽管有许多关于 GNOME 3目前的版本速度慢、资源重等争议它仍然是许多人的流行和默认选择
说了这么多,让我们来看看如何在裸机 Arch 中安装 GNOME 桌面。 说了这么多,让我们来看看如何在裸机 Arch 中安装 GNOME 桌面。
@ -28,23 +30,23 @@ GNOME 桌面是稳定和用户友好的桌面之一,因此它被许多普通
如果你已经安装了 Arch Linux你可以跳过这一步直接进入下面安装 GNOME 桌面部分。 如果你已经安装了 Arch Linux你可以跳过这一步直接进入下面安装 GNOME 桌面部分。
要快速安装 Arch Linux 基础版,请遵循以下步骤。你也可以访问[该指南][1],了解如何将 Arch Linux 安装为双启动或在虚拟机中的完整教程。 要快速安装 Arch Linux 基础版,请遵循以下步骤。你也可以访问 [该指南][1],了解如何将 Arch Linux 安装为双启动或在虚拟机中的完整教程。
本文下面介绍的步骤是安装 Arch 的传统方式。新手请按照下面的指南链接,以更现代的方式使用 archinstall 脚本。完成后,回来通过[步骤 2](#第二部分在-arch-linux-中安装-gnome) 继续 GNOME 安装。 本文下面介绍的步骤是安装 Arch 的传统方式。新手请按照下面的指南链接,以更现代的方式使用 `archinstall` 脚本。完成后,回来通过第二部分的步骤继续 GNOME 安装。
[现代方法。使用 archinstall 脚本安装(推荐)][2]。 > **[现代方式:使用 archinstall 脚本安装(推荐)][2]**
##### 传统的方法。下载 Arch Linux ##### 传统方式:下载 Arch Linux
从下面的链接下载 Arch Linux .iso。这里也提供磁力和种子链接。下载后,将 ISO 写入 USB 驱动器。然后从该驱动器启动。 从下面的链接下载 Arch Linux 的 .iso 文件。它也提供了磁力链接和种子链接。下载后,将 ISO 写入 USB 驱动器。然后从该驱动器启动。
[下载 Arch Linux][3] > **[下载 Arch Linux][3]**
如果你打算通过 GNOME Boxes、virt-manager 把它安装成一个虚拟机镜像--那么你就不需要把它写入 U 盘。 如果你打算通过 GNOME Boxes、virt-manager 把它安装成一个虚拟机镜像那么你就不需要把它写入 U 盘。
##### 启动和配置分区 ##### 启动和配置分区
从 Arch Linux iso 启动后,你必须运行一系列的命令来安装基本系统。 从 Arch Linux ISO 启动后,你必须运行一系列的命令来安装基本系统。
首先,运行下面的命令,找出设备标识符。 首先,运行下面的命令,找出设备标识符。
@ -52,7 +54,7 @@ GNOME 桌面是稳定和用户友好的桌面之一,因此它被许多普通
fdisk -l fdisk -l
``` ```
![ fdisk -l][4] ![之前的 fdisk -l][4]
然后用设备标识符,运行下面的命令,开始对你的磁盘进行分区。请确保根据你的系统改变 `/dev/sda` 然后用设备标识符,运行下面的命令,开始对你的磁盘进行分区。请确保根据你的系统改变 `/dev/sda`
@ -62,7 +64,7 @@ cfdisk /dev/sda
在下一个提示中选择 `label type = dos` 在下一个提示中选择 `label type = dos`
选择自由空间,并从底部选择新的选项。在这个例子中,我将创建三个分区,如下图所示。 选择自由空间,并从底部选择<ruby>新建<rt>New</rt></ruby>” 选项。在这个例子中,我将创建三个分区,如下图所示:
``` ```
/dev/sda1 - 1G - for /boot /dev/sda1 - 1G - for /boot
@ -76,13 +78,13 @@ cfdisk /dev/sda
对大小为 5GB 的主根分区重复同样的步骤。 对大小为 5GB 的主根分区重复同样的步骤。
![交换分区类型改变][6] ![改变为交换分区类型][6]
用同样的步骤创建一个大小为 1G 的交换分区(你可以根据你的需要改变它)。创建交换分区后,确保在底部选择类型,并将其标记为 "Linux Swap/Solaris "选项的交换分区。 用同样的步骤创建一个大小为 1G 的交换分区(你可以根据你的需要改变它)。创建交换分区后,确保在底部选择<ruby>类型<rt>Type</rt></ruby>”,并用 “Linux Swap/Solaris” 选项将其标记为交换分区。
![cfdisk 中的最终分区列表][7] ![cfdisk 中的最终分区列表][7]
一旦完成,使用底部的写入选项将变化写入磁盘。确保你在写入前做了备份,因为这是你系统中的一个永久性变化。 一旦完成,使用底部的<ruby>写入<rt>Write</rt></ruby>选项将变化写入磁盘。**确保你在写入前做了备份,因为这是你系统中的一个永久性变化。**
在你继续之前,运行下面的命令来检查。你可以看到在这个例子中,有三个分区被列出。 在你继续之前,运行下面的命令来检查。你可以看到在这个例子中,有三个分区被列出。
@ -90,9 +92,9 @@ cfdisk /dev/sda
fdisk -l fdisk -l
``` ```
![fdisk 中的最终分区列表][8] ![fdisk 中的最终分区列表][8]
依次运行下面的命令,在上面新创建的分区中格式化并创建一个 ext4 文件系统。请确保你根据你的需要改变 `/dev/sda1``/dev/sda2` 依次运行下面的命令,在上面新创建的分区中格式化并创建一个 ext4 文件系统。请确保你根据你的需要改变 `/dev/sda1``/dev/sda2`
``` ```
mkfs.ext4 /dev/sda1 mkfs.ext4 /dev/sda1
@ -101,7 +103,7 @@ mkswap /dev/sda3
swapon /dev/sda3 swapon /dev/sda3
``` ```
完成后,装载系统并创建必要的目录 完成后,装载系统并创建必要的目录
``` ```
mount /dev/sda2 /mnt mount /dev/sda2 /mnt
@ -115,7 +117,7 @@ mount /dev/sda1 /mnt/boot
##### 安装基础系统 ##### 安装基础系统
我希望你已经连接到互联网了。如果没有,请尝试使用 USB 加密狗或 Arch 安装程序自动配置和检测的有线网络连接。如果你没有可用的有线连接,请按照[该指南][10] 使用 Arch Linux 安装程序配置一个无线或 wifi 网络。 我希望你已经连接到互联网了。如果没有,请尝试使用 USB 网卡或 Arch 安装程序自动配置和检测的有线网络连接。如果你没有可用的有线连接,请按照 [该指南][10] 使用 Arch Linux 安装程序配置一个无线或 Wi-Fi 网络。
依次运行下面的命令,将基本系统安装到已安装的分区中。下载的大小约为 400MB。 依次运行下面的命令,将基本系统安装到已安装的分区中。下载的大小约为 400MB。
@ -134,44 +136,44 @@ genfstab -U /mnt >> /mnt/etc/fstab
##### 配置基础系统 ##### 配置基础系统
依次按照下面的命令来配置基本系统。这涉及到设置你的地域、语言、添加一个登录用户,以及设置互联网 依次按照下面的命令来配置基本系统。这涉及到设置你的地域、语言、添加一个登录用户,以及设置互联网
``` ```
arch-chroot /mnt arch-chroot /mnt
nano /etc/locale.gen nano /etc/locale.gen
``` ```
去掉开头的 #,取消对你所选择的 locale 的注释。在本指南中,我选择了 en_US.UTF-8 UTF-8. 按 CTRL+O、Enter 和 CTRL+X 退出 nano。 通过去掉开头的 `#` 来取消对你所选择的 <ruby>语言环境<rt>locale</rt></ruby> 的注释。在本指南中,我选择了 `en_US.UTF-8 UTF-8`,按 `CTRL+O`、回车和 `CTRL+X` 退出 nano。
![本地化][12] ![本地化][12]
使用以下方法生成 locale。 使用以下方法生成语言环境:
``` ```
locale-gen locale-gen
``` ```
如果你不想手动去 `/etc/locale.gen` 设置语言,也可以使用以下命令设置语言 如果你不想手动去 `/etc/locale.gen` 设置语言,也可以使用以下命令设置语言
``` ```
echo LANG=en_US.UTF-8 > /etc/locale.conf echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8 export LANG=en_US.UTF-8
``` ```
设置当地的时区 设置当地的时区
``` ```
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
``` ```
同样,你可以根据你的需要来选择它们。你可以通过以下命令列出当地的时区 同样,你可以根据你的需要来选择它们。你可以通过以下命令列出当地的时区
``` ```
ls /usr/share/zoneinfo ls /usr/share/zoneinfo
ls /usr/share/zoneinfo/America ls /usr/share/zoneinfo/America
``` ```
设置硬件时钟,创建一个主机名,并使用以下命令依次启用互联网的 DHCP。你可以根据你的愿望,将 `"arindam-pc"` 改为任何主机名。 设置硬件时钟,创建一个主机名,并使用以下命令依次启用互联网的 DHCP。你可以根据你的想法,将 `arindam-pc` 改为任何主机名:
``` ```
hwclock --systohc --utc hwclock --systohc --utc
@ -179,9 +181,9 @@ echo arindam-pc > /etc/hostname
systemctl enable dhcpcd systemctl enable dhcpcd
``` ```
下一步是设置根用户的密码,创建一个管理员用户,并在 sudoers 文件中添加该用户。 下一步是设置根用户的密码,创建一个管理员用户,并在 `sudoers` 文件中添加该用户。
依次按照下面的命令进行操作。请确保根据你的需要将用户名从 `debugpoint` 改为其他名称 依次按照下面的命令进行操作。请确保根据你的需要将用户名从 `debugpoint` 改为其他名称
``` ```
passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint
@ -189,13 +191,13 @@ passwd rootuseradd -m -g users -G wheel -s /bin/bash debugpointpasswd debugpoint
![创建用户][13] ![创建用户][13]
打开 sudoers 文件,添加以下几行。 打开 `sudoers` 文件,添加以下几行:
``` ```
nano /etc/sudoers nano /etc/sudoers
``` ```
添加以下几行。由于你已经创建了根用户,该条目应该在那里。 添加以下几行。由于你已经创建了 `root` 用户,该条目应该已经有了:
``` ```
root ALL=(ALL) ALL root ALL=(ALL) ALL
@ -204,7 +206,7 @@ debugpoint ALL=(ALL) ALL
![更改 sudoer 文件][14] ![更改 sudoer 文件][14]
安装 grub设置初始 ramdisk 环境,依次使用下面的命令安装引导。 依次使用如下命令安装 Grub设置初始化 Ramdisk 环境,卸载系统:
``` ```
grub-install /dev/sda grub-install /dev/sda
@ -213,7 +215,7 @@ mkinitcpio -p linux
exit exit
``` ```
![配置 grub][15] 。 ![配置 Grub][15]
然后重新启动你的系统。如果你是在一个物理系统中安装的,在这一步要拔掉 USB 介质。 然后重新启动你的系统。如果你是在一个物理系统中安装的,在这一步要拔掉 USB 介质。
@ -229,27 +231,25 @@ reboot
#### 第二部分:在 Arch Linux 中安装 GNOME #### 第二部分:在 Arch Linux 中安装 GNOME
重启后,从 grub 中选择 Arch Linux。在 Arch Linux 的提示符下,开始依次运行以下命令。这些命令安装 Xorg 服务器、显示管理器、GNOME 桌面组件、控制器包和其他应用程序。 重启后,从 Grub 中选择 Arch Linux。在 Arch Linux 的提示符下,开始依次运行以下命令。这些命令安装 Xorg 服务器、显示管理器、GNOME 桌面组件、控制器包和其他应用程序。
所有的命令都使用默认值,即在要求时按回车。 所有的命令都使用默认值,即在要求时按回车。
- **安装 Xorg 服务器。安装大小约为 80MB。** 安装 Xorg 服务器。安装大小约为 80MB:
``` ```
sudo pacman -S --needed xorg sudo pacman -S --needed xorg
``` ```
- **安装显示管理器GNOME 桌面。安装大小约为 300MB。** 安装显示管理器、GNOME 桌面。安装大小约为 300MB
``` ```
sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome gnome-multi-writer adwaita-icon-theme xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm sudo pacman -S --needed gnome gnome-tweaks nautilus-sendto gnome-nettool gnome-usage gnome gnome-multi-writer adwaita-icon-theme xdg-user-dirs-gtk fwupd arc-gtk-theme seahosrse gdm
``` ```
上面的安装会要求提供几个软件包的选项。选择你想要的任何一个。如果你不确定,在询问时选择 jack、noto-sans 和 xdg-portal-desktop-gnome。 上面的安装会要求提供几个软件包的选项。选择你想要的任何一个。如果你不确定,在询问时选择 jacknoto-sansxdg-portal-desktop-gnome
- **安装应用程序** 安装应用程序。这只是一个参考。你也可以安装你所需要的:
这只是一个参考。你也可以安装你所需要的。
``` ```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
@ -262,25 +262,28 @@ systemctl enable gdm
systemctl enable NetworkManager systemctl enable NetworkManager
``` ```
使用 reboot 命令重新启动系统。 使用 `reboot` 命令重新启动系统:
``` ```
reboot reboot
``` ```
![Arch Linux 运行 GNOME 43 桌面][17] ![Arch Linux 运行 GNOME 43 桌面][17]
如果一切顺利,你应该在 GNOME 桌面上看到一个漂亮的登录提示。使用你刚刚创建的凭证登录。迎接你的应该是 Arch Linux 漂亮而干净的 GNOME 43 桌面。 如果一切顺利,你应该在 GNOME 桌面上看到一个漂亮的登录提示。使用你刚刚创建的凭证登录。迎接你的应该是 Arch Linux 漂亮而干净的 GNOME 43 桌面。
我希望这个指南能帮助你在裸机 Arch 安装 GNOME 桌面。 我希望这个指南能帮助你在裸机 Arch 安装 GNOME 桌面。
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
通过。https://www.debugpoint.com/gnome-arch-linux-install/ via: https://www.debugpoint.com/gnome-arch-linux-install/
作者:[Arindam][a] 选题:[lkxed][b] 翻译者:[Chao-zhi](https://github.com/Chao-zhi)校对:[校对者ID](https://github.com/校对者ID) 作者:[Arindam][a]
选题:[lkxed][b]
译者:[Chao-zhi](https://github.com/Chao-zhi)
校对:[wxy](https://github.com/wxy)
本文由[LCTT](https://github.com/LCTT/TranslateProject)原创编译,[Linux中国](https://linux.cn/)荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/ [a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed [b]: https://github.com/lkxed
@ -301,3 +304,4 @@ reboot
[15]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg [15]: https://www.debugpoint.com/wp-content/uploads/2020/12/configure-grub-1024x639.jpg
[16]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-is-installed.jpg [16]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-is-installed.jpg
[17]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-Linux-Running-GNOME-43-Desktop-1024x636.jpg [17]: https://www.debugpoint.com/wp-content/uploads/2020/12/Arch-Linux-Running-GNOME-43-Desktop-1024x636.jpg
[0]: https://img.linux.net.cn/data/attachment/album/202302/13/220203a5yb5xy24yer4atv.jpg

View File

@ -3,34 +3,36 @@
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: "Chao-zhi" [#]: translator: "Chao-zhi"
[#]: reviewer: " " [#]: reviewer: "wxy"
[#]: publisher: " " [#]: publisher: "wxy"
[#]: url: " " [#]: url: "https://linux.cn/article-15544-1.html"
如何使用 journalctl 查看和分析 Systemd 日志 [附实例] 。 如何使用 journalctl 查看和分析 systemd 日志(附实例)
====== ======
**本指南介绍了 [Systemd][1] 的 journalctl 工具及其各种命令的基础知识。你可以使用这些命令对 Linux 中的桌面和服务器日志进行故障诊断。以下是如何使用 journalctl 查看和分析 Systemd 日志的不同例子。** ![][0]
> 本指南介绍了 [systemd][1] 的 journalctl 工具及其各种命令的基础知识。你可以使用这些命令对 Linux 中的桌面和服务器日志进行故障诊断。以下是如何使用 journalctl 查看和分析 systemd 日志的不同例子。
### 简介 ### 简介
很多人说 Systemd 不好,它对系统的影响很大,这也是一个有争议的话题。但你不能否认的是,它提供了一套完善的工具来管理和排除系统故障。想象一下,当你遇到一个没有 GUI 的坏系统时,你可能会把启动和 GRUB 弄得一团糟。在这种情况下,你可以从一个 live 系统启动,挂上你的 Linux 分区,然后浏览 Systemd 的日志,找出问题所在。 很多人说 systemd 不好,它对系统的影响很大,这也是一个有争议的话题。但你不能否认的是,它提供了一套完善的工具来管理和排除系统故障。想象一下,当你遇到一个没有 GUI 的坏系统时,你可能会把启动和 GRUB 弄得一团糟。在这种情况下,你可以从一个<ruby>立付<rt>Live</rt></ruby>系统启动,挂上你的 Linux 分区,然后浏览 systemd 的日志,找出问题所在。
Systemd有三个基本组件,如下所示: systemd 有三个基本组件,如下所示:
- **systemd**Linux 操作系统的系统和服务管理器。 - `systemd`Linux 操作系统的系统和服务管理器。
- **systemctl**。命令,用于反观和控制 systemd 系统和服务管理器的状态。 - `systemctl` :该命令用于反观和控制 systemd 系统和服务管理器的状态。
- **systemd-analyze**提供系统启动时的性能统计,并从系统和服务管理器中检索其他状态和跟踪信息。 - `systemd-analyze`:该命令提供系统启动时的性能统计,并从系统和服务管理器中检索其他状态和跟踪信息。
除了这三个服务外systemd 还提供其他服务,如 journald、logind、networkd 等。在本指南中,我们将讨论 systemd 的 journald 服务。 除了这三个服务外systemd 还提供其他服务,如 journald、logind、networkd 等。在本指南中,我们将讨论 systemd 的 journald 服务。
### journald - systemd日志服务 ### journald - systemd 日志服务
根据设计systemd 提供了一个集中的方式来处理所有来自进程、应用程序等的操作系统日志。所有这些日志事件都由 systemd 的 journald 守护进程来处理。journald 守护进程收集所有来自 Linux 操作系统各处的日志,并将其作为二进制数据存储在文件中。 根据设计systemd 提供了一个集中的方式来处理所有来自进程、应用程序等的操作系统日志。所有这些日志事件都由 systemd 的 journald 守护进程来处理。journald 守护进程收集所有来自 Linux 操作系统各处的日志,并将其作为二进制数据存储在文件中。
集中记录事件、系统问题作为二进制数据的好处有很多。例如,由于系统日志是以二进制而不是文本形式存储的--你可以以多种方式进行翻译如文本、JSON对象,以满足各种需求。另外,由于日志是按顺序存储的,通过对日志的日期/时间操作,超级容易追踪到单个事件。 以二进制数据集中记录事件、系统问题的好处有很多。例如,由于系统日志是以二进制而不是文本形式存储的你可以以文本、JSON 对象等多种方式进行转译,以满足各种需求。另外,由于日志是按顺序存储的,通过对日志的日期/时间操作,超级容易追踪到单个事件。
请记住journald 收集的日志文件有几千行,而且每次开机都会对每个事件进行更新。因此,如果你有一个长期运行的 Linux 操作系统--日志的大小应该以 GB 为单位。由于有着数以千计的日志,最好用基本命令进行过滤,以了解更多系统问题。 请记住journald 收集的日志文件数以千行计,而且不断更新每次开机、每个事件。因此,如果你有一个长期运行的 Linux 操作系统,日志的大小应该以 GB 为单位。由于有着数以千计的日志,最好用基本命令进行过滤,以了解更多系统问题。
#### journald 配置文件 #### journald 配置文件
@ -42,7 +44,7 @@ journald 的配置文件存在于以下路径中。它包含了关于如何进
#### journald 存储二进制日志文件的地方 #### journald 存储二进制日志文件的地方
journald 以二进制格式存储日志。它们被保存在这个路径下的一个目录中 journald 以二进制格式存储日志。它们被保存在这个路径下的一个目录中
``` ```
/var/log/journal /var/log/journal
@ -52,13 +54,13 @@ journald 以二进制格式存储日志。它们被保存在这个路径下的
![journalctl log file path][2] ![journalctl log file path][2]
不要使用 cat 命令,也不要使用 nano 或 vi 来打开这些文件。它们将无法正常显示。 不要使用 `cat` 命令,也不要使用 `nano``vi` 来打开这些文件。它们(是二进制的),无法正常显示。
### 使用 journalctl 来查看和分析 systemd 日志 ### 使用 journalctl 来查看和分析 systemd 日志
#### journald 基本命令 #### journald 基本命令
使用 journal daemon 查看日志的基本命令是: 查看 journald 日志的基本命令是:
``` ```
journalctl journalctl
@ -66,11 +68,11 @@ journalctl
![journalctl][3] ![journalctl][3]
该命令提供了所有应用程序和进程的日志条目,包括错误、警告等。它显示的列表中,最古老的日志在顶部,当前的日志在底部。你需要不断按回车键来逐行滚动浏览。你也可以使用 PAGE UP 和 PAGE DOWN 键来滚动。按 q 键可以退出这个视图。 该命令提供了所有应用程序和进程的日志条目,包括错误、警告等。它显示的列表中,最的日志在顶部,当前的日志在底部。你需要不断按回车键来逐行滚动浏览。你也可以使用 `PAGE UP``PAGE DOWN` 键来滚动。按 `q` 键可以退出这个视图。
#### 如何以不同时区的时间查看日志条目 #### 如何以不同时区的时间查看日志条目
默认情况下,journalctl 显示的是当前系统时区的日志时间。然而,你可以很容易地在命令中提供时区,将同一日志转换为不同的时区。例如,要查看 UTC 的日志,请使用以下命令: 默认情况下,`journalctl` 以当前系统时区显示日志的时间。然而,你可以很容易地在命令中提供时区,将同一日志转换为不同的时区。例如,要以 UTC 查看日志,请使用以下命令:
``` ```
journalctl --utc journalctl --utc
@ -100,10 +102,10 @@ journalctl -p 0
4: 警告 4: 警告
5: 通知 5: 通知
6: 信息 6: 信息
7调试 7: 调试
``` ```
当你指定错误代码时,它显示该等级及比他等级更高的所有信息。例如,如果你指定下面的命令,它会显示所有优先级为 2、1 和 0 的信息: 当你指定错误代码时,它显示该等级及更高的所有信息。例如,如果你指定下面的命令,它会显示所有优先级为 2、1 和 0 的信息:
``` ```
journalctl -p 2 journalctl -p 2
@ -111,7 +113,7 @@ journalctl -p 2
#### 如何查看特定启动的日志 #### 如何查看特定启动的日志
当你运行 journalctl 命令时,它会显示当前启动的信息,即你正在运行的会话中的信息。但也可以查看过去启动信息。 当你运行 `journalctl` 命令时,它会显示当前启动的信息,即你正在运行的会话中的信息。但也可以查看过去启动信息。
在每次重启时日志都会持续更新。journald 会记录不同启动时的日志。要查看不同启动时的日志,请使用以下命令。 在每次重启时日志都会持续更新。journald 会记录不同启动时的日志。要查看不同启动时的日志,请使用以下命令。
@ -122,12 +124,10 @@ journalctl --list-boots
![journalctl list-boots][6] ![journalctl list-boots][6]
- 第一个数字显示的是 journald 的唯一的启动跟踪号码,你可以在下一个命令中使用它来分析该特定的启动。 - 第一个数字显示的是 journald 的唯一的启动跟踪号码,你可以在下一个命令中使用它来分析该特定的启动。
- 第二个数字是启动 ID你也可以在命令中指定。
- 第二个数字是 boot ID你也可以在命令中指定。
- 接下来的两个日期、时间组合是存储在相应文件中的日志的时间。如果你想找出某个特定日期、时间的日志或错误,这就非常方便了。 - 接下来的两个日期、时间组合是存储在相应文件中的日志的时间。如果你想找出某个特定日期、时间的日志或错误,这就非常方便了。
要查看一个特定的启动号码,你可以选择第一个号码或启动 ID如下所示。 要查看一个特定的启动号码,你可以选择第一个启动跟踪号码或启动 ID如下所示。
``` ```
journalctl -b -45 journalctl -b -45
@ -149,9 +149,9 @@ journalctl -xb -p 3
#### 如何查看某一特定时间、日期的日志记录 #### 如何查看某一特定时间、日期的日志记录
journalctl 功能强大,可以在命令中提供类似 "english" 的参数,用于时间和日期操作。 `journalctl` 功能强大,可以在命令中提供类似英语的参数,用于时间和日期操作。
你可以使用 `--since` 选项与 `“yesterday”, “today”, “tomorrow”, 或 “now”` 组合。 你可以使用 `--since` 选项与 `yesterday`、`today`、`tomorrow` 或 `now` 组合。
下面是一些不同命令的例子。你可以根据你的需要修改它们。它们是不言自明的。以下命令中的日期、时间格式为 `"YYYY-MM-DD HH:MM:SS"` 下面是一些不同命令的例子。你可以根据你的需要修改它们。它们是不言自明的。以下命令中的日期、时间格式为 `"YYYY-MM-DD HH:MM:SS"`
@ -178,7 +178,7 @@ journalctl --since 09:00 --until "1 hour ago"
#### 如何查看内核特定的日志记录 #### 如何查看内核特定的日志记录
Linux 内核信息也可以从日志中提取出来。要查看当前启动时的内核信息,请使用以下命令 Linux 内核信息也可以从日志中提取出来。要查看当前启动时的内核信息,请使用以下命令
``` ```
journalctl -k journalctl -k
@ -194,7 +194,7 @@ journalctl -u NetworkManager.service
![journalctl NetworkManager service][10] ![journalctl NetworkManager service][10]
如果你不知道服务名称可以使用下面的命令来列出系统中的systemd服务。 如果你不知道服务名称,可以使用下面的命令来列出系统中的 systemd 服务。
``` ```
systemctl list-units --type=service systemctl list-units --type=service
@ -202,13 +202,13 @@ systemctl list-units --type=service
#### 如何查看用户、组的日志 #### 如何查看用户、组的日志
如果你正在分析服务器日志,在多个用户登录的情况下,这个命令很有帮助。你可以先用下面的命令从用户名中找出用户的 ID。例如要找出用户 "`debugpoint`" 的ID 如果你正在分析服务器日志,在多个用户登录的情况下,这个命令很有帮助。你可以先用下面的命令从用户名中找出用户的 ID。例如要找出用户 `debugpoint`ID
``` ```
id -u debugpoint id -u debugpoint
``` ```
然后使用 `_UID` 选项指定该ID与来查看该用户产生的日志。 然后使用 `_UID` 选项指定该 ID 与来查看该用户产生的日志。
``` ```
journalctl _UID=1000 --since today journalctl _UID=1000 --since today
@ -220,7 +220,7 @@ journalctl _UID=1000 --since today
#### 如何查看一个可执行文件的日志 #### 如何查看一个可执行文件的日志
你也可以查看某个特定程序或可执行文件的日志。例如,如果你想找出 gnome-shell 的信息,你可以运行以下命令。 你也可以查看某个特定程序或可执行文件的日志。例如,如果你想找出 `gnome-shell` 的信息,你可以运行以下命令。
``` ```
journalctl /usr/bin/gnome-shell --since today journalctl /usr/bin/gnome-shell --since today
@ -230,7 +230,7 @@ journalctl /usr/bin/gnome-shell --since today
### 结束语 ### 结束语
希望本指南能帮助你使用 journalctl 查看分析 Linux 桌面或服务器上的 systemd 日志排除故障。如果你知道如何使用这些命令systemd 日志管理的功能非常强大,它能让你在调试时的生活变得轻松一些。现在所有主流的 Linux 发行版都使用 systemd。Ubuntu、Debian、Fedora、Arch--它们都使用systemd 作为其默认的操作系统产品。如果你想了解无 systemd 的Linux发行版你可能想看看[MX-Linux][13]、Gentoo、Slackware、Void Linux。 希望本指南能帮助你使用 `journalctl` 查看分析 Linux 桌面或服务器上的 systemd 日志排除故障。如果你知道如何使用这些命令systemd 日志管理的功能非常强大,它能让你在调试时的生活变得轻松一些。现在所有主流的 Linux 发行版都使用 systemd。Ubuntu、Debian、Fedora、Arch 它们都使用 systemd 作为其默认的操作系统组件。如果你想了解不使用 systemd 的 Linux发行版你可能想看看 [MX-Linux][13]、Gentoo、Slackware、Void Linux。
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -239,7 +239,7 @@ via: https://www.debugpoint.com/systemd-journalctl/
作者:[Arindam][a] 作者:[Arindam][a]
选题:[lkxed][b] 选题:[lkxed][b]
译者:[Chao-zhi](https://github.com/Chao-zhi) 译者:[Chao-zhi](https://github.com/Chao-zhi)
校对:[校对者ID](https://github.com/校对者ID) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -258,3 +258,4 @@ via: https://www.debugpoint.com/systemd-journalctl/
[11]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-_UID.jpg [11]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-_UID.jpg
[12]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-gnome-shell.jpg [12]: https://www.debugpoint.com/wp-content/uploads/2020/12/journalctl-gnome-shell.jpg
[13]: https://www.debugpoint.com/tag/mx-linux [13]: https://www.debugpoint.com/tag/mx-linux
[0]: https://img.linux.net.cn/data/attachment/album/202302/16/085250d5ngtogo2fjjn8o2.jpg

View File

@ -3,20 +3,18 @@
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: "geekpi" [#]: translator: "geekpi"
[#]: reviewer: " " [#]: reviewer: "wxy"
[#]: publisher: " " [#]: publisher: "wxy"
[#]: url: " " [#]: url: "https://linux.cn/article-15545-1.html"
Rnote一个用于笔记和注释的开源绘图应用 Rnote一个用于笔记和注释的开源绘图应用
====== ======
**_简介_**_Rnote 允许你做笔记、绘图和注释文件。听起来你需要它让我们来探讨一下。_ > Rnote 可以让你做笔记、绘图和注释文件。听起来你需要它?让我们来了解一下。
我们已经介绍了许多记笔记的应用,但支持手写笔记的选项却屈指可数。 我们已经介绍了许多记笔记的应用,但支持手写笔记的选项却屈指可数。
Rnote 就是这样一个有用的应用,它可以让你做手写笔记并对文件/图片进行注释。 Rnote 就是这样一个有用的应用,它可以让你做手写笔记并对文件/图片进行注释。当然,你需要一个绘图板或一个带有手写笔的设置来使用 Rnote。
当然,你需要一个绘图板或一个带有手写笔的设置来使用 Rnote。
### Rnote: 基于矢量的绘图应用,用于绘制草图和手写笔记 ### Rnote: 基于矢量的绘图应用,用于绘制草图和手写笔记
@ -28,11 +26,11 @@ Rnote 是一个用 Rust 和 GTK 4 编写的令人印象深刻的开源应用。
让我强调一下它能做的一些事情。 让我强调一下它能做的一些事情。
### Rnote的特点 ### Rnote 的特点
![rnote settings][3] ![rnote settings][3]
[Rnote][4] 是一个简单但有很多功能的绘图/记事应用程。一些功能包括: [Rnote][4] 是一个简洁而有很多功能的绘图/记事应用程序。一些功能包括:
- 支持具有各种笔画风格的压敏笔输入 - 支持具有各种笔画风格的压敏笔输入
- 用形状工具添加不同的形状 - 用形状工具添加不同的形状
@ -45,9 +43,9 @@ Rnote 是一个用 Rust 和 GTK 4 编写的令人印象深刻的开源应用。
- 集成的工作区浏览器可快速访问媒体文件 - 集成的工作区浏览器可快速访问媒体文件
- 支持拖放 - 支持拖放
- 支持剪贴板 - 支持剪贴板
- 支持常见的页面格式A6、A5、US letter 等) - 支持常见的页面格式A6、A5、US letter 等)
- 从 PDF、位图和 SVG 文件导入 - 从 PDF、位图和 SVG 文件导入
- 原生的 .rnote 文件来保存/加载文件 - 使用原生的 .rnote 文件来保存/加载文件
- 支持导出到 SVG 和 PDF - 支持导出到 SVG 和 PDF
- 自动保存功能 - 自动保存功能
- 深色/浅色模式 - 深色/浅色模式
@ -80,7 +78,7 @@ flatpak install flathub com.github.flxzt.rnote
Rnote 正在积极开发,并在其功能设置方面取得了良好的进展。如果你喜欢 Rnote你可能想看看 [Xournal++][9],它是另一个能让你做手写笔记的应用。 Rnote 正在积极开发,并在其功能设置方面取得了良好的进展。如果你喜欢 Rnote你可能想看看 [Xournal++][9],它是另一个能让你做手写笔记的应用。
_你还知道其他像 Rnote 这样令人兴奋的应用吗?你觉得 Rnote 怎么样?请在下面的评论中分享你的想法。_ 你还知道其他像 Rnote 这样令人兴奋的应用吗?你觉得 Rnote 怎么样?请在下面的评论中分享你的想法。
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -89,16 +87,16 @@ via: https://itsfoss.com/rnote/
作者:[Ankush Das][a] 作者:[Ankush Das][a]
选题:[lkxed][b] 选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi) 译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/ [a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lkxed [b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/11/rnote-screenshot.png [1]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-screenshot.png
[3]: https://itsfoss.com/wp-content/uploads/2022/11/rnote-settings.png [3]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-settings.png
[4]: https://rnote.flxzt.net [4]: https://rnote.flxzt.net
[5]: https://itsfoss.com/wp-content/uploads/2022/11/rnote-screenshot-1.png [5]: https://itsfoss.com/content/images/wordpress/2022/11/rnote-screenshot-1.png
[6]: https://flathub.org/apps/details/com.github.flxzt.rnote [6]: https://flathub.org/apps/details/com.github.flxzt.rnote
[7]: https://itsfoss.com/flatpak-guide/ [7]: https://itsfoss.com/flatpak-guide/
[8]: https://github.com/flxzt/rnote [8]: https://github.com/flxzt/rnote

View File

@ -3,50 +3,52 @@
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: "Chao-zhi" [#]: translator: "Chao-zhi"
[#]: reviewer: " " [#]: reviewer: "wxy"
[#]: publisher: " " [#]: publisher: "wxy"
[#]: url: " " [#]: url: "https://linux.cn/article-15539-1.html"
通过实例学习Linux中的zip命令 zip 命令的解释与示例
====== ======
**这里是关于理解 Linux 中的 zip 命令的初学者指南,并附有一些例子。** > 这是一份关于理解 Linux 中的 zip 命令的初学者指南,并附有一些例子。
![][1] ![][1]
这篇文章是 [Linux 命令][4]学习系列的一部分。
zip 文件是一个包含一个或多个文件的压缩档案。它作为一种无损数据压缩技术被广泛使用。由于压缩,它占用的磁盘空间更少,在计算机网络上传输时需要的数据也更少。 zip 文件是一个包含一个或多个文件的压缩档案。它作为一种无损数据压缩技术被广泛使用。由于压缩,它占用的磁盘空间更少,在计算机网络上传输时需要的数据也更少。
这些压缩文件可以在 Linux、Windows 和 macOS 中轻松提取。有各种支持压缩文件的软件,也提供提取它们的功能。 这些压缩文件可以在 Linux、Windows 和 macOS 中轻松提取。有各种支持压缩 zip 文件的软件,也提供提取它们的功能。
由于它很流行,几乎所有的操作系统都内置了这个功能。 由于它很流行,几乎所有的操作系统都内置了这个功能。
在本教程中,我们将谈论几种基于终端的方法来压缩 Linux 中的文件。 在本教程中,我们将谈论几种基于终端的方法来压缩 Linux 中的文件。
### Linux 中的 Zip 命令,例子: ### Linux 中的 Zip 命令示例
#### 语法 #### 语法
在 Linux 中,你需要使用的压缩文件的程序名称是`zip`。下面是基本的语法。 在 Linux 中,你需要使用的压缩文件的程序名称是 `zip`。下面是基本的语法:
``` sh ```
zip [压缩文件名] file1 file2 file3 zip [压缩文件名] file1 file2 file3
``` ```
这里是官方的语法。 以下是正式的语法:
``` sh ```
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list] zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
``` ```
理想情况下,zip 命令应该被安装在所有主要的 Linux 发行版中。如果没有,使用下面的命令来安装它。 理想情况下,`zip` 命令应该被安装在所有主流的 Linux 发行版中。如果没有,使用下面的命令来安装它。
#### 在 Debian, Ubuntu and 相关发行版上安装 #### 在 Debian、Ubuntu 和相关发行版上安装
``` ```
sudo apt install zip sudo apt install zip
``` ```
#### 在 Fedora, 基于 RHEL 的系统上安装 #### 在 Fedora基于 RHEL 的系统上安装
``` ```
sudo dnf install zip sudo dnf install zip
@ -58,17 +60,17 @@ sudo dnf install zip
pacman -S zip pacman -S zip
``` ```
让我们继续看一些例子 让我们继续看一些例子
#### 如何压缩文件和文件夹 #### 如何压缩文件和文件夹
我的测试目录中有以下三个文件。它们是 file1.txt、file2.txt 和 file3.txt。如果我想用 zip 压缩三个文件,并创建一个 myfiles.zip 的压缩包,用下面的命令就可以了。 我的测试目录中有以下三个文件。它们是 `file1.txt``file2.txt``file3.txt`。如果我想用 zip 压缩三个文件,并创建一个 `myfiles.zip` 的压缩包,用下面的命令就可以了。
``` ```
zip myfiles.zip file1.txt file2.txt file3.mp3 zip myfiles.zip file1.txt file2.txt file3.mp3
``` ```
输出 输出
``` ```
adding: file1.txt (stored 0%) adding: file1.txt (stored 0%)
@ -81,12 +83,12 @@ adding: file3.mp3 (deflated 13%)
这里你应该记住几个要点。 这里你应该记住几个要点。
- 当创建一个 zip 文件时,你应该有对当前目录的修改权限。 - 当创建一个 zip 文件时,你应该有对当前目录的修改权限。
- zip 文件格式不包含权限即读42和执行1。所以创建该文件的用户成为该文件的所有者。 - zip 文件格式不包含权限即读42和执行1。所以创建该文件的用户成为该文件的所有者。
- 如果你想使用有权限的 zip可以尝试使用 `tar` 命令(将在后面的教程中解释)。 - 如果你想使用有权限的 zip可以尝试使用 `tar` 命令(将在后面的教程中解释)。
- 在上面的输出中,`zip` 命令显示了被添加到存档中的文件名和压缩方法。 - 在上面的输出中,`zip` 命令显示了被添加到存档中的文件名和压缩方法。
- 在目标文件名中指定 .zip 文件名的扩展名并不是必须的。如果你省略了 .zip`zip` 会在最后加上 .zip。 - 在目标文件名中指定 .zip 文件名的扩展名并不是必须的。如果你省略了 .zip`zip` 会在最后加上 .zip。
当你有成百上千的文件在运行时,可以在终端中减少输出。你可以使用 `-q` 参数来抑制 `zip` 命令中的输出。 当你操作成百上千的文件时,为了减少终端中的输出,你可以使用 `-q` 参数来抑制 `zip` 命令中的输出:
``` ```
zip -q myfiles.zip file1.txt file2.txt file3.txt zip -q myfiles.zip file1.txt file2.txt file3.txt
@ -96,13 +98,13 @@ zip -q myfiles.zip file1.txt file2.txt file3.txt
`zip` 命令的 `-r` 选项使你能够囊括所有子目录。这个选项会递归地遍历到一个目录结构的最后一个子目录,并将它们全部加入到压缩文件中。 `zip` 命令的 `-r` 选项使你能够囊括所有子目录。这个选项会递归地遍历到一个目录结构的最后一个子目录,并将它们全部加入到压缩文件中。
下面的命令创建了一个包含 my_folder 内所有内容和子目录的压缩文件。 下面的命令创建了一个包含 `my_folder` 内所有内容和子目录的压缩文件:
``` ```
zip -r myfolder.zip my_folder zip -r myfolder.zip my_folder
``` ```
你也可以使用通配符(*)在你的压缩文件中包含特定类型的文件 你也可以使用通配符(`*`)在你的压缩文件中包含特定类型的文件
``` ```
zip -0 my_movies.zip *.mp4 zip -0 my_movies.zip *.mp4
@ -118,9 +120,9 @@ zip -r myfiles.zip file1.txt file2.txt file3.txt my_folder1 my_folder2
### 压缩算法 ### 压缩算法
zip 压缩的默认输出包含两个不同的词,即 deflate 和 store。zip 默认使用的压缩方法是 deflate。如果它成功地压缩了文件那么输出显示 deflate。而当它不能压缩一个文件时它只是将它们原封不动地存储在 .zip 文件中。这些文件的输出显示为 store。 zip 压缩的默认输出包含两个不同的词,即 `deflate``store`。zip 默认使用的压缩方法是 `deflate`。如果它成功地压缩了文件,那么输出显示 `deflate`。而当它不能压缩一个文件时,它只是将它们原封不动地存储在 .zip 文件中。这些文件的输出显示为 `store`
目前有许多压缩算法。其中一种是 bzip2 压缩法,它在 Linux 中被 `zip` 命令所支持。你可以指定压缩算法作为一个命令选项来使用。使用选项 `-Z`,后面跟上算法名称,如下所示 目前有许多压缩算法。其中一种是 bzip2 压缩法,在 Linux 中的 `zip` 命令支持它。你可以指定压缩算法作为一个命令选项来使用。使用选项 `-Z`,后面跟上算法名称,如下所示
``` ```
zip -r -Z bzip2 myfolder.zip my_folder zip -r -Z bzip2 myfolder.zip my_folder
@ -138,7 +140,7 @@ zip -9 -r myfolder.zip my_folder
#### 用密码保护一个压缩文件 #### 用密码保护一个压缩文件
你也可以用下面的 `-e` 选项对压缩文件进行密码保护 你也可以用下面的 `-e` 选项对压缩文件进行密码保护
``` ```
zip -e -r myfolder.zip my_folder zip -e -r myfolder.zip my_folder
@ -146,7 +148,7 @@ zip -e -r myfolder.zip my_folder
运行该命令后,它将要求输入密码。 运行该命令后,它将要求输入密码。
> 注意。尽量不要使用 zip 命令来对压缩文件进行密码保护。zip 的加密算法是使用流密的 PKZIP。而它很容易被破解。如果你想保护你的文件请使用 7-Zip 或其他高级工具。 > 注意。尽量不要使用 zip 命令来对压缩文件进行密码保护。zip 的加密算法是使用流式加密的 PKZIP。而它很容易被破解。如果你想保护你的文件请使用 7-Zip 或其他高级工具。
#### 分割较大的压缩文件 #### 分割较大的压缩文件
@ -160,9 +162,8 @@ zip -s 1g -r myfolder.zip my_folder
你学到了一些 `zip` 命令的基本知识。它对大多数本地情况很有用,在这些情况下,你需要通过即时压缩来进行快速备份。然而,对于更高级的选项,你应该使用 7-Zip 或其他命令,我将在接下来的几篇文章中分享。 你学到了一些 `zip` 命令的基本知识。它对大多数本地情况很有用,在这些情况下,你需要通过即时压缩来进行快速备份。然而,对于更高级的选项,你应该使用 7-Zip 或其他命令,我将在接下来的几篇文章中分享。
同时,你可以在 [zip 手册][3]中了解更多。 同时,你可以在 [zip 手册][3] 中了解更多。
_这篇文章是 [Linux 命令][4]学习系列的一部分。_
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -171,7 +172,7 @@ via: https://www.debugpoint.com/zip-command-linux-examples/
作者:[Arindam][a] 作者:[Arindam][a]
选题:[lkxed][b] 选题:[lkxed][b]
译者:[Chao-zhi](https://github.com/Chao-zhi) 译者:[Chao-zhi](https://github.com/Chao-zhi)
校对:[校对者ID](https://github.com/校对者ID) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,62 @@
[#]: subject: "Merge design and code with Penpot"
[#]: via: "https://opensource.com/article/23/1/merge-design-code-penpot"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15549-1.html"
用 Penpot 弥合设计和代码之间的鸿沟
======
![][0]
> 用 Penpot 这个开源的设计工作空间来弥合编程和设计之间的鸿沟。
在计算机编程的大部分历史中在创建应用的代码的程序员和创建应用的用户体验UX的设计师之间一直存在着鸿沟。这两个学科接受的培训大不相同他们使用的工具也不同。程序员使用文本编辑器或集成开发环境来编写代码而设计师则经常绘制小部件布局和潜在交互的示意图。虽然一些 IDE像 [Eclipse][1] 和 [Netbeans][2],有界面设计组件,但它们通常专注于小部件的位置而不是小部件的设计。开源设计应用 [Penpot][3] 是一个协作式设计和原型设计平台。它有一套新的功能使设计师和开发者可以很容易地用熟悉的工作流程协同工作。Penpot 的设计界面可以让开发者在设计过程中和谐地编写代码,这是其他工具所无法做到的。自从我们 [上次介绍它][4] 以来,它已经有了长足的进步。它的最新功能不仅改善了你使用 Penpot 的体验,还推动了开源的 Penpot 应用超越类似的专有工具。
### 用 Penpot 做原型
在设计应用的最佳工作方式时,常见问题之一是在设计的时候这个应用还不存在。设计师可以通可视化和故事板来帮助设计团队和程序员了解目标是什么。但这是一个需要迭代和反馈的过程,当开发人员开始实施 UX 设计,设计会发生变化以应对对代码的实际变化。
使用 Penpot你可以为你的网络或移动应用创建一个“可用”原型。你可以将按钮与特定的行动联系起来根据用户的输入触发布局的变化。而这一切都可以在项目的代码存在之前完成。
但是,这方面最重要的不是模拟的能力。在 Penpot 中为应用的设计所做的一切都有可用的布局数据开发人员可以在最终的项目中使用它们。Penpot 不仅仅是一个出色的绘图和布局工具。它为编码过程提供了信息。
Penpot 现在不仅仅是提供了一个设计师特定元素的视觉列表,如属性、颜色和排版,而是将代码输出直接整合到设计工作区(就像 Web 浏览器中的开发者工具)。设计师和开发人员共享设计和前端开发的相同空间,以他们需要的任何格式获得规格。
![Image of the current Penpot interface][5]
### 内存解锁
许多在线设计工具使用专有技术来提供一些花哨的功能,但代价是基本上成为一个应用,你只能运行它,而不能通过浏览器访问。不过 Penpot 使用开放的网络标准,并由你的网络浏览器渲染。这意味着 Penpot 可以访问浏览器可用的最大内存,使得 Penpot 成为第一个具有设计扩展性的在线原型和布局应用。你可以提供更多的选项、更多的模型,和更多的场地。此外,你可以向更多的并发协作者开放你的设计空间,而不必担心应用的内存耗尽。
### 自我托管和 SaaS
Penpot 是开源的,所以你不用必须在云上使用它,如果这不适合你的工作流程。你可以在一个容器中轻松地自我托管 Penpot在你自己的工作站上作为一个本地应用使用或者在你自己的服务器上为你的组织托管它。
### 开源设计
我以前写过一篇 [Penpot 的介绍性文章][6],自那以后,这个应用变得更好了。如果你想把程序员和相关人员带入你的设计过程中,那么请试试 Penpot。
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/1/merge-design-code-penpot
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/20/12/eclipse
[2]: https://opensource.com/article/20/12/netbeans
[3]: http://penpot.app
[4]: https://opensource.com/article/21/9/open-source-design
[5]: https://opensource.com/sites/default/files/2022-07/Current%20Penpot%20interface.png
[6]: https://opensource.com/article/21/12/open-source-design-penpot
[0]: https://img.linux.net.cn/data/attachment/album/202302/17/143544u59tzeqplyhpt08h.jpg

View File

@ -0,0 +1,110 @@
[#]: subject: "Start developing for WebAssembly with our new guide"
[#]: via: "https://opensource.com/article/23/2/webassembly-guide"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15541-1.html"
跟着我们的新指南学习开发 WebAssembly
======
![][0]
> 使用 WebAssembly 开发有很多不同的方向,这取决于你已经知道的东西和你想建立的东西。
在过去的几十年里Web 浏览器作为最流行的跨平台应用经久不衰。从另一个角度看浏览器,它是最受欢迎的应用交付平台之一。想想你使用的所有网站,它们取代了你过去用桌面上运行的软件进行的活动。你仍然在使用软件,但你是通过浏览器来访问它,而且是在别人的 Linux 服务器上运行。在优化我们所有人使用的软件的永恒努力中,软件开发世界早在 2019 年就引入了 WebAssembly作为通过 Web 浏览器运行编译代码的一种方式。应用的性能比以往任何时候都要好,而且可以生成 WebAssembly 编码的语言远不只是通常的 PHP、Python 和 JavaScript。
### 一个目标和一种语言
关于 WebAssembly 的一个强大但也最令人困惑的地方是“WebAssembly” 这个词既指一种语言也指一个目标。WebAssembly 是一种汇编语言,但没有多少人选择直接用汇编写代码。即使是汇编语言,最终也会被转换为二进制格式,这也是计算机运行代码的要求。这种二进制格式也被称为 WebAssembly。不过这很好因为这意味着你可以用你选择的语言来写一些最终以 WebAssembly 交付的东西,包括 C、C++、Rust、Javascript 和其他许多语言。
进入 WebAssembly 的途径是 Emscripten这是一个 LLVM 编译器工具链,可以从你的代码中产生 WebAssembly。
### 安装 Emscripten
要在你的 Linux 或 macOS 电脑上安装 Emscripten请使用 Git
```
$ git clone https://github.com/emscripten-core/emsdk.git
```
改变目录进入 `emsdk` 目录并运行安装命令:
```
$ ./emsdk install latest
$ ./emsdk activate latest
```
Emscripten 工具链中的所有内容都安装在 `emsdk` 目录下,对系统的其他部分没有影响。由于这个原因,在使用 `emsdk` 之前,你必须 <ruby>源引<rt>source</rt></ruby> 它的环境:
```
$ source ./emsdk_env.sh
```
如果你打算经常使用 `emsdk`,你也可以在 `.bashrc` 中加入环境设置脚本。
要在 Windows 上安装 Emscripten你可以在 WSL 环境下运行 Linux。
请访问 [Emscripten 网站][1] 了解更多安装信息。
### Hello World
下面是一个用 C++ 编写的简单的 “Hello World” 应用。
```
#include <iostream>
using namespace std;
int main() {
cout << "Hello world";
return 0;
}
```
先把它作为你的系统的标准二进制文件来测试:
```
$ g++ hello.cpp -o world
$ ./world
Hello world
```
看到它像预期的那样工作,用 `emcc` 把它构建为 WebAssembly
```
$ emcc hello.cpp -o world.html
```
最后,用 `emrun` 运行它:
```
$ emrun ./world.html
```
`emrun` 工具是一个用于本地测试的方便命令。当你在服务器上托管你的应用时,`emrun` 就没有必要了。
### 学习更多关于 WebAssembly 的知识
使用 WebAssembly 开发可以有很多不同的方向,这取决于你已经知道的东西和你想建立的东西。如果你了解 C 或 C++,那么你可以用这些来写你的项目。如果你正在学习 Rust那么你可以使用 Rust。甚至 Python 代码也可以使用 Pyodide 模块来作为 WebAssembly 运行。你有很多选择,而且没有错误的开始方式(甚至有 COBOL 到 WebAssembly 的编译器)。如果你渴望开始使用 WebAssembly
> **[请下载我们免费的电子书][2]**
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/webassembly-guide
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed/
[1]: https://emscripten.org/
[2]: https://opensource.com/downloads/webassembly-ebook
[0]: https://img.linux.net.cn/data/attachment/album/202302/15/204034uy4t9h6z6o06hj6j.jpg

View File

@ -0,0 +1,61 @@
[#]: subject: "Opera Browser Plans to Integrate ChatGPT"
[#]: via: "https://debugpointnews.com/opera-chatgpt-integration/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: "gpchn"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15547-1.html"
Opera 浏览器计划集成 ChatGPT
======
![][1]
> 据报道Opera 浏览器正在寻求将语言模型 ChatGPT 集成到其桌面和移动产品中。
### 摘要
- 据报道,流行的桌面和移动网络浏览器 Opera 浏览器正在探索将语言模型 ChatGPT 集成到其产品中。
- 微软最近宣布将 ChatGPT 的制造商 OpenAI 技术集成到其 Edge 网络浏览器中,为用户添加人工智能功能。
### Opera 与 ChatGPT
[Opera][2],一个被广泛使用的桌面和移动网络浏览器,将把语言模型 ChatGPT 集成到它的软件产品中。Opera 的母公司昆仑科技是这一新闻的幕后推手尽管这次集成的细节仍然有限。Opera 提供了一系列软件产品,包括桌面网络浏览器、移动网络浏览器以及其为 Chromebook 设计的浏览器版本。
最有可能整合 ChatGPT 的是 Opera 的主要桌面浏览器,包括 Opera 浏览器和 Opera GX这是一款为游戏玩家设计的浏览器。然而也有可能集成到 Opera 的移动浏览器中,包括常规的 Opera 移动浏览器、Opera Mini 和 Opera Crypto 浏览器。
### 来自微软和谷歌的最新更新
微软上周宣布将 OpenAI 集成到其 Edge 网络浏览器中,成为头条新闻。这种集成将在未来为 Edge 用户带来两种人工智能功能,即 “<ruby>Chat<rt>聊天</rt></ruby>” 和 “<ruby>撰写<rt>Compose</rt></ruby>”。“聊天”功能可以让用户在浏览器中直接与人工智能交流。同时,“撰写”功能帮助用户进行文本撰写,包括使用不同的语气和长度撰写电子邮件和社交媒体帖子。
在最近的一次演示中,谷歌没有宣布将人工智能聊天机器人直接集成到其 Chrome 浏览器中,这一举措得到的回应并不热烈。
### 下一步是什么
据 Statcounter 统计Opera 浏览器被数亿用户使用,在全球浏览器市场占有 2.4% 的份额。虽然它可能落后于谷歌 Chrome 的 65% 和 Safari 的 18%,但与 Mozilla Firefox 的 3% 相比,它仍然保持着自己的优势。
昆仑科技是一家在深圳证券交易所上市的北京公司。本周,中国搜索巨头百度宣布计划在其搜索产品中集成 ChatGPT 风格的机器人。
总之ChatGPT 与 Opera 浏览器的集成代表着人工智能网络浏览向前迈出的重要一步。随着微软和百度等公司将人工智能技术融入其产品Opera 将自己定位为该领域的领导者。
随着数亿用户和浏览器市场的日益增长ChatGPT 与 Opera 的集成是一项备受期待的发展。
参考:[CNBC][3]
--------------------------------------------------------------------------------
via: https://debugpointnews.com/opera-chatgpt-integration/
作者:[arindam][a]
选题:[lkxed][b]
译者:[gpchn](https://github.com/gpchn)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2023/02/opera.jpg
[2]: https://www.opera.com/
[3]: https://www.cnbc.com/2023/02/09/web-browser-opera-is-planning-to-incorporate-chatgpt.html

View File

@ -0,0 +1,172 @@
[#]: subject: "How to Install DOSBox in Ubuntu to Play Old Games"
[#]: via: "https://www.debugpoint.com/install-dosbox-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "gpchn"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-15538-1.html"
如何在 Ubuntu 中安装 DOSBox 玩老游戏
======
![][0]
> 了解如何在 Ubuntu 中安装 DOSBox并配置它来玩旧式 DOS 游戏。
DOSBox 是一个自由开源的操作系统模拟器,可以在现代 Linux 系统中运行。它有几个组件可以模仿旧的硬件,以运行旧的程序和游戏。
这一切使得在现代 Linux 发行版中享受旧游戏和应用程序成为可能。
在本指南中,我将向你展示如何安装 DOSBox配置它并玩一个示例游戏。
### 在 Ubuntu 中安装 DOSBox
DOSBox 的主软件包在所有主要的 Linux 发行版中都可用。
在 Ubuntu、Debian、LinuxMint 和相关发行版中,使用以下命令安装它:
```
sudo apt install dosbox
```
在 Fedora、CentOS、RHEL 和相关发行版中,使用以下命令安装它:
```
sudo dnf install dosbox
```
在 Arch Linux 中,使用以下命令安装它:
```
pacman -S --needed dosbox
```
安装就结束了。现在是配置和运行的时候了。
### 运行 DOSBox
安装后,从终端键入以下内容:
```
dosbox
```
它将显示以下界面,这是 DOSBox 提示符。第一次运行非常重要,因为它会创建 DOSBox 配置文件。
键入 `exit` 暂时关闭 DOSBox。
![DOSBox first time run][1]
配置文件为你提供了几个调整设置的选项。在 Ubuntu 中,该文件创建在 `~/.dosbox/dosbox-[version].conf`
在 Fedora 中,它从以下路径加载临时配置文件 `~/.config/dosbox/dosbox-staging.conf`.
默认情况下,你可以使用默认配置。但是如果你愿意,你可以修改它。
例如,如果你想全屏启动 DOSBox你可以启用或禁用相关设置。像这样:
```
fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=100
waitonerror=true
```
你可以在 [官方文档][2] 中找到所有的设置选项。
### 下载以及游玩老游戏
有许多网站提供旧的 DOS 游戏。我使用过下面的网站,它提供了一套可以在现代系统中玩的老游戏。
所以,访问下面的网站,下载你想要的任何游戏。
> **[下载 DOS 游戏][3]**
在你的 `/home` 目录下创建一个文件夹,并将其命名为 `dosbox`
```
cd ~
mkdir dosbox
```
现在,解压你下载的游戏(应该是一个 .exe 文件),在 `~/dosbox` 目录下创建一个单独的文件夹。
例如,我下载了游戏 “马里奥和路易吉1994”。我在 `dosbox` 文件夹中创建了一个名为 `mario` 的文件夹,并将游戏文件放进去。
![Keep the game in a separate folder][4]
现在从终端启动 dosbox
```
dosbox
```
并键入以下内容,将游戏挂载到虚拟的 C: 盘中:
```
mount c ~/dosbox/mario
```
以上命令完成后,将驱动器更改为 C:
```
c:
```
现在,你可以输入游戏的文件名来运行游戏:
```
mario
```
![Running the game][5]
![Mario running in DOSBox in Ubuntu][6]
### 键盘或控制器映射
默认情况下DOSBox 会自动检测键盘或你插入的控制器。但是,如果你想更改游戏按键绑定,可以从终端运行以下命令:
```
dosbox -startmapper
```
它将显示以下界面,每个键上都标记有事件。你可以点开任何一个键,根据自己的习惯进行更改。
![DOSBox keyboard and controller mapping][7]
### 结论
我希望你在 Ubuntu 和其他发行版中安装了 DOSBox 之后,能够运行你最喜欢的 DOS 游戏。DOSBox 是最酷的软件之一,你可以使用它来运行任何程序,例如 [Turbo C][8] 等。
如果你有任何麻烦或问题,请在评论区告诉我。
享受游戏吧!
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-dosbox-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[gpchn](https://github.com/gpchn)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBox-first-time-run.jpg
[2]: https://www.dosbox.com/wiki/Dosbox.conf#Sections
[3]: https://archive.org/details/softwarelibrary_msdos_games?tab=collection
[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/Keep-the-game-in-a-separate-folder.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-the-game.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/Mario-playing-in-DOSBox-in-Ubuntu.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBOox-keyboard-and-controller-mapping.jpg
[8]: https://www.debugpoint.com/setting-up-dosbox-in-ubuntu-to-run-turbo-c/
[0]: https://img.linux.net.cn/data/attachment/album/202302/14/142608nsoov2vory2nipiv.jpg

View File

@ -1,83 +0,0 @@
[#]: subject: "GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago"
[#]: via: "https://news.itsfoss.com/gnome-design-quick-access/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago
======
GNOME design changes makes sense, as it brings back (sort of) a similar functionality that it removed earlier.
![GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago][1]
GNOME removed the application menus and indicators a few years back.
If you are curious, app indicators were a way of interacting with the apps running in the background from the top panel.
Yes, you can [add an extension for app indicators][2] to get the same functionality. But, you will no longer find the ability by default on distributions using stock GNOME desktop environment, like Fedora.
However, Ubuntu, some of its [official flavors][3], and other distributions like Pop!_OS support the system tray icons even though GNOME dropped them.
Now, after years of design changes, it looks like we might be seeing something similar.
### GNOME to Add a Quick Way to Check Active Apps in the Background
Currently, there's no quick way to find out the apps running in the background without an active window.
You must use the [task manager][4] or [system monitoring tools][5] for better insights.
With future GNOME releases (probably GNOME 44), you may expect **a feature to monitor background running apps** right from the **menu panel** of the top panel.
![gnome design mockup for backround app check from the notification menu][6]
The idea by [Allan Day][7] is still in discussion, and a [design mockup][8] has been shared. However, there is a good chance that it will be accepted.
This idea has also prompted developer [Georges Basile Stavracas Neto][9] to expose Flatpak's xdg-desktop-portal component, making it easy to detect running Flatpak applications.
> 📋 The placement or design of checking background apps is still a work in progress; what you see above may change with the final implementation.
### Would This Bring Back App Indicators Too?
Not exactly.
With this feature, GNOME aims to allow you to quickly see the background running apps and manage them (close them or access specific settings).
However, you still have a few clicks to reach this point 🖱️
The applet indicators or the system tray icons were a faster way to access applications running in the background, even though not every background app was listed.
After all, it is better than nothing.
And eventually, these design changes could result in an intuitive way to get app indicators back in some form.
_💬 What do you think about this decision with GNOME design changes for upcoming releases? Share your thoughts in the comments below._
**Via**: [Phoronix][10]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/gnome-design-quick-access/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed/
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/gnome-brings-mysterious-features.png
[2]: https://itsfoss.com/enable-applet-indicator-gnome/
[3]: https://itsfoss.com/which-ubuntu-install/
[4]: https://itsfoss.com/task-manager-linux/
[5]: https://itsfoss.com/linux-system-monitoring-tools/
[6]: https://news.itsfoss.com/content/images/2023/02/background-app-running.png
[7]: https://gitlab.gnome.org/aday
[8]: https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/191
[9]: https://github.com/GeorgesStavracas
[10]: https://www.phoronix.com/news/GNOME-Monitor-Background-Apps

View File

@ -1,61 +0,0 @@
[#]: subject: "Opera Browser Plans to Integrate ChatGPT"
[#]: via: "https://debugpointnews.com/opera-chatgpt-integration/"
[#]: author: "arindam https://debugpointnews.com/author/dpicubegmail-com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Opera Browser Plans to Integrate ChatGPT
======
![][1]
**Opera browser is reportedly looking to integrate the language model ChatGPT into its desktop and mobile products.**
### In brief
- Opera browser, a popular desktop and mobile web browser is reportedly exploring integrating the language model ChatGPT into its products.
- Microsoft recently announced the integration of OpenAI technology, the maker of ChatGPT, into its Microsoft Edge web browser, adding AI-powered features for users.
### Opera and ChatGPT
[Opera][2], a widely-used desktop and mobile web browser is set to integrate the language model ChatGPT into its software products. Operas parent company Kunlun Tech is behind the news, although the details of the integration remain limited. Opera offers a range of software products, including desktop web browsers, mobile web browsers, and a version of its browser designed for Chromebooks.
The most likely candidates for the ChatGPT integration are Operas main desktop browsers, including Opera browser and Opera GX, a browser designed for gamers. However, there is also potential for integration into Operas mobile browsers, including the regular Opera mobile browser, Opera Mini, and Opera Crypto Browser.
### Recent updates from Microsoft and Google
Microsoft made headlines this week by announcing OpenAI integration into its Microsoft Edge web browser. The integration will bring two AI-powered features, Chat and Compose, to Edge users in the future. Chat allows users to communicate directly with the AI in the browser. At the same time, Compose helps users with text composition, including writing emails and social media posts with different tones and lengths.
During a recent presentation, Google did not announce direct AI chatbot integration into its Chrome browser, which received a less-than-enthusiastic response.
### Whats next
Opera browser is used by hundreds of millions of users, with a 2.4% share of the global browser market, according to Statcounter. While it may trail behind Google Chromes 65% and Safaris 18%, it still holds its own compared to Mozilla Firefoxs 3%.
Kunlun Tech is a Beijing-based company listed on the Shenzhen stock exchange. This week, Chinese search giant Baidu announced plans to integrate a ChatGPT-style bot into its search product.
In conclusion, the integration of ChatGPT into the Opera browser represents a significant step forward in AI-powered web browsing. As companies like Microsoft and Baidu integrate AI technology into their products, Opera is positioning itself as a leader in the field.
With hundreds of millions of users and a growing presence in the browser market, the integration of ChatGPT into Opera is a highly-anticipated development.
Via [CNBC][3]
--------------------------------------------------------------------------------
via: https://debugpointnews.com/opera-chatgpt-integration/
作者:[arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://debugpointnews.com/author/dpicubegmail-com/
[b]: https://github.com/lkxed
[1]: https://debugpointnews.com/wp-content/uploads/2023/02/opera.jpg
[2]: https://www.opera.com/
[3]: https://www.cnbc.com/2023/02/09/web-browser-opera-is-planning-to-incorporate-chatgpt.html

View File

@ -1,147 +0,0 @@
[#]: subject: "How to Use a Differential Analyzer (to Murder People)"
[#]: via: "https://twobithistory.org/2020/04/06/differential-analyzer.html"
[#]: author: "Two-Bit History https://twobithistory.org"
[#]: collector: "lujun9972"
[#]: translator: "toknow-gh"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Use a Differential Analyzer (to Murder People)
======
A differential analyzer is a mechanical, analog computer that can solve differential equations. Differential analyzers arent used anymore because even a cheap laptop can solve the same equations much faster—and can do it in the background while you stream the new season of Westworld on HBO. Before the invention of digital computers though, differential analyzers allowed mathematicians to make calculations that would not have been practical otherwise.
It is hard to see today how a computer made out of anything other than digital circuitry printed in silicon could work. A mechanical computer sounds like something out of a steampunk novel. But differential analyzers did work and even proved to be an essential tool in many lines of research. Most famously, differential analyzers were used by the US Army to calculate range tables for their artillery pieces. Even the largest gun is not going to be effective unless you have a range table to help you aim it, so differential analyzers arguably played an important role in helping the Allies win the Second World War.
To understand how differential analyzers could do all this, you will need to know what differential equations are. Forgotten what those are? Thats okay, because I had too.
### Differential Equations
Differential equations are something you might first encounter in the final few weeks of a college-level Calculus I course. By that point in the semester, your underpaid adjunct professor will have taught you about limits, derivatives, and integrals; if you take those concepts and add an equals sign, you get a differential equation.
Differential equations describe rates of change in terms of some other variable (or perhaps multiple other variables). Whereas a familiar algebraic expression like \\(y = 4x + 3\\) specifies the relationship between some variable quantity \\(y\\) and some other variable quantity \\(x\\), a differential equation, which might look like \\(\frac{dy}{dx} = x\\), or even \\(\frac{dy}{dx} = 2\\), specifies the relationship between a _rate of change_ and some other variable quantity. Basically, a differential equation is just a description of a rate of change in exact mathematical terms. The first of those last two differential equations is saying, “The variable \\(y\\) changes with respect to \\(x\\) at a rate defined exactly by \\(x\\),” and the second is saying, “No matter what \\(x\\) is, the variable \\(y\\) changes with respect to \\(x\\) at a rate of exactly 2.”
Differential equations are useful because in the real world it is often easier to describe how complex systems change from one instant to the next than it is to come up with an equation describing the system at all possible instants. Differential equations are widely used in physics and engineering for that reason. One famous differential equation is the heat equation, which describes how heat diffuses through an object over time. It would be hard to come up with a function that fully describes the distribution of heat throughout an object given only a time \\(t\\), but reasoning about how heat diffuses from one time to the next is less likely to turn your brain into soup—the hot bits near lots of cold bits will probably get colder, the cold bits near lots of hot bits will probably get hotter, etc. So the heat equation, though it is much more complicated than the examples in the last paragraph, is likewise just a description of rates of change. It describes how the temperature of any one point on the object will change over time given how its temperature differs from the points around it.
Lets consider another example that I think will make all of this more concrete. If I am standing in a vacuum and throw a tennis ball straight up, will it come back down before I asphyxiate? This kind of question, posed less dramatically, is the kind of thing I was asked in high school physics class, and all I needed to solve it back then were some basic Newtonian equations of motion. But lets pretend for a minute that I have forgotten those equations and all I can remember is that objects accelerate toward earth at a constant rate of \\(g\\), or about \\(10 \;m/s^2\\). How can differential equations help me solve this problem?
Well, we can express the one thing I remember about high school physics as a differential equation. The tennis ball, once it leaves my hand, will accelerate toward the earth at a rate of \\(g\\). This is the same as saying that the velocity of the ball will change (in the negative direction) over time at a rate of \\(g\\). We could even go one step further and say that _the rate of change in the height of my ball above the ground_ (this is just its velocity) will change over time at a rate of negative \\(g\\). We can write this down as the following, where \\(h\\) represents height and \\(t\\) represents time:
\\[\frac{d^2h}{dt^2} = -g\\]
This looks slightly different from the differential equations we have seen so far because this is what is known as a second-order differential equation. We are talking about the rate of change of a rate of change, which, as you might remember from your own calculus education, involves second derivatives. Thats why parts of the expression on the left look like they are being squared. But this equation is still just expressing the fact that the ball accelerates downward at a constant acceleration of \\(g\\).
From here, one option I have is to use the tools of calculus to solve the differential equation. With differential equations, this does not mean finding a single value or set of values that satisfy the relationship but instead finding a function or set of functions that do. Another way to think about this is that the differential equation is telling us that there is some function out there whose second derivative is the constant \\(-g\\); we want to find that function because it will give us the height of the ball at any given time. This differential equation happens to be an easy one to solve. By doing so, we can re-derive the basic equations of motion that I had forgotten and easily calculate how long it will take the ball to come back down.
But most of the time differential equations are hard to solve. Sometimes they are even impossible to solve. So another option I have, given that I paid more attention in my computer science classes that my calculus classes in college, is to take my differential equation and use it as the basis for a simulation. If I know the starting velocity and the acceleration of my tennis ball, then I can easily write a little for-loop, perhaps in Python, that iterates through my problem second by second and tells me what the velocity will be at any given second \\(t\\) after the initial time. Once Ive done that, I could tweak my for-loop so that it also uses the calculated velocity to update the height of the ball on each iteration. Now I can run my Python simulation and figure out when the ball will come back down. My simulation wont be perfectly accurate, but I can decrease the size of the time step if I need more accuracy. All I am trying to accomplish anyway is to figure out if the ball will come back down while I am still alive.
This is the numerical approach to solving a differential equation. It is how differential equations are solved in practice in most fields where they arise. Computers are indispensable here, because the accuracy of the simulation depends on us being able to take millions of small little steps through our problem. Doing this by hand would obviously be error-prone and take a long time.
So what if I were not just standing in a vacuum with a tennis ball but were standing in a vacuum with a tennis ball in, say, 1936? I still want to automate my computation, but Claude Shannon wont even complete his masters thesis for another year yet (the one in which he casually implements Boolean algebra using electronic circuits). Without digital computers, Im afraid, we have to go analog.
### The Differential Analyzer
The first differential analyzer was built between 1928 and 1931 at MIT by Vannevar Bush and Harold Hazen. Both men were engineers. The machine was created to tackle practical problems in applied mathematics and physics. It was supposed to address what Bush described, in [a 1931 paper][1] about the machine, as the contemporary problem of mathematicians who are “continually being hampered by the complexity rather than the profundity of the equations they employ.”
A differential analyzer is a complicated arrangement of rods, gears, and spinning discs that can solve differential equations of up to the sixth order. It is like a digital computer in this way, which is also a complicated arrangement of simple parts that somehow adds up to a machine that can do amazing things. But whereas the circuitry of a digital computer implements Boolean logic that is then used to simulate arbitrary problems, the rods, gears, and spinning discs _directly_ simulate the differential equation problem. This is what makes a differential analyzer an analog computer—it is a direct mechanical analogy for the real problem.
How on earth do gears and spinning discs do calculus? This is actually the easiest part of the machine to explain. The most important components in a differential analyzer are the six mechanical integrators, one for each order in a sixth-order differential equation. A mechanical integrator is a relatively simple device that can integrate a single input function; mechanical integrators go back to the 19th century. We will want to understand how they work, but, as an aside here, Bushs big accomplishment was not inventing the mechanical integrator but rather figuring out a practical way to chain integrators together to solve higher-order differential equations.
A mechanical integrator consists of one large spinning disc and one much smaller spinning wheel. The disc is laid flat parallel to the ground like the turntable of a record player. It is driven by a motor and rotates at a constant speed. The small wheel is suspended above the disc so that it rests on the surface of the disc ever so slightly—with enough pressure that the disc drives the wheel but not enough that the wheel cannot freely slide sideways over the surface of the disc. So as the disc turns, the wheel turns too.
The speed at which the wheel turns will depend on how far from the center of the disc the wheel is positioned. The inner parts of the disc, of course, are rotating more slowly than the outer parts. The wheel stays fixed where it is, but the disc is mounted on a carriage that can be moved back and forth in one direction, which repositions the wheel relative to the center of the disc. Now this is the key to how the integrator works: The position of the disc carriage is driven by the input function to the integrator. The output from the integrator is determined by the rotation of the small wheel. So your input function drives the rate of change of your output function and you have just transformed the derivative of some function into the function itself—which is what we call integration!
If that explanation does nothing for you, seeing a mechanical integrator in action really helps. The principle is surprisingly simple and there is no way to watch the device operate without grasping how it works. So I have created [a visualization of a running mechanical integrator][2] that I encourage you to take a look at. The visualization shows the integration of some function \\(f(x)\\) into its antiderivative \\(F(x)\\) while various things spin and move. Its pretty exciting.
![][3] _A nice screenshot of my visualization, but you should check out the real thing!_
So we have a component that can do integration for us, but that alone is not enough to solve a differential equation. To explain the full process to you, Im going to use an example that Bush offers himself in his 1931 paper, which also happens to be essentially the same example we contemplated in our earlier discussion of differential equations. (This was a happy accident!) Bush introduces the following differential equation to represent the motion of a falling body:
\\[\frac{d^2x}{dt^2} = -k\,\frac{dx}{dt} - g\\]
This is the same equation we used to model the motion of our tennis ball, only Bush has used \\(x\\) in place of \\(h\\) and has added another term that accounts for how air resistance will decelerate the ball. This new term describes the effect of air resistance on the ball in the simplest possible way: The air will slow the balls velocity at a rate that is proportional to its velocity (the \\(k\\) here is some proportionality constant whose value we dont really care about). So as the ball moves faster, the force of air resistance will be stronger, further decelerating the ball.
To configure a differential analyzer to solve this differential equation, we have to start with what Bush calls the “input table.” The input table is just a piece of graphing paper mounted on a carriage. If we were trying to solve a more complicated equation, the operator of the machine would first plot our input function on the graphing paper and then, once the machine starts running, trace out the function using a pointer connected to the rest of the machine. In this case, though, our input is just the constant \\(g\\), so we only have to move the pointer to the right value and then leave it there.
What about the other variables \\(x\\) and \\(t\\)? The \\(x\\) variable is our output as it represents the height of the ball. It will be plotted on graphing paper placed on the output table, which is similar to the input table only the pointer is a pen and is driven by the machine. The \\(t\\) variable should do nothing more than advance at a steady rate. (In our Python simulation of the tennis ball problem as posed earlier, we just incremented \\(t\\) in a loop.) So the \\(t\\) variable comes from the differential analyzers motor, which kicks off the whole process by rotating the rod connected to it at a constant speed.
Bush has a helpful diagram documenting all of this that I will show you in a second, but first we need to make one more tweak to our differential equation that will make the diagram easier to understand. We can integrate both sides of our equation once, yielding the following:
\\[\frac{dx}{dt} = - \int \left(k\,\frac{dx}{dt} + g\right)\,dt\\]
The terms in this equation map better to values represented by the rotation of various parts of the machine while it runs. Okay, heres that diagram:
![][4] _The differential analyzer configured to solve the problem of a falling body in one dimension._
The input table is at the top of the diagram. The output table is at the bottom-right. The output table here is set up to graph both \\(x\\) and \\(\frac{dx}{dt}\\), i.e. height and velocity. The integrators appear at the bottom-left; since this is a second-order differential equation, we need two. The motor drives the very top rod labeled \\(t\\). (Interestingly, Bush referred to these horizontal rods as “buses.”)
That leaves two components unexplained. The box with the little \\(k\\) in it is a multiplier respresnting our proportionality constant \\(k\\). It takes the rotation of the rod labeled \\(\frac{dx}{dt}\\) and scales it up or down using a gear ratio. The box with the \\(\sum\\) symbol is an adder. It uses a clever arrangement of gears to add the rotations of two rods together to drive a third rod. We need it since our equation involves the sum of two terms. These extra components available in the differential analyzer ensure that the machine can flexibly simulate equations with all kinds of terms and coefficients.
I find it helpful to reason in ultra-slow motion about the cascade of cause and effect that plays out as soon as the motor starts running. The motor immediately begins to rotate the rod labeled \\(t\\) at a constant speed. Thus, we have our notion of time. This rod does three things, illustrated by the three vertical rods connected to it: it drives the rotation of the discs in both integrators and also advances the carriage of the output table so that the output pen begins to draw.
Now if the integrators were set up so that their wheels are centered, then the rotation of rod \\(t\\) would cause no other rods to rotate. The integrator discs would spin but the wheels, centered as they are, would not be driven. The output chart would just show a flat line. This happens because we have not accounted for the initial conditions of the problem. In our earlier Python simulation, we needed to know the initial velocity of the ball, which we would have represented there as a constant variable or as a parameter of our Python function. Here, we account for the initial velocity and acceleration by displacing the integrator discs by the appropriate amount before the machine begins to run.
Once weve done that, the rotation of rod \\(t\\) propagates through the whole system. Physically, a lot of things start rotating at the same time, but we can think of the rotation going first to integrator II, which combines it with the acceleration expression calculated based on \\(g\\) and then integrates it to get the result \\(\frac{dx}{dt}\\). This represents the velocity of the ball. The velocity is in turn used as input to integrator I, whose disc is displaced so that the output wheel rotates at the rate \\(\frac{dx}{dt}\\). The output from integrator I is our final output \\(x\\), which gets routed directly to the output table.
One confusing thing Ive glossed over is that there is a cycle in the machine: Integrator II takes as an input the rotation of the rod labeled \\((k\,\frac{dx}{dt} + g)\\), but that rods rotation is determined in part by the output from integrator II itself. This might make you feel queasy, but there is no physical issue here—everything is rotating at once. If anything, we should not be surprised to see cycles like this, since differential equations often describe rates of change in a function as a function of the function itself. (In this example, the acceleration, which is the rate of change of velocity, depends on the velocity.)
With everything correctly configured, the output we get is a nice graph, charting both the position and velocity of our ball over time. This graph is on paper. To our modern digital sensibilities, that might seem absurd. What can you do with a paper graph? While its true that the differential analyzer is not so magical that it can write out a neat mathematical expression for the solution to our problem, its worth remembering that neat solutions to many differential equations are not possible anyway. The paper graph that the machine does write out contains exactly the same information that could be output by our earlier Python simulation of a falling ball: where the ball is at any given time. It can be used to answer any practical question you might have about the problem.
The differential analyzer is a preposterously cool machine. It is complicated, but it fundamentally involves nothing more than rotating rods and gears. You dont have to be an electrical engineer or know how to fabricate a microchip to understand all the physical processes involved. And yet the machine does calculus! It solves differential equations that you never could on your own. The differential analyzer demonstrates that the key material required for the construction of a useful computing machine is not silicon but human ingenuity.
### Murdering People
Human ingenuity can serve purposes both good and bad. As I have mentioned, the highest-profile use of differential analyzers historically was to calculate artillery range tables for the US Army. To the extent that the Second World War was the “Good Fight,” this was probably for the best. But there is also no getting past the fact that differential analyzers helped to make very large guns better at killing lots of people. And kill lots of people they did—if Wikipedia is to be believed, more soldiers were killed by artillery than small arms fire during the Second World War.
I will get back to the moralizing in a minute, but just a quick detour here to explain why calculating range tables was hard and how differential analyzers helped, because its nice to see how differential analyzers were applied to a real problem. A range table tells the artilleryman operating a gun how high to elevate the barrel to reach a certain range. One way to produce a range table might be just to fire that particular kind of gun at different angles of elevation many times and record the results. This was done at proving grounds like the Aberdeen Proving Ground in Maryland. But producing range tables solely through empirical observation like this is expensive and time-consuming. There is also no way to account for other factors like the weather or for different weights of shell without combinatorially increasing the necessary number of firings to something unmanageable. So using a mathematical theory that can fill in a complete range table based on a smaller number of observed firings is a better approach.
I dont want to get too deep into how these mathematical theories work, because the math is complicated and I dont really understand it. But as you might imagine, the physics that governs the motion of an artillery shell in flight is not that different from the physics that governs the motion of a tennis ball thrown upward. The need for accuracy means that the differential equations employed have to depart from the idealized forms weve been using and quickly get gnarly. Even the earliest attempts to formulate a rigorous ballistic theory involve equations that account for, among other factors, the weight, diameter, and shape of the projectile, the prevailing wind, the altitude, the atmospheric density, and the rotation of the earth[1][5].
So the equations are complicated, but they are still differential equations that a differential analyzer can solve numerically in the way that we have already seen. Differential analyzers were put to work solving ballistics equations at the Aberdeen Proving Ground in 1935, where they dramatically sped up the process of calculating range tables.[2][6] Nevertheless, during the Second World War, the demand for range tables grew so quickly that the US Army could not calculate them fast enough to accompany all the weaponry being shipped to Europe. This eventually led the Army to fund the ENIAC project at the University of Pennsylvania, which, depending on your definitions, produced the worlds first digital computer. ENIAC could, through rewiring, run any program, but it was constructed primarily to perform range table calculations many times faster than could be done with a differential analyzer.
Given that the range table problem drove much of the early history of computing even apart from the differential analyzer, perhaps its unfair to single out the differential analyzer for moral hand-wringing. The differential analyzer isnt uniquely compromised by its military applications—the entire field of computing, during the Second World War and well afterward, advanced because of the endless funding being thrown at it by the United States military.
Anyway, I think the more interesting legacy of the differential analyzer is what it teaches us about the nature of computing. I am surprised that the differential analyzer can accomplish as much as it can; my guess is that you are too. It is easy to fall into the trap of thinking of computing as the realm of what can be realized with very fast digital circuits. In truth, computing is a more abstract process than that, and electronic, digital circuits are just what we typically use to get it done. In his paper about the differential analyzer, Vannevar Bush suggests that his invention is just a small contribution to “the far-reaching project of utilizing complex mechanical interrelationships as substitutes for intricate processes of reasoning.” That puts it nicely.
_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out._
_Previously on TwoBitHistory…_
> Do you worry that your children are "BBS-ing"? Do you have a neighbor who talks too much about his "door games"?
>
> In this VICE News special report, we take you into the seedy underworld of bulletin board systems:<https://t.co/hBrKGU2rfB>
>
> — TwoBitHistory (@TwoBitHistory) [February 2, 2020][9]
1. Alan Gluchoff. “Artillerymen and Mathematicians: Forest Ray Moulton and Changes in American Exterior Ballistics, 1885-1934.” Historia Mathematica, vol. 38, no. 4, 2011, pp. 506547., <https://www.sciencedirect.com/science/article/pii/S0315086011000279>. [↩︎][10]
2. Karl Kempf. “Electronic Computers within the Ordnance Corps,” 1961, accessed April 6, 2020, <https://ftp.arl.army.mil/~mike/comphist/61ordnance/index.html>. [↩︎][11]
--------------------------------------------------------------------------------
via: https://twobithistory.org/2020/04/06/differential-analyzer.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://twobithistory.org
[b]: https://github.com/lujun9972
[1]: http://worrydream.com/refs/Bush%20-%20The%20Differential%20Analyzer.pdf
[2]: https://sinclairtarget.com/differential-analyzer/
[3]: https://twobithistory.org/images/diff-analyzer-viz.png
[4]: https://twobithistory.org/images/analyzer-diagram.png
[5]: tmp.MoynZsbJ7w#fn:1
[6]: tmp.MoynZsbJ7w#fn:2
[7]: https://twitter.com/TwoBitHistory
[8]: https://twobithistory.org/feed.xml
[9]: https://twitter.com/TwoBitHistory/status/1224014531778826240?ref_src=twsrc%5Etfw
[10]: tmp.MoynZsbJ7w#fnref:1
[11]: tmp.MoynZsbJ7w#fnref:2

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin" [#]: via: "https://opensource.com/article/22/1/troubleshoot-hardware-sysadmin"
[#]: author: "David Both https://opensource.com/users/dboth" [#]: author: "David Both https://opensource.com/users/dboth"
[#]: collector: "lujun9972" [#]: collector: "lujun9972"
[#]: translator: " " [#]: translator: "toknow-gh"
[#]: reviewer: " " [#]: reviewer: " "
[#]: publisher: " " [#]: publisher: " "
[#]: url: " " [#]: url: " "

View File

@ -1,104 +0,0 @@
[#]: subject: "How we hired an open source developer"
[#]: via: "https://opensource.com/article/22/2/how-we-hired-open-source-developer"
[#]: author: "Mike Bursell https://opensource.com/users/mikecamel"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How we hired an open source developer
======
My team opted out of the standard algorithm coding exercise for a
process that yielded more relevant results.
![people in different locations who are part of the same team][1]
As the CEO and co-founder of [Profian][2], a start-up security company, I've been part of our effort to hire developers to work on [Enarx][3], a security project that deals with confidential computing, written almost exclusively in [Rust][4] (with a bit of Assembly). Profian has now found all the people it was looking for in this search, with a couple of developers due to start in the next few weeks. However, new contributors are absolutely welcome to Enarx, and if things continue to go well, the company will definitely want to hire more folks in the future.
Hiring people is not easy, and Profian had a set of specialized requirements that made the task even more difficult. I thought it would be useful and interesting for the community to share how we approached the problem.
### What were we looking for?
These are the specialized requirements I'm talking about:
* **Systems programming:** Profian mainly needs people who are happy programming at the systems layer. This is pretty far down the stack, with lots of interactions directly with hardware or the OS. To create client-server pieces, for instance, we have to write quite a lot of the protocols, manage the crypto, and so forth, and the tools for this aren't all very mature (see "Rust" below).
* **Rust:** Almost all of the project is written in Rust, and what isn't is written in Assembly language (currently exclusively x86, though that may change as we add more platforms). Rust is new, cool, and exciting, but it's still quite young, and some areas don't have all the support you might like or aren't as mature as you'd hope—everything from cryptography through multithreading libraries and compiler/build infrastructure.
* **Distributed team:** Profian is building a team of folks where we can find them. Profian has developers in Germany, Finland, the Netherlands, North Carolina (US), Massachusetts (US), Virginia (US), and Georgia (US). I'm in the United Kingdom, our community manager is in Brazil, and we have interns in India and Nigeria. We knew from the beginning that we wouldn't have everyone in one place, and this required people who would be able to communicate and collaborate with people via video, chat, and (at worst) email.
* **Security:** Enarx is a security project. Although we weren't specifically looking for security experts, we need people who can think and work with security top of mind and design and write code that is applicable and appropriate for the environment.
* **Git:** All of our code is stored in git (mainly [GitHub][5], with a bit of GitLab thrown in). so much of our interaction around code revolves around git that anybody joining us would need to be very comfortable using it as a standard tool in their day-to-day work.
* **Open source:** Open source isn't just a licence; it's a mindset and, equally important, a way of collaborating. A great deal of open source software is created by people who aren't geographically co-located and who might not even see themselves as a team. We needed to know that the people we hired, while gelling as a close team within the company, would be able to collaborate with people outside the organisation and embrace Profian's "open by default" culture, not just for code, but for discussions, communications, and documentation.
### How did we find them?
As I've mentioned elsewhere, [recruiting is hard][6]. Profian used a variety of means to find candidates, with varying levels of success:
* LinkedIn job adverts
* LinkedIn searches
* Language-specific discussion boards and hiring boards (e.g., Reddit)
* An external recruiter (shout out to Gerald at [Interstem][7])
* Word-of-mouth/personal recommendations
It's difficult to judge between these sources in terms of quality, but without an external recruiter, we'd certainly have struggled with quantity (and we had some great candidates from that pathway, too).
### How did we select them?
We needed to measure all of the candidates against all of the requirements noted above, but not all of them were equal. For instance, although we were keen to hire Rust programmers, someone with strong C/C++ skills at the systems level would be able to pick up Rust quickly enough to be useful. On the other hand, a good knowledge of using git was absolutely vital, as we couldn't spend time working with new team members to bring them up to speed on our way of working.
A strong open source background was, possibly surprisingly, not a requirement, but the mindset to work in that sort of model was, and anyone with a history of open source involvement is likely to have a good knowledge of git. The same goes for the ability to work in a distributed team: So much of open source is distributed that involvement in almost any open source community was a positive indicator. Security, we decided, was a "nice-to-have" qualification.
We wanted to keep the process simple and quick. Profian doesn't have a dedicated HR or People function, and we're busy trying to get code written. This is what we ended up with (with slight variations), and we tried to complete it within 1-2 weeks:
1. Initial CV/resume/GitHub/GitLab/LinkedIn review to decide whether to interview
2. 30-40 minute discussion with me as CEO, to find out if they might be a good cultural fit, to give them a chance to find out about us, and to get an idea if they were as technically adept as they appeared in Step 1
3. Deep dive technical discussion led by Nathaniel, usually with me there
4. Chat with other members of the team
5. Coding exercise
6. Quick decision (usually within 24 hours)
The coding exercise was key, but we decided against the usual approach. Our view was that a pure "algorithm coding" exercise beloved by many tech companies was pretty much useless for what we wanted: to find out whether a candidate could quickly understand a piece of code, fix some problems, and work with the team to do so. We created a GitHub repository with some almost-working Rust code in it (in fact, we ended up using two, with one for people a little higher up the stack), then instructed candidates to fix it, perform some git-related processes on it, and improve it slightly, adding tests along the way.
An essential part of the test was to get candidates to interact with the team via our chat room(s). We scheduled 15 minutes on a video call for setup and initial questions, two hours for the exercise ("open book" as well as talking to the team, candidates were encouraged to use all resources available to them on the Internet), followed by a 30-minute wrap-up session where the team could ask questions, and the candidate could reflect on the task. This conversation, combined with the chat interactions during the exercise, allowed us to get an idea of how well the candidate was able to communicate with the team. Afterwards, the candidate would drop off the call, and we'd most often decide within 5-10 minutes whether we wanted to hire them.
This method generally worked very well. Some candidates struggled with the task, some didn't communicate well, some failed to do well with the git interactions these were the people we didn't hire. It doesn't mean they're not good coders or might not be a good fit for the project or the company later on, but they didn't meet the criteria we need now. Of the developers we hired, the level of Rust experience and need for interaction with the team varied, but the level of git expertise and their reactions to our discussions afterwards were always sufficient for us to decide to take them.
### Reflections
On the whole, I don't think we'd change a huge amount about the selection process—though I'm pretty sure we could do better with the search process. The route through to the coding exercise allowed us to filter out quite a few candidates, and the coding exercise did a great job of helping us pick the right people. Hopefully, everyone who's come through the process will be a great fit and produce great code (and tests and documentation and …) for the project. Time will tell!
* * *
This article originally appeared on [Alice, Eve and Bob a security blog][8] and is republished with permission.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/2/how-we-hired-open-source-developer
作者:[Mike Bursell][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mikecamel
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team)
[2]: https://profian.com/
[3]: https://enarx.dev/
[4]: https://opensource.com/article/21/3/rust-programmer
[5]: https://github.com/enarx/
[6]: https://aliceevebob.com/2021/11/09/recruiting-is-hard/
[7]: https://www.interstem.co.uk/
[8]: https://aliceevebob.com/

View File

@ -1,134 +0,0 @@
[#]: subject: "“Its time to contribute to open source”"
[#]: via: "https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/"
[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
“Its time to contribute to open source”
======
Nilesh Vaghela is an AWS community hero and founder, ElectroMech Corporation, a cloud and open source company. According to him, contributing to open source is a rewarding act in itself. However, it needs commitment and there are many steps involved in the process, right from selecting a project to ensuring your contribution is noticed. In a conversation with Abbinaya Kuzhanthaivel of OSFY, he shares a few tips on how developers can help to improve Indias contributions to open source.
![Nilesh Vaghela,
AWS community hero and
founder, ElectroMech Corporation][1]
##### Q. Can you tell us a bit about your current role and contributions to open source.
**A.** I am currently an architect working on automation. I lead multiple teams and also contribute majorly to Invinsense, an open source security service platform. I started open source groups in early 1998 and had around 1500 members even then. A group (https://groups.google.com/g/vglug) I am handling now has been very active since 2014-15.
##### Q. How did you start working with open source projects?
**A.** I am a mechanical engineer by qualification, and was dealing with modems and UPS systems at my firm ElectroMech Corporation. I slowly got dragged into handling PCs, networking and Linux. I started experimenting in 1996 after getting inspired by seeing over 150 computer servers running on Linux at a Nuclear Science Centre. Thats when I converted my company entirely, focusing on open source for training and support.
I can proudly say that I was one of the first and early adopters of open source — helping customers to understand what is open source, what are its benefits, whats available for free, security or code issues, and so on. We got at least four or five customers in Vadodara supporting us, and we eventually promoted ourselves through advertisements in the Yellow Pages. We partnered with Red Hat and the journey continues till now.
##### Q. How do you think open source has evolved since then?
A. I can say that, earlier, open source was a passion that fascinated and attracted people to participate. I was particularly impressed hearing user-friendly stories across the world when some Siberian contributors were working to improve water scarcity. It was more like a corporate social responsibility (CSR) activity. A board would be created by people and experts to govern and take projects forward. People would come in for the love of technology without expectations.
I did not believe then that open source could get commercial, but it is the driving force for most of the innovation and technology today, and many more enterprises are adopting it. We are looking forward to a great balance in contribution to and use of open source, as we have people, communities and big companies coming into play. This is the real future and power of open source.
##### Q. Could you share some of your challenges?
A. Initially, I walked alone but people joined once they knew my intentions were good. I created a lot of communities without any expectation, but did get paid indirectly in terms of reputation or fame; some people understood that I was a technical expert and gave projects in the long term. As it was very early days, people started joining the community and contributing without much effort. The goal wasnt to get business and hence I can say I didnt really face any hurdles.
##### Q. What are your leadership mantras and lessons from being a community leader?
**A.** First, if you want to start a community, then be neutral and dont harbour a biased opinion. It may look like you are running a community as a leader, but remember those joining you are contributing equally. And never demotivate anyone. Be polite while making comments and addressing queries. Whatever the question, if you dont want to give an answer, then choose to be quiet. But dont stop anyone from asking. Help them build expertise.
Second, dont involve the community in business. Do not mix and match the goals of your business and community. Have a clear differentiation.
Always try to encourage people to participate instead of delivering instructions as an expert. If you find people are interested to lead and take initiatives, then give them the stage. Invite and engage them in the community. That will help you to make more community leaders. Also, keep your community simple and dont involve sponsors in the initial stages.
##### Q. Who do you look up to for inspiration?
**A.** Richard Stallman, the father of the open source movement, is my inspiration and I have always admired his projects.
Apart from him, I have an interesting incident to share that inspired me to work on open source. At the time when I started working on open source, most of the software for the Nuclear Science Centre was based on the Windows OS. However, many scientists wanted to work with Linux based software. And within two or three months, they actually created Linux drivers. This is what fascinated me that the user can create these drivers which may not be possible in the case of proprietary software. I really liked the fact that open source empowered the user.
##### Q. Your thoughts on the open source landscape in India and the scope for improvement.
**A.** India is the largest consumer of open source and we are focusing on becoming a contributor. With so many developers around, we still do not have software giants in India. What we have mostly are service providers and not innovators. More people should become contributors to open source and develop something with international labels.
The very thought of contributing to open source should begin from the level of schools and colleges. Fortunately, the Gujarat government has already introduced lessons based on Linux from Class 8 to Class 10. It is important to educate and make youngsters aware of open source models.
Second, we have to develop good mentors. When people start contributing, it is important to find an open source mentor working in that particular project. The mentor gives a small assignment, tries the code and then commits it. If everything goes fine, the contribution is increased gradually. Unfortunately, we have very few mentors available in India. We need to prepare a lot of mentors or maybe connect to those across the world.
Third, we need to encourage those who come forward to contribute. Once you are a recognised developer or a person contributing to open source development, you also progress in your career and business.
India can be a major contributor to open source by following such simple methods.
##### Q. What do you think about the coding requirements to contribute to open source?
**A.** From my experience, if you know the internal parts, how to develop the application, what code standard you should maintain, and how to manage the team and other best practices, you may not have to actually worry about coding expertise.
There are other roles too with respect to designing, security maintenance and integration. See what works for you. Develop and strengthen your skill in what you like to do. If you feel coding still interests you, then take the support of fellow developers to learn it.
##### Q. How do you shortlist a project you would like to contribute to?
A. You need to understand your top few interest areas and then do your research on the projects happening around them. You need to figure out the area of requirements or openings for contributors and more volunteers. You can start small to practice and then build expertise.
Avoid going by the trendy topics; whats important is your individual interest. For instance, DevOps is in high demand now and you may tend to go for a DevOps project. Do not make this mistake.
You can find open source projects on Cloud Native Computing Foundation ([CNCF][2]), Apache, Fedora, Red Hat, and so on. This way you can also find mentors who are already working on projects and can get proper guidance.
##### Q. Projects have their own purpose and target audience. Sometimes they even misalign with open source goals. So, what does one check before contributing?
A. I agree it becomes challenging when somebody starts an open source project and then commercialises it. But this is always a risk, and should not discourage you.
First try to check out the group — how popular are the contributors working in the group, how long have they been contributing, and how reputed are they. And once you join, observing everyone and everything is the key. Try to learn at least for three to six months, and understand how everything works. You can always leave the project if you find the intention is wrong. But if you feel its all right, then go ahead and contribute.
![The team at ElectroMech Corporation][3]
There are certain licence checks that you can do, say, like GPL version 3. You can also look at unmodified licence versions like the Apache open source licence.
##### Q. Do you think big companies will accept contributions from freshers?
A. Yes, of course. Companies also like mentoring. They usually dont allow you to contribute directly, but may give you a small assignment initially. A mentor will first try to understand what skill you have and how good you are at it. Once they recognise you have the kind of skill that is needed, they will continue to guide you or assign you to some other mentor based on your skill. The initial stages are very crucial. Many companies do some sort of screening, and you may be allowed to contribute only after you have proved your ability.
##### Q. What are the initial challenges that contributors have to overcome when picking up projects?
A. First, you should be very serious about your contribution. There are no written commitments and contributors may tend to take the work lightly. Thats totally wrong. Try to dedicate 8-10 hours or whatever is feasible each day. If you are skipping this commitment because you feel there are no immediate returns, then you will not be a good contributor.
Always adhere to a mentors guidance strictly at the initial stages. This is very crucial for a healthy contribution. Sometimes it may happen that you believe you are good at something, while your mentor may not assign a project based on that skill. Simply approach your mentor in such scenarios and ask him what you should do, what is your role, and how you can contribute.
##### Q. Many developers do not get replies after submitting the contribution to a project. How does one make a submission noticeable?
A. Write a small blog on the project you are planning to contribute to, covering aspects like what you like in it, what you dont like, and what can be improved. Such a positive and promotional approach can greatly help you.
Be a part of the group and be involved in activities related to that particular project. Instead of contributing, first try to engage with the group, and this will increase the chances for you to get adopted as a contributor.
Once you have a better understanding of the project, not only will your work be accepted but you will be able to better align yourself with that project.
##### Q. How do you overcome a situation where your contribution is not accepted?
A. Just understand that this can happen for many reasons — maybe you are not in the right project or you have not contributed correctly. If the project is country driven, your request may not be accepted. Hence, remember to have a checklist as stated earlier. Dont worry if your contribution is not accepted because either you are not fit for the project or the project is not fit for you.
All I would recommend is try to identify four or five projects, and at least one among those projects you work on will probably be accepted.
##### Q. What is your message for our readers?
A. Open source is the driving force behind most of the innovation happening today. Instead of just using open source, let us try to contribute according to our capacity and skills. Contributions can be in terms of code, documentation, testing, blogs, money, etc. Its time to contribute.
##### Q. Any hiring plans for ElectroMech Corporation — what are the roles and skill expectations?
We have requirements in cloud DevOps, and are hiring cloud architects, Python developers, Linux architects and security professionals.
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/
作者:[Abbinaya Kuzhanthaivel][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/abbinaya-swath/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Nilesh-Vaghela-AWS-community-hero-and-founder-ElectroMech-Corporation.jpg
[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib2vvv3dv3AhVa7XMBHfZSCsIQFnoECAgQAQ&url=https%3A%2F%2Fwww.cncf.io%2F&usg=AOvVaw2LnRyH4SZPDHntRLJU_b3q
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/The-team-at-ElectroMech-Corporation.jpg

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/10/whats-new-awk" [#]: via: "https://opensource.com/article/22/10/whats-new-awk"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: " " [#]: translator: "connermemory"
[#]: reviewer: " " [#]: reviewer: " "
[#]: publisher: " " [#]: publisher: " "
[#]: url: " " [#]: url: " "

View File

@ -0,0 +1,305 @@
[#]: subject: "A 10-step guide for a successful hackathon"
[#]: via: "https://opensource.com/article/23/2/hackathon-guide"
[#]: author: "Tiffany Long https://opensource.com/users/tiffany-long"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A 10-step guide for a successful hackathon
======
Hackathons are easy. How much thought do you need to put into them anyway? Just set a date, and people will show up. Well, that is not quite true!
While you may get lucky with that approach, the reality is that hackathons are a keystone experience in the tech industry, and attendees have specific expectations. Not only that, but your organization also has certain needs and should set goals for a hackathon. So, how do you ensure that a hackathon works for your organization and attendees?
A successful hackathon depends on several decisions that tend to be recursive. Decisions about what you want to achieve will impact what resources you allot and how you want to communicate. Those decisions affect whether you go virtual or in person, and that decision will once again impact the resources you need and how you communicate. Alignment when planning hackathons is not just about getting people to agree. You will have a whole suite of decisions that must internally align. For example, a technically difficult hackathon might not be able to attract a large audience (ask me how I know!) and will require a specialized recruitment strategy that requires different resources.
I've done many hackathons over the years, including just a few months back, when my organization hosted a hackathon that led to new features that we will incorporate into the next version of our open source product, Traefik Proxy 3.0. So, trust me when I say planning a hackathon that will enrich attendees and create valuable outcomes for your project is about more than hope, pizza, and chaos.
This article uses the most recent Traefik Labs Hackathon as a blueprint. I share a checklist, tips, and tricks to help you identify your objectives, plan, manage the contest and compensation, share your results, and manage the long tail of the hackathon (the work isn't over when the hackathon ends!)
This guide serves as a model for you to outline best practices so that you, too, can hold a successful hackathon with a sizable target audience that delivers results!
- [Three questions to determine your goals][1]
- [Why are you doing this?][2]
- [Who is your audience?][3]
- [How are you measuring goals?][4]
- [Decide on in-person vs. virtual][5]
- [Build your communication strategy][6]
- [Decide on the prizes][7]
- [Swag it up][8]
- [Get the word out][9]
- [Managing the long tail][10]
**[ Get a PDF and EPUB version of this article. [Download it here.][11] ]**
### 1. Three questions to determine your goals
The first and most crucial step is to set your goals. But this is no simple affair. Before you set goals, you need to coordinate internally on multiple fronts and ask questions such as:
- Why do you want to do a hackathon?
- Who do you want to attend?
- How are you going to measure your success?
#### Identify your internal stakeholders and set expectations
**Hackathons are cross-functional**. No hackathon is run by a community person alone. It is important to ensure everyone is aligned on the goals, what is required to achieve them, and that the necessary resources are committed. This probably sounds super corporate, but these functions exist even within the smallest projects. A project needs adoption and code. It also needs value decisions based on who will be using it. And, of course, projects need passionate contributors.
**Hackathons require cross-functional resources**. One team with a single set of resources cannot successfully run a hackathon. The organization must make various resources available, including:
- Marketing for planning and outreach.
- Product Management for product and industry-specific insight.
- Engineering for deep technical knowledge and community engagement.
For these reasons, hackathons usually support cross-functional goals. Your Community Team, for example, might want to build ownership and convert users to active community members. The Marketing Team might want to enhance awareness and court new users. The Engineering Team might need new perspectives on specific needs or challenges. The Product Team might have goals or no-go areas the community should be aware of.
And last but not least, the hackathon budget is cross-functional. I am sorry to inform you, but hackathons ain't free! Your largest expense is always the dedicated time of your team.
### 2. Why are you doing this?
Setting your goals is the most important part of a successful hackathon. If you don't know what you want to do or why a hackathon is important, at best, it will have a ton of wasted potential and be a disconnected mess at worst.
Communities feed off of ownership. Decide what you need from your community and what ownership stake you want community members to have. Without a clear understanding of this, your hackathon might not reach its full potential in empowering your community.
Be very careful with your hackathon design and goals. Different types of hackathons appeal to different skill levels. If the code you're looking for is very advanced, take the extra time to court the right audience and accept that it will include less overall attendance. Cast a wide net if the contributions can vary in skill and experience.
#### Are you hosting a hackathon to get code and build your project?
- Sometimes, projects hit a critical juncture or acquire a lot of excitement around them, and you want to harness the energy to build something together. A hackathon is a great way to achieve this!
- If you have an active community of users, a hackathon can bring everyone together at the same time to harness that excitement to feed the creative energy of your group.
**Note:** This is more easily achievable with smaller groups who know each other and have a shared experience with the project. You also need to carefully evaluate the skills required to build your project.
#### Are you hosting a hackathon to build your community or re-engage them?
- Maybe you are just building your community or noticed that your community needs a little juice. Hackathons are exciting, and they can help bring that back.
- Above, I said, "Communities feed off of ownership." If your community members do not feel they have a stake or that their needs and voices matter, they will drift away. This is common when projects grow and become more formalized. As the barrier to entry rises, the ability for community members to feel ownership falls, and the project becomes like a product to the user. One way to enhance community membership is by creating events that engage users and lower the bar for entry: Bug round-ups, light requests, and longer timelines.
- Perhaps your user community is growing, but the contributor community is becoming more specialized as your tech becomes more complex. In this case, you need to court sophisticated technologists who understand your tech and the use cases. Look for community members who use your tech in their jobs—especially at companies with large or complex deployments. These people are more likely to understand the needs of users and of the tech itself. They will also have suggestions for significant and valuable enhancements.
- You are free to choose goals that build your community and match your team and community members' energy and time. For example, at Traefik Labs, a hackathon aimed at enthusiastic folks with a small time commitment might target our Plugin Catalog. However, when looking for larger contributions or contributions that take significant expertise, we might target advanced technologistsespecially those we know.
#### Are you hosting a hackathon to celebrate something?
- Hackathons are a great way to celebrate a new launch and hype your community. For example, that is exactly why we hosted the [Traefik Proxy 3.0 Hackaethon][12].
- Hackathons are also great for getting the word out about a new product capability. The [Traefik Plugin Hackaethon][13] is an excellent example here.
- Maybe you want to organize an event to celebrate your top contributors. Do it with a hackathon! Take a look at [this hackathon organized by HackerOne][14]. And if you're thinking, "but this is not about open source software (OSS), how can it be a hackathon?" I've got news for you—hackathons are not just for OSS! Hackathons are for creating with a large community.
#### Are you hosting a hackathon to build awareness?
Hackathons are a great place to begin if you are just starting and want to build awareness around your product/brand. However, there are a few conditions.
- Laser-focused goals and big contributions are unlikely to happen at this stage. Go for a softer, broader focus, and minimize the work required by attendees.
- Reach out to new community members, less experienced users, and users with less exposure to your specific project.
#### Are you hosting a hackathon to connect to users?
I can think of no better way to connect new users to your project than a hackathon. Not only will your users become intimately familiar with your project, but hackathons also have a unique way of engendering a sense of ownership, rarely achievable through other types of events.
### 3. Who is your audience?
Assuming you have pinpointed why you want to host a hackathon and what you want to achieve, it's time to assess the characteristics that a participant needs to be successful. Use your decisions about your goals to identify your audience to ask what type of community member can help you achieve your objectives. Use the list of comparisons below:
- Highly-skilled vs. mixed-skilled vs. low-skilled
- Specialized vs. generalized skill
- Intensive time vs. less intensive time
- Individual contributions vs. group contributions
Your most active community members must look a bit like your target audience.
You might rethink your goals if your target audience doesn't align with at least 80% of the people you know you can attract. Accurately identifying your target audience will go a long way to making your communication strategy around the hackathon and the hackathon itself more successful.
### 4. How are you measuring goals?
Perfect, now that you answered the first two big questions and have your goals laid down, it's time for the third big question—how will you measure those goals? Inspiring your internal teams and your community to work together in building the future of your project, engendering ownership, and increasing engagement are awesome, but you can't determine success if you can't measure your goals.
#### What does success look like immediately after the event?
- A major sign of success is whether attendees connect and engage with each other, co-educate, and build teams during their hackathon.
- Were mentorships built? Through partnership, did several newer users grow into skilled mid-level users, or did mid-level users evolve into expert-tier users? This is the gold ring of success indicators.
- Did your partner organizations (maybe universities) request future hackathons or other events?
- Clearly, the first sign of success is that your attendees had an overall good experience and are motivated to engage more with your project.
- If you are looking for outreach, set a quantity of participants to shoot for and a number of participants who return to contribute more after the event or in three months.
- If building awareness, you might also look for successful follow-up chatter. Who wrote blog posts? Were attendees talking about it on social media?
- If you are looking for contributions, did they work for you? Are these the contributions you want? Did they impact how your team thinks about the problems they face? Will you have ongoing collaborations with these contributors?
#### What will denote success three months after the event?
Defining benchmarks for long-term success is just as important. Here are a few examples of what could indicate long-term success:
- Your hackathon should increase the number of returning contributors to your project. The goal is to get people hooked. If people new to your project came from the hackathon and stayed as users, or if your existing users became more active, you know you won.
- Hackathons are great as self-contained events, but they are supremely valuable as marketing content. They build trust in the community, showing you are responsive and value community input. They are fun loci of activity that let community members bond and look forward to the future, and they are aspirational. People love to see others celebrated and plan to achieve that celebration in the future.
- When you build marketing content around your hackathon (or better yet, others build content around your hackathon), you can expand your reach among second-degree connections.
- Tall poppy syndrome is a shame. Hackathons are a great opportunity to gather those participants who stood out and galvanize them to do other cool things and spread the word about your project.
### 5. Decide on in-person vs. virtual
I know what you're thinking—is in-person even a consideration? We've all gotten so used to doing everything virtually in the post-covid world. So, are the days of in-person gone? I would argue no, they are not. With care and safety measures in place, in-person events are the heart and soul of hackathons.
- In-person means no distractions, lots of pizza, and energy drink-fueled friendship.
- In-person fuels group participation rather than individual contributor participation.
- In-person works well at scale and in miniature: Organizing in-person hackathons for large groups brings high energy and rewards. But they can get quite costly. If you want to organize a large-scale hackathon, you'll be more successful if you target less experienced developers (students, clubs, new careerists) because these folks have the most time and the most to gain when demonstrating their skill and passion.
- In-person also works well for small groups and is great for intense planning and iteration—long nights with new and old friends, usually over food and beer!
And while many pros come with in-person hackathons, it doesn't mean that the virtual experience only comes with cons. Granted, nothing replaces that feeling of late nights with pizza, off-the-cuff remarks that end up changing your entire project, and a friendly set of eyes over your shoulder as you test or debug. But...
- Virtual means you can get a wider group of participants at a significantly lower cost.
- Virtual respects disability.
- Virtual is geolocation friendly.
- Virtual allows for higher individual contributor participation.
- Virtual offers more flexibility in the style and length of the event you cannot have a month-long in-person event!
#### Timelines of virtual hackathons
Did you decide to do a virtual hackathon? Great! Now, you need to determine the type of virtual hackathon you want. Do you envision a prolonged or intensive timeline? Keep in mind that the type of [virtual hackathon][15] you choose will determine, to some extent, your target audience and communication strategy.
**Extended timeline:**
- Allows after-hours tinkering and enables developers to attend without taking time off from work.
- Provides more time to solicit contributions.
- Requires fewer resources for both the organizer and the participants.
- Extended timelines require fewer real-time resources.
**Intense timeline:**
- Recreates that feeling of intensity usually experienced in in-person hackathons.
- Requires a high amount of resources for a short period of time.
- Requires tight management and a communication platform.
- Requires clear one-on-one communication, but also fosters group-to-group or intra-community communication.
### 6. Build your communication strategy
Speaking of communication, once you have your goals, you must decide **who** communicates with participants and **how**. It's common to choose between the popular apps of the day. Your choice impacts the event's feel. Different [chat applications][16] and [collaboration platforms][17] have their own cultures and strengths. The decision you made early on about how to host your hackathon (in-person or virtual, prolonged or intense timeline) is likely to have the most significant impact on your communication strategy.
#### In-person communication plan
If you are running an in-person hackathon, consider it a genuine event—it feels almost like a conference. In-person hackathons often include the following:
- **Workshops/round tables:** Meant to educate and develop new industry standards/best practices for the concerns of the day. These sessions can function as proctored time-bound conversations amongst 6-10 individuals, where they agree upon findings and take notes that are made public to all participants.
- **Planning sessions:** Often used for projects with non-code outcomes, like developing updated standards.
- **Coding sessions:** Used for code-based projects which require work to maintain and enhance.
Each of the above has different communication needs:
- People prepared to facilitate, but not lead, conversations in workshops.
- Note takers and people to make sure that the notes are turned into a publishable product.
- Project managers to ensure the above tasks are done.
- General communication for running the event (food, cleaning, management of resources).
- Masters of ceremonies to move through the agendas.
- For workshops:
Making this all happen requires the resources and specialized knowledge from your Community, Product Managers, and teach-savvy teams. From past experience, it took a team of community members and staff to manage an event of this scope. To be successful, your team will need specialized people as well.
You also need to decide what types of communication you want to foster and who is responsible for it:
- Multiple teams will need to take shifts to perform general support.
- A DevRel, engineering, or support team will need to manage technical communication between triage and participants.
- Community Teams usually spend extensive time connecting participants to help build strong groups by reinforcing skills or points of view. This is one way to ensure that hackathon magic.
- Community Teams also need to support marketing efforts to engage participants and manage follow-up.
#### Virtual communication plan
For virtual hackathons, the choice of a communication platform depends heavily on the outcome you want to achieve, the timeline you've chosen for your hackathon (prolonged or intensive), and the type of communication you wish to facilitate (synchronous or asynchronous).
**Using Pull Requests and Issues on Git hosts (asynchronous):**
- Choosing to communicate through Git pull requests and Issues on your project directly frees up technical staff resources because it keeps the conversations about projects in your current process and allows your team to be responsive rather than instigating communication.
- This approach is great if the team for your hackathon is small or if the expected contributions are relatively small and you do not plan to help participants form teams.
- Using your existing processes is especially great for prolonged hackathons as they do not require additional moderation or require your team to monitor an additional app.
- The downside is that you will only facilitate communication with the individual contributor or group of contributors already working together. It's difficult to connect participants who are working separately. Participants can't find each other as easily on their own, so you lose some of the magic that happens when hackathon participants organically talk to each other in open threads.
**Using a chat application (synchronous):**
- Choosing dedicated chat servers is required for intense hackathons.
- Chat facilitates the team formation and communication necessary for complex projects with fast timelines and sparks the brainstorming that preludes an awesome contribution.
- Additionally, your goal is to build community. People want to join communities where they have ownership, have friends, and feel comfortable. You need a place for participants to feel connected to each other if you want them to return.
- Chat servers can outlast an event, allowing for continued community engagement.
Regardless of which platform you choose, you need a communication plan that identifies when every person on your team is available. Managing a virtual hackathon can get quite tricky, primarily due to the different timezones—people can participate whenever they want, from wherever they want. You must plan to accommodate participants across all time zones and for every occasion. Draw up a plan with who is responsible (and when) for the following:
- Determining response SLAs.
- Animating your virtual space (a dead space guarantees poor communication).
- Encouraging team building.
- Responding to technical questions.
- Checking in on participants.
- Moderating the space to ensure the safety of your participants.
### 7. Decide on the prizes
Is your hackathon a contest? Hackathon participants are often content with grand prizes and "swagpaloozas" for top contributions. But before you decide on the fun stuff (the actual awards), you must determine what your contest values.
- What differentiates a good contribution from a great contribution? If your attendees know how you feel about this, they are more likely to hit it out of the park.
- What do you value? This is your chance to tell participants what you want to see submitted by attaching a prize to it. For example, during the last Traefik Hackaethon, we offered bounties for the most-wanted features. These were, indeed, the ones most people worked on.
- Are there categories of contributions? You need to decide on prizes for each category.
- Create a rubric (a chart or grid defining and ranking achievements, [like this example][18]). This way, participants know what you value and how they are judged. This was one way we improved submissions at HackerOne.
On the other hand, some may argue that competition is overrated. If your goal is participation, feel free to reward every single one of your participants for simply giving back! [Hacktoberfest][19] is a great example of this approach.
### 8. Swag it up
Everyone loves swag! And your participants would certainly appreciate a token to remember this event, whether virtual or in person. Swag has two purposes:
- Swag shows your appreciation: The contributors took their time to engage with you in an intense way; thank them with a gift that shows you value their contributions.
- Swag builds awareness: Gifting swag to your participants helps them spread the love and build awareness of your community by sharing their loot and experience.
The community loves swag, but they don't love boring swag! You probably distributed your existing t-shirts and stickers during another event. Make your hackathon memorable and go for new, exciting, and exclusive designs. Shirts are great, and hoodies reign supreme. But think about cool swag participants may not have already. Think of something that could become their new staple item, like backup batteries or hats (both popular at HackerOne). Personally, my own home features some towels and slippers from hackathons!
### 9. Get the word out
Setting your goals and deciding on amazing grand prizes and swag are all important steps. But how will anyone know your hackathon is happening if you don't get the word out? You need to investigate the available channels carefully, and you need to be bold with your promotion. I'm talking blogs, vlogs, emails, social media—anything you can get your hands on.
However, depending on your defined goals, you need to invest in the appropriate channel. Where you advertise depends on who you want to invite to your hackathon.
- IIf you want to attract more experienced users, target big organizations where your project is used. LinkedIn and email promotion would be most effective here.
- If you want to bring in new and less experienced users, you're better off targeting universities and boot camps. Promoting the event on community-based media, like Mastodon, Matrix, Mattermost, Reddit, Discourse, Discord, and any place your target audience hangs out is a better choice.
### 10. Managing the long tail
Yay, the hackathon is over! Now all hackathon-related activities can stop, and we no longer need to pull resources, right? Wrong! Think of hackathons as only one step of the road in a series of events in your software development and community building. To deem your hackathon a success, you must be prepared to engage in post-event activities.
- Communicating your results: Don't forget to communicate hackathon outcomes internally and externally. Demonstrate the ownership the community members gained during the hackathon to grow trust in your community and project.
- Building community: Lean on your hackathon participants for future community activity.
- Putting together the retrospective: What went well, what went terrible, what was meh, what surprised you? This analysis is how you grow, change, and iterate. Don't forget to do a blameless retro as soon as possible so it is all fresh in your mind.
### Wrap up
If you started reading this article thinking that hackathons aren't that hard to pull off, I'm sorry to have burst your bubble! And although I sincerely believe hackathons are a great way to engage and communicate with your community on so many levels, having just the intention does not guarantee the results.
For a hackathon to be successful, you need to be meticulous and prepared to invest significant resources and effort to plan and execute it properly.
Thank you for reading, and I hope this checklist helps you successfully organize your next hackathon!
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/hackathon-guide
作者:[Tiffany Long][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/tiffany-long
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/23/2/hackathon-guide#set-your-goals
[2]: https://opensource.com/article/23/2/hackathon-guide#why-are-you-doing-this
[3]: https://opensource.com/article/23/2/hackathon-guide#who-is-your-audience
[4]: https://opensource.com/article/23/2/hackathon-guide#how-are-you-measuring-goals
[5]: https://opensource.com/article/23/2/hackathon-guide#decide-on-in-person-vs-virtual
[6]: https://opensource.com/article/23/2/hackathon-guide#build-your-communication-strategy
[7]: https://opensource.com/article/23/2/hackathon-guide#decide-on-the-prizes
[8]: https://opensource.com/article/23/2/hackathon-guide#swag-it-up
[9]: https://opensource.com/article/23/2/hackathon-guide#get-the-word-out
[10]: https://opensource.com/article/23/2/hackathon-guide#managing-the-long-tail
[11]: https://opensource.com/downloads/hackathon-guide
[12]: https://traefik.io/blog/announcing-traefik-proxy-3-0-hackaethon/
[13]: https://traefik.io/blog/announcing-the-inaugural-traefik-hackaethon-2020-in-october/
[14]: https://www.youtube.com/watch?v=9VZCD9TirCg&list=PLxhvVyxYRvibM_KJBPtPsfEcjnP5oGS8H
[15]: https://opensource.com/article/20/8/virtual-hackathon
[16]: https://opensource.com/alternatives/slack
[17]: https://opensource.com/article/21/9/alternatives-zoom
[18]: https://www.isothermal.edu/about/assessment/assets/rubric-present.pdf
[19]: https://hacktoberfest.com/

View File

@ -1,119 +0,0 @@
[#]: subject: (Try quantum computing with this open source software development kit)
[#]: via: (https://opensource.com/article/21/6/qiskit)
[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
[#]: collector: (lujun9972)
[#]: translator: (cool-summer-021)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Try quantum computing with this open source software development kit
======
Qiskit is an open source software development kit for accessing quantum
simulators and hardware for free.
![Tips and gears turning][1]
Classical computing is based on bits. Zeros and ones. This isn't because there's some inherent advantage to a binary logic system over logic systems with more states—or even over analog computers. But on-off switches are easy to make and, with modern semiconductor technology, we can make them very small and very cheap.
But they're not without limits. Some problems just can't be efficiently solved by a classical computer. These tend to be problems where the cost, in time or memory, increases exponentially with the scale (`n`) of the problem. We say such problems are `O(2n)` in [Big O notation][2].
Much of modern cryptography even depends on this characteristic. Multiplying two, even large, prime numbers together is fairly cheap computationally (`O(n2)`). But reversing the operation takes exponential time. Use large enough numbers, and decryption that depends on such a factoring attack is infeasible.
### Enter quantum
A detailed primer on the mathematical and quantum mechanical underpinnings of quantum computing is beyond the scope of this article. However, here are some basics.
A quantum computer replaces bits with [qubits][3]—controllable units of computing that display quantum properties. Qubits are typically made out of either an engineered superconducting component or a naturally occurring quantum object such as an electron. Qubits can be placed into a "superposition" state that is a complex combination of the 0 and 1 states. You sometimes hear that qubits are _both_ 0 and 1, but that's not really accurate. What is true is that, when a measurement is made, the qubit state will collapse into a 0 or 1. Mathematically, the (unmeasured) quantum state of the qubit is a point on a geometric representation called the [Bloch sphere][4].
While superposition is a novel property for anyone used to classical computing, one qubit by itself isn't very interesting. The next unique quantum computational property is "interference." Real quantum computers are essentially statistical in nature. Quantum algorithms encode an interference pattern that increases the probability of measuring a state encoding the solution.
While novel, superposition and interference do have some analogs in the physical world. The quantum mechanical property "entanglement" doesn't, and it's the real key to exponential quantum speedups. With entanglement, measurements on one particle can affect the outcome of subsequent measurements on any entangled particles—even ones not physically connected.
### What can quantum do?
Today's quantum computers are quite small in terms of the number of qubits they contain—tens to hundreds. Thus, while algorithms are actively being developed, the hardware needed to run them faster than their classical equivalents doesn't exist.
But there's considerable interest in quantum computing in many fields. For example, quantum computers may offer a good way to simulate natural quantum systems, like molecules, whose complexity rapidly exceeds the ability of classical computers to model them accurately. Quantum computing is also tied mathematically to linear algebra, which underpins machine learning and many other modern optimization problems. Therefore, it's reasonable to think quantum computing could be a good fit there as well.
One commonly cited example of an existing quantum algorithm likely to outperform classical algorithms is [Shor's algorithm][5], which can do the factoring mentioned earlier. Invented by MIT mathematician Peter Shor in 1994, quantum computers can't yet run the algorithm on larger than trivially sized problems. But it's been demonstrated to work in polynomial `O(n3)` time rather than the exponential time required by classical algorithms.
### Getting started with Qiskit
At this point, you may be thinking: "But I don't have a quantum computer, and I really like to get hands-on. Is there any hope?"
Enter an open source (Apache 2.0 licensed) project called [Qiskit][6]. It's a software development kit (SDK) for accessing both the quantum computing simulators and the actual quantum hardware (for free) in the IBM Quantum Experience. You just need to sign up for an API key.
Certainly, a deep dive into Qiskit, to say nothing of the related linear algebra, is far beyond what I can get into here. If you seek such a dive, there are [many free resources online][7], including a complete textbook. However, dipping a toe in the water is straightforward, requiring only some surface-level knowledge of Python and Jupyter Notebooks.
To give you a taste, let's do a "Hello, World!" program entirely within the [Qiskit textbook][8].
Begin by installing some tools and widgets specific to the textbook:
```
`pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src`
```
Next, do the imports:
```
from qiskit import QuantumCircuit, assemble, Aer
from math import pi, sqrt
from qiskit.visualization import plot_bloch_multivector, plot_histogram
```
Aer is the local simulator. Qiskit consists of four components: **Aer**, the **Terra** foundation, **Ignis** for dealing with noise and errors on real quantum systems, and **Aqua** for algorithm development.
```
# Let's do an X-gate on a |0&gt; qubit
qc = QuantumCircuit(1)
qc.x(0)
qc.draw()
```
An **X-gate** in quantum computing is similar to a **Not gate** in classical computing, although the underlying math actually involves matrix multiplication. (It is, in fact, often called a **NOT-gate**.)
Now, run it and do a measurement. The result is as you would expect because the qubit was initialized in a `|0>` state, then inverted, and measured. (Use `|0>` and `|1>` to distinguish from classic bits.)
```
# Let's see the result
svsim = Aer.get_backend('statevector_simulator')
qobj = assemble(qc)
state = svsim.run(qobj).result().get_statevector()
plot_bloch_multivector(state)
```
![Bloch sphere showing the expected result][9]
Bloch sphere showing the expected result. (Gordon Haff, [CC-BY-SA 4.0][10])
### Conclusion
In some respects, you can think of quantum computing as a sort of exotic co-processor for classical computers in the same manner as graphics processing units (GPUs) and field-programmable gate arrays (FPGAs). One difference is that quantum computers will be accessed almost entirely as network resources for the foreseeable future. Another is that they work fundamentally differently, which makes them unlike most other accelerators you might be familiar with. That's why there's so much interest in algorithm development and significant resources going in to determine where and when quantum fits best. It wouldn't hurt to see what all the fuss is about.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/qiskit
作者:[Gordon Haff][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ghaff
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning)
[2]: https://en.wikipedia.org/wiki/Big_O_notation
[3]: https://en.wikipedia.org/wiki/Qubit
[4]: https://en.wikipedia.org/wiki/Bloch_sphere
[5]: https://en.wikipedia.org/wiki/Shor%27s_algorithm
[6]: https://qiskit.org/
[7]: https://qiskit.org/learn
[8]: https://qiskit.org/textbook/preface.html
[9]: https://opensource.com/sites/default/files/uploads/bloch-sphere.png (Bloch sphere showing the expected result)
[10]: https://creativecommons.org/licenses/by-sa/4.0/

View File

@ -2,7 +2,7 @@
[#]: via: "https://news.itsfoss.com/kde-connect-ios/" [#]: via: "https://news.itsfoss.com/kde-connect-ios/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: " " [#]: translator: "XiaotingHuang22"
[#]: reviewer: " " [#]: reviewer: " "
[#]: publisher: " " [#]: publisher: " "
[#]: url: " " [#]: url: " "

View File

@ -1,98 +0,0 @@
[#]: subject: "How to Install MATE Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/mate-desktop-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install MATE Desktop in Arch Linux [Complete Guide]
======
**This guide explains the steps you need to install MATE Desktop in Arch Linux.**
This guide has two parts. The first part deals with installing the base Arch system. The second part is installing the complete MATE desktop environment on top of Arch Linux.
This article tested in the following versions: MATE 1.24, and MATE 1.26.
### What is the MATE Desktop?
When the GNOME desktop changed its direction from GNOME 2 to GNOME 3 by changing the user interaction and interface, the MATE desktop continued the older/Legacy GNOME 2 development. So, the MATE desktop environment continues the GNOME 2 desktop, which preserved the traditional desktop experience in Linux. It is fast and low on memory consumption. In my opinion, one of the underrated desktop environments which need more love!
The MATE team continued development as it is one of the popular GNOME 2 based desktop while supporting newer technologies. You can learn more on its [official website][1].
### Install MATE Desktop in Arch Linux
#### Part 1: Install Arch Linux
If you already have Arch Linux installed, you can skip this step and directly go to the [installation of MATE Desktop section below][2].
For a quick Arch Linux installation, follow this automated archinstall guide which is super easy to follow. And once installed, continue to Part 2.
#### Part 2: Install MATE Desktop in Arch Linux
After reboot, choose Arch Linux from grub. In the Arch Linux prompt, start running the following commands in sequence. These commands install the Xorg server, display manager, MATE desktop components, controller packages, and additional applications.
For all the commands, use default, i.e. press enter when asked.
- **Install Xorg. Approx install size is 80 MB.**
```
sudo pacman -S --needed xorg
```
- **Install display manager, and MATE desktop components. Approx install size is 380 MB.**
```
sudo pacman -S --needed mate mate-extra ttf-freefont lightdm lightdm-gtk-greeter
```
![Installing MATE Packages][3]
- **Install applications**
This is just a reference. You can also install the ones you require.
```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
```
Now its time to enable the display manager and network manager as a service. So that the next time you log on, they can run automatically by systemd.
```
systemctl enable lightdm
systemctl enable NetworkManager
```
Reboot the system using the reboot command.
```
reboot
```
You should see a login prompt on the MATE desktop if all goes well.
And you can now log in using the user ID and password which you just created. A superfast and legacy MATE Desktop would welcome you.
![MATE Desktop in Arch Linux][4]
I hope this guide helps you create your own Arch Linux environment with a legacy MATE desktop from scratch. Please let me know if you run into trouble using the comment box below.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/mate-desktop-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://mate-desktop.org/
[2]: https://www.debugpoint.com/archinstall-guide/
[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Installing-MATE-Packages.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/MATE-Desktop-in-Arch-Linux-1.jpg

View File

@ -2,7 +2,7 @@
[#]: via: "https://itsfoss.com/use-htop/" [#]: via: "https://itsfoss.com/use-htop/"
[#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/" [#]: author: "Sagar Sharma https://itsfoss.com/author/sagar/"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: " " [#]: translator: "perfiffer"
[#]: reviewer: " " [#]: reviewer: " "
[#]: publisher: " " [#]: publisher: " "
[#]: url: " " [#]: url: " "

View File

@ -1,144 +0,0 @@
[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu"
[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/"
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu
======
If you use a PPA or add an external repository in Ubuntu 22.04 and later versions, chances are that you will see a message like this:
```
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
```
![ubuntu key is stored legacy][1]
First thing first. It is not an error, it is a warning message. A warning does not stop the procedure. You can continue upgrading your system even if you see this warning message during an update.
If you dont like seeing the warning message, you can take some manual steps to get rid of it.
There are two ways; the proper way and the quick and dirty way. Read both methods and see which one you feel comfortable with.
### Method 1: Import the key [Proper but complicated way]
First, list all the GPG keys added to your system.
```
sudo apt-key list
```
This will show a huge list of keys stored in your system. What you have to do here is to look for the keys associated with the warning message.
```
[email protected]:~$ sudo apt-key list
[sudo] password for abhishek:
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
uid [ expired] packagecloud ops (production key) <[email protected]>
pub rsa4096 2016-02-18 [SCEA]
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
sub rsa4096 2016-02-18 [SEA]
/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg
----------------------------------------------------
pub rsa4096 2015-08-30 [SC]
42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F
uid [ unknown] Launchpad PPA for Team audio-recorder
/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg
-------------------------------------------------------------------
pub rsa1024 2010-10-08 [SC]
59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03
```
How do you do that? Read the message carefully.
```
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy
```
In my case, the repository has keywords like packagecloud, slacktechnologies. It is shown at the top of the apt-key list output. You may have to scroll a bit in your case.
In this rare case, the external repository added by Slack, has two GPG keys. One of them is expired and Ill ignore it. You may not have such a situation.
You should the last 8 characters (excluding the space) under the line after pub.
```
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
uid [ expired] packagecloud ops (production key) <[email protected]>
pub rsa4096 2016-02-18 [SCEA]
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
```
So from the line “DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD”, Ill take the last 8 characters “0386 51BD”, remove the space and then use it to import the GPG key in its dedicated file under the /etc/apt/trusted.gpg.d directory:
```
sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg
```
I created a new file slack.gpg here, in case you didnt notice it. I named it slack.gpg because it is associated with Slack application I installed earlier. The filename does not matter but its good for identification.
If the command runs successfully, you wont see any message. You can verify that by checking if the newly created gpg file exists or not.
![import gpg key to trusted ubuntu][2]
Run the update again and now you should not see the warning message anymore.
### Method 2: Copy to the trusted.gpd.d directory [Quick and dirty way]
If you dont feel comfortable doing all the above stuff manually, well, you can ignore the warning message. I mean, ignoring it is always an option.
Another option is to copy the /etc/apt/trusted.gpg file to /etc/apt/trusted.gpg.d directory. After all, Ubuntu only complains that it needs the GPG keys in /etc/apt/trusted.gpg.d directory.
Youll still have to use the terminal. Open it and use the following command:
```
sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
```
Now, if you run the update, you wont see the “Key is stored in legacy trusted.gpg keyring” warning message anymore.
![quick dirty way to fix apt key stored legacy][3]
### Conclusion
I have written a detailed article on [apt-key deprecation][4]. Apparently, that article had some readers confused and hence I wrote this one to give them direct steps for getting rid of the message.
As I said before, it is a warning message and can be ignored for now. The onus to fix this issue lies on the external software developers and Ubuntu developers. The external software developers should make sure that their GPG keys are no longer added in the /etc/apt/trusted.gpg file.
The end users should not take the pain for their laziness.
So, which method did you use to get rid of the key is stored in legacy warning message? The first one or the second one?
--------------------------------------------------------------------------------
via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/11/ubuntu-key-is-stored-legacy.png
[2]: https://itsfoss.com/wp-content/uploads/2022/11/import-gpg-key-to-trusted-ubuntu.png
[3]: https://itsfoss.com/wp-content/uploads/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png
[4]: https://itsfoss.com/apt-key-deprecated/

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/22/11/react-timeline-planby" [#]: via: "https://opensource.com/article/22/11/react-timeline-planby"
[#]: author: "Karol Kozer https://opensource.com/users/karolkozer" [#]: author: "Karol Kozer https://opensource.com/users/karolkozer"
[#]: collector: "lkxed" [#]: collector: "lkxed"
[#]: translator: " " [#]: translator: "geekpi"
[#]: reviewer: " " [#]: reviewer: " "
[#]: publisher: " " [#]: publisher: " "
[#]: url: " " [#]: url: " "

View File

@ -1,117 +0,0 @@
[#]: subject: "Elementary OS 7 Installation Guide with Screenshots"
[#]: via: "https://www.linuxtechi.com/elementary-os-7-installation-guide/"
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Elementary OS 7 Installation Guide with Screenshots
======
Hello techies, in this post, we will cover how to Install Elementary OS 7 step by step with screenshots on laptop or desktop. It is based on latest and stable Ubuntu 22.04 LTS.
Elementary OS 7 with code name “Horus” released with lot of improvements like :
- Improved AppCenter and install all application that one need.
- Improved sideloading and alt store (Flathub) experience
- Latest GNOME Web 43 support for creating web apps.
- Getting OS and Applicate Updates quickly
- Power Profile Management
- Improvement in App Description
##### System Requirements for Elementary OS 7
- Dual Core 64-bit processor
- 4 GB RAM or more
- 32 GB hard disk
- Internet Access
- Bootable USB Flash Drive ( 4 GB Storage)
Without any further delay, lets jump into the installation steps
### 1) Download Elementary OS 7
Use below official URL to download ISO file,
- Download Elementary OS 7 ISO
Once ISO file is downloaded then burn it into USB flash drive and make it bootable.
On Windows operating use “Rufus” software to make bootable USB drive using ISO file. In Linux, refer the following URL:
- How to Create Bootable USB Drive on Ubuntu / Linux Mint
### 2) Boot the system with bootable media
Now boot the target system with bootable USB drive. From bios settings change the boot medium from hard disk to USB. When the system boots up with USB drive then we will get the following screen,
### 3) Select Language for Installation
Choose your preferred language and then click select,
### 4) Choose Keyboard Layout
In this step, you will be requested to choose keyboard layout and then click on Select
### 5) Try or Install elementary OS
We will be presented the beneath screen, where we must our choose installation type. It gives us following options,
- Try Demo Mode Try Elementary OS 7 without installing
- Erase disk and Install Installer will erase the whole disk and will create required partitions automatically.
- Custom Install (Advanced) It will give us the option to create custom partitions.
In this post, I will go with the 2nd option (Erase disk and install).
Click on “Erase Disk and Install”
In the following screen, select the drive on which OS will be installed and then click on “Erase and Install”
If you want to encrypt the devices drive, then click on “Choose Password” else click on “Dont Encrypt”.
### 6) Installation Progress
As we can see below, installation got started and is in progress.
Once the installation is completed, installer will prompt to reboot the system.
Click on “Restart Device” and dont forget to change boot medium from bios settings so that it boots up with the disk.
### 7) Create Local User and Set Hostname
When the system boots up after the installation, you will be prompted to enter local user details and hostname of your system.
Specify the details as per your requirement,
Click on “Finish Setup”.
In the following screen, you will be prompted to enter your local user credentials that you have created above,
After entering the credentials, hit enter
### 8) Elementary OS 7 Welcome Screen
We will get the beneath welcome screen,
Choose “Skip All”
Click “Get Started” and then we will get following desktop screen,
Great, it confirms that you have successfully installed Elementary OS 7 on your system. Thats all from this guide, explore this exciting Linux distribution and have fun 😊.
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/elementary-os-7-installation-guide/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lkxed

View File

@ -1,153 +0,0 @@
[#]: subject: "Learn Tcl by writing a simple game"
[#]: via: "https://opensource.com/article/23/2/learn-tcl-writing-simple-game"
[#]: author: "James Farrell https://opensource.com/users/jamesf"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Learn Tcl by writing a simple game
======
My path to Tcl started with a recent need to automate a difficult Java-based command-line configuration utility. I do a bit of automation programming using Ansible, and I occasionally use the expect module. Frankly, I find this module has limited utility for a number of reasons including: difficulty with sequencing identical prompts, capturing values for use in additional steps, limited flexibility with control logic, and so on. Sometimes you can get away with using the shell module instead. But sometimes you hit that ill-behaving and overly complicated command-line interface that seems impossible to automate.
In my case, I was automating the installation of one of my company's programs. The last configuration step could only be done through the command-line, through several ill-formed, repeating prompts and data output that needed capturing. The good old traditional Expect was the only answer. A deep understanding of Tcl is not necessary to use the basics of Expect, but the more you know, the more power you can get from it. This is a topic for a follow-up article. For now, I explore the basic language constructs of Tcl, which include user input, output, variables, conditional evaluation, looping, and simple functions.
### Install Tcl
On a Linux system, I use this:
```
# dnf install tcl
# which tclsh
/bin/tclsh
```
On macOS, you can use [Homebrew][1]to install the latest Tcl:
```
$ brew install tcl-tk
$ which tclsh
/usr/local/bin/tclsh
```
### Guess the number in Tcl
Start by creating the basic executable script `numgame.tcl`:
```
$ touch numgame.tcl
$ chmod 755 numgame.tcl
```
And then start coding in your file headed up by the usual shebang script header:
```
#!/usr/bin/tclsh
```
Here are a few quick words about artifacts of Tcl to track along with this article.
The first point is that all of Tcl is considered a series of strings. Variables are generally treated as strings but can switch types and internal representations automatically (something you generally have no visibility into). Functions may interpret their string arguments as numbers ( `expr`) and are only passed in by value. Strings are usually delineated using double quotes or curly braces. Double quotes allow for variable expansion and escape sequences, and curly braces impose no expansion at all.
The next point is that Tcl statements can be separated by semicolons but usually are not. Statement lines can be split using the backslash character. However, it's typical to enclose multiline statements within curly braces to avoid needing this. Curly braces are just simpler, and the code formatting below reflects this. Curly braces allow for deferred evaluation of strings. A value is passed to a function before Tcl does variable substitution.
Finally, Tcl uses square brackets for command substitution. Anything between the square brackets is sent to a new recursive invocation of the Tcl interpreter for evaluation. This is handy for calling functions in the middle of expressions or for generating parameters for functions.
### Procedures
Although not necessary for this game, I start with an example of defining a function in Tcl that you can use later:
```
proc used_time {start} {
return [expr [clock seconds] - $start]
}
```
Using `proc` sets this up to be a function (or procedure) definition. Next comes the name of the function. This is then followed by a list containing the parameters; in this case 1 parameter `{start}` and then followed by the function body. Note that the body curly brace starts on this line, it cannot be on the following line. The function returns a value. The returned value is a compound evaluation (square braces) that starts by reading the system clock `[clock seconds]` and does the math to subtract out the `$start` parameter.
### Setup, logic, and finish
You can add more details to the rest of this game with some initial setup, iterating over the player's guesses, and then printing results when completed:
```
set num [expr round(rand()*100)]
set starttime [clock seconds]
set guess -1
set count 0
puts "Guess a number between 1 and 100"
while { $guess != $num } {
incr count
puts -nonewline "==> "
flush stdout
gets stdin guess
if { $guess < $num } {
puts "Too small, try again"
} elseif { $guess > $num } {
puts "Too large, try again"
} else {
puts "That's right!"
}
}
set used [used_time $starttime]
puts "You guessed value $num after $count tries and $used elapsed seconds"
```
The first `set` statements establish variables. The first two evaluate expressions to discern a random number between 1 and 100, and the next one saves the system clock start time.
The `puts` and `gets` command are used for output to and input from the player. The `puts` I've used imply standard out for output. The `gets` needs the input channel to be defined, so this code specifies `stdin` as the source for terminal input from the user.
The `flush stdout` command is needed when `puts` omits the end-of-line termination because Tcl buffers output and it might not get displayed before the next I/O is needed.
From there the `while` statement illustrates the looping control structure and conditional logic needed to give the player feedback and eventually end the loop.
The final `set` command calls our function to calculate elapsed seconds for gameplay, followed by the collected stats to end the game.
### Play it!
```
$ ./numgame.tcl
Guess a number between 1 and 100
==> 100
Too large, try again
==> 50
Too large, try again
==> 25
Too large, try again
==> 12
Too large, try again
==> 6
Too large, try again
==> 3
That's right!
You guessed value 3 after 6 tries and 20 elapsed seconds
```
### Continue learning
When I started this exercise, I doubted just how useful going back to a late 1990s fad language would be to me. Along the way, I found a few things about Tcl that I really enjoyed — my favorite being the square bracket command evaluation. It just seems so much easier to read and use than many other languages that overuse complicated closure structures. What I thought was a [dead language][2] was actually still thriving and supported on several platforms. I learned a few new skills and grew an appreciation for this venerable language.
Check out the official site over at [https://www.tcl-lang.org][3]. You can find references to the latest source, binary distributions, forums, docs, and information on conferences that are still ongoing.
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/learn-tcl-writing-simple-game
作者:[James Farrell][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/20/6/homebrew-mac
[2]: https://opensource.com/article/19/6/favorite-dead-language
[3]: https://www.tcl-lang.org

View File

@ -1,104 +0,0 @@
[#]: subject: "Start developing for WebAssembly with our new guide"
[#]: via: "https://opensource.com/article/23/2/webassembly-guide"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Start developing for WebAssembly with our new guide
======
Over the past few decades, the web browser has endured as the most popular cross-platform application. Looking at the browser from a different angle, it is one of the most popular platforms for application delivery. Think of all the websites you use that take the place of activities you used to do with software running on your desktop. You're still using software, but you're accessing it through a browser, and it's running on somebody else's Linux server. In the eternal effort to optimize the software we all use, the world of software development introduced WebAssembly back in 2019 as a way to run compiled code through a web browser. Application performance is better than ever, and the options for coding go far beyond the usual list of PHP, Python, and JavaScript.
### A target and a language
One of the powerful but also most confusing things about WebAssembly is that the term "webassembly" refers to both a language and a target. WebAssembly is an assembly language, but not many people choose to write code directly in assembly. Even the assembly language is ultimately converted to a binary format, which is what a computer requires to run code. This binary format is also called WebAssembly. This is good, though, because it means that you can use your choice of languages to write something that's ultimately delivered in WebAssembly, including C, C++, Rust, Javascript, and many others.
The gateway into WebAssembly is Emscripten, an LLVM compiler toolchain that produces WebAssembly from your code.
### Install Emscripten
To install Emscripten on your Linux or macOS computer, use Git:
```
$ git clone \
https://github.com/emscripten-core/emsdk.git
```
Change directory into the `emsdk` directory and run the install command:
```
$ ./emsdk install latest
$ ./emsdk activate latest
```
Everything in the Emscripten toolchain is installed within the `emsdk` directory and has no effect on the rest of your system. For this reason, before you use `emsdk`, you must source its environment:
```
$ source ./emsdk_env.sh
```
If you plan on using `emsdk` often, you can also source its environment setup script in `.bashrc`.
To install Emscripten on Windows, you can run Linux in the WSL environment.
Visit the [Emscripten website][1] for more information on installation.
### Hello world
Here's a simple "hello world" application in written in C++.
```
#include <iostream>
using namespace std;
int main() {
cout << "Hello world";
return 0;
}
```
Test it as a standard binary for your system first:
```
$ g++ hello.cpp -o world
$ ./world
Hello world
```
Seeing that it works as expected, use `emcc` to build it as WebAssembly:
```
$ emcc hello.cpp -o world.html
```
Finally, run it with `emrun`:
```
$ emrun ./world.html
```
The `emrun` utility is a convenience command for local testing. When you host your application on a server, `emrun` isn't necessary.
### Learning more about WebAssembly
Developing for WebAssembly can go in many different directions, depending on what you already know and what you're trying to build. If you know C or C++, then you can write your project using those. If you're learning Rust, then you can use Rust. Even Python code can use the Pyodide module to run as WebAssembly. You have lots of options, and there's no wrong way to start (there's even a COBOL-to-WebAssembly compiler). If you're keen to get started with WebAssembly, [download our complimentary eBook][2].
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/webassembly-guide
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed/
[1]: https://emscripten.org/
[2]: https://opensource.com/downloads/webassembly-ebook

View File

@ -1,168 +0,0 @@
[#]: subject: "How to Install DOSBox in Ubuntu to Play Old Games"
[#]: via: "https://www.debugpoint.com/install-dosbox-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "gpchn"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install DOSBox in Ubuntu to Play Old Games
======
**Learn how to install DOSBox in Ubuntu and configure it to play old DOS games.**
DOSBox is a free and open-source operating system emulator that can run inside modern Linux systems. It has several components which emulate older hardware so that ancient programs and games can run.
All these make it possible to enjoy the older games and applications in modern Linux distributions.
In this guide, I will show you how to install DOSBox, configure it and play a sample game.
### Install DOSBox in Ubuntu
The main package of DOSBox is available in all the major repo of Linux distributions.
For Ubuntu, Debian, Linux Mint and related distributions use the following command to install it:
```
sudo apt install dosbox
```
For Fedora, CentOS, RHEL and related distributions use the following:
```
sudo dnf install dosbox
```
Arch Linux users, use the following command to install it.
```
pacman -S --needed dosbox
```
That will conclude the installation. Now its time to configure and run.
### Running DOSBox
After installation, type the following from the terminal.
```
dosbox
```
It will show you the following screen showing the DOSBox prompt. This first-time run is essential because it creates the DOSBox configuration file.
Type `exit` to close DOSBox for now.
![DOSBox first time run][1]
The configuration file gives you several options to tweak settings. The file is created at your home directory path `~/.dosbox/dosbox-[version].conf` for Ubuntu.
For fedora, it loads the staging config file from this path`~/.config/dosbox/dosbox-staging.conf`.
By default, you can keep the configuration unchanged. However, if you want, you can change it.
For example, if you want to start DOSBox fullscreen, you can enable and disable the switch. Heres a sample:
```
fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=100
waitonerror=true
```
You can find all the settings in the official [documentation][2].
### Download old games and run
There are many websites which provide old DOS games. I have used the following website, which provides a fair set of old games which can be played in the modern system.
So, visit the following page and download any game you want.
[Download DOS games][3]
Create a directory in your /home folder and name it dosbox.
```
cd ~mkdir dosbox
```
Now, extract the game which you downloaded (it should be a .exe file) and create a separate folder inside `~/dosbox`.
For example, I downloaded the game “Mario & Luigi (1994)”. And I created a folder called “mario” inside the “dosbox” folder. And placed the game file inside it.
![Keep the game in a separate folder][4]
Now launch dosbox from the terminal.
```
dosbox
```
And type the following to mount the game in a virtual C: drive.
```
mount c ~/dosbox/mario
```
After the above command is complete, change the drive to C:.
```
c:
```
And now, you can type the games file name to run the game.
```
mario
```
![Running the game][5]
![Mario running in DOSBox in Ubuntu][6]
### Keyboard or controller mapping
By default, DOSBox should detect the keyboard or any controller you may have plugged in. However, if you want to change game keybindings, you can run the below command from the terminal.
```
dosbox -startmapper
```
It will give you the following screen with the events tagged to each key. You can click on any key and change it according to your taste.
![DOSBox keyboard and controller mapping][7]
### Conclusion
I hope you managed to run your favourite dos game after installing dosbox in Ubuntu and other distros. DOSBox is one of the coolest pieces of software you can use to run any program, such as [Turbo C][8] and others.
If you have any trouble or questions, let me know in the comment box.
Enjoy!
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-dosbox-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBox-first-time-run.jpg
[2]: https://www.dosbox.com/wiki/Dosbox.conf#Sections
[3]: https://archive.org/details/softwarelibrary_msdos_games?tab=collection
[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/Keep-the-game-in-a-separate-folder.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-the-game.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/Mario-playing-in-DOSBox-in-Ubuntu.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBOox-keyboard-and-controller-mapping.jpg
[8]: https://www.debugpoint.com/setting-up-dosbox-in-ubuntu-to-run-turbo-c/

View File

@ -0,0 +1,251 @@
[#]: subject: "Learn Expect by writing and automating a simple game"
[#]: via: "https://opensource.com/article/23/2/learn-expect-automate-simple-game"
[#]: author: "James Farrell https://opensource.com/users/jamesf"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Learn Expect by writing and automating a simple game
======
While trying to automate my workflow, I hit upon a configuration utility that defied meaningful automation. It was a Java process that didn't support a silent installer, or support `stdin`, and had an inconsistent set of prompts. Ansible's `expect` module was inadequate for this task. But I found that the `expect` command was just the tool for the job.
My journey to learn Expect meant [learning a bit of Tcl][1]. Now that I have the background to create simple programs, I can better learn to program in Expect. I thought it would be fun to write an article that demonstrates the cool functionality of this venerable utility.
This article goes beyond the typical simple game format. I plan to use parts of Expect to create the game itself. Then I demonstrate the real power of Expect with a separate script to automate playing the game.
This programming exercise shows several classic programming examples of variables, input, output, conditional evaluation, and loops.
### Install Expect
For Linux based systems use:
```
$ sudo dnf install expect
$ which expect
/bin/expect
```
I found that my version of Expect was included in the base operating system of macOS:
```
$ which expect
/usr/bin/expect
```
On macOS, you can also load a slightly newer version using brew:
```
$ brew install expect
$ which expect
/usr/local/bin/expect
```
### Guess the number in Expect
The number guessing game using Expect is not that different from the base Tcl I used in my [previous article][1].
All things in Tcl are strings, including variable values. Code lines are best contained by curly braces (Instead of trying to use line continuation). Square brackets are used for command substitution. Command substitution is useful for deriving values from other functions. It can be used directly as input where needed. You can see all of this in the subsequent script.
Create a new game file `numgame.exp`, set it to be executable, and then enter the script below:
```
#!/usr/bin/expect
proc used_time {start} {
return [expr [clock seconds] - $start]
}
set num [expr round(rand()*100)]
set starttime [clock seconds]
set guess -1
set count 0
send "Guess a number between 1 and 100\n"
while { $guess != $num } {
incr count
send "==> "
expect {
-re "^(\[0-9]+)\n" {
send "Read in: $expect_out(1,string)\n"
set guess $expect_out(1,string)
}
-re "^(.*)\n" {
send "Invalid entry: $expect_out(1,string) "
}
}
if { $guess < $num } {
send "Too small, try again\n"
} elseif { $guess > $num } {
send "Too large, try again\n"
} else {
send "That's right!\n"
}
}
set used [used_time $starttime]
send "You guessed value $num after $count tries and $used elapsed seconds\n"
```
Using `proc` sets up a function (or procedure) definition. This consists of the name of the function, followed by a list containing the parameters (1 parameter `{start}`) and then followed by the function body. The return statement shows a good example of nested Tcl command substitution. The `set` statements define variables. The first two use command substitution to store a random number and the current system time in seconds.
The `while` loop and if-elseif-else logic should be familiar. Note again the particular placement of the curly braces to help group multiple command strings together without needing line continuation.
The big difference you see here (from the previous Tcl program) is the use of the functions `expect` and `send` rather than using `puts` and `gets`. Using `expect` and `send` form the core of Expect program automation. In this case, you use these functions to automate a human at a terminal. Later you can automate a real program. Using the `send` command in this context isn't much more than printing information to screen. The `expect` command is a bit more complex.
The `expect` command can take a few different forms depending on the complexity of your processing needs. The typical use consists of one of more pattern-action pairs such as:
```
expect "pattern1" {action1} "pattern2" {action2}
```
More complex needs can place multiple pattern action pairs within curly braces optionally prefixed with options that alter the processing logic. The form I used above encapsulates multiple pattern-action pairs. It uses the option `-re` to apply regex processing (instead of glob processing) to the pattern. It follows this with curly braces encapsulating one or more statements to execute. I've defined two patterns above. The first is Is intended to match a string of 1 or more numbers:
```
"^(\[0-9]+)\n"
```
The second pattern is designed to match anything else that is not a string of numbers:
```
"^(.*)\n"
```
Take note that this use of `expect` is executed repeatedly from within a `while` statement. This is a perfectly valid approach to reading multiple entries. In the automation, I show a slight variation of Expect that does the iteration for you.
Finally, the `$expect_out` variable is an array used by `expect` to hold the results of its processing. In this case, the variable `$expect_out(1,string)` holds the first captured pattern of the regex.
### Run the game
There should be no surprises here:
```
$ ./numgame.exp
Guess a number between 1 and 100
==> Too small, try again
==> 100
Read in: 100
Too large, try again
==> 50
Read in: 50
Too small, try again
==> 75
Read in: 75
Too small, try again
==> 85
Read in: 85
Too large, try again
==> 80
Read in: 80
Too small, try again
==> 82
Read in: 82
That's right!
You guessed value 82 after 8 tries and 43 elapsed seconds
```
One difference you may notice is the impatiencethis version exhibits. If you hesitate long enough, expect timeouts with an invalid entry. It then prompts you again. This is different from `gets` which waits indefinitely. The `expect` timeout is a configurable feature. It helps deal with hung programs or during an unexpected output.
### Automate the game in Expect
For this example, the Expect automation script needs to be in the same folder as your `numgame.exp` script. Create the `automate.exp` file, make it executable, open your editor, and enter the following:
```
#!/usr/bin/expect
spawn ./numgame.exp
set guess [expr round(rand()*100)]
set min 0
set max 100
puts "I'm starting to guess using the number $guess"
expect {
-re "==> " {
send "$guess\n"
expect {
"Too small" {
set min $guess
set guess [expr ($max+$min)/2]
}
"Too large" {
set max $guess
set guess [expr ($max+$min)/2]
}
-re "value (\[0-9]+) after (\[0-9]+) tries and (\[0-9]+)" {
set tries $expect_out(2,string)
set secs $expect_out(3,string)
}
}
exp_continue
}
"elapsed seconds"
}
puts "I finished your game in about $secs seconds using $tries tries"
```
The `spawn` function executes the program you want to automate. It takes the command as separate strings followed by the arguments to pass to it. I set the initial number to guess, and the real fun begins. The `expect` statement is considerably more complicated and illustrates the power of this utility. Note that there is no looping statement here to iterate over the prompts. Because my game has predictable prompts, I can ask `expect`to do a little more processing for me. The outer `expect` attempts to match the game input prompt of `==>` . Seeing that, it uses `send` to guess and then uses an additional `expect` to figure out the results of the guess. Depending on the output, variables are adjusted and calculated to set up the next guess. When the prompt `==>` is matched, the `exp_continue` statement is invoked. That causes the outer `expect` to be re-evaluated. So a loop here is no longer needed.
This input processing relies on another behavior of Expect's processing. Expect buffers the terminal output until it matches a pattern. This buffering includes any embedded end of line and other unprintable characters. This is different than the typical regex line matching you are used to with Awk and Perl. When a pattern is matched, anything coming after the match remains in the buffer. It's made available for the next match attempt. I've exploited this to cleanly end the outer `expect` statement:
```
-re "value (\[0-9]+) after (\[0-9]+) tries and (\[0-9]+)"
```
You can see that the inner pattern matches the correct guess and does not consume all of the characters printed by the game. The very last part of the string (elapsed seconds) is still buffered after the successful guess. On the next evaluation of the outer `expect` , this string is matched from the buffer to cleanly end (no action is supplied). Now for the fun part, let's run the full automation:
```
$ ./automate.exp
spawn ./numgame.exp
I'm starting to guess with the number 99
Guess a number between 1 and 100
==> 99
Read in: 99
Too large, try again
==> 49
Read in: 49
Too small, try again
==> 74
Read in: 74
Too large, try again
==> 61
Read in: 61
Too small, try again
==> 67
Read in: 67
That's right!
You guessed value 67 after 5 tries and 0 elapsed seconds
I finished your game in about 0 seconds using 5 tries
```
Wow! My number guessing efficiency dramatically increased thanks to automation! A few trial runs resulted in anywhere from 5-8 guesses on average. It also always completed in under 1 second. Now that this pesky, time-consuming fun can be dispatched so quickly, I have no excuse to delay other more important tasks like working on my home-improvement projects :P
### Never stop learning
This article was a bit lengthy but well worth the effort. The number guessing game offered a good base for demonstrating a more interesting example of Expect processing. I learned quite a bit from the exercise and was able to complete my work automation successfully. I hope you found this programming example interesting and that it helps you to further your automation goals.
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/learn-expect-automate-simple-game
作者:[James Farrell][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/23/2/learn-tcl-writing-simple-game

View File

@ -0,0 +1,337 @@
[#]: subject: "Create a modern user interface with the Tkinter Python library"
[#]: via: "https://opensource.com/article/23/2/user-interface-tkinter-python"
[#]: author: "Patrik Dufresne https://opensource.com/users/patrik-dufresne"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Create a modern user interface with the Tkinter Python library
======
Python's Tkinter library isn't exactly known for its good looks. I've developed a library to help create a modern graphical user interface for Python.
I spent a lot of time searching for a simple but modern GUI toolkit before developing a new library called TKVue that creates graphical interfaces for desktop applications. Through my research, I realized that there were [several different libraries][1] to create graphical interfaces. However, most involve adding new dependencies to bind with graphical libraries. For example, there's a library for Qt, another for wxWidgets, and a third for GTK. None are native to Python or entirely coded in Python. That's a problem. If you want to code a GUI with Qt, it's necessary to compile the Qt source code on each platform you want to support. I wanted to target the three leading platforms: Linux, Windows, and Mac.
The big advantage of Tkinter is that it's embedded in Python. There's no need for new dependencies or to compile new libraries. Everything's already done for you.
In short, it is best to use Tkinter to create something portable.
### Tkinter with a modern theme
Creating a GUI with Tkinter is easy, but there's no denying that by default, it looks like a GUI from the 1980s. In addition to creating graphical interfaces that aren't very pleasing to the eye, the programming methodology is also from the 1980s: Programming the Tkinter graphical interface is not declarative.
Motivated by Tkinter's portability, I was determined to use it to create a professional and modern graphical interface. My research led me to discover a whole system for modifying Tkinter's appearance using [themes][2]. Tkinter themes are similar to the CSS file of a web page. They allow you to configure the appearance of the components that make up the graphical interface by declaring new styles. The creation of these styles requires some work, but the system is flexible enough to allow the creation of a modern-looking graphical interface. This work is similar to customizing a CSS theme in web development. If you create a web page without CSS, the appearance is not modern, and a lot of work is needed to improve it. This is why CSS libraries such as bootstrap are used to speed up the creation of the graphic interface.
In the Tkinter universe, there is no CSS library. Some pre-existing themes exist, but it's preferable for any project to customize the color palette to match your product branding and give it a web look-and-feel.
To achieve that, the most important element in creating a modern interface with Tkinter is changing the background color and the buttons' appearance.
Once properly personalized to your liking, the result is a clean and visually attractive graphical interface.
Here is the "default" theme:
![Default theme][3]
The "clam" theme looks like this:
![Clam theme][4]
Then with my personalization:
![Personalized theme][5]
**TKVue:**
```
import tkvue
import tkinter.ttk as ttk
tkvue.configure_tk(theme="clam")
class RootDialog(tkvue.Component):
template = """
<TopLevel title="TKVue Test" geometry="450x200">
<Frame style="default.TFrame" pack-fill="both" pack-expand="1" padding="10">
<Label text="Hello World!" style="H1.TLabel" pack-padx="25" pack-pady="25"/>
<Frame style="default.TFrame" pack-fill="both" pack-expand="1" pack-padx="10" pack-pady="10">
<Button style="default.TButton" text="Continue" pack-side="right" pack-padx="5"/>
<Button style="default.TButton" text="Cancel" pack-side="right"/>
</Frame>
</Frame>
</TopLevel>
"""
def __init__(self, master=None):
super().__init__(master)
s = ttk.Style(master=self.root)
s.configure('H1.TLabel', font=['Lato', '-60'], background='#ffffff')
s.configure('default.TFrame', background='#ffffff')
s.configure(
default.TButton',
foreground='#0E2933',
background='#B6DDE2',
bordercolor='#ACD1D6',
darkcolor='#B6DDE2',
lightcolor='#B6DDE2',
focuscolor='#0E2933',
)
s.map(
default.TButton',
background=[('disabled', '#E9F4F6'), ('hover !disabled', '#9ABBC0'), ('pressed !disabled', '#88A5A9')],
)
if __name__ == "__main__":
dlg = RootDialog()
dlg.mainloop()
```
### Use a declarative language
After discovering the Tkinter style system, another problem to solve is using a declarative language. For a person who develops web interfaces every day, creating a GUI using Python code doesn't make sense. It requires too much code and too many variables, and poorly structured code. Creating a simple button requires many lines of code intertwined through the creation of many other components.
Modifying the GUI is tedious because it requires many variables that are all tangled up.
In comparison, creating a graphical interface using HTML tags is much more declarative and allows the creation of complex graphical interfaces while remaining structured. That's why I decided to use the Markup Language to create a graphical interface easily from the components available in Tkinter.
The initial idea was quite simple; a tag corresponds to a component. If I want to create a button component with the text **Hello**, I just have to make a tag named button with an attribute with the value **Hello**.
**TKVue:**
```
<Button text="Hello" />
```
**Python:**
```
b = Button(parent, text ="Hello")
b.pack()
```
I extrapolated the concept to all the components and functionalities in the Tkinter library from this starting idea. So, to create a more complex graphical interface with different elements, just nest them inside each other by creating a parent-child structure and defining the attributes for each component.
**TKVue:**
```
<TopLevel title="TKVue Test">
<Frame pack-fill="both" pack-expand="1" pack-padx="10" pack-pady="10">
<Label text="Available values: " width="20" pack-side="left"/>
<ComboBox id="label" pack-side="left" pack-expand="1" values="['zero', 'one', 'two', 'three']" />
</Frame>
</TopLevel>
```
**Python:**
```
import tkinter
from tkinter.ttk import Frame, Label, Combobox
top = tkinter.Tk()
top.title = "TKVue Test
frame = tkinter.Frame(top)
frame.pack(fill='both', expand=1, padx=10, pady=10)
l = Label(frame, text="Available values: ", width=20)
l.pack(side='left')
c = Combobox(frame, values=['zero', 'one', 'two', 'three'])
c.pack(side='left', expand=1)
top.mainloop()
```
**Result:**
![Initial result][6]
Using a hierarchical design similar to HTML simplifies the creation of the graphical interface and significantly simplifies the presentation of the parent-child structure created between each component.
### Create a dynamic interface
The other problem I encountered using Tkinter was the non-dynamic side of the interface. Having coded Web GUIs with Jinja2 templates, which allow you to reuse variables and create loops easily, I wanted similar functionality when creating desktop GUIs.
I must admit that the dynamic side of TKVue gave me some problems. My initial plan was to update the GUI dynamically when a variable was changed by the code. So it should be possible to use variables in the markup language. Suppose I select a value from a drop-down list. I want to be able to associate the specified value with a variable and allow that variable to be reused in another component for display. See the code sample below:
**TKVue:**
```
import tkvue
class RootDialog(tkvue.Component):
template = """
<TopLevel title="TKVue Test">
<Frame pack-fill="both" pack-expand="1" pack-padx="10" pack-pady="10">
<Label text="Available values: " width="20" pack-side="left"/>
<ComboBox pack-side="left" pack-expand="1" values="{{myvalues}}" textvariable="{{var1}}" />
</Frame>
<Frame pack-fill="both" pack-expand="1" pack-padx="10" pack-pady="10">
<Label text="{{'Available values:' + var1 }}" />
</Frame>
</TopLevel>
"""
data = tkvue.Context({"myvalues": ["zero", "one", "two", "three"], "var1": ""})
dlg = RootDialog()
dlg.mainloop()
```
**Python:**
```
import tkinter
from tkinter.ttk import Frame, Label, Combobox
top = tkinter.Tk()
top.title = "TKVue Test
frame = tkinter.Frame(top)
frame.pack(fill='both', expand=1, padx=10, pady=10)
l = Label(frame, text="Available values: ", width=20)
l.pack(side='left')
var1 = tkinter.StringVar()
c = Combobox(frame, values=['zero', 'one', 'two', 'three'], textvariable=var1)
c.pack(side='left', expand=1)
frame2 = tkinter.Frame(top)
frame2.pack(fill='both', expand=1, padx=10, pady=10)
s = Label(frame2, text='Value selected:')
s.pack(side='bottom')
var1.trace_add("write", lambda *args: s.configure(text='Value selected: ' + var1.get()))
top.mainloop()
```
**Result:**
![Result][7]
With this in place, it is possible to create a graphical interface that reacts to the user's actions in a simple and declarative way.
### Use loops and conditions
To make the model as dynamic as possible, it was necessary to support the use of loops and conditions to show or hide components depending on variables. TKVue introduces two special attributes to fill this need, the **for** attribute for loop creation and the **visible**attribute.
The following example allows the user to select the number of items to be displayed in the loop from a drop-down list. The following example demonstrates the dynamic side of a loop reacting to the user's actions:
**TKVue:**
```
import tkvue
class RootDialog(tkvue.Component):
template = """
<TopLevel geometry="970x500" title="TKVue Test">
<Frame pack-fill="both" pack-expand="true" padding="10">
<Label text="Selection number of row to display:" />
<Combobox values="{{ list(range(1, 100)) }}" textvariable="{{ count }}"/>
<Frame pack-fill="both" pack-expand="1" pack-side="left">
<Label pack-fill="x" pack-expand="1" for="i in range(1, count)" text="{{ 'row %s' % i }}" />
</Frame>
</Frame>
</TopLevel>
"""
data = tkvue.Context({'count': 5})
if __name__ == "__main__":
dlg = RootDialog()
dlg.mainloop()
```
**Result:**
![Result with rows][8]
The condition declaration is even simpler. You must define an expression in the **visible** attribute as follows:
**TkVue:**
```
import tkvue
class RootDialog(tkvue.Component):
template = """
<TopLevel geometry="970x500" title="TKVue Test">
<Frame pack-fill="both" pack-expand="true" padding="10">
<Checkbutton text="Show Text" variable="{{show}}" />
<Label text="Text is Visible" visible="{{show}}" />
</Frame>
</TopLevel>
"""
data = tkvue.Context({'show': True})
if __name__ == "__main__":
dlg = RootDialog()
dlg.mainloop()
```
**Result:**
![Result with text][9]
### Use localization
Another important aspect of the development of my application is to allow the translation of the graphical interface quickly by using technologies that are already known and widely used in Python: `gettext`.
To do this, the library provides an adapter for Babel, which allows extracting the strings to be translated. You can then find these strings in a translation catalog (.po file).
Here is an example of a configuration file for Babel that allows you to extract strings for translation purposes:
Place the following in `Babel.cfg`:
```
[python: **.py]
[tkvue: **/templates/**.html]
```
I'm using Tkinter and my theming library for my data backup software, Minarca.
The final result is elegant and simple at the same time. The style matches the color palette of the Minarca project.
![Result welcome][10]
### Try TKVue today
The objective of all this work is to bring familiar advantages in web development to traditional development. TKVue saves time while developing the graphical interface and makes it easier to maintain and modify the code afterward.
The work I have done so far in the library is quite rudimentary and needs further modification before being used more widely in projects. I hope that the publication of this article allows someone else to take over the development of a similar library or to continue to develop directly in TKVue to improve its functionality. TKVue's code is available on [GitLab][11].
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/user-interface-tkinter-python
作者:[Patrik Dufresne][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/patrik-dufresne
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/17/4/pyqt-versus-wxpython
[2]: https://tkdocs.com/tutorial/styles.html#usetheme
[3]: https://opensource.com/sites/default/files/2023-02/1default.png
[4]: https://opensource.com/sites/default/files/2023-02/2clam.png
[5]: https://opensource.com/sites/default/files/2023-02/3personalized.png
[6]: https://opensource.com/sites/default/files/2023-02/4result.png
[7]: https://opensource.com/sites/default/files/2023-02/5result.png
[8]: https://opensource.com/sites/default/files/2023-02/6result-rows.png
[9]: https://opensource.com/sites/default/files/2023-02/7result-text.png
[10]: https://opensource.com/sites/default/files/2023-02/8result-welcome.png
[11]: https://gitlab.com/ikus-soft/tkvue

View File

@ -0,0 +1,148 @@
[#]: subject: "Lua loops: how to use while and repeat until"
[#]: via: "https://opensource.com/article/23/2/lua-loops-while-repeat-until"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Lua loops: how to use while and repeat until
======
Control structures are an important feature of programming languages because they enable you to direct the flow of the program based on conditions that are often established dynamically as the program is running. Different languages provide different controls, and in Lua there's the while loop, for loop, and repeatuntil loop. This article covers the while and repeat until loops. Because of their flexibility, I cover for loops in a [separate article][1].
A condition is defined by an expression using an operator, which is a fancy term for symbols you may recognize from math classes. Valid operators in Lua are:
- `==` equal to
- `~=` not equal to
- `<` less than
- `>` greater than
- `⇐` less than or equal to
- `>=` greater than or equal to
Those are known as relational operators because they prompt an investigation of how two values relate to one another. There are also logical operators, which mean the same as they mean in English and can be incorporated into conditions to further describe the state you want to check for:
- `and`
- `or`
Here are some example conditions:
- `foo > 3`: Is the variable `foo` is greater than 3? The `foo` must be 4 or more to satisfy this condition.
- `foo >= 3`: Is `foo` greater than or equal to 3? The `foo` must be 3 or more to satisfy this condition.
- `foo > 3 and bar < 1`: Is `foo` greater than 3 while `bar` is less than 1? For this condition to be true, the `foo` variable must be 4 or more at the same moment that `bar` is 0.
- `foo > 3 or bar < 1`: Is `foo` greater than 3? Alternately, is `bar` less than 1? If `foo` is 4 or more, or `bar` is 0, then this condition is true. What happens if `foo` is 4 or more while `bar` is 0? The answer appears later in this article.
### While loop
A while loop executes instructions for as long as _some condition_ is satisfied. For example, suppose you're developing an application to monitor an ongoing zombie apocalypse. When there are no zombies remaining, then there is no more zombie apocalypse:
```
zombie = 1024
while (zombie > 0) do
print(zombie)
zombie = zombie-1
end
if zombie == 0 then
print("No more zombie apocalypse!")
end
```
Run the code to watch the zombies vanish:
```
$ lua ./while.lua
1024
1023
[...]
3
2
1
No more zombie apocalypse!
```
### Until loop
Lua also has a repeat until loop construct that's essentially a while loop with a "catch" statement. Suppose you've taken up gardening and you want to track what's left to harvest:
```
mytable = { "tomato", "lettuce", "brains" }
bc = 3
repeat
print(mytable[bc])
bc = bc - 1
until( bc == 0 )
```
Run the code:
```
$ lua ./until.lua
brains
lettuce
tomato
```
That's helpful!
### Infinite loops
An infinite loop has a condition that can never be satisfied, so it runs infinitely. This is often a bug caused by bad logic or an unexpected state in your program. For instance, at the start of this article, I posed a logic puzzle. If a loop is set to run until `foo > 3 or bar < 1`, then what happens when `foo` is 4 or more while `bar` is 0?
Here's the code to solve this puzzle, with a safety catch using the `break` statement just in case:
```
foo = 9
bar = 0
while ( foo > 3 or bar < 1 ) do
print(foo)
foo = foo-1
-- safety catch
if foo < -800000 then
break
end
end
```
You can safely run this code, but it does mimic an accidental infinite loop. The flawed logic is the `or` operator, which permits this loop to continue both when `foo` is greater than 3 and when `bar` is less than 1. The `and` operator has a different effect, but I leave that to you to explore.
Infinite loops actually do have their uses. Graphical applications use what are technically infinite loops to keep the application window open. There's no way of knowing how long your user intends to use the application, so the program runs infinitely until the user selects **Quit**. The simple condition used in these cases is one that is obviously always satisfied. Here's an example infinite loop, again with a safety catch built in for convenience:
```
n = 0
while true do
print(n)
n = n+1
if n > 100 then
break
end
end
```
The condition `while true` is always satisfied because `true` is always true. It's the terse way of writing `while 1 == 1` or something similarly eternally true.
### Loops in Lua
As you can tell from the sample code, although there are different implementations, loops all basically work toward the same goal. Choose the one that makes sense to you and that works best with the processing you need to perform. And just in case you need it: The keyboard shortcut to terminate a runaway loop is **Ctrl+C**.
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/lua-loops-while-repeat-until
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/22/11/lua-for-loops

View File

@ -0,0 +1,83 @@
[#]: subject: "GNOME is (kind of) Bringing Back a Feature It Had Removed a Few Years Ago"
[#]: via: "https://news.itsfoss.com/gnome-design-quick-access/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: "SJFCS"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
GNOME 正在恢复在过去几年里被删除的功能(某种程度上)
======
GNOME 的设计变化是有意义的,因为它带回了一个它早先删除的类似功能(某种程度上)。
![GNOME 正在恢复它几年前删除的功能(某种程度上)][1]
几年前GNOME 移除了应用程序的菜单和指示器。
如果你感到好奇,应用程序指示器是一种从顶部面板与后台运行的应用程序进行交互的方式。
是的,你可以 [为应用指示器添加扩展][2] 来获得同样的功能。但是,在使用 GNOME 桌面环境的发行版上,如 Fedora你将不再能找到默认的能力。
然而Ubuntu它的一些 [官方风格][3],以及其他发行版如 Pop!_OS 支持系统托盘图标,尽管 GNOME 放弃了它们。
现在,经过多年的设计变化,看起来我们可能会看到类似的东西。
### GNOME 将添加一个快速方法来检查后台的活动程序
目前,在没有活动窗口的情况下,没有快速的方法来找出在后台运行的应用程序。
你必须使用 [任务管理器][4] 或 [系统监控工具][5] 以获得更好的观测能力。
在未来的 GNOME 版本中(可能是 GNOME 44你可能会期待一个位于菜单面板顶部的**资源监控应用**。
![gnome 设计模拟图,用于从通知菜单中检查后台应用程序][6] 。
[Allan Day][7] 的想法仍在讨论中并分享了一个 [设计模拟图][8]。不过,它很有可能会被接受。
这个想法也促使开发者 [Georges Basile Stavracas Neto][9] 公开了 Flatpak 的 xdg-desktop-portal 组件,使得检测运行中的 Flatpak 应用程序变得容易。
> 📋 检查后台应用程序的位置或设计仍在进行中;你在上面看到的内容可能会随着最终的实施而改变。
### 这是否也会使应用指标回归?
并非如此。
通过这个功能GNOME 旨在让你快速看到后台运行的应用程序,并对它们进行管理(关闭它们或访问特定的设置)。
然而,你仍需要少量点击来达到这一点🖱️
小程序指示器或系统托盘图标是访问在后台运行的应用程序更快捷的方式,尽管不是每个后台应用程序都被列出。
毕竟,这比什么都好。
而最终,这些设计上的变化可能会产生一种直观的方式,以某种形式让应用指标回归。
_💬 你对这个决定与即将发布的 GNOME 设计变化有何看法?请在下面的评论中分享你的想法。
**Via**: [Phoronix][10]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/gnome-design-quick-access/
作者:[Ankush Das][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lkxed/
[1]: https://news.itsfoss.com/content/images/size/w2000/2023/02/gnome-brings-mysterious-features.png
[2]: https://itsfoss.com/enable-applet-indicator-gnome/
[3]: https://itsfoss.com/which-ubuntu-install/
[4]: https://itsfoss.com/task-manager-linux/
[5]: https://itsfoss.com/linux-system-monitoring-tools/
[6]: https://news.itsfoss.com/content/images/2023/02/background-app-running.png
[7]: https://gitlab.gnome.org/aday
[8]: https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/191
[9]: https://github.com/GeorgesStavracas
[10]: https://www.phoronix.com/news/GNOME-Monitor-Background-Apps

View File

@ -0,0 +1,143 @@
[#]: subject: "How to Use a Differential Analyzer (to Murder People)"
[#]: via: "https://twobithistory.org/2020/04/06/differential-analyzer.html"
[#]: author: "Two-Bit History https://twobithistory.org"
[#]: collector: "lujun9972"
[#]: translator: "toknow-gh"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
怎么用微分分析仪(杀人)
======
微分分析仪是一种能够求解微分方程的机械式模拟计算机。它已经不再使用了,因为如今最便宜的笔记本电脑都能更快地解决相同的问题,并且你还可以同时在线刷剧。然而在数字计算机发明之前,微分分析仪使数学家能够完成一些用其它工具不可能完成的计算。
现如今很难想象一台不是由印刷数字电路组成的计算机竟然是可以正常运作的。机械计算机听起来就像是从蒸汽朋克小说里跑出来的一样。事实证明微分分析仪不但能用,而且还是一些研究领域中必不可少的工具。它最为人所知的应用是曾被美国陆军用于编制火炮射表。如果没有射表辅助瞄准,口径再大的火炮也无法充分发挥效能。所以理论上来说,微分分析仪在帮助同盟国赢得二战上发挥了重要作用。
要弄清微分分析仪是如何做到这些的,你首先得知道什么是微分方程。已经还给学校了?没事,我也一样。
### 微分方程
你首次接触微分方程应该是在大学微积分 I 的最后几周。在学期的这个阶段,你那薪资低微的兼职教授应该已经教授过极限、导数和积分这些概念了。在这些概念之上再引入等号,现在你就得到了一个微分方程。
微分方程描述一个变量相对于另一个(或多个)变量的变化率。形如 $y = 4x + 3$ 的常见代数式表示变量 $y$ 与 变量 $x$ 之间的关系。形如 $\frac{dy}{dx} = x$ 或 $\frac{dy}{dx} = 2$ 的微分方程表示变化率与其它变量间的关系。本质上微分方程就是用纯数学方式来描述变化率。前面第一个方程表示 “变量 $y$ 相对于变量 $x$ 的变化率刚好等于 $x$。”第二个方程表示“无论 $x$ 的值是多少,$y$ 相对于 $x$ 的变化率总是 2。”
微分方程非常有用,因为在面对真实世界中的复杂系统时比起提出一个能够描述系统在任意时刻状态的方程,描述系统从一个时刻到下一个时刻的状态变化要容易得多。因此,微分方程被广泛应用于物理和工程领域。一个著名的微分方程是<ruby>热传导方程<rt>heat equation</rt></ruby>。它能描述热量在物体中的扩散过程。要提出一个完全地描述物体在某时刻 $t$ 的热量分布的函数很困难,但推理热量从某时刻到下一个时刻的扩散过程不太可能会让你绞尽脑汁——近冷者变热,近热者变冷。所以尽管热传导方程在形式上比起前面的例子要复杂得多,它也只是变化率的描述而已。它描述了在给定与周围的温差时,物体上任意一点的温度随时间的变化。
再来举一个更具体的例子。假如我在真空中竖直向上抛出一个网球,在我窒息之前它会落回来吗?这是我在高中物理课上被问到的问题,解决它只需要基本的牛顿运动方程。现在暂且假设我已经忘记了牛顿运动方程,只记得物体以恒定的加速度 $g$ (大约为 $10 \;m/s^2$)向地球加速运动。那么如何用微分方程来解决这个问题呢?
现在把我对高中物理仅存的记忆表示成微分方程。网球在离手后会向地球以 $g$ 加速运动。也就是说网球的速度相对于时间的变化率为 $g$(在负方向上)。进一步,我们可以说球离地高度的变化率(也就是速度)随时间的变化率是负方向的 $g$。其微分方程形式如下,其中 $h$ 表示高度,$t$ 表示时间:
$$
\frac{d^2h}{dt^2} = -g
$$
它跟前面的微分方程看起来略有差别,因为这是所谓的二阶微分方程。我们讨论的是变化率的变化率,也许你还记得微积分课讲过,这需要用到二阶导数。这是方程左边部分看上去像被平方了的原因。但是该方程也仅仅表示了球向下以恒定的加速度 $g$ 加速运动这一事实。
到这里,我可以选择使用微积分来求解微分方程。解微分方程并不是要找满足指定关系的值,而是要找满足关系的函数。对上面的微分方程的另一种理解是存在这样的函数,它的二阶导数为 $-g$。我们想要找到这个函数,因为它能告诉我们球在任意时刻的高度。好在这个微分方程恰巧是容易求解的。通过这样,我们可以重新推导出那些被我遗忘了的运动方程,从而轻松地计算出球落回来所花的时间。
但是大部分情况下微分方程是很难求解的。有时甚至是无法求解的。假设我在大学时把更多的精力花在了计算机科学上,那么我的另一种选择就是用微分方程来做模拟。如果已知球的初速度和加速度,我可以轻易用 Python 写一个 for 循环来逐秒迭代计算球在离手后 $t$ 时刻的速度。在此基础上对循环程序稍加修改,就可以用算出的速度迭代计算出球的高度。运行这个 Python 模拟程序,它就可以计算出球什么时候落回来了。这个模拟并不是完全精确的,但是我可以通过减小计算用的时间步长来提升精度。总之我要做的只是搞清楚当球落回来时我是否还活着。
这就是微分方程的数值解法。这也是大多数领域中求解微分方程时实际采用的方法。对于用数值方法求解微分方程,计算机是必不可少的,因为模拟的精度取决于在微小步长上进行的大量计算。手工计算容易出错并且太耗时。
那如果将这个问题的背景时间设定在 1936 年呢?我仍然希望实现计算过程的自动化。但是此时离 <ruby>克劳德·香农<rt>Claude Shannon</rt></ruby> 完成他的硕士论文还有一年时间。在这篇论文中香农用数字电路实现了布尔 <ruby>代数<rt> boolean algebra</rt></ruby>。没有数字计算机可用,恐怕就只能寄希望于于模拟计算机了。
### 微分分析仪
首台微分分析仪是由 <ruby>范内瓦·布什<rt>Vannevar Bush</rt></ruby><ruby>哈罗德·哈森<rt>Harold Hazen</rt></ruby> 于 1928 年到 1931年在 MIT 建造的。他们两人都是工程师。制造它是为了解决应用数学和物理领域中的实际问题。正如布什在 [1931 年的一篇论文][1] 中所说,微分分析仪是为了解决那些“持续被他们所用方程的复杂度而不是深度所困扰的”的数学家的所面临的当代问题。
微分分析仪是一台由传动轴、齿轮和转盘组成的复杂仪器,它能够求解高达六阶的微分方程。它是一台由简单部件通过复杂组合而成的神奇机器。在这一点上它和数字计算机很像。不同点是,数字计算机通过在电路中实现布尔代数来模拟代数问题,而微分分析仪通过传动轴、齿轮和转盘直接模拟微分方程问题。微分分析仪的本质就是对实际问题的直接机械类比。
那到底怎么用齿轮和转盘来计算微积分呢?其实这是最容易解释的部分。微分分析仪最重要的构件是六个积分器,每一个对应一阶的微分方程。机械积分器的历史可以追溯到 19 世纪,它是一个相对简单的装置,能够对单个简单函数进行积分运算的。下面我们将了解积分器的工作原理,但顺便说一句,布什的巨大成就不是发明了机械积分器,而是发现了一种将积分器串联起来解决高阶微分方程的方法。
机械积分器由一个大转盘和一小得多的转轮组成。转盘像唱片机的转台一样平行于地面平放。它由电机驱动匀速转动。转轮竖直的轻放于转盘表面上,其压力既要足够让转盘驱动转轮,又不能太大以致于阻碍转轮相对于转盘自由侧向滑动。总之当转盘转动时,转轮也跟着转动。
转轮的转速由它距离转盘中心的距离决定。转盘的中心部分自然转动得比边缘部分慢。转轮的位置是固定不动的,而转盘被安装在一个可以来回滑动的底座上。这样就可以调节转轮相对转盘中心的位置。下面就是积分器工作的关键原理:转盘底座的位置由积分器的输入函数控制。积分器输出取决于转轮的转动量。所以输入函数驱动了输出函数的变化率,这就是将某个函数的导数转换成了这个函数本身。这不就是积分运算吗?
如果刚才的解释还没有让你理解积分器的原理,那么直接看到机械积分器实际工作的样子应该对你有所帮助。其实它的原理出乎意料的简单,看一遍它的运行过程你肯定就能窥见其运作机制。因此我制作了一个 [运行中的机械积分器动态原理图][2],强烈建议你看一看。它展示了通过各个部件的旋转和移动求函数 $f(x)$ 的 <ruby>不定积分<rt>antiderivative</rt></ruby> $F(x)$ 的过程。这可太有趣了。
![][3] _A nice screenshot of my visualization, but you should check out the real thing!_
现在我们有了可以做积分运算的组件,但是只靠它还不足以解决微分方程。为了解释求解微分方程的全过程,我将使用布什在他 1931 年的论文中所举的例子。这个例子恰巧跟前面考虑的微分方程是在本质上是一样的。(真是奇妙的巧合!)布什使用下面的微分方程来表示下落物体的运动:
$$
\frac{d^2x}{dt^2} = -k\,\frac{dx}{dt} - g
$$
这跟前面的网球运动的方程基本上是一样的,只不过布什使用 $x$ 代替了 $h$,并且增加了一项来表示空气阻力的减速作用。这个新增项采用了最简单的形式来描述空气阻力的作用:空气减慢球速的比率正比于球的速度(这里 $k$ 是一个常比例系数,我并不关心它的具体取值)。也就说是球运动得越快,空气阻力就越大,对球的减速作用越显著。
为了配置微分分析仪来解决这个微分方程,我们需要从布什称之为“输入面板”的东西开始。输入面板其实就是一张安装在支架上的坐标纸。如果想要解更复杂的方程,首先需要操作员在坐标纸上绘制好输入函数图像,然后在机器启动时用一个与机器主体相连的指针来跟踪函数图像的轨迹。在我们举的例子中,输入是常数 $g$,所以我们只需将指针移动到正确的位置并让它保持不动即可。
剩下的变量 $x$ 和 $t$ 又是什么呢?变量 $x$ 表示球的高度,是微分分析仪的输出。它会被绘制在输出面板上的坐标纸上。输出面板与输入面板类似,只是它没有指针,取而代之的是由微分分析仪驱动的绘图笔。变量 $t$ 仅仅是按固定速率步进。(在前面模拟网球运动 Python 程序中,我们通过循环来增加 $t$。)变量 $t$ 来源于微分分析仪的电机,它通过匀速转动传动轴来驱动整个计算过程。
布什的原理图对于理解我下面要介绍的内容很有帮助。不过为了便于理解,需要先对微分方程再做一次变换。对方程两边同时进行一次积分,得到下式:
$$
\frac{dx}{dt} = - \int \left(k\,\frac{dx}{dt} + g\right)\,dt
$$
现在方程中的各项与微分分析仪运行中各部件转动量所表示的值之间有了更明确的对应关系。布什的原理图如下:
![][4] _The differential analyzer configured to solve the problem of a falling body in one dimension._
在原理图的顶部是输入面板,右下角是输出面板。图中的输出面板被配置成同时绘制高度 $x$ 和速度 $\frac{dx}{dt}$。积分器在左下方,由于这是二阶微分方程,所以我们需要两个积分器。电机驱动顶部标注为 $t$ 的传动轴。(有趣的是,布什将这些水平传动轴称为“总线”。)
现在原理图中还剩下两个部件没有解释了。里边标记了 $k$ 的方框是<ruby>乘法器<rt>multiplier</rt></ruby>$k$ 是比例常数。它获取由 $\frac{dx}{dt}$ 标记的传动轴的转动量,并通过齿轮组进行放缩。用 $\sum$ 标记的方框是<ruby>加法器<rt>adder</rt></ruby>。它通过巧妙的齿轮组合将两个传动轴的的转动叠加起来驱动第三个传动轴。我们的方程中涉及了求两项之和,所以需要引入加法器。这些额外组件的引入确保了微分分析仪有足够的灵活性来模拟由各种各样的项和系数组成的方程。
我发现以慢放的方式来推演电机启动时的级联因果过程对于理解微分分析仪的原理很有帮助。电机启动后立即驱动传动轴 $t$ 匀速旋转。这样我们就有了时间的概念。这个传动轴有三个作用,分别由连接其上的三个竖直传动轴表示:它驱动了两个积分器的转盘的转动,同时带动输出面板的支架让绘图笔作图。
如果积分器的转轮被放置在转盘中心,那么传动轴 $t$ 就不会带动其它传动轴转动。积分器的转盘会转动,但是放置在转盘中心的转轮不会被带动。这时输出图像将会是一条平坦的直线。出现这种情况是因为我们没有明确指定问题的初始条件。在上面的 Python 程序中,我们需要以常量或函数参数的形式用到网球的初始速度。在启动机器之前,我们通过将两个积分器的转盘调整到合适的位置来指定速度和加速度的初始值。
设置好这些之后,传动轴 $t$ 的转动将会传导到整个系统之中。从物理上来说,许多部件会同时开始转动。但是我们可以认为转动首先传导到积分器 II然后与基于 $g$ 计算得到的加速度表达式求积分得到球的速度 $\frac{dx}{dt}$。速度又反过来作为积分器 I 的输入,推动它的转盘让输出转轮以速率 $\frac{dx}{dt}$ 转动。积分器 I 的输出作为最终结果将会被直接导向到输出面板上。
前面我有意避开了一个令人困惑的细节,那就是机器里有一个怪圈。积分器 II 以传动轴 $(k\,\frac{dx}{dt} + g)$ 为输入,但是该传动轴的转动又部分决定于积分器 II 的输出本身。这可能快把你绕吐了,但在物理上这并没有任何问题——因为所有部部件都是一同转动的。出现这种怪圈并没什么奇怪的,因为在用微分方程在描述某函数的变化率时,也经常会用该函数的函数的形式。(在这个例子中,加速度,即速度的变化率,取决于于速度。)
在将所有东西都正确配置好后,机器会输出球的高度和速度随时间变化的函数图像。这个图像是纸质的。用我们的现代数字化思维来看,这可能有点难以理解。画在纸上的函数图像能干什么?微分分析仪确实不能魔术般地给出解的简洁数学表达式,这是事实。但也请记住一点,很多的微分方程根本没有简洁的解析解。纸上的函数图像与前面模拟球下落的 Python 程序包含相同的信息:某时刻球的位置。它可以回答任何关于该问题的实际问题。
微分分析仪简直酷到爆。它虽然结构复杂,但是本质上只是一些传动轴和齿轮外的组合。要理解它的运作过程,你不必是电气工程师或者会制造芯片。然而它确实可以解微积分!它能够求解出那些靠你自己永远无法解决的微分方程问题。它证明建造计算机器的关键材料不是硅而是人类的创造力。
### 杀人
人类的创造力既能为善,也能为恶。正如我提到的,微分分析仪在历史上最知名的应用是为美国陆军计算火炮射表。鉴于二战是一场“正义的战争”,这是最好的结果。但是也不能忽视微分分析仪增强了大口径火炮的杀伤效能。火炮的确杀死了很多人。如果维基百科可信的话,在二战中死于炮火的士兵比被轻武器杀死的更多。
我们稍后再回到道德讨论上来,先快速解释一下为什么计算射表这么困难,以及微分分析仪是怎么帮助计算射表的。这是将微分分析仪应用于实际问题的很好的例子。射表能告诉炮手在射击某个距离外的目标时需要将炮口上抬多高。编制射表的一种方法是在不同的仰角下发射该火炮,并将结果记录下来。这种方法被用在靶场,比如位于马里兰的阿伯丁试验场。但是单纯通过实验观察的方式来编制射表即昂贵又耗时。在考虑到如天气状况或不同弹丸重量等其它因素时,需要进行的射击次数将会随组合爆增到无法实施的程度。所以基于少量观测数据建立数学模型,再基于该模型来填充出完整的射表是一个更好的方法。
我不想太深入讨论这些数学理论,它们实在太难了,我也不懂。但是你应该也想到了,支配飞行中的炮弹和向上抛出的网球运动的物理规律并没有什么不同。由于计算精度的需要,我们使用的微分方程不得不偏离其理想化的形式,并迅速变得面目狰狞起来。即便是最早的精确弹道理论中的公式,除其它因素外,还考虑了弹丸的重量、直径、形状、主风、海拔、大气密度以及地球自转[1][5]。
虽然关于射表计算的方程很复杂但它们跟前面的微分方程一样都可以通过微分分析仪数值求解。1935 年微分分析仪被阿伯丁试验场用于求解弹道方程。这显著加快了计算射表的速度。[2][6] 然而,二战期间对于射表的需求增长太快了,以至于美国陆军计算射表的速度难以满足运往欧洲战场的武器装备的配套需求。这最终导致陆军资助了宾夕法尼亚大学的 ENIAC 项目。这促成了世界上第一台数字计算机的诞生。(译注:严格来说 ENIAC 是第二台电子数字计算机。第一台电子计算机是阿塔纳索夫-贝瑞计算机AtanasoffBerry Computer简称 ABC 计算机ENIAC 能够通过重新布线运行任意程序。但建造它的主要是为了以数倍于微分分析仪的速度来计算射表。
鉴于在微分分析仪之外,射表计算问题极大地推动了早期计算领域的发展,专门挑出微分分析仪的道德问题也许是不公正的。微分分析仪并没有局限于军事领域的应用,在二战期间和二战后的很大一段时间里,由于美国军方投入的大量的拨款,整个计算领域得到了发展。
总之,我认为微分分析仪更有趣的遗产是它告诉了我们计算的本质。我惊叹于于微分分析仪能做到这么多事情,我猜你也一样。我们很容易落入这样的思维陷阱:将计算看作是由快速数字电路实现的领域。事实上,计算是更抽象的过程,电子数字电路只是实现计算的典型手段罢了。在关于微分分析仪的论文中,布什说他的发明不过是在“运用复杂机械结构来类比复杂的推理过程这一影响深远的计划”上的微小贡献。他的总结很贴切。
1. Alan Gluchoff. “Artillerymen and Mathematicians: Forest Ray Moulton and Changes in American Exterior Ballistics, 1885-1934.” Historia Mathematica, vol. 38, no. 4, 2011, pp. 506547., <https://www.sciencedirect.com/science/article/pii/S0315086011000279>. [↩︎][10]
2. Karl Kempf. “Electronic Computers within the Ordnance Corps,” 1961, accessed April 6, 2020, <https://ftp.arl.army.mil/~mike/comphist/61ordnance/index.html>. [↩︎][11]
--------------------------------------------------------------------------------
via: https://twobithistory.org/2020/04/06/differential-analyzer.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[toknow-gh](https://github.com/toknow-gh)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://twobithistory.org
[b]: https://github.com/lujun9972
[1]: http://worrydream.com/refs/Bush%20-%20The%20Differential%20Analyzer.pdf
[2]: https://sinclairtarget.com/differential-analyzer/
[3]: https://twobithistory.org/images/diff-analyzer-viz.png
[4]: https://twobithistory.org/images/analyzer-diagram.png
[5]: tmp.MoynZsbJ7w#fn:1
[6]: tmp.MoynZsbJ7w#fn:2
[7]: https://twitter.com/TwoBitHistory
[8]: https://twobithistory.org/feed.xml
[9]: https://twitter.com/TwoBitHistory/status/1224014531778826240?ref_src=twsrc%5Etfw
[10]: tmp.MoynZsbJ7w#fnref:1
[11]: tmp.MoynZsbJ7w#fnref:2

View File

@ -0,0 +1,138 @@
[#]: subject: "“Its time to contribute to open source”"
[#]: via: "https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/"
[#]: author: "Abbinaya Kuzhanthaivel https://www.opensourceforu.com/author/abbinaya-swath/"
[#]: collector: "lkxed"
[#]: translator: "XiaotingHuang22"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
“是时候为开源做贡献了”
======
Nilesh Vaghela 是 AWS 社区的英雄和一家云计算开源公司ElectroMech Corporation的创始人。据Nilesh说为开源做出贡献本身就是一种有意义的事。 但是它需要人们的投入和奉献,而这个过程涉及许多步骤,从选择项目到确保您的贡献成果获得关注。在与 OSFY的 Abbinaya Kuzhanthaivel 的对话中,他分享了一些关于开发人员如何帮助改善印度对开源的贡献的技巧。
![Nilesh Vaghela,
AWS 的社区英雄以及ElectroMech公司的创始人][1]
##### 问:您能告诉我们一下您目前的角色和对开源的贡献吗?
**答:** 我目前是一名从事自动化工作的架构师。我领导多个团队,并且主要在开源安全服务平台 Invinsense 上作出贡献。我在 1998 年初创建了开源小组,当时已经有大约 1500 名成员。我现在处理的一个小组 (https://groups.google.com/g/vglug) 自 2014-15 年以来一直非常活跃。
##### 问:您是如何开始在开源项目中工作的?
**答:** 我是一名有着从业资格的机械工程师,当时我在我的公司 ElectroMech Corporation 处理调制解调器和 UPS 系统。我慢慢地陷入了奔波于处理 PC、网络和Linux的困境。1996年我在核科学中心看到超过 150 台计算机服务器在 Linux 上运行时广受启发,之后便开始进行实验。自此我将我的公司完全转变为专注于培训和支持的开源公司。
我可以自豪地说,我是最早一批使用开源的人——帮助客户了解什么是开源、它有什么好处、什么是免费的、安全或代码问题等等。我们在巴罗达得到了至少四五个客户的支持,并且最终通过黄页上的广告宣传了自己。我们与 Red Hat 合作并且关系一直持续到现在。
##### 问:自那以来您认为开源发展如何?
答:我可以说,早期开源是一种令人着迷的强烈爱好,吸引人们参与其中。当年一些来自西伯利亚的贡献者致力于改善水资源短缺问题,世界各地的用户都说他们的产品有多么简单易用,这给我留下了特别深刻的印象。它更像是一项企业社会责任 (CSR) 活动。委员会由开源人员和专家组成,共同管理和推进项目。人们会不带期望,仅因为对技术的热爱而加入。
那时我不相信开源可以商业化,但它是当今大多数创新和技术的驱动力,而且越来越多的企业正在采用它。我们期待在贡献和使用开源方面取得很好的平衡,因为我们有个人、社区和大公司参与进来。这才是开源真正的未来和力量。
##### 问:您可以分享一些自己遇到的困难吗?
答:最初我是单枪匹马干,但一旦人们知道我的意图是好的,他们就会加入我。我在没有任何期望的情况下创建了很多社区,但确实在声誉或名望方面间接地获得了回报;有人理解我是技术达人,并给了我长期的项目。在早期,人们刚开始加入社区并且不需要付出很多精力就可以做出贡献。因为我的目标不是做生意,因此可以说我没有真正面临什么障碍。
##### 问:作为社区领袖,您的领导格言和经验教训是什么?
**答:** 首先,如果你想建立一个社区,那就保持中立,不要抱有偏见。虽然看起来好像是你作为领导者正在管理一个社区,但请记住,加入社区的人都是平等地做出贡献的。永远不要让成员失去动力。在发表评论和回答问题时要有礼貌。不管是什么问题,如果你不想回答,那就选择沉默。但别让人们停止提问,而是帮助他们建立专业知识。
第二,不要让社区掺杂商业。不要让社区的目标和你个人企业的目标产生混淆和互相匹配。将它们严格区分开来。
始终尝试鼓励人们参与,而不是作为专家提供指导。如果你发现人们有兴趣领导项目并采取主动,请给出舞台让他们发挥。邀请他们参与社区活动。这将帮助你培养更多的社区领袖。此外,让您的社区保持简单,不要在初始阶段让赞助商参与进来。
##### 问:您向谁寻求灵感?
**答:** 开源运动之父 Richard Stallman 是我的灵感来源,我一直很钦佩他的项目。
除了他之外,我还有一个有趣的事要分享,它激励着我从事开源工作。 在我开始从事开源工作的时候,核科学中心的大部分软件都是基于 Windows 操作系统的。然而,许多科学家希望使用基于 Linux 的软件。 在两三个月内,他们实际上创建了 Linux 驱动程序。 这就是让我着迷的地方——用户可以创建这些驱动程序,这在专有软件中是不太可能发生的。我真的很喜欢开源赋权用户这一点。
##### 问:您对印度开源格局以及改进空间有什么看法?
**答:** 印度是最多人使用开源的国家,我们正致力于成为贡献者。有这么多开发者,印度却仍然没有软件巨头。我们拥有的主要是服务提供者,而不是创新者。更多的人应该成为开源的贡献者,去开发具有国际标签的东西。
为开源做贡献的想法应该从学校和大学抓起。幸运的是,古吉拉特邦政府已经在 8 年级到 10 年级里推出基于 Linux 的课程。教育年轻一代并让他们了解开源模型很重要。
其次,我们要培养好的导师。 当人们开始贡献时,找到一位在这个项目中工作的开源导师很重要。导师给出了一个小任务,尝试代码然后提交。如果一切顺利,成员的贡献会逐渐增加。不幸的是,在印度导师很少。 我们需要有很多导师,或者可以与世界各地的导师建立联系。
三是要鼓励那些踊跃贡献的人。让人们发现,一旦你成为了一位广受认可的开发人员或为开源开发做出贡献的人,你在职业发展和业务上也会有所突破。
通过遵循这些简单的方法,印度可以成为开源的主要贡献者。
##### 问:您如何看待为开源做出贡献时编程方面的要求?
**答:** 根据我的经验,如果你知道内部部件,如何开发应用程序,你应该维护什么样的代码标准,以及如何管理团队和其他最佳做法,你可能不必担心编程专业知识。
在设计、安全维护和整合方面还有其他角色可以担任。看看你合适什么。通过做你喜欢的事情来不断提升加强自己的技能。如果你仍然对编码感兴趣,那么你就在其他开发人员的支持下去学习。
##### 问:你如何确定一个你想参与的项目?
答:你需要了解你最感兴趣的几个领域,然后对围绕这些领域发生的项目进行研究。你需要弄清楚哪些领域有招募更多志愿者的需求或职位空缺。 您可以从小处着手练习,然后积累专业知识。
避免随大流;重要的是你的个人兴趣。例如,因为现在 DevOps (开发运维一体化)的需求量很大,你便可能更倾向于选择 DevOps 项目。不要犯这个错误。
你可以在 Cloud Native Computing Foundation ([CNCF][2])、Apache、Fedora、Red Hat 等平台上找到开源项目。通过这种方式,你还可以找到已经在从事项目并可以给出适当指导的导师。
##### 问:每个项目有自己的目的和目标受众。有时它们甚至与开源目标不一致。那么,在开始做出贡献之前要核实什么?
答:我同意当有人开始一个开源项目但随后又将其商业化时,你会感到为开源作出贡献也变得颇有难度。 但这样的风险总是会有的,不应让你对此感到挫败。
首先试着去了解小组——小组中的贡献者有多受欢迎,他们贡献了多长时间,以及他们的声誉如何。 一旦你加入,观察每一个人和每一件事是关键。尝试至少学习三到六个月,并了解一切是如何运作的。如果你发现他们的意图不对,你可以随时离开这个项目。但如果你觉得没问题,那就继续做贡献吧。
![ElectroMech公司的团队][3]
你可以看看他们是否有某些许可证,例如 GPL 版本 3。你还可以查看未修改的许可证版本例如 Apache 开源许可证。
##### 问: 你觉得大公司会接受应届生投稿吗?
答:是的,当然。公司也喜欢指导新人。他们通常不允许你直接贡献,但可能先会给你一个小任务。导师会首先尝试了解你拥有什么技能以及你的能力如何。一旦他们认可你具备所需的技能,他们将继续指导你或根据你的技能将你分配给其他导师。初始阶段非常关键。很多公司都会做一些筛选,只有在你证明了自己的能力之后,你才会被允许做出贡献。
##### 问:贡献者在接手项目时必须克服的最初挑战是什么?
A. 首先,你应该非常认真地对待你的贡献。 没有书面承诺,贡献者可能倾向于对工作掉以轻心。这种想法是完全错误的。尝试每天投入 8-10 小时或任何可行的时间。如果你因为觉得没有立竿见影的回报而不愿投入其中,那么你就不是一个好的贡献者。
在最初阶段始终严格遵守导师的指导。这对于健康的贡献非常重要。有时你可能会认为自己擅长某事,而你的导师可能不会根据该技能给你分配项目。在这种情况下只需找你的导师,问他你应该做什么你的角色是什么,以及你可以如何贡献。
##### 问:许多开发人员在提交项目贡献后没有得到回复。如何让自己提交的东西被人注意到呢?
答:写一篇关于你计划作出贡献的项目的小博客,包括你喜欢的方面,你不喜欢的地方,以及可以改进的地方。这种积极的推广方式可以帮到你很多。
成为小组的一员并参与与该项目相关的活动。作为贡献的替代,首先尝试参与到团队中去,这将增加你被采纳为贡献者的机会。
一旦您对项目有了更好的了解,您的工作不仅会被接受,而且您将能够更好地适应该项目。
##### 问:你如何克服你的贡献不被接受的情况?
答:就是理解发生这种情况的原因有很多——也许你没有在合适的项目中,或者你没有做出正确的贡献。如果项目是国家驱动的,您的请求可能不会被接受。因此,如前所述,请记得列个清单。如果您的贡献没有被接受,请不要担心,因为要么你不适合该项目,要么该项目不适合你。
我会建议尝试找四到五个项目,并且至少有一个项目会接受你所做的工作。
##### 问:您对我们的读者有何想说的?
答:开源是当今大多数创新背后的驱动力。让我们根据自己的能力和技能试着做出贡献,而不是仅仅使用开源。贡献可以是代码、文档、测试、博客、金钱等。是时候做出贡献了。
##### 问ElectroMech 公司有招人的计划吗?
我们在云 DevOps开发运维一体化方面有需求正在招聘云架构师、Python 开发人员、Linux 架构师和安全专业人员。
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/06/its-time-to-contributing-to-open-source/
作者:[Abbinaya Kuzhanthaivel][a]
选题:[lkxed][b]
译者:[XiaotingHuang22](https://github.com/XiaotingHuang22)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/abbinaya-swath/
[b]: https://github.com/lkxed
[1]: https://www.opensourceforu.com/wp-content/uploads/2022/05/Nilesh-Vaghela-AWS-community-hero-and-founder-ElectroMech-Corporation.jpg
[2]: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwib2vvv3dv3AhVa7XMBHfZSCsIQFnoECAgQAQ&url=https%3A%2F%2Fwww.cncf.io%2F&usg=AOvVaw2LnRyH4SZPDHntRLJU_b3q
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/05/The-team-at-ElectroMech-Corporation.jpg

View File

@ -0,0 +1,119 @@
[#]: subject: (Try quantum computing with this open source software development kit)
[#]: via: (https://opensource.com/article/21/6/qiskit)
[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
[#]: collector: (lujun9972)
[#]: translator: (cool-summer-021)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
借助开源软件开发包尝试量子计算编程
======
Qiskit 是一个开源 SDK借助它可以免费访问量子模拟器和硬件资源。
![Tips and gears turning][1]
经典计算机是基于二进制数的二进制数有0和1两种形式。这并不是由于二进制逻辑系统比有更多基本状态的系统甚至包括模拟计算机有内在优势。但是对电路元件的开关操作很容易实现而且借助先进的半导体技术可以制造出体积小且价格低廉的计算机。
但它们并非没有局限性。经典计算机求解某些问题的效率并不高,主要是那些时间或内存成本随着问题的规模(`n`)呈指数级增长的问题。我们把这种问题称为' O(2n) '[大写O表示法][2]。
很多现代加密方法还是基于这种特征的。把两个大素数相乘,耗费的成本低,但进行反向操作就非常耗时。所以只要使用的数字足够大,对它分解质因数就非常困难。
### 进入量子世界
量子计算的基础数学和力学知识不在本文的探讨范围内。然而,还是有一些基础知识需要预先说明。
量子计算机以[量子比特][3]代替了二进制比特——量子比特是体现量子属性的可控计算单元。构成量子比特的既不是超导元件也不是自然界中存在的量子实物例如电子。量子比特可以以叠加状态存在叠加态是0和1以某种方式组合起来的特俗状态。你可能听说过量子比特既为 1 又为 0这种说法并不准确。真实情况是如果进行测量量子比特的状态会坍缩为0 或 1。在数学上量子比特未测量的状态可以看作[布洛赫球面][4]上的一个点。
尽管对习惯使用经典计算机的任何人来说,叠加态是一个全新的概念,量子比特本身并没有什么趣味性。量子计算的第二个概念是“干涉”。真正的量子计算机本质上是统计性质的。量子算法对干涉图案进行编码,增加了可以测量编码方案的状态的概率。
叠加和干涉的概念虽然新颖,但在物理世界中也有对应的现象。量子力学中的“纠缠”虽然没有,但它是实现指数级加速的关键。借助量子纠缠,对一个微观粒子的测量可以影响后续对其他被纠缠的粒子的测量结果——即使是那些物理上没有关联的粒子。
### 量子计算能做什么?
就所含量子比特数(几十个到几百个)而言,如今的量子计算机体积是非常小的。因此,虽然人们不断开发新的算法,但比同级别经典计算机运行得快的硬件还未问世。
但是在很多领域,量子计算机能带来很大好处。例如,它能提供较好的方法来模拟自然界的量子系统,例如分子,其复杂程度超过了经典计算机的建模能力。量子计算也跟线性代数有关,它是机器学习和很多其他优化问题的基础。所以,认为量子计算适合它们的观点是合理的。
在量子算法相对于普通算法的优势方面,[Shor 算法][5] 是经常被提及的例子,它在较早时候就用于分解质因数。由 MIT 的数学家 Peter Shor 于1994 年发明的量子计算机目前还不能在较大的问题上运行算法。但它已经被证明可以在 `O(n3)` 时间内完成工作,而不像经典算法那样需要指数级的时间。
### 从使用 Qiskit 开始
你可能在想:“我身边没有量子计算机,但我很想尝试一下。能做到吗?”
我们来了解一下名称为 [Qiskit][6] 的开源项目Apache 2.0 认证)。它是一个软件开发包,用于访问量子计算模拟器和 IBM 量子实验室的实际硬件。你需要注册,才能获得 API 密钥。
当然如果要深入研究Qiskit需要很多其他方面的知识线性代数只是其中一部分这些都远远超出了本文的范围。如果你需要深入学习网上有很多免费资源其中也不乏完整的教科书。然而尝试一下也是直截了当的只需要一些Python和Jupyter notebook的基础知识即可。
为了增加趣味性,我们全程使用 [Qiskit 文本编辑器][8] 写一个 "Hello, World!" 程序:
首先,安装文本编辑器的相关工具和部件:
```
`pip install git+https://github.com/qiskit-community/qiskit-textbook.git#subdirectory=qiskit-textbook-src`
```
下一步,进行软件包的导入:
```
from qiskit import QuantumCircuit, assemble, Aer
from math import pi, sqrt
from qiskit.visualization import plot_bloch_multivector, plot_histogram
```
Aer 是本地模拟器。Qiskit 包括四个组件:**Aer**,基础组件 **Terra**,用于实际的量子系统上的错误处理的 **Ignis**,以及用于算法开发的 **Aqua**
```
# Let's do an X-gate on a |0&gt; qubit
qc = QuantumCircuit(1)
qc.x(0)
qc.draw()
```
虽然底层数学原理还涉及到矩阵乘法,量子计算机中 **X-gate** 也可以认为类似于经典计算机中的 **Not gate**
现在,运行并测量它。结果跟你预期的一样,因为量子比特的初始状态是 `|0>`,接着反转,然后被测量。(使用 `|0>``|1>` 与经典计算机中的比特区分开来)
```
# Let's see the result
svsim = Aer.get_backend('statevector_simulator')
qobj = assemble(qc)
state = svsim.run(qobj).result().get_statevector()
plot_bloch_multivector(state)
```
![Bloch sphere showing the expected result][9]
布洛赫球体显示了预期的运行结果。
### 结论
在某些方面,你可以把量子计算看作一种用于经典计算机的、独特的协同处理器,跟 GPU 和FPGA 一样。不同的是,在可预见的未来,量子计算机可以被用户像网络资源一样访问到。另一个差异是,它们的工作有本质的不同,所以不像很多其他你熟悉的加速器那样。因此,人们对算法开发如此感兴趣,并投入大量资源来研究量子在何时何地的性能最好。了解一下这些东西也无妨。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/qiskit
作者:[Gordon Haff][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ghaff
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning)
[2]: https://en.wikipedia.org/wiki/Big_O_notation
[3]: https://en.wikipedia.org/wiki/Qubit
[4]: https://en.wikipedia.org/wiki/Bloch_sphere
[5]: https://en.wikipedia.org/wiki/Shor%27s_algorithm
[6]: https://qiskit.org/
[7]: https://qiskit.org/learn
[8]: https://qiskit.org/textbook/preface.html
[9]: https://opensource.com/sites/default/files/uploads/bloch-sphere.png (Bloch sphere showing the expected result)
[10]: https://creativecommons.org/licenses/by-sa/4.0/

View File

@ -0,0 +1,101 @@
[#]: subject: "How to Install MATE Desktop in Arch Linux [Complete Guide]"
[#]: via: "https://www.debugpoint.com/mate-desktop-arch-linux-install/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: "Chao-zhi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 Arch Linux 中安装 MATE 桌面
======
**本指南将详细解释您在 Arch Linux 中安装 MATE 桌面所需的步骤。**
本指南分为两部分。第一部分讨论安装基础 Arch 系统。第二部分是在 Arch Linux 上安装完整的 MATE 桌面环境。
本文在以下版本中进行了测试MATE 1.24 和 MATE 1.26。
### 什么是 MATE 桌面?
当 GNOME 桌面从 GNOME 2 改变方向到 GNOME 3 时MATE桌面仍然延续了“较旧的”或者说“传统的” GNOME 2 的开发方向它是通过改变用户交互和界面实现的。因此MATE 桌面环境延续了 GNOME 2 桌面,它保留了 Linux 中的传统桌面体验。它速度快内存消耗低。在我看来MATE 桌面环境是一个被低估的桌面环境,需要更多的关注!
MATE 团队一直在继续开发,它是一个流行的基于 GNOME 2 的桌面,但同时支持更新的技术。您可以在[官方网站][1]上了解更多信息。
### 在 Arch Linux 中安装 MATE 桌面
#### 第一部分: 安装 Arch Linux
如果您已经安装了 Arch Linux则可以跳过此步骤直接转到下面的 MATE 桌面安装部分。
要快速安装 Arch Linux请按照这个自动 [archinstall 指南][2]进行操作,该指南非常容易上手。安装完成后,继续至第二部分。
#### 第二部分:在 Arch Linux 中安装 MATE 桌面
重新启动后,从 grub 中选择 Arch Linux。在 Arch Linux 提示符下,按顺序运行以下命令。这些命令将安装 Xorg 服务器、显示管理器、MATE 桌面组件、控制器包以及其他应用程序。
对于所有命令,请使用默认值,即在询问时按 Enter 键。
- **安装 Xorg。安装大小大约为 80 MB。**
```
sudo pacman -S --needed xorg
```
- **安装显示管理器和 MATE 桌面组件。安装大小大约为 380 MB。**
```
sudo pacman -S --needed mate mate-extra ttf-freefont lightdm lightdm-gtk-greeter
```
> 译者按:在 Arch Linux 中,很多时候 lightdm 显示管理器需要额外的配置才能正常启用。可以参考:[LightDM - ArchWiki][5]。除此之外,可以安装 lightdm-gtk-greeter-settings 来对 lightdm-gtk-greeter 进行配置。
![安装 MATE 包][3]
- **安装应用软件**
这只是一个参考。您也可以安装您所需要的内容。
```
sudo pacman -S --needed firefox vlc filezilla leafpad xscreensaver archlinux-wallpaper
```
现在是时候以服务的方式启用显示管理器和网络管理器了。这样,下次登录时,它们就可以通过 systemd 自动运行了。
```
systemctl enable lightdm
systemctl enable NetworkManager
```
使用重启命令重启系统。
```
reboot
```
如果一切顺利,您应该在 MATE 桌面上看到登录提示。
现在您可以使用刚刚创建的用户 ID 和密码登录。一个超快速和传统的 MATE 桌面将欢迎您的到来。
![Arch Linux 中的 MATE 桌面][4]
我希望本指南能帮助您从头开始创建自己的 Arch Linux 环境,并使用传统的 MATE 桌面。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/mate-desktop-arch-linux-install/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[Chao-zhi](https://github.com/Chao-zhi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://mate-desktop.org/
[2]: https://www.debugpoint.com/archinstall-guide/
[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Installing-MATE-Packages.jpg
[4]: https://www.debugpoint.com/wp-content/uploads/2021/08/MATE-Desktop-in-Arch-Linux-1.jpg
[5]: https://wiki.archlinux.org/title/LightDM

View File

@ -0,0 +1,144 @@
[#]: subject: "Fixing “Key is stored in legacy trusted.gpg keyring” Issue in Ubuntu"
[#]: via: "https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/"
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
修复 Ubuntu 中的 “Key is stored in legacy trusted.gpg keyring” 问题
======
如果你在 Ubuntu 22.04 及以后的版本中使用 PPA 或添加外部仓库,你有可能会看到这样的信息:
```
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
```
![ubuntu key is stored legacy][1]
首先,这不是一个错误,而是一个警告信息。警告并不会停止程序。即使你在更新过程中看到这个警告信息,你也可以继续升级你的系统。
如果你不想看到这个警告信息,你可以采取一些手动步骤来摆脱它。
有两种方法;正确的方法和快速而不优雅的方法。阅读这两种方法,看看你对哪一种感到满意。
### 方法 1导入密钥正确但复杂的方法
首先,列出所有添加到你系统中的 GPG 密钥。
```
sudo apt-key list
```
这将显示一个存储在你系统中的巨大的密钥列表。你在这里要做的是寻找与警告信息相关的密钥。
```
[email protected]:~$ sudo apt-key list
[sudo] password for abhishek:
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
uid [ expired] packagecloud ops (production key) <[email protected]>
pub rsa4096 2016-02-18 [SCEA]
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
sub rsa4096 2016-02-18 [SEA]
/etc/apt/trusted.gpg.d/audio-recorder-ubuntu-ppa.gpg
----------------------------------------------------
pub rsa4096 2015-08-30 [SC]
42EF 41ED 9813 B713 D4F1 F06D 5CF1 2638 ACF9 669F
uid [ unknown] Launchpad PPA for Team audio-recorder
/etc/apt/trusted.gpg.d/danielrichter2007-ubuntu-grub-customizer.gpg
-------------------------------------------------------------------
pub rsa1024 2010-10-08 [SC]
59DA D276 B942 642B 1BBD 0EAC A8AA 1FAA 3F05 5C03
```
你是怎么做的?仔细阅读该信息。
```
W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy
```
在我的例子中,仓库有 packagecloud、slacktechnologies 等关键词。它显示在 apt-key 列表输出的顶部。在你的情况下,你可能需要滚动一下。
在这种罕见的情况下,由 Slack 添加的外部仓库,有两个 GPG 密钥。其中一个已经过期,我会忽略它。你可能不会有这样的情况。
你应该看到 pub 后一行的最后 8 个字符(不包括空格)。
```
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2014-01-13 [SCEA] [expired: 2019-01-12]
418A 7F2F B0E1 E6E7 EABF 6FE8 C2E7 3424 D590 97AB
uid [ expired] packagecloud ops (production key) <[email protected]>
pub rsa4096 2016-02-18 [SCEA]
DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD
uid [ unknown] https://packagecloud.io/slacktechnologies/slack (https://packagecloud.io/docs#gpg_signing) <[email protected]>
```
因此,从 “DB08 5A08 CA13 B8AC B917 E0F6 D938 EC0D 0386 51BD” 这行中我将提取最后8个字符 “0386 51BD”去掉空格然后用它来导入 /etc/apt/trusted.gpg.d 目录下专用文件中的 GPG 密钥:
```
sudo apt-key export 038651BD | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/slack.gpg
```
我在这里创建了一个新的文件 slack.gpg以防你没有注意到它。我把它命名为 slack.gpg 是因为它与我之前安装的 Slack 应用有关。文件名并不重要,但它对识别有好处。
如果命令运行成功,你将不会看到任何信息。你可以通过检查新创建的 gpg 文件是否存在来验证。
![import gpg key to trusted ubuntu][2]
再次运行更新,现在你应该不会再看到警告信息了。
### 方法 2复制到 trusted.gpd.d 目录中(快速而不优雅的方法)
如果你觉得手动做上面的事情不舒服,那么,你可以忽略这个警告信息。我的意思是,忽略它总是一种选择。
另一个选择是把 /etc/apt/trusted.gpg 文件复制到 /etc/apt/trusted.gpg.d 目录。毕竟Ubuntu 只抱怨说它需要 /etc/apt/trusted.gpg.d 目录下的 GPG 密钥。
你仍然要使用终端。打开它并使用以下命令:
```
sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d
```
现在,如果你运行更新,你就不会再看到 “Key is stored in legacy trusted.gpg keyring” 的警告信息。
![quick dirty way to fix apt key stored legacy][3]
### 总结
我曾经写过一篇关于[apt-key 弃用][4]的详细文章。显然,那篇文章让一些读者感到困惑,因此我写了这篇文章,给他们提供摆脱该信息的直接步骤。
正如我之前所说,这是一个警告信息,目前可以忽略。解决这个问题的责任在于外部软件开发者和 Ubuntu 开发者。外部软件开发者应该确保他们的 GPG 密钥不再被添加到 /etc/apt/trusted.gpg 文件中。
终端用户不应该为他们的懒惰而承担痛苦。
那么,你是用哪种方法来摆脱 “key is stored in legacy” 的警告信息的呢?第一个方法还是第二个方法?
--------------------------------------------------------------------------------
via: https://itsfoss.com/key-is-stored-in-legacy-trusted-gpg/
作者:[Abhishek Prakash][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/
[b]: https://github.com/lkxed
[1]: https://itsfoss.com/wp-content/uploads/2022/11/ubuntu-key-is-stored-legacy.png
[2]: https://itsfoss.com/wp-content/uploads/2022/11/import-gpg-key-to-trusted-ubuntu.png
[3]: https://itsfoss.com/wp-content/uploads/2022/11/quick-dirty-way-to-fix-apt-key-stored-legacy.png
[4]: https://itsfoss.com/apt-key-deprecated/

View File

@ -1,58 +0,0 @@
[#]: subject: "Merge design and code with Penpot"
[#]: via: "https://opensource.com/article/23/1/merge-design-code-penpot"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
用 Penpot 合并设计和代码
======
在计算机编程的大部分历史中在创建应用的代码的程序员和创建应用的用户体验UX的设计师之间一直存在着差距。这两个学科接受的培训大不相同他们使用的工具也不同。程序员使用文本编辑器或集成开发环境来编写代码而设计师则经常绘制小部件布局和潜在交互的概念。虽然一些 IDE像 [Eclipse][1] 和 [Netbeans][2],有界面设计组件,但它们通常专注于小部件的位置而不是小部件的设计。开源设计应用 [Penpot][3] 是一个协作式设计和原型设计平台。它有一套新的功能使设计师和开发者可以很容易地用熟悉的工作流程一起工作。Penpot 的设计界面可以让开发者在设计过程中和谐地编写代码,这是其他工具所无法做到的。自从 Opensource.com [最后一次关注它][4]以来,它已经有了长足的进步。它的最新功能不仅改善了你使用 Penpot 的体验,还推动了开源的 Penpot 应用超越类似的专有工具。
### 用 Penpot 做原型
试图设计一个应用如何最好地工作的常见问题之一是,在设计的时候,这个应用还不存在。设计师可以通过视觉化和故事板来帮助设计团队和程序员了解目标是什么。但这是一个需要迭代和反馈的过程,因为开发人员开始实施 UX 概念,并且设计会发生变化以对代码的现实做出反应。
使用 Penpot你可以为你的网络或移动应用创建一个“可用”原型。你可以将按钮与特定的行动联系起来根据用户的输入触发布局的变化。而这一切都可以在项目的代码存在之前完成。
这方面最重要的不是做一个模拟的能力,但是。在 Penpot 中为应用的设计所做的一切都有可用的布局数据开发人员可以在最终的项目中使用。Penpot 不仅仅是一个伟大的绘图和布局工具。它为编码过程提供信息。
Penpot 不是仅仅提供一个设计师特定元素的视觉列表,如属性、颜色和排版,而是现在将代码输出直接整合到设计工作区(就像 Web 浏览器中的开发者工具)。设计师和开发人员共享设计和前端开发的相同空间,以他们需要的任何格式获得规范。
![Image of the current Penpot interface][5]
### 内存解锁
许多在线设计工具使用专有技术来提供一些花哨的功能,但代价是基本上成为一个应用,你不能运行,而只能通过浏览器访问。虽然 Penpot 使用开放的网络标准,并由你的 Web
浏览器渲染。这意味着 Penpot 可以访问 Web 浏览器的最大可用内存,这使得 Penpot 成为第一个具有设计扩展性的在线原型和布局应用。你可以提供更多的选项,更多的模型,和更多的投稿。此外,你可以向更多的并发合作者开放你的设计空间,而不必担心应用的内存耗尽。
### 自我托管和 SaaS
Penpot 是开源的,所以你不必在云上使用它,如果这不适合你的工作流程。你可以在一个容器中轻松地自我托管 Penpot在你自己的工作站上作为一个本地应用使用或者在你自己的服务器上为你的组织托管它。
### 开源设计
我以前写过一篇 [Penpot 的介绍性文章][6],自那以后,这个应用变得更好了。如果你想把程序员和相关人员带入你的设计过程中,那么请试试 Penpot。
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/1/merge-design-code-penpot
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/20/12/eclipse
[2]: https://opensource.com/article/20/12/netbeans
[3]: http://penpot.app
[4]: https://opensource.com/article/21/9/open-source-design
[5]: https://opensource.com/sites/default/files/2022-07/Current%20Penpot%20interface.png
[6]: https://opensource.com/article/21/12/open-source-design-penpot

View File

@ -0,0 +1,157 @@
[#]: subject: "Elementary OS 7 Installation Guide with Screenshots"
[#]: via: "https://www.linuxtechi.com/elementary-os-7-installation-guide/"
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Elementary OS 7 安装指南及截图
======
你好,技术人员,在这篇文章中,我们将介绍如何在笔记本电脑或台式机上一步一步地安装 Elementary OS 7并附有截图。它是基于最新和稳定的 Ubuntu 22.04 LTS。
Elementary OS 7 的代号为 “Horus”并带来了很多改进例如
- 改进了 AppCenter 和安装所有需要的应用。
- 改进了 Sideload 和可选商店 Flathub 的体验。
- 最新的 GNOME Web 43支持创建网络应用。
- 快速获得操作系统和应用的更新
- 电源配置文件管理
- 应用描述的改进
##### Elementary OS 7 的系统要求
- 双核 64 位处理器
- 4GB 内存或更多
- 32GB 硬盘
- 互联网接入
- 可启动的 USB 驱动器4GB 存储空间)
闲话少说,让我们进入安装步骤
### 1下载 Elementary OS 7
使用下面的官方网址来下载 ISO 文件。
- [下载 Elementary OS 7 ISO][1]
ISO 文件下载完成后,将其刻录到 USB 驱动器,并使其可启动。
在 Windows 操作系统中,用 “Rufus” 制作可启动的 USB 驱动器。在 Linux 中,请参考以下网址:
- [如何在 Ubuntu/Linux Mint 上创建可启动的 USB 驱动器][2]
### 2用可启动媒体启动系统
现在用可启动的 USB 驱动器启动目标系统。从 bios 设置中把启动介质从硬盘改为 USB。当系统用 USB 驱动器启动时,我们将看到以下页面。
![][3]
### 3选择安装语言
选择你喜欢的语言,然后点击“选择”。
![][4]
### 4选择键盘布局
在这一步,你将被要求选择键盘布局,然后点击“选择”。
![][5]
### 5 尝试或安装 elementary OS
我们将看到下面的页面,在这里我们必须选择安装类型。它给了我们以下选项:
- 试用演示模式 试用 Elementary OS 7 而不安装
- 擦除磁盘并安装 安装程序将擦除整个磁盘并自动创建所需分区。
- 自定义安装(高级)– 它将给我们一个选项来创建自定义分区。
在这篇文章中,我将使用第二个选项(擦除磁盘并安装)。
![][6]
点击“擦除磁盘并安装”。
在下面的屏幕上,选择要安装操作系统的驱动器,然后点击“擦除并安装”。
![][7]
如果你想对设备的驱动器进行加密,那么点击“选择密码”,否则点击“不加密”。
![][8]
### 6安装进度
正如我们在下面看到的,安装已经开始,并且正在进行中。
![][9]
安装完成后,安装程序将提示重启系统。
![][10]
点击“重启设备”,不要忘记从 bios 设置中改变启动介质,以便用磁盘启动。
### 7创建本地用户并设置主机名
当系统在安装后启动时,系统会提示你输入本地用户的详细信息和系统的主机名。
根据你的要求指定这些细节。
![][11]
点击“完成设置”。
在下面的页面中,你将被提示输入你在上面创建的本地用户凭证。
![][12]
输入凭证后,点击回车。
### 8Elementary OS 7 欢迎页
我们将看到下面的欢迎页。
![][13]
选择“跳过所有”。
![][14]
点击“开始使用”,然后我们会看到下面的桌面。
![][15]
很好,这表明你已经成功地在系统上安装了 Elementary OS 7。这就是本指南的全部内容请探索这个令人兴奋的 Linux 发行版并享受其中的乐趣吧😊。
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/elementary-os-7-installation-guide/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linuxtechi.com/author/pradeep/
[b]: https://github.com/lkxed
[1]: https://elementary.io/
[2]: https://www.linuxtechi.com/create-bootable-usb-disk-dvd-ubuntu-linux-mint/
[3]: https://www.linuxtechi.com/wp-content/uploads/2023/02/BootScreen-elementaryOS7.png?ezimgfmt=ng:webp/ngcb22
[4]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Keyboard-Layout-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22
[5]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Keyboard-Layout-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22
[6]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Installation-Type-ElementaryOS7.png?ezimgfmt=ngcb22/notWebP
[7]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Select-Drive-for-elementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22
[8]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Encryption-Drive-ElementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22
[9]: https://www.linuxtechi.com/wp-content/uploads/2023/02/ElementaryOS7-Installation-Progress.png?ezimgfmt=ng:webp/ngcb22
[10]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Restart-Device-After-elementaryOS7-Installation.png?ezimgfmt=ng:webp/ngcb22
[11]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Create-Local-Account-ElementaryOS7.png?ezimgfmt=ng:webp/ngcb22
[12]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Login-screen-elementaryos7.png?ezimgfmt=ng:webp/ngcb22
[13]: https://www.linuxtechi.com/wp-content/uploads/2023/02/ElementaryOS7-Welcome-Screen.png?ezimgfmt=ng:webp/ngcb22
[14]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Get-Started-ElementaryOS7.png?ezimgfmt=ng:webp/ngcb22
[15]: https://www.linuxtechi.com/wp-content/uploads/2023/02/Desktop-Screen-ElementaryOS7-After-Installation.png

View File

@ -0,0 +1,153 @@
[#]: subject: "Learn Tcl by writing a simple game"
[#]: via: "https://opensource.com/article/23/2/learn-tcl-writing-simple-game"
[#]: author: "James Farrell https://opensource.com/users/jamesf"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
通过编写一个简单的游戏来学习 Tcl
======
我的 Tcl 之路始于最近需要将一个困难的基于 Java 的命令行配置工具自动化。我使用 Ansible 做了一些自动化编程,偶尔也会使用 expect 模块。坦率地说,我发现这个模块的作用有限,原因包括:难以对相同的提示进行排序,难以捕捉到额外步骤的值,控制逻辑的灵活性有限,等等。有时你可以用 shell 模块来代替。但有时你会遇到那种行为异常、过于复杂的命令行界面,似乎无法实现自动化。
就我而言,我正在自动安装我公司的一个程序。最后的配置步骤只能通过命令行来完成,通过几个不规范的、重复的提示和需要捕捉的数据输出。好在传统的 Expect 是唯一的答案。要使用 Expect 的基本功能,并不需要对 Tcl 有很深的了解,但你了解的越多,你就能从它那里得到更多的力量。这是后续文章的话题。现在,我探讨一下 Tcl 的基本语言结构,包括用户输入、输出、变量、条件判断、循环和简单函数。
### 安装 Tcl
在 Linux 系统上,我使用这个:
```
# dnf install tcl
# which tclsh
/bin/tclsh
```
在 macOS 上,你可以使用 [Homebrew][1] 来安装最新的 Tcl
```
$ brew install tcl-tk
$ which tclsh
/usr/local/bin/tclsh
```
### 在 Tcl 中猜数字
从创建基本的可执行脚本 `numgame.tcl` 开始:
```
$ touch numgame.tcl
$ chmod 755 numgame.tcl
```
接着在你的文件中开始编码,标题是通常的 #!
```
#!/usr/bin/tclsh
```
这里有一些关于 Tcl 的简单介绍,以便与本文一起追踪。
第一点是,所有的 Tcl 都被认为是一系列的字符串。变量通常被当作字符串处理,但可以自动切换类型和内部表示(这一点你通常无法看到)。函数可以把它们的字符串参数解释为数字(`expr`),并且只通过值传递。字符串通常使用双引号或大括号来划分。双引号允许变量扩展和转义序列,而大括号则完全没有扩展。
第二点是 Tcl 语句可以用分号隔开,但通常不是这样。语句行可以用反斜杠字符来分割。然而,典型的做法是将多行语句放在大括号内,以避免需要这样做。大括号只是更简单,下面的代码格式也反映了这一点。大括号允许对字符串进行延迟求值。在 Tcl 进行变量替换之前,一个值被传递给一个函数。
最后Tcl 使用方括号进行命令替换。方括号之间的任何东西都会被送到 Tcl 解释器的一个新的递归调用中进行求值。这对于在表达式中间调用函数或为函数生成参数是很方便的。
### 过程
虽然在这个游戏中没有必要,但我先举一个在 Tcl 中定义函数的例子,你可以在以后使用:
```
proc used_time {start} {
return [expr [clock seconds] - $start]
}
```
使用 `proc` 将其设定为一个函数(或过程)定义。接下来是函数的名称。然后是一个包含参数的列表;在本例中是一个参数 `{start}` ,然后是函数主体。注意,主体的大括号在这一行开始,它不能在下面一行。该函数返回一个值。返回值是一个复合求值(方括号),它从读取系统时钟 `[clock seconds]` 开始,并进行数学运算以减去 `$start` 参数。
### 设置、逻辑和完成
你可以在这个游戏的其余部分增加更多的细节,进行一些初始设置,对玩家的猜测进行迭代,然后在完成后打印结果:
```
set num [expr round(rand()*100)]
set starttime [clock seconds]
set guess -1
set count 0
puts "Guess a number between 1 and 100"
while { $guess != $num } {
incr count
puts -nonewline "==> "
flush stdout
gets stdin guess
if { $guess < $num } {
puts "Too small, try again"
} elseif { $guess > $num } {
puts "Too large, try again"
} else {
puts "That's right!"
}
}
set used [used_time $starttime]
puts "You guessed value $num after $count tries and $used elapsed seconds"
```
前面的 `set` 语句建立变量。前两个求值表达式用于识别 1 到 100 之间的随机数,下一个保存系统时钟启动时间。
`puts``gets` 命令用于来自玩家的输出和输入。我使用的 `puts` 暗示输出是标准输出。`gets` 需要定义输入通道,所以这段代码指定 `stdin` 作为用户的终端输入源。
`puts` 省略行末终止符时,需要 `flush stdout` 命令,因为 Tcl 缓冲了输出,在需要下一个 I/O 之前可能不会被显示。
从这里开始,`while` 语句说明了循环控制结构和条件逻辑,需要给玩家反馈并最终结束循环。
最后的 `set` 命令调用我们的函数来计算游戏的耗时秒数,接着是收集到的统计数字来结束游戏。
### 玩吧!
```
$ ./numgame.tcl
Guess a number between 1 and 100
==> 100
Too large, try again
==> 50
Too large, try again
==> 25
Too large, try again
==> 12
Too large, try again
==> 6
Too large, try again
==> 3
That's right!
You guessed value 3 after 6 tries and 20 elapsed seconds
```
### 继续学习
当我开始这个练习时,我怀疑回到 90 年代末的流行语言对我有多大的帮助。一路走来,我发现 Tcl 有几处让我非常喜欢的地方,我最喜欢的是方括号内的命令求值。与其他许多过度使用复杂闭包结构的语言相比,它似乎更容易阅读和使用。我以为它是一种[死语言][2],但实际上它仍在蓬勃发展,并在多个平台上得到支持。我学到了一些新的技能,并对这种古老的语言有了新的认识。
在 [https://www.tcl-lang.org][3] 上查看官方网站。你可以找到最新的源代码、二进制发行版、论坛、文档,以及仍在进行的会议信息的参考。
--------------------------------------------------------------------------------
via: https://opensource.com/article/23/2/learn-tcl-writing-simple-game
作者:[James Farrell][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lkxed/
[1]: https://opensource.com/article/20/6/homebrew-mac
[2]: https://opensource.com/article/19/6/favorite-dead-language
[3]: https://www.tcl-lang.org